fixing a traceback from previous commit
This commit is contained in:
parent
665d7b8a58
commit
d5fdbc7a45
|
@ -241,12 +241,15 @@ class RosterWindow:
|
|||
model.set_value(iter, 0, img)
|
||||
model.set_value(iter, 1, name)
|
||||
|
||||
def join_gc_room(self, account, bm):
|
||||
jid = bm['jid']
|
||||
self.new_room(jid, bm['nick'], account)
|
||||
def join_gc_room(self, account, bookmark):
|
||||
jid = bookmark['jid']
|
||||
self.new_room(jid, bookmark['nick'], account)
|
||||
self.plugin.windows[account]['gc'][jid].set_active_tab(jid)
|
||||
self.plugin.windows[account]['gc'][jid].window.present()
|
||||
|
||||
def on_bookmark_menuitem_activate(self, widget, account, bookmark):
|
||||
self.join_gc_room(account, bookmark)
|
||||
|
||||
def on_bm_header_changed_state(self, widget, event):
|
||||
widget.set_state(gtk.STATE_NORMAL) #do not allow selected_state
|
||||
|
||||
|
@ -290,6 +293,8 @@ class RosterWindow:
|
|||
sub_menu = gtk.Menu()
|
||||
join_gc_menuitem.set_submenu(sub_menu)
|
||||
for account in gajim.connections:
|
||||
if gajim.connections[account].connected <= 1:
|
||||
continue
|
||||
label = gtk.Label()
|
||||
label.set_markup('<u>' + account.upper() +'</u>')
|
||||
item = gtk.MenuItem()
|
||||
|
@ -297,17 +302,16 @@ class RosterWindow:
|
|||
item.connect('state-changed', self.on_bm_header_changed_state)
|
||||
sub_menu.append(item)
|
||||
|
||||
item = gtk.MenuItem(_('New Room'))
|
||||
item = gtk.MenuItem(_('New _Room'))
|
||||
sub_menu.append(item)
|
||||
item.connect('activate', self.on_join_gc_activate, account)
|
||||
|
||||
#FIXME: delmonico hack here [get bookmakrs and add them]
|
||||
if gajim.connections[account].connected <= 1:
|
||||
continue
|
||||
|
||||
for bookmark in gajim.connections[account].bookmarks:
|
||||
print bookmark['name']
|
||||
item = gtk.MenuItem(bookmark['name'])
|
||||
sub_menu.append(item)
|
||||
item.connect('activate', self.join_gc_room, account, bookmark)
|
||||
item.connect('activate', self.on_bookmark_menuitem_activate,
|
||||
account, bookmark)
|
||||
|
||||
newitem = gtk.MenuItem() # seperator
|
||||
sub_menu.append(newitem)
|
||||
|
|
Loading…
Reference in New Issue