[polari] connectionsDialog: Sort connections list
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] connectionsDialog: Sort connections list
- Date: Thu, 8 Aug 2013 13:09:12 +0000 (UTC)
commit 40f50a3e0da0cd70e1e5535c91b982b661b06e0d
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jul 25 00:05:56 2013 +0200
connectionsDialog: Sort connections list
src/connections.js | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/connections.js b/src/connections.js
index 9c8ff60..d63e7db 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -26,6 +26,10 @@ const ConnectionsDialog = new Lang.Class({
this._listBox = builder.get_object('accounts_list');
this._stack = builder.get_object('stack');
+ this._listBox.set_sort_func(function(row1, row2) {
+ return row1._account.display_name < row2._account.display_name ? -1 : 1;
+ });
+
let addButton = builder.get_object('add_button');
addButton.connect('clicked', Lang.bind(this, this._addConnection));
@@ -92,6 +96,10 @@ const ConnectionsDialog = new Lang.Class({
GObject.BindingFlags.SYNC_CREATE);
account.bind_property('enabled', sw, 'active',
GObject.BindingFlags.SYNC_CREATE);
+ account.connect('notify::display-name',
+ function() {
+ row.changed();
+ });
sw.connect('notify::active',
function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]