fixed service editing for custom nodes, fixed hiding picker when clicking edit custom nodes

This commit is contained in:
Blake Harnden 2019-11-08 16:37:00 -08:00
parent 78f44e8110
commit 5bf0a2ac05
2 changed files with 5 additions and 3 deletions

View file

@ -15,7 +15,7 @@ class ServicesSelectDialog(Dialog):
self.groups = None
self.services = None
self.current = None
self.current_services = current_services
self.current_services = set(current_services)
self.draw()
def draw(self):
@ -48,7 +48,7 @@ class ServicesSelectDialog(Dialog):
frame.grid(stick="ew")
for i in range(2):
frame.columnconfigure(i, weight=1)
button = tk.Button(frame, text="Save", command=self.click_cancel)
button = tk.Button(frame, text="Save", command=self.destroy)
button.grid(row=0, column=0, sticky="ew")
button = tk.Button(frame, text="Cancel", command=self.click_cancel)
button.grid(row=0, column=1, sticky="ew")
@ -174,7 +174,8 @@ class CustomNodesDialog(Dialog):
dialog = ServicesSelectDialog(self, self.app, self.services)
dialog.show()
if dialog.current_services is not None:
self.services = dialog.current_services
self.services.clear()
self.services.update(dialog.current_services)
def click_save(self):
self.app.config["nodes"].clear()

View file

@ -232,6 +232,7 @@ class Toolbar(tk.Frame):
self.app.canvas.mode = GraphMode.EDGE
def click_edit_node(self):
self.hide_pickers()
dialog = CustomNodesDialog(self.app, self.app)
dialog.show()