fixing UI for bookmarks
This commit is contained in:
parent
7762919ae7
commit
f0fca2d2b0
3 changed files with 21 additions and 22 deletions
|
@ -2377,7 +2377,8 @@ class ManageBookmarksWindow:
|
||||||
'password': bm[4], 'nick': bm[5] }
|
'password': bm[4], 'nick': bm[5] }
|
||||||
|
|
||||||
gajim.connections[account[1]].store_bookmarks()
|
gajim.connections[account[1]].store_bookmarks()
|
||||||
|
|
||||||
|
self.plugin.roster.make_menu()
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
|
||||||
def on_cancel_button_clicked(self, widget):
|
def on_cancel_button_clicked(self, widget):
|
||||||
|
|
|
@ -294,11 +294,11 @@ class GroupchatWindow(chat.Chat):
|
||||||
|
|
||||||
def on_add_bookmark_menuitem_activate(self, widget):
|
def on_add_bookmark_menuitem_activate(self, widget):
|
||||||
room_jid = self.get_active_jid()
|
room_jid = self.get_active_jid()
|
||||||
bm = { 'name': '',
|
bm = { 'name': room_jid,
|
||||||
'jid': self.get_active_jid(),
|
'jid': room_jid,
|
||||||
'autojoin': '0',
|
'autojoin': '0',
|
||||||
'password': '',
|
'password': '',
|
||||||
'nick': self.nicks[self.get_active_jid()]
|
'nick': self.nicks[room_jid]
|
||||||
}
|
}
|
||||||
|
|
||||||
for bookmark in gajim.connections[self.account].bookmarks:
|
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].bookmarks.append(bm)
|
||||||
gajim.connections[self.account].store_bookmarks()
|
gajim.connections[self.account].store_bookmarks()
|
||||||
|
|
||||||
#FIXME: use join_gc_window [where user can put password] and change the
|
self.plugin.roster.make_menu()
|
||||||
#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()
|
|
||||||
|
|
||||||
|
|
||||||
def on_message_textview_key_press_event(self, widget, event):
|
def on_message_textview_key_press_event(self, widget, event):
|
||||||
"""When a key is pressed:
|
"""When a key is pressed:
|
||||||
|
|
|
@ -291,10 +291,13 @@ class RosterWindow:
|
||||||
|
|
||||||
#join gc
|
#join gc
|
||||||
sub_menu = gtk.Menu()
|
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:
|
for account in gajim.connections:
|
||||||
if gajim.connections[account].connected <= 1:
|
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 = gtk.Label()
|
||||||
label.set_markup('<u>' + account.upper() +'</u>')
|
label.set_markup('<u>' + account.upper() +'</u>')
|
||||||
item = gtk.MenuItem()
|
item = gtk.MenuItem()
|
||||||
|
@ -311,14 +314,15 @@ class RosterWindow:
|
||||||
sub_menu.append(item)
|
sub_menu.append(item)
|
||||||
item.connect('activate', self.on_bookmark_menuitem_activate,
|
item.connect('activate', self.on_bookmark_menuitem_activate,
|
||||||
account, bookmark)
|
account, bookmark)
|
||||||
|
|
||||||
newitem = gtk.MenuItem() # seperator
|
if at_least_one_account_connected:
|
||||||
sub_menu.append(newitem)
|
newitem = gtk.MenuItem() # seperator
|
||||||
|
sub_menu.append(newitem)
|
||||||
newitem = gtk.MenuItem('Bookmarks')
|
|
||||||
sub_menu.append(newitem)
|
newitem = gtk.MenuItem('Bookmarks')
|
||||||
newitem.connect('activate', self.on_bookmarks_menuitem_activate)
|
sub_menu.append(newitem)
|
||||||
sub_menu.show_all()
|
newitem.connect('activate', self.on_bookmarks_menuitem_activate)
|
||||||
|
sub_menu.show_all()
|
||||||
|
|
||||||
if len(gajim.connections) >= 2: # 2 or more accounts? make submenus
|
if len(gajim.connections) >= 2: # 2 or more accounts? make submenus
|
||||||
#add
|
#add
|
||||||
|
|
Loading…
Add table
Reference in a new issue