add advanced option to allow not saving roster position. Fixes #5712
This commit is contained in:
parent
82f77772a3
commit
c2ea566b12
3 changed files with 17 additions and 11 deletions
|
@ -147,6 +147,7 @@ class Config:
|
||||||
'single-msg-y-position': [opt_int, 0],
|
'single-msg-y-position': [opt_int, 0],
|
||||||
'single-msg-width': [opt_int, 400],
|
'single-msg-width': [opt_int, 400],
|
||||||
'single-msg-height': [opt_int, 280],
|
'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_x-position': [ opt_int, 0 ],
|
||||||
'roster_y-position': [ opt_int, 0 ],
|
'roster_y-position': [ opt_int, 0 ],
|
||||||
'roster_width': [ opt_int, 200 ],
|
'roster_width': [ opt_int, 200 ],
|
||||||
|
|
|
@ -2337,9 +2337,10 @@ class RosterWindow:
|
||||||
# in case show_roster_on_start is False and roster is never shown
|
# in case show_roster_on_start is False and roster is never shown
|
||||||
# window.window is None
|
# window.window is None
|
||||||
if self.window.window is not None:
|
if self.window.window is not None:
|
||||||
x, y = self.window.window.get_root_origin()
|
if gajim.config.get('save-roster-position'):
|
||||||
gajim.config.set('roster_x-position', x)
|
x, y = self.window.window.get_root_origin()
|
||||||
gajim.config.set('roster_y-position', y)
|
gajim.config.set('roster_x-position', x)
|
||||||
|
gajim.config.set('roster_y-position', y)
|
||||||
width, height = self.window.get_size()
|
width, height = self.window.get_size()
|
||||||
# For the width use the size of the vbox containing the tree and
|
# For the width use the size of the vbox containing the tree and
|
||||||
# status combo, this will cancel out any hpaned width
|
# status combo, this will cancel out any hpaned width
|
||||||
|
@ -6150,9 +6151,10 @@ class RosterWindow:
|
||||||
gtkgui_helpers.resize_window(self.window,
|
gtkgui_helpers.resize_window(self.window,
|
||||||
gajim.config.get('roster_width'),
|
gajim.config.get('roster_width'),
|
||||||
gajim.config.get('roster_height'))
|
gajim.config.get('roster_height'))
|
||||||
gtkgui_helpers.move_window(self.window,
|
if gajim.config.get('save-roster-position'):
|
||||||
gajim.config.get('roster_x-position'),
|
gtkgui_helpers.move_window(self.window,
|
||||||
gajim.config.get('roster_y-position'))
|
gajim.config.get('roster_x-position'),
|
||||||
|
gajim.config.get('roster_y-position'))
|
||||||
|
|
||||||
self.popups_notification_height = 0
|
self.popups_notification_height = 0
|
||||||
self.popup_notification_windows = []
|
self.popup_notification_windows = []
|
||||||
|
|
|
@ -396,7 +396,8 @@ class StatusIcon:
|
||||||
|
|
||||||
# we could be in another VD right now. eg vd2
|
# we could be in another VD right now. eg vd2
|
||||||
# and we want to show it in 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()
|
x, y = win.get_position()
|
||||||
gajim.config.set('roster_x-position', x)
|
gajim.config.set('roster_x-position', x)
|
||||||
gajim.config.set('roster_y-position', y)
|
gajim.config.set('roster_y-position', y)
|
||||||
|
@ -404,9 +405,10 @@ class StatusIcon:
|
||||||
else:
|
else:
|
||||||
if not win.get_property('visible'):
|
if not win.get_property('visible'):
|
||||||
win.show_all()
|
win.show_all()
|
||||||
gtkgui_helpers.move_window(win,
|
if gajim.config.get('save-roster-position'):
|
||||||
gajim.config.get('roster_x-position'),
|
gtkgui_helpers.move_window(win,
|
||||||
gajim.config.get('roster_y-position'))
|
gajim.config.get('roster_x-position'),
|
||||||
|
gajim.config.get('roster_y-position'))
|
||||||
if not gajim.config.get('roster_window_skip_taskbar'):
|
if not gajim.config.get('roster_window_skip_taskbar'):
|
||||||
win.set_property('skip-taskbar-hint', False)
|
win.set_property('skip-taskbar-hint', False)
|
||||||
win.present_with_time(gtk.get_current_event_time())
|
win.present_with_time(gtk.get_current_event_time())
|
||||||
|
@ -418,7 +420,8 @@ class StatusIcon:
|
||||||
if not event:
|
if not event:
|
||||||
return
|
return
|
||||||
win = gajim.interface.roster.window
|
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,
|
gtkgui_helpers.move_window(win,
|
||||||
gajim.config.get('roster_x-position'),
|
gajim.config.get('roster_x-position'),
|
||||||
gajim.config.get('roster_y-position'))
|
gajim.config.get('roster_y-position'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue