Commit 8109ddf7 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Pamhyr: Chose to close all subwindow at window close.

Showing with 18 additions and 3 deletions
+18 -3
......@@ -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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment