diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py index d9169c2fd..2c84da854 100644 --- a/plugins/gtkgui/config.py +++ b/plugins/gtkgui/config.py @@ -1365,13 +1365,12 @@ class Account_modification_window: class Accounts_window: """Class for accounts window: lists of accounts""" - def on_delete_event(self, widget, event): - self.window.hide() - return True # do NOT destory the window + def on_accounts_window_destroy(self, widget): + del self.plugin.windows['accounts'] def on_close_button_clicked(self, widget): - self.window.hide() - + widget.get_toplevel().destroy() + def init_accounts(self): """initialize listStore with existing accounts""" self.modify_button.set_sensitive(False) diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade index 9419761ce..a653cbd45 100644 --- a/plugins/gtkgui/gtkgui.glade +++ b/plugins/gtkgui/gtkgui.glade @@ -310,6 +310,7 @@ 4 420 160 + True Accounts GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE @@ -321,7 +322,7 @@ False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST - + diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index 5af5ee2a6..995a9bac4 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -934,7 +934,6 @@ class plugin: # get instances for windows/dialogs that will show_all()/hide() self.windows['preferences'] = Preferences_window(self) self.windows['roster'] = self.roster - self.windows['accounts'] = Accounts_window(self) gtk.gdk.threads_enter() gobject.timeout_add(100, self.autoconnect) diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py index 513fff48c..c44dd99eb 100644 --- a/plugins/gtkgui/roster_window.py +++ b/plugins/gtkgui/roster_window.py @@ -908,10 +908,8 @@ class Roster_window: About_dialog(self.plugin) def on_accounts_menuitem_activate(self, widget): - if self.plugin.windows['accounts'].window.get_property('visible'): - self.plugin.windows['accounts'].window.present() # give focus - else: - self.plugin.windows['accounts'].window.show_all() + if not self.plugin.windows.has_key('accounts'): + self.plugin.windows['accounts'] = Accounts_window(self.plugin) def close_all(self, dic): """close all the windows in the given dictionary"""