mirror of https://gitlab.com/pamhyr/pamhyr2
Pamhyr: Chose to close all subwindow at window close.
parent
f0f6ad17e2
commit
8109ddf78f
|
|
@ -342,6 +342,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
def _do_propagate_update(self):
|
||||
for key in self._propagation_keys:
|
||||
if key == "window_list":
|
||||
logger.debug(f"Update window list")
|
||||
self._do_update_window_list()
|
||||
continue
|
||||
|
||||
|
|
@ -568,9 +569,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
elif res == QMessageBox.Cancel:
|
||||
return False
|
||||
|
||||
#############
|
||||
# SUBWINDOW #
|
||||
#############
|
||||
#########################
|
||||
# SUB WINDOWS MENU LIST #
|
||||
#########################
|
||||
|
||||
def _activate_window(self, window_hash):
|
||||
self._try_activate_window_for_window(self, window_hash)
|
||||
|
|
@ -629,6 +630,10 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
|
||||
menu.addAction(action)
|
||||
|
||||
###############
|
||||
# SUB WINDOWS #
|
||||
###############
|
||||
|
||||
def open_configure(self):
|
||||
"""Open configure window
|
||||
|
||||
|
|
|
|||
|
|
@ -112,3 +112,7 @@ class ListedSubWindow(object):
|
|||
self._parent._update_window_list()
|
||||
except Exception:
|
||||
return
|
||||
|
||||
def _close_sub_window(self):
|
||||
for _, win in self._sub_win_list:
|
||||
win.close()
|
||||
|
|
|
|||
|
|
@ -172,6 +172,12 @@ class PamhyrWindow(ASubMainWindow, ListedSubWindow, PamhyrWindowTools):
|
|||
|
||||
self._set_title()
|
||||
|
||||
def closeEvent(self, event):
|
||||
self._close_sub_window()
|
||||
self._propagate_update("window_list")
|
||||
|
||||
super(PamhyrWindow, self).closeEvent(event)
|
||||
|
||||
|
||||
class PamhyrDialog(ASubWindow, ListedSubWindow, PamhyrWindowTools):
|
||||
_pamhyr_ui = "dummy"
|
||||
|
|
|
|||
Loading…
Reference in New Issue