disable bookmark button / menuitem when room is already bookmarked. Fixes #4156

This commit is contained in:
Yann Leboulanger 2008-11-03 06:08:10 +00:00
parent 3d7ef26ddb
commit e706e86c2e
1 changed files with 16 additions and 5 deletions

View File

@ -194,7 +194,13 @@ class GroupchatControl(ChatControlBase):
self.handlers[id] = widget self.handlers[id] = widget
widget = self.xml.get_widget('bookmark_button') widget = self.xml.get_widget('bookmark_button')
id = widget.connect('clicked', self._on_bookmark_room_menuitem_activate) for bm in gajim.connections[self.account].bookmarks:
if bm['jid'] == self.contact.jid:
widget.set_sensitive(False)
break
else:
id = widget.connect('clicked',
self._on_bookmark_room_menuitem_activate)
self.handlers[id] = widget self.handlers[id] = widget
widget = self.xml.get_widget('list_treeview') widget = self.xml.get_widget('list_treeview')
@ -271,6 +277,11 @@ class GroupchatControl(ChatControlBase):
xm = gtkgui_helpers.get_glade('gc_control_popup_menu.glade') xm = gtkgui_helpers.get_glade('gc_control_popup_menu.glade')
self.bookmark_room_menuitem = xm.get_widget('bookmark_room_menuitem') self.bookmark_room_menuitem = xm.get_widget('bookmark_room_menuitem')
for bm in gajim.connections[self.account].bookmarks:
if bm['jid'] == self.room_jid:
self.bookmark_room_menuitem.set_sensitive(False)
break
else:
id = self.bookmark_room_menuitem.connect('activate', id = self.bookmark_room_menuitem.connect('activate',
self._on_bookmark_room_menuitem_activate) self._on_bookmark_room_menuitem_activate)
self.handlers[id] = self.bookmark_room_menuitem self.handlers[id] = self.bookmark_room_menuitem