Commit 0ae1c768 authored by Kathleen Brade's avatar Kathleen Brade
Browse files

Improve progress dialog.

Show "Connecting to the Tor network" heading and, if browser window is not open yet,
  show "Your browser will open after you are connected." message.
parent 5c869988
......@@ -291,7 +291,8 @@ function openProgressDialog()
{
var chromeURL = "chrome://torlauncher/content/progress.xul";
var features = "chrome,dialog=yes,modal=yes,dependent=yes";
window.openDialog(chromeURL, "_blank", features, onProgressDialogClose);
window.openDialog(chromeURL, "_blank", features,
gIsInitialBootstrap, onProgressDialogClose);
}
......
......@@ -27,8 +27,14 @@ function initDialog()
}
catch (e) {}
var isBrowserStartup = false;
if (window.arguments)
gOpenerCallbackFunc = window.arguments[0];
{
isBrowserStartup = window.arguments[0];
if (window.arguments.length > 1)
gOpenerCallbackFunc = window.arguments[1];
}
// If this dialog was not opened from network settings, change Cancel to Quit.
if (!gOpenerCallbackFunc)
......@@ -37,6 +43,14 @@ function initDialog()
var quitKey = (TorLauncherUtil.isWindows) ? "quit_win" : "quit";
cancelBtn.label = TorLauncherUtil.getLocalizedString(quitKey);
}
// If opened during browser startup, display the "please wait" message.
if (isBrowserStartup)
{
var pleaseWait = document.getElementById("progressPleaseWait");
if (pleaseWait)
pleaseWait.removeAttribute("hidden");
}
}
......
......@@ -30,10 +30,11 @@
</vbox>
<separator orient="vertical" />
<vbox>
<label id="progressHeading" value="&torprogress.dialog.title;" />
<label id="progressHeading" value="&torprogress.heading;" />
<description id="progressDesc" />
</vbox>
</hbox>
<progressmeter id="progressMeter" mode="determined" value="0" />
<label id="progressPleaseWait" value="&torprogress.pleaseWait;" hidden="true" />
</vbox>
</dialog>
<!ENTITY torprogress.dialog.title "Tor Status">
<!ENTITY torprogress.heading "Connecting to the Tor network">
<!ENTITY torprogress.pleaseWait "Your browser will open after you are connected.">
......@@ -15,6 +15,11 @@ dialog {
font-weight: bold;
}
#progressPleaseWait {
font-size: 110%;
margin-bottom: 15px;
}
#tbb-icon {
list-style-image: url("chrome://torlauncher/skin/default48.png");
width: 48px;
......
......@@ -342,14 +342,7 @@ TorProcessService.prototype =
var wwSvc = Cc["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Ci.nsIWindowWatcher);
var winFeatures = "chrome,dialog=yes,modal,all";
var argsArray = Cc["@mozilla.org/array;1"]
.createInstance(Ci.nsIMutableArray);
var variant = Cc["@mozilla.org/variant;1"]
.createInstance(Ci.nsIWritableVariant);
variant.setFromVariant(aIsInitialBootstrap);
argsArray.appendElement(variant, false);
var argsArray = this._createOpenWindowArgsArray(aIsInitialBootstrap);
wwSvc.openWindow(null, kChromeURL, "_blank", winFeatures, argsArray);
},
......@@ -359,7 +352,19 @@ TorProcessService.prototype =
var wwSvc = Cc["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Ci.nsIWindowWatcher);
var winFeatures = "chrome,dialog=yes,modal,all";
wwSvc.openWindow(null, chromeURL, "_blank", winFeatures, null);
var argsArray = this._createOpenWindowArgsArray(true);
wwSvc.openWindow(null, chromeURL, "_blank", winFeatures, argsArray);
},
_createOpenWindowArgsArray: function(aBool)
{
var argsArray = Cc["@mozilla.org/array;1"]
.createInstance(Ci.nsIMutableArray);
var variant = Cc["@mozilla.org/variant;1"]
.createInstance(Ci.nsIWritableVariant);
variant.setFromVariant(aBool);
argsArray.appendElement(variant, false);
return argsArray;
},
// Returns an nsIFile.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment