diff --git a/coretk/coretk/dialogs/wlanconfig.py b/coretk/coretk/dialogs/wlanconfig.py index aed411b8..20966d2b 100644 --- a/coretk/coretk/dialogs/wlanconfig.py +++ b/coretk/coretk/dialogs/wlanconfig.py @@ -58,6 +58,9 @@ class WlanConfigDialog(Dialog): :return: nothing """ - self.config_frame.parse_config() + config = self.config_frame.parse_config() self.app.core.wlan_configs[self.node.id] = self.config + if self.app.core.is_runtime(): + session_id = self.app.core.session_id + self.app.core.client.set_wlan_config(session_id, self.node.id, config) self.destroy() diff --git a/coretk/coretk/graph/graph.py b/coretk/coretk/graph/graph.py index a2d82dc4..acce0e28 100644 --- a/coretk/coretk/graph/graph.py +++ b/coretk/coretk/graph/graph.py @@ -87,6 +87,9 @@ class CanvasGraph(tk.Canvas): :param core.api.grpc.core_pb2.Session session: session to draw :return: nothing """ + # hide context + self.hide_context() + # delete any existing drawn items for tag in tags.COMPONENT_TAGS: self.delete(tag) @@ -122,6 +125,11 @@ class CanvasGraph(tk.Canvas): self.bind("", lambda e: self.scan_mark(e.x, e.y)) self.bind("", lambda e: self.scan_dragto(e.x, e.y, gain=1)) + def hide_context(self): + if self.context: + self.context.unpost() + self.context = None + def get_actual_coords(self, x, y): actual_x = (x - self.offset[0]) / self.ratio actual_y = (y - self.offset[1]) / self.ratio @@ -294,8 +302,7 @@ class CanvasGraph(tk.Canvas): return if self.context: - self.context.unpost() - self.context = None + self.hide_context() else: if self.mode == GraphMode.ANNOTATION: self.focus_set() @@ -592,8 +599,7 @@ class CanvasGraph(tk.Canvas): self.context = canvas_node.create_context() self.context.post(event.x_root, event.y_root) else: - self.context.unpost() - self.context = None + self.hide_context() def press_delete(self, event): """ diff --git a/coretk/coretk/toolbar.py b/coretk/coretk/toolbar.py index df183494..323c5d67 100644 --- a/coretk/coretk/toolbar.py +++ b/coretk/coretk/toolbar.py @@ -222,6 +222,7 @@ class Toolbar(ttk.Frame): :return: nothing """ + self.app.canvas.hide_context() self.app.statusbar.core_alarms.clear() self.app.statusbar.progress_bar.start(5) self.app.canvas.mode = GraphMode.SELECT @@ -385,6 +386,7 @@ class Toolbar(ttk.Frame): :return: nothing """ + self.app.canvas.hide_context() self.app.statusbar.progress_bar.start(5) thread = threading.Thread(target=self.app.core.stop_session) thread.start()