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

PamhyrDialog: Fix window list delete whene dialog is done.

Showing with 8 additions and 1 deletion
+8 -1
...@@ -101,4 +101,5 @@ class NewStudyWindow(PamhyrDialog): ...@@ -101,4 +101,5 @@ class NewStudyWindow(PamhyrDialog):
self._study.use_date(date) self._study.use_date(date)
else: else:
self._study.use_time() self._study.use_time()
self.done(True) self.done(True)
...@@ -55,11 +55,12 @@ class ListedSubWindow(object): ...@@ -55,11 +55,12 @@ class ListedSubWindow(object):
logger.info(f"Close window: ({h}) {self.sub_win_cnt}") logger.info(f"Close window: ({h}) {self.sub_win_cnt}")
def _sub_win_exists(self, h): def _sub_win_exists(self, h):
return reduce( res = reduce(
lambda acc, el: (acc or (h == (el[1].hash()))), lambda acc, el: (acc or (h == (el[1].hash()))),
self.sub_win_list, self.sub_win_list,
False False
) )
return res
def sub_win_exists(self, h): def sub_win_exists(self, h):
return self._sub_win_exists(h) return self._sub_win_exists(h)
......
...@@ -186,3 +186,8 @@ class PamhyrDialog(ASubWindow, ListedSubWindow, PamhyrWindowTools): ...@@ -186,3 +186,8 @@ class PamhyrDialog(ASubWindow, ListedSubWindow, PamhyrWindowTools):
self._hash_data.append(self._config) self._hash_data.append(self._config)
self._set_title() self._set_title()
def done(self, result):
if self.parent is not None:
self.parent.sub_win_del(self.hash())
super(PamhyrDialog, self).done(result)
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