Fix ManagedWindow/GrampsWindowManager for subsidiary window close
fixes #10194
This commit is contained in:
parent
e5ce8bc829
commit
43c768c2d4
@ -196,10 +196,14 @@ class GrampsWindowManager:
|
|||||||
|
|
||||||
def close_item(self, item, *args):
|
def close_item(self, item, *args):
|
||||||
# Given an item, close its window and remove it's ID from the dict
|
# Given an item, close its window and remove it's ID from the dict
|
||||||
|
if item.opened:
|
||||||
|
item.close()
|
||||||
if item.window_id:
|
if item.window_id:
|
||||||
del self.id2item[item.window_id]
|
del self.id2item[item.window_id]
|
||||||
|
item.window_id = None
|
||||||
if item.get_window():
|
if item.get_window():
|
||||||
item.get_window().destroy()
|
item.get_window().destroy()
|
||||||
|
item.window = None
|
||||||
|
|
||||||
def remove_item(self, track):
|
def remove_item(self, track):
|
||||||
# We need the whole gymnastics below because our item
|
# We need the whole gymnastics below because our item
|
||||||
@ -560,11 +564,11 @@ class ManagedWindow:
|
|||||||
|
|
||||||
Takes care of closing children and removing itself from menu.
|
Takes care of closing children and removing itself from menu.
|
||||||
"""
|
"""
|
||||||
self._save_position(save_config=False) # the next line will save it
|
self.opened = False
|
||||||
|
self._save_position(save_config=False) # the next line will save it
|
||||||
self._save_size()
|
self._save_size()
|
||||||
self.clean_up()
|
self.clean_up()
|
||||||
self.uistate.gwm.close_track(self.track)
|
self.uistate.gwm.close_track(self.track)
|
||||||
self.opened = False
|
|
||||||
# put a previously modal window back to modal, now that we are closing
|
# put a previously modal window back to modal, now that we are closing
|
||||||
if self.other_modal_window:
|
if self.other_modal_window:
|
||||||
self.other_modal_window.set_modal(True)
|
self.other_modal_window.set_modal(True)
|
||||||
|
Loading…
Reference in New Issue
Block a user