[kaylan] Remember size and position of history window. Closes #2824.
This commit is contained in:
parent
917f6fc3a5
commit
2c7c345a7c
|
@ -156,6 +156,10 @@ class Config:
|
||||||
'roster_y-position': [ opt_int, 0 ],
|
'roster_y-position': [ opt_int, 0 ],
|
||||||
'roster_width': [ opt_int, 200 ],
|
'roster_width': [ opt_int, 200 ],
|
||||||
'roster_height': [ opt_int, 400 ],
|
'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, '' ],
|
'latest_disco_addresses': [ opt_str, '' ],
|
||||||
'recently_groupchat': [ 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') ],
|
'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') ],
|
||||||
|
|
|
@ -119,6 +119,13 @@ class HistoryWindow:
|
||||||
if jid:
|
if jid:
|
||||||
self.jid_entry.set_text(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)
|
xml.signal_autoconnect(self)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
|
@ -217,9 +224,11 @@ class HistoryWindow:
|
||||||
|
|
||||||
def on_history_window_key_press_event(self, widget, event):
|
def on_history_window_key_press_event(self, widget, event):
|
||||||
if event.keyval == gtk.keysyms.Escape:
|
if event.keyval == gtk.keysyms.Escape:
|
||||||
|
self.save_state()
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
|
||||||
def on_close_button_clicked(self, widget):
|
def on_close_button_clicked(self, widget):
|
||||||
|
self.save_state()
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
|
||||||
def on_jid_entry_activate(self, widget):
|
def on_jid_entry_activate(self, widget):
|
||||||
|
@ -588,4 +597,15 @@ class HistoryWindow:
|
||||||
self._load_history(jid, account)
|
self._load_history(jid, account)
|
||||||
self.results_window.set_property('visible', False)
|
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:
|
# vim: se ts=3:
|
||||||
|
|
Loading…
Reference in New Issue