MessageWindow reconfig bug fixes for deleted roster

This commit is contained in:
Travis Shirk 2007-12-20 03:40:27 +00:00
parent 1a7b1672a7
commit 4bedeec964
2 changed files with 19 additions and 7 deletions

View File

@ -238,7 +238,10 @@ class MessageWindow(object):
self.setup_tab_dnd(control.widget)
self.redraw_tab(control)
if self.parent_paned:
self.notebook.show_all()
else:
self.window.show_all()
# NOTE: we do not call set_control_active(True) since we don't know whether
# the tab is the active one.
self.show_title()
@ -437,7 +440,6 @@ class MessageWindow(object):
# Don't close parent window, just remove the child
child = self.parent_paned.get_child2()
self.parent_paned.remove(child)
# FIXME: restore preferred roster size
else:
self.window.destroy()
return # don't show_title, we are dead
@ -925,8 +927,10 @@ class MessageWindowMgr(gobject.GObject):
def shutdown(self, width_adjust=0):
for w in self.windows():
self.save_state(w, width_adjust)
if not w.parent_paned:
w.window.hide()
w.window.destroy()
gajim.interface.save_config()
def save_state(self, msg_win, width_adjust=0):
@ -993,6 +997,9 @@ class MessageWindowMgr(gobject.GObject):
controls = []
for w in self.windows():
# Note, we are taking care not to hide/delete the roster window when the
# MessageWindow is embedded.
if not w.parent_paned:
w.window.hide()
while w.notebook.get_n_pages():
page = w.notebook.get_nth_page(0)
@ -1002,7 +1009,12 @@ class MessageWindowMgr(gobject.GObject):
controls.append(ctrl)
# Must clear _controls from window to prevent MessageControl.shutdown calls
w._controls = {}
if not w.parent_paned:
w.window.destroy()
else:
# Don't close parent window, just remove the child
child = w.parent_paned.get_child2()
w.parent_paned.remove(child)
self._windows = {}