[polari] accountsMonitor: Add 'account-status-changed' signal
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] accountsMonitor: Add 'account-status-changed' signal
- Date: Thu, 8 Aug 2013 13:09:32 +0000 (UTC)
commit 8c9834f6062bc35ffe59c5e615ecb0dbbc4c4523
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jul 25 01:06:51 2013 +0200
accountsMonitor: Add 'account-status-changed' signal
Connecting to a server can take a while (irc.gnome.org, hi!), so
we should inform users that a connection is being established.
This adds the necessary API to AccountsMonitor to enable us to
implement this.
src/accountsMonitor.js | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/accountsMonitor.js b/src/accountsMonitor.js
index e81b5ab..500388f 100644
--- a/src/accountsMonitor.js
+++ b/src/accountsMonitor.js
@@ -56,6 +56,11 @@ const AccountsMonitor = new Lang.Class({
if (!this._shouldMonitorAccount(account))
return;
+ account._statusNotifyId =
+ account.connect('notify::connection-status', Lang.bind(this,
+ function() {
+ this.emit('account-status-changed', account);
+ }));
this._accounts.push(account);
this.emit('account-added', account);
@@ -68,6 +73,8 @@ const AccountsMonitor = new Lang.Class({
if (index == -1)
return;
+ account.disconnect(account._statusNotifyId);
+ delete account._statusNotifyId;
this._accounts.splice(index, 1);
this.emit('account-removed', account);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]