Author: js Date: 2008-11-23 20:17:58 +0100 (Sun, 23 Nov 2008) New Revision: 10689
Modified: trunk/src/common/config.py trunk/src/history_window.py Log: [kaylan] Remember size and position of history window. Closes #2824.
Modified: trunk/src/common/config.py =================================================================== --- trunk/src/common/config.py 2008-11-23 18:25:27 UTC (rev 10688) +++ trunk/src/common/config.py 2008-11-23 19:17:58 UTC (rev 10689) @@ -156,6 +156,10 @@ 'roster_y-position': [ opt_int, 0 ], 'roster_width': [ opt_int, 200 ], 'roster_height': [ opt_int, 400 ], + 'history_window_width': [ opt_int, 650 ], + 'history_window_height': [ opt_int, 450 ], + 'history_window_x-position': [ opt_int, 0 ], + 'history_window_y-position': [ opt_int, 0 ], 'latest_disco_addresses': [ opt_str, '' ], 'recently_groupchat': [ opt_str, '' ], 'time_stamp': [ opt_str, '[%X] ', _('This option let you customize timestamp that is printed in conversation. For exemple "[%H:%M] " will show "[hour:minute] ". See python doc on strftime for full documentation: http://docs.python.org/lib/module-time.html') ],
Modified: trunk/src/history_window.py =================================================================== --- trunk/src/history_window.py 2008-11-23 18:25:27 UTC (rev 10688) +++ trunk/src/history_window.py 2008-11-23 19:17:58 UTC (rev 10689) @@ -119,6 +119,13 @@ if jid: self.jid_entry.set_text(jid)
+ gtkgui_helpers.resize_window(self.window, + gajim.config.get('history_window_width'), + gajim.config.get('history_window_height')) + gtkgui_helpers.move_window(self.window, + gajim.config.get('history_window_x-position'), + gajim.config.get('history_window_y-position')) + xml.signal_autoconnect(self) self.window.show_all()
@@ -217,9 +224,11 @@
def on_history_window_key_press_event(self, widget, event): if event.keyval == gtk.keysyms.Escape: + self.save_state() self.window.destroy()
def on_close_button_clicked(self, widget): + self.save_state() self.window.destroy()
def on_jid_entry_activate(self, widget): @@ -588,4 +597,15 @@ self._load_history(jid, account) self.results_window.set_property('visible', False)
+ def save_state(self): + x,y = self.window.window.get_root_origin() + width, height = self.window.get_size() + + gajim.config.set('history_window_x-position', x) + gajim.config.set('history_window_y-position', y) + gajim.config.set('history_window_width', width); + gajim.config.set('history_window_height', height); + + gajim.interface.save_config() + # vim: se ts=3: