Author: nicfit Date: 2007-12-18 04:41:11 +0100 (Tue, 18 Dec 2007) New Revision: 9169
Modified: branches/one_window/src/message_window.py branches/one_window/src/roster_window.py Log: Bunch of saved size bugs fixed
Modified: branches/one_window/src/message_window.py =================================================================== --- branches/one_window/src/message_window.py 2007-12-18 02:07:49 UTC (rev 9168) +++ branches/one_window/src/message_window.py 2007-12-18 03:41:11 UTC (rev 9169) @@ -922,14 +922,14 @@ for c in w.controls(): yield c
- def shutdown(self): + def shutdown(self, width_adjust=0): for w in self.windows(): - self.save_state(w) + self.save_state(w, width_adjust) w.window.hide() w.window.destroy() gajim.interface.save_config()
- def save_state(self, msg_win): + def save_state(self, msg_win, width_adjust=0): if not gajim.config.get('saveposition'): return
@@ -972,6 +972,7 @@ gajim.config.set_per('accounts', acct, pos_y_key, y)
else: + width += width_adjust gajim.config.set(size_width_key, width) gajim.config.set(size_height_key, height)
Modified: branches/one_window/src/roster_window.py =================================================================== --- branches/one_window/src/roster_window.py 2007-12-18 02:07:49 UTC (rev 9168) +++ branches/one_window/src/roster_window.py 2007-12-18 03:41:11 UTC (rev 9169) @@ -4252,6 +4252,7 @@ def quit_gtkgui_interface(self): '''When we quit the gtk interface : tell that to the core and exit gtk''' + msgwin_width_adjust = 0 if gajim.config.get('saveposition'): # in case show_roster_on_start is False and roster is never shown # window.window is None @@ -4265,10 +4266,16 @@ width = self.xml.get_widget('roster_vbox2').allocation.width gajim.config.set('roster_width', width) gajim.config.set('roster_height', height) + if not self.xml.get_widget('roster_vbox2').get_property('visible'): + # The roster vbox is hidden, so the message window is larger + # then we want to save (i.e. the window will grow every startup) + # so adjust. + msgwin_width_adjust = -1 * width
+ gajim.config.set('show_roster_on_startup', self.window.get_property('visible')) - gajim.interface.msg_win_mgr.shutdown() + gajim.interface.msg_win_mgr.shutdown(msgwin_width_adjust)
gajim.config.set('collapsed_rows', '\t'.join(self.collapsed_rows)) gajim.interface.save_config() @@ -4672,8 +4679,7 @@
def on_view_menu_activate(self, widget): # Hide the show roster menu if we are not in the right windowing mode. - if (gajim.config.get('one_message_window') == 'always_with_roster' and - gajim.interface.msg_win_mgr.one_window_opened()): + if self.hpaned.get_child2() is not None: self.xml.get_widget('show_roster_menuitem').show() else: self.xml.get_widget('show_roster_menuitem').hide() @@ -4681,11 +4687,10 @@ def on_show_roster_menuitem_toggled(self, widget): # when num controls is 0 this menuitem is hidden, but still need to # disable keybinding - if (gajim.config.get('one_message_window') == 'always_with_roster' and - gajim.interface.msg_win_mgr.one_window_opened()): - self.show_roster(widget.get_active()) + if self.hpaned.get_child2() is not None: + self.show_roster_vbox(widget.get_active())
- def show_roster(self, active): + def show_roster_vbox(self, active): if active: self.xml.get_widget('roster_vbox2').show() else: @@ -5357,7 +5362,7 @@
def _on_message_window_delete(self, win_mgr, msg_win): if gajim.config.get('one_message_window') == 'always_with_roster': - self.show_roster(True) + self.show_roster_vbox(True) gtkgui_helpers.resize_window(self.window, gajim.config.get('roster_width'), gajim.config.get('roster_height')) @@ -5593,3 +5598,4 @@
if sys.platform == 'darwin': self.setup_for_osx() +