Auto sort bookmarked rooms list (when opening manage dialog and when adding
new one). Fixes #3739.
This commit is contained in:
parent
59cc0a4aa8
commit
06fdc8367b
2 changed files with 14 additions and 2 deletions
|
@ -2642,6 +2642,7 @@ class ManageBookmarksWindow:
|
||||||
# Account-JID, RoomName, Room-JID, Autojoin, Minimize, Passowrd, Nick,
|
# Account-JID, RoomName, Room-JID, Autojoin, Minimize, Passowrd, Nick,
|
||||||
# Show_Status
|
# Show_Status
|
||||||
self.treestore = gtk.TreeStore(str, str, str, bool, bool, str, str, str)
|
self.treestore = gtk.TreeStore(str, str, str, bool, bool, str, str, str)
|
||||||
|
self.treestore.set_sort_column_id(1, gtk.SORT_ASCENDING)
|
||||||
|
|
||||||
# Store bookmarks in treeview.
|
# Store bookmarks in treeview.
|
||||||
for account in gajim.connections:
|
for account in gajim.connections:
|
||||||
|
|
|
@ -1740,9 +1740,20 @@ class GroupchatControl(ChatControlBase):
|
||||||
_('Group Chat "%s" is already in your bookmarks.') % bm['jid'])
|
_('Group Chat "%s" is already in your bookmarks.') % bm['jid'])
|
||||||
return
|
return
|
||||||
|
|
||||||
gajim.connections[self.account].bookmarks.append(bm)
|
place_found = False
|
||||||
gajim.connections[self.account].store_bookmarks()
|
index = 0
|
||||||
|
# Respect alpha order
|
||||||
|
for bookmark in gajim.connections[self.account].bookmarks:
|
||||||
|
if bookmark['name'] > bm['name']:
|
||||||
|
place_found = True
|
||||||
|
break
|
||||||
|
index += 1
|
||||||
|
if place_found:
|
||||||
|
gajim.connections[self.account].bookmarks.insert(index, bm)
|
||||||
|
else:
|
||||||
|
gajim.connections[self.account].bookmarks.append(bm)
|
||||||
|
|
||||||
|
gajim.connections[self.account].store_bookmarks()
|
||||||
gajim.interface.roster.set_actions_menu_needs_rebuild()
|
gajim.interface.roster.set_actions_menu_needs_rebuild()
|
||||||
|
|
||||||
dialogs.InformationDialog(
|
dialogs.InformationDialog(
|
||||||
|
|
Loading…
Add table
Reference in a new issue