close dialogs on klippy restart
This commit is contained in:
parent
e8e4555d46
commit
d5bc271788
@ -218,6 +218,7 @@ class KlippyGtk:
|
|||||||
else:
|
else:
|
||||||
dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR))
|
dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR))
|
||||||
|
|
||||||
|
self.screen.dialogs.append(dialog)
|
||||||
return dialog
|
return dialog
|
||||||
|
|
||||||
def ToggleButtonImage(self, image_name, label, style=None, scale=1.38):
|
def ToggleButtonImage(self, image_name, label, style=None, scale=1.38):
|
||||||
|
@ -88,6 +88,7 @@ class KlipperScreen(Gtk.Window):
|
|||||||
self.use_dpms = True
|
self.use_dpms = True
|
||||||
self.apiclient = None
|
self.apiclient = None
|
||||||
self.version = version
|
self.version = version
|
||||||
|
self.dialogs = []
|
||||||
|
|
||||||
configfile = os.path.normpath(os.path.expanduser(args.configfile))
|
configfile = os.path.normpath(os.path.expanduser(args.configfile))
|
||||||
|
|
||||||
@ -213,6 +214,8 @@ class KlipperScreen(Gtk.Window):
|
|||||||
for panel in list(self.panels):
|
for panel in list(self.panels):
|
||||||
if panel not in ["printer_select", "splash_screen"]:
|
if panel not in ["printer_select", "splash_screen"]:
|
||||||
del self.panels[panel]
|
del self.panels[panel]
|
||||||
|
for dialog in self.dialogs:
|
||||||
|
dialog.destroy()
|
||||||
self.base_panel.show_printer_select(True)
|
self.base_panel.show_printer_select(True)
|
||||||
self.printer_initializing(_("Connecting to %s") % name)
|
self.printer_initializing(_("Connecting to %s") % name)
|
||||||
|
|
||||||
@ -757,6 +760,8 @@ class KlipperScreen(Gtk.Window):
|
|||||||
for panel in list(self.panels):
|
for panel in list(self.panels):
|
||||||
if panel not in ["printer_select", "splash_screen"]:
|
if panel not in ["printer_select", "splash_screen"]:
|
||||||
del self.panels[panel]
|
del self.panels[panel]
|
||||||
|
if dialog in self.dialogs:
|
||||||
|
dialog.destroy()
|
||||||
|
|
||||||
def state_paused(self, prev_state):
|
def state_paused(self, prev_state):
|
||||||
if "job_status" not in self._cur_panels:
|
if "job_status" not in self._cur_panels:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user