add advanced option to put the roster on the right in single window mode. Fixes #4679

This commit is contained in:
Yann Leboulanger 2016-02-21 11:07:04 +01:00
parent a0d9d6cf2a
commit b74fdf1c8b
2 changed files with 11 additions and 2 deletions

View File

@ -164,6 +164,7 @@ class Config:
'roster_width': [ opt_int, 200 ],
'roster_height': [ opt_int, 400 ],
'roster_hpaned_position': [opt_int, 200],
'roster_on_the_right': [opt_bool, False, _('Place the roster on the right in single window mode'), True],
'history_window_width': [ opt_int, 650 ],
'history_window_height': [ opt_int, 450 ],
'history_window_x-position': [ opt_int, 0 ],

View File

@ -86,8 +86,16 @@ class MessageWindow(object):
self.parent_paned = parent_paned
old_parent = self.notebook.get_parent()
old_parent.remove(self.notebook)
self.parent_paned.add(self.notebook)
self.parent_paned.pack2(self.notebook, resize=True, shrink=True)
if gajim.config.get('roster_on_the_right'):
child1 = self.parent_paned.get_child1()
self.parent_paned.remove(child1)
self.parent_paned.add(self.notebook)
self.parent_paned.pack1(self.notebook, resize=False,
shrink=True)
self.parent_paned.pack2(child1, resize=True, shrink=True)
else:
self.parent_paned.add(self.notebook)
self.parent_paned.pack2(self.notebook, resize=True, shrink=True)
gajim.interface.roster.xml.get_object('show_roster_menuitem').\
set_sensitive(True)
orig_window.destroy()