fixing UI for bookmarks
This commit is contained in:
parent
7762919ae7
commit
f0fca2d2b0
|
@ -2377,7 +2377,8 @@ class ManageBookmarksWindow:
|
|||
'password': bm[4], 'nick': bm[5] }
|
||||
|
||||
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:
|
||||
|
@ -310,14 +310,8 @@ 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:
|
||||
|
|
|
@ -291,10 +291,13 @@ class RosterWindow:
|
|||
|
||||
#join gc
|
||||
sub_menu = gtk.Menu()
|
||||
join_gc_menuitem.set_submenu(sub_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
|
||||
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()
|
||||
|
@ -311,14 +314,15 @@ class RosterWindow:
|
|||
sub_menu.append(item)
|
||||
item.connect('activate', self.on_bookmark_menuitem_activate,
|
||||
account, bookmark)
|
||||
|
||||
newitem = gtk.MenuItem() # seperator
|
||||
sub_menu.append(newitem)
|
||||
|
||||
newitem = gtk.MenuItem('Bookmarks')
|
||||
sub_menu.append(newitem)
|
||||
newitem.connect('activate', self.on_bookmarks_menuitem_activate)
|
||||
sub_menu.show_all()
|
||||
|
||||
if at_least_one_account_connected:
|
||||
newitem = gtk.MenuItem() # seperator
|
||||
sub_menu.append(newitem)
|
||||
|
||||
newitem = gtk.MenuItem('Bookmarks')
|
||||
sub_menu.append(newitem)
|
||||
newitem.connect('activate', self.on_bookmarks_menuitem_activate)
|
||||
sub_menu.show_all()
|
||||
|
||||
if len(gajim.connections) >= 2: # 2 or more accounts? make submenus
|
||||
#add
|
||||
|
|
Loading…
Reference in New Issue