close chat window when we remove an account. Fixes #2370
This commit is contained in:
parent
2d56a72fcb
commit
2b06b55994
|
@ -2275,7 +2275,7 @@ class RemoveAccountWindow:
|
||||||
if not res:
|
if not res:
|
||||||
return
|
return
|
||||||
# Close all opened windows
|
# Close all opened windows
|
||||||
gajim.interface.roster.close_all(gajim.interface.instances[self.account])
|
gajim.interface.roster.close_all(self.account)
|
||||||
gajim.connections[self.account].disconnect(on_purpose = True)
|
gajim.connections[self.account].disconnect(on_purpose = True)
|
||||||
del gajim.connections[self.account]
|
del gajim.connections[self.account]
|
||||||
gajim.config.del_per('accounts', self.account)
|
gajim.config.del_per('accounts', self.account)
|
||||||
|
|
|
@ -2613,13 +2613,19 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
def on_profile_avatar_menuitem_activate(self, widget, account):
|
def on_profile_avatar_menuitem_activate(self, widget, account):
|
||||||
gajim.interface.edit_own_details(account)
|
gajim.interface.edit_own_details(account)
|
||||||
|
|
||||||
def close_all(self, dic):
|
def close_all_from_dict(self, dic):
|
||||||
'''close all the windows in the given dictionary'''
|
'''close all the windows in the given dictionary'''
|
||||||
for w in dic.values():
|
for w in dic.values():
|
||||||
if type(w) == type({}):
|
if type(w) == type({}):
|
||||||
self.close_all(w)
|
self.close_all_from_dict(w)
|
||||||
else:
|
else:
|
||||||
w.window.destroy()
|
w.window.destroy()
|
||||||
|
|
||||||
|
def close_all(self, account):
|
||||||
|
'''close all the windows from an account'''
|
||||||
|
self.close_all_from_dict(gajim.interface.instances[account])
|
||||||
|
for ctrl in gajim.interface.msg_win_mgr.get_controls():
|
||||||
|
ctrl.parent_win.remove_tab(ctrl)
|
||||||
|
|
||||||
def on_roster_window_delete_event(self, widget, event):
|
def on_roster_window_delete_event(self, widget, event):
|
||||||
'''When we want to close the window'''
|
'''When we want to close the window'''
|
||||||
|
@ -2698,7 +2704,7 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
gajim.interface.save_config()
|
gajim.interface.save_config()
|
||||||
for account in gajim.connections:
|
for account in gajim.connections:
|
||||||
gajim.connections[account].quit(True)
|
gajim.connections[account].quit(True)
|
||||||
self.close_all(gajim.interface.instances)
|
self.close_all(account)
|
||||||
if gajim.interface.systray_enabled:
|
if gajim.interface.systray_enabled:
|
||||||
gajim.interface.hide_systray()
|
gajim.interface.hide_systray()
|
||||||
gtk.main_quit()
|
gtk.main_quit()
|
||||||
|
@ -3600,7 +3606,12 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
if len(self._last_selected_contact):
|
if len(self._last_selected_contact):
|
||||||
# update unselected rows
|
# update unselected rows
|
||||||
for (jid, account) in self._last_selected_contact:
|
for (jid, account) in self._last_selected_contact:
|
||||||
self.draw_contact(jid, account)
|
try:
|
||||||
|
self.draw_contact(jid, account)
|
||||||
|
except:
|
||||||
|
# This can fail when last selected row was on an account we just
|
||||||
|
# removed. So we don't care if that fail
|
||||||
|
pass
|
||||||
self._last_selected_contact = []
|
self._last_selected_contact = []
|
||||||
if len(list_of_paths) == 0:
|
if len(list_of_paths) == 0:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue