don't allow to do ctrl+r when roster is hidden. See #7315

This commit is contained in:
Yann Leboulanger 2014-02-05 12:46:48 +01:00
parent ff93ad5737
commit 506741ff97
2 changed files with 7 additions and 0 deletions

View File

@ -319,6 +319,7 @@
<child> <child>
<object class="GtkCheckMenuItem" id="show_roster_menuitem"> <object class="GtkCheckMenuItem" id="show_roster_menuitem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Show _Roster</property> <property name="label" translatable="yes">Show _Roster</property>

View File

@ -86,6 +86,8 @@ class MessageWindow(object):
self.parent_paned = parent_paned self.parent_paned = parent_paned
self.notebook.reparent(self.parent_paned) self.notebook.reparent(self.parent_paned)
self.parent_paned.pack2(self.notebook, resize=True, shrink=True) 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() orig_window.destroy()
del orig_window del orig_window
@ -615,6 +617,8 @@ class MessageWindow(object):
# Don't close parent window, just remove the child # Don't close parent window, just remove the child
child = self.parent_paned.get_child2() child = self.parent_paned.get_child2()
self.parent_paned.remove(child) self.parent_paned.remove(child)
gajim.interface.roster.xml.get_object('show_roster_menuitem').\
set_sensitive(False)
else: else:
self.window.destroy() self.window.destroy()
return # don't show_title, we are dead return # don't show_title, we are dead
@ -1261,6 +1265,8 @@ class MessageWindowMgr(GObject.GObject):
# Don't close parent window, just remove the child # Don't close parent window, just remove the child
child = w.parent_paned.get_child2() child = w.parent_paned.get_child2()
w.parent_paned.remove(child) w.parent_paned.remove(child)
gajim.interface.roster.xml.get_object('show_roster_menuitem').\
set_sensitive(False)
gtkgui_helpers.resize_window(w.window, gtkgui_helpers.resize_window(w.window,
gajim.config.get('roster_width'), gajim.config.get('roster_width'),
gajim.config.get('roster_height')) gajim.config.get('roster_height'))