fix owner editor to properly destroy glade object

This commit is contained in:
prculley 2017-01-30 09:02:36 -06:00
parent 0307c10244
commit 2da74564a3
2 changed files with 7 additions and 4 deletions

View File

@ -35,7 +35,6 @@
<object class="GtkWindow" id="ownereditor">
<property name="can_focus">False</property>
<property name="window_position">center</property>
<signal name="delete-event" handler="on_delete_event" swapped="no"/>
<child>
<object class="GtkEventBox" id="eventbox">
<property name="visible">True</property>

View File

@ -113,12 +113,12 @@ class OwnerEditor(tool.Tool, ManagedWindow):
"on_cancel_button_clicked": self.close,
"on_help_button_clicked": self.on_help_button_clicked,
"on_eventbox_button_press_event": self.on_button_press_event,
"on_menu_activate": self.on_menu_activate,
"on_delete_event" : self.close,
})
"on_menu_activate": self.on_menu_activate})
# fetch the popup menu
self.menu = topDialog.get_object("popup_menu")
self.track_ref_for_deletion("menu")
#topDialog.connect_signals({"on_menu_activate": self.on_menu_activate})
# get current db owner and attach it to the entries of the window
@ -148,6 +148,7 @@ class OwnerEditor(tool.Tool, ManagedWindow):
def on_ok_button_clicked(self, obj):
"""Update the current db's owner information from editor"""
self.db.set_researcher(self.owner)
self.menu.destroy()
self.close()
def on_help_button_clicked(self, obj):
@ -173,6 +174,9 @@ class OwnerEditor(tool.Tool, ManagedWindow):
for i in range(len(config_keys)):
config.set(config_keys[i], self.owner.get()[i])
def clean_up(self):
self.menu.destroy()
#-------------------------------------------------------------------------
#
# OwnerEditorOptions (None at the moment)