fixing UI for bookmarks
This commit is contained in:
parent
7762919ae7
commit
f0fca2d2b0
3 changed files with 21 additions and 22 deletions
|
@ -2378,6 +2378,7 @@ class ManageBookmarksWindow:
|
|||
|
||||
gajim.connections[account[1]].store_bookmarks()
|
||||
|
||||
self.plugin.roster.make_menu()
|
||||
self.window.destroy()
|
||||
|
||||
def on_cancel_button_clicked(self, widget):
|
||||
|
|
|
@ -294,11 +294,11 @@ class GroupchatWindow(chat.Chat):
|
|||
|
||||
def on_add_bookmark_menuitem_activate(self, widget):
|
||||
room_jid = self.get_active_jid()
|
||||
bm = { 'name': '',
|
||||
'jid': self.get_active_jid(),
|
||||
bm = { 'name': room_jid,
|
||||
'jid': room_jid,
|
||||
'autojoin': '0',
|
||||
'password': '',
|
||||
'nick': self.nicks[self.get_active_jid()]
|
||||
'nick': self.nicks[room_jid]
|
||||
}
|
||||
|
||||
for bookmark in gajim.connections[self.account].bookmarks:
|
||||
|
@ -311,13 +311,7 @@ class GroupchatWindow(chat.Chat):
|
|||
gajim.connections[self.account].bookmarks.append(bm)
|
||||
gajim.connections[self.account].store_bookmarks()
|
||||
|
||||
#FIXME: use join_gc_window [where user can put password] and change the
|
||||
#name of the boookmark [default: fill with room's 'name']
|
||||
dialogs.InformationDialog(
|
||||
_('Bookmark has been added successfully'),
|
||||
_('You can find the bookmark for room "%s" in your roster.') % \
|
||||
room_jid.split('@')[0]).get_response()
|
||||
|
||||
self.plugin.roster.make_menu()
|
||||
|
||||
def on_message_textview_key_press_event(self, widget, event):
|
||||
"""When a key is pressed:
|
||||
|
|
|
@ -292,9 +292,12 @@ class RosterWindow:
|
|||
#join gc
|
||||
sub_menu = gtk.Menu()
|
||||
join_gc_menuitem.set_submenu(sub_menu)
|
||||
at_least_one_account_connected = False
|
||||
for account in gajim.connections:
|
||||
if gajim.connections[account].connected <= 1:
|
||||
continue
|
||||
if not at_least_one_account_connected:
|
||||
at_least_one_account_connected = True
|
||||
label = gtk.Label()
|
||||
label.set_markup('<u>' + account.upper() +'</u>')
|
||||
item = gtk.MenuItem()
|
||||
|
@ -312,6 +315,7 @@ class RosterWindow:
|
|||
item.connect('activate', self.on_bookmark_menuitem_activate,
|
||||
account, bookmark)
|
||||
|
||||
if at_least_one_account_connected:
|
||||
newitem = gtk.MenuItem() # seperator
|
||||
sub_menu.append(newitem)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue