destroy accounts_window when we close the window instead of hiding it

This commit is contained in:
Yann Leboulanger 2005-04-02 20:35:33 +00:00
parent 821cc6899d
commit 5f44066b49
4 changed files with 8 additions and 11 deletions

View File

@ -1365,13 +1365,12 @@ class Account_modification_window:
class Accounts_window: class Accounts_window:
"""Class for accounts window: lists of accounts""" """Class for accounts window: lists of accounts"""
def on_delete_event(self, widget, event): def on_accounts_window_destroy(self, widget):
self.window.hide() del self.plugin.windows['accounts']
return True # do NOT destory the window
def on_close_button_clicked(self, widget): def on_close_button_clicked(self, widget):
self.window.hide() widget.get_toplevel().destroy()
def init_accounts(self): def init_accounts(self):
"""initialize listStore with existing accounts""" """initialize listStore with existing accounts"""
self.modify_button.set_sensitive(False) self.modify_button.set_sensitive(False)

View File

@ -310,6 +310,7 @@
<property name="border_width">4</property> <property name="border_width">4</property>
<property name="width_request">420</property> <property name="width_request">420</property>
<property name="height_request">160</property> <property name="height_request">160</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Accounts</property> <property name="title" translatable="yes">Accounts</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property> <property name="window_position">GTK_WIN_POS_NONE</property>
@ -321,7 +322,7 @@
<property name="skip_pager_hint">False</property> <property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="delete_event" handler="on_delete_event" last_modification_time="Sun, 27 Mar 2005 18:58:04 GMT"/> <signal name="destroy" handler="on_accounts_window_destroy" last_modification_time="Sat, 02 Apr 2005 20:34:04 GMT"/>
<child> <child>
<widget class="GtkVBox" id="vbox5"> <widget class="GtkVBox" id="vbox5">

View File

@ -934,7 +934,6 @@ class plugin:
# get instances for windows/dialogs that will show_all()/hide() # get instances for windows/dialogs that will show_all()/hide()
self.windows['preferences'] = Preferences_window(self) self.windows['preferences'] = Preferences_window(self)
self.windows['roster'] = self.roster self.windows['roster'] = self.roster
self.windows['accounts'] = Accounts_window(self)
gtk.gdk.threads_enter() gtk.gdk.threads_enter()
gobject.timeout_add(100, self.autoconnect) gobject.timeout_add(100, self.autoconnect)

View File

@ -908,10 +908,8 @@ class Roster_window:
About_dialog(self.plugin) About_dialog(self.plugin)
def on_accounts_menuitem_activate(self, widget): def on_accounts_menuitem_activate(self, widget):
if self.plugin.windows['accounts'].window.get_property('visible'): if not self.plugin.windows.has_key('accounts'):
self.plugin.windows['accounts'].window.present() # give focus self.plugin.windows['accounts'] = Accounts_window(self.plugin)
else:
self.plugin.windows['accounts'].window.show_all()
def close_all(self, dic): def close_all(self, dic):
"""close all the windows in the given dictionary""" """close all the windows in the given dictionary"""