add advanced option to allow not saving roster position. Fixes #5712

This commit is contained in:
Yann Leboulanger 2011-04-21 20:52:14 +02:00
parent 82f77772a3
commit c2ea566b12
3 changed files with 17 additions and 11 deletions

View file

@ -147,6 +147,7 @@ class Config:
'single-msg-y-position': [opt_int, 0],
'single-msg-width': [opt_int, 400],
'single-msg-height': [opt_int, 280],
'save-roster-position': [opt_bool, True, _('If true, Gajim will save roster position when hiding roster, and restore it when showing roster.')],
'roster_x-position': [ opt_int, 0 ],
'roster_y-position': [ opt_int, 0 ],
'roster_width': [ opt_int, 200 ],

View file

@ -2337,9 +2337,10 @@ class RosterWindow:
# in case show_roster_on_start is False and roster is never shown
# window.window is None
if self.window.window is not None:
x, y = self.window.window.get_root_origin()
gajim.config.set('roster_x-position', x)
gajim.config.set('roster_y-position', y)
if gajim.config.get('save-roster-position'):
x, y = self.window.window.get_root_origin()
gajim.config.set('roster_x-position', x)
gajim.config.set('roster_y-position', y)
width, height = self.window.get_size()
# For the width use the size of the vbox containing the tree and
# status combo, this will cancel out any hpaned width
@ -6150,9 +6151,10 @@ class RosterWindow:
gtkgui_helpers.resize_window(self.window,
gajim.config.get('roster_width'),
gajim.config.get('roster_height'))
gtkgui_helpers.move_window(self.window,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
if gajim.config.get('save-roster-position'):
gtkgui_helpers.move_window(self.window,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
self.popups_notification_height = 0
self.popup_notification_windows = []

View file

@ -396,7 +396,8 @@ class StatusIcon:
# we could be in another VD right now. eg vd2
# and we want to show it in vd2
if not gtkgui_helpers.possibly_move_window_in_current_desktop(win):
if not gtkgui_helpers.possibly_move_window_in_current_desktop(
win) and gajim.config.get('save-roster-position'):
x, y = win.get_position()
gajim.config.set('roster_x-position', x)
gajim.config.set('roster_y-position', y)
@ -404,9 +405,10 @@ class StatusIcon:
else:
if not win.get_property('visible'):
win.show_all()
gtkgui_helpers.move_window(win,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
if gajim.config.get('save-roster-position'):
gtkgui_helpers.move_window(win,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
if not gajim.config.get('roster_window_skip_taskbar'):
win.set_property('skip-taskbar-hint', False)
win.present_with_time(gtk.get_current_event_time())
@ -418,7 +420,8 @@ class StatusIcon:
if not event:
return
win = gajim.interface.roster.window
if not win.get_property('visible'):
if not win.get_property('visible') and gajim.config.get(
'save-roster-position'):
gtkgui_helpers.move_window(win,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))