[gnome-shell] NetworkAgent: cancel requests when disabling component
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-shell] NetworkAgent: cancel requests when disabling component
- Date: Tue, 30 Oct 2012 15:37:05 +0000 (UTC)
commit 88192114ac8cd3c0d3484c4d304446b28b957370
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Mon Oct 22 23:13:45 2012 +0200
    NetworkAgent: cancel requests when disabling component
    
    When the NetworkAgent is disabled (for example because the lock screen
    is being activated), cancel all modal dialogs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685239
 js/ui/components/networkAgent.js |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 2eaca0c..986c4bd 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -408,7 +408,10 @@ const VPNRequestHandler = new Lang.Class({
         }
     },
 
-    cancel: function() {
+    cancel: function(respond) {
+        if (respond)
+            this._agent.respond(this._requestId, Shell.NetworkAgentResponse.USER_CANCELED);
+
         if (this._newStylePlugin && this._shellDialog) {
             this._shellDialog.close(global.get_current_time());
             this._shellDialog.destroy();
@@ -599,6 +602,16 @@ const NetworkAgent = new Lang.Class({
     },
 
     disable: function() {
+        let requestId;
+
+        for (requestId in this._dialogs)
+            this._dialogs[requestId].cancel();
+        this._dialogs = { };
+
+        for (requestId in this._vpnRequests)
+            this._vpnRequests[requestId].cancel(true);
+        this._vpnRequests = { };
+
         this._native.unregister();
     },
 
@@ -622,7 +635,7 @@ const NetworkAgent = new Lang.Class({
             this._dialogs[requestId].destroy();
             delete this._dialogs[requestId];
         } else if (this._vpnRequests[requestId]) {
-            this._vpnRequests[requestId].cancel();
+            this._vpnRequests[requestId].cancel(false);
             delete this._vpnRequests[requestId];
         }
     },
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]