diff --git a/src/common/config.py b/src/common/config.py index b5cc1d6205472416ea97e070d4cd81beb557b428..1b6fd7cb07921558d387489bddf2f41f532061e0 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -156,6 +156,10 @@ class Config: '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') ], diff --git a/src/history_window.py b/src/history_window.py index 36e790191ace207d18ff326e81f2d956b975bd5f..ba345ad2282082e2aa3fa810e93ad25a8b2e1845 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -119,6 +119,13 @@ class HistoryWindow: 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 @@ class HistoryWindow: 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 @@ class HistoryWindow: 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: