[polari] connections: Make account switch lazy
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] connections: Make account switch lazy
- Date: Wed, 17 Sep 2014 02:50:36 +0000 (UTC)
commit 17b2880143f59daf96b2f6c77c996925a358006c
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Sep 11 00:45:16 2014 +0200
connections: Make account switch lazy
Enabling/disabling an account is not instantaneous, reflect this by
only updating the switch state after the account state has changed.
src/connections.js | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/connections.js b/src/connections.js
index 94c30bf..64650cb 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -92,19 +92,20 @@ const ConnectionsDialog = new Lang.Class({
account.bind_property('display-name', label, 'label',
GObject.BindingFlags.SYNC_CREATE);
- account.bind_property('enabled', sw, 'active',
+ account.bind_property('enabled', sw, 'state',
GObject.BindingFlags.SYNC_CREATE);
account.connect('notify::display-name',
function() {
row.changed();
});
- sw.connect('notify::active',
- function() {
- account.set_enabled_async(sw.active, Lang.bind(this,
+ sw.connect('state-set',
+ function(w, state) {
+ account.set_enabled_async(state, Lang.bind(this,
function(a, res) {
a.set_enabled_finish(res);
}));
+ return true;
});
row.connect('key-press-event', Lang.bind(this,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]