[gnome-shell] userMenu: Make presence chooser insensitive when offline



commit cd43c4983b56fa475b477e2d049262059ca9e65f
Author: Florian MÃllner <fmuellner gnome org>
Date:   Wed Jun 13 00:44:29 2012 +0200

    userMenu: Make presence chooser insensitive when offline
    
    Setting an IM presence only makes sense when connected to the
    network, reflect this by making the presence chooser insensitive
    when no network is available.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677982

 js/ui/userMenu.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js
index ce4f8ca..f113664 100644
--- a/js/ui/userMenu.js
+++ b/js/ui/userMenu.js
@@ -216,6 +216,8 @@ const IMStatusChooserItem = new Lang.Class({
         this._networkMonitor = Gio.NetworkMonitor.get_default();
         this._networkMonitor.connect('network-changed',
             Lang.bind(this, function(monitor, available) {
+                this._IMAccountsChanged(this._accountMgr);
+
                 if (available && !this._imPresenceRestored)
                     this._restorePresence();
             }));
@@ -303,7 +305,8 @@ const IMStatusChooserItem = new Lang.Class({
         let accounts = mgr.get_valid_accounts().filter(function(account) {
             return account.enabled;
         });
-        this._combo.setSensitive(accounts.length > 0);
+        let sensitive = accounts.length > 0 && this._networkMonitor.network_available;
+        this._combo.setSensitive(sensitive);
     },
 
     _IMStatusChanged: function(accountMgr, presence, status, message) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]