[tor-commits] [tor-launcher/master] Do not close progress window when an error occurs.

brade at torproject.org brade at torproject.org
Thu Apr 18 14:54:08 UTC 2013


commit 3f6a79266e3a3019429f8c684f1124184dc9502c
Author: Kathy Brade <brade at torproject.org>
Date:   Wed Apr 17 16:52:17 2013 -0400

    Do not close progress window when an error occurs.
    
    Attempting to close when a modal error alert was being displayed
    causes exceptions inside progress window.
---
 src/chrome/content/progress.js  |   19 +++++++++++++++----
 src/chrome/content/progress.xul |    1 +
 src/components/tl-process.js    |    4 ++--
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/chrome/content/progress.js b/src/chrome/content/progress.js
index 865ddec..3be7aac 100644
--- a/src/chrome/content/progress.js
+++ b/src/chrome/content/progress.js
@@ -112,9 +112,6 @@ var gObserver = {
       var labelText = (statusObj.SUMMARY) ? statusObj.SUMMARY : "";
       var percentComplete = (statusObj.PROGRESS) ? statusObj.PROGRESS : 0;
 
-      var desc = document.getElementById("progressDesc");
-      if (desc)
-        desc.textContent = labelText;
       var meter = document.getElementById("progressMeter");
       if (meter)
         meter.value = percentComplete;
@@ -127,7 +124,21 @@ var gObserver = {
         window.setTimeout(function() { closeThisWindow(true); }, 250);
       }
       else if (statusObj._errorOccurred)
-        closeThisWindow(false);
+      {
+        if (statusObj.WARNING)
+          labelText = statusObj.WARNING;
+
+        if (meter)
+          meter.setAttribute("hidden", true);
+
+        var pleaseWait = document.getElementById("progressPleaseWait");
+        if (pleaseWait)
+          pleaseWait.setAttribute("hidden", true);
+      }
+
+      var desc = document.getElementById("progressDesc");
+      if (labelText && desc)
+        desc.textContent = labelText;
     }
   },
 };
diff --git a/src/chrome/content/progress.xul b/src/chrome/content/progress.xul
index c5c5aca..2e59ebb 100644
--- a/src/chrome/content/progress.xul
+++ b/src/chrome/content/progress.xul
@@ -14,6 +14,7 @@
 <dialog id="TorProgress"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="&torprogress.dialog.title;"
+        windowtype="TorLauncher:Progress"
         persist="screenX screenY"
         buttons="cancel"
         ondialogcancel="return onCancel();"
diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index 6014125..fcfbf89 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -303,7 +303,7 @@ TorProcessService.prototype =
       this.mTorProcess = p;
       this.mTorProcessStartTime = Date.now();
 
-      this._waitForTorProcessStartup();
+      this._monitorTorProcessStartup();
 
       if (isInitialBootstrap)
       {
@@ -342,7 +342,7 @@ TorProcessService.prototype =
     }
   }, // _startTor()
 
-  _waitForTorProcessStartup: function()
+  _monitorTorProcessStartup: function()
   {
     this.mControlConnDelayMS = this.kInitialControlConnDelayMS;
     this.mControlConnTimer = Cc["@mozilla.org/timer;1"]



More information about the tor-commits mailing list