GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 3aa48602 authored by Kathleen Brade's avatar Kathleen Brade
Browse files

Bug 11199 fixup: Improve behavior if tor exits.

Improved alert/error messages and button labels.
parent 9c0ef4f6
......@@ -168,7 +168,7 @@
<spring flex="1" />
<hbox>
<spring flex="1" />
<description id="errorPanelMessage" />
<description id="errorPanelMessage" flex="1" />
<spring flex="1" />
</hbox>
<separator/>
......
......@@ -491,15 +491,20 @@ function showErrorMessage(aTorExited, aErrorMsg)
if (aTorExited)
{
// Show "Tor exited" message and "Restart Tor" button.
aErrorMsg = TorLauncherUtil.getLocalizedString("tor_exited");
aErrorMsg = TorLauncherUtil.getLocalizedString("tor_exited")
+ "\n\n" + TorLauncherUtil.getLocalizedString("tor_exited2");
if (btn)
btn.removeAttribute("hidden");
if (elem)
elem.style.textAlign = "start";
}
else
{
if (btn)
btn.setAttribute("hidden", true);
if (elem)
elem.style.textAlign = "center";
}
if (elem)
......
......@@ -67,7 +67,7 @@
<spring flex="1" />
<hbox>
<spring flex="1" />
<description id="errorPanelMessage" />
<description id="errorPanelMessage" flex="1" />
<spring flex="1" />
</hbox>
<separator/>
......
......@@ -3,8 +3,8 @@
torlauncher.error_title=Tor Launcher
torlauncher.tor_exited=Tor unexpectedly exited.
torlauncher.tor_connection_lost=Your connection to the Tor Network has been lost.
torlauncher.tor_exited=Tor unexpectedly exited. This might be due to a bug in Tor itself, another program on your system, or faulty hardware. Until you restart Tor, the Tor Browser will not able to reach any websites. If the problem persists, please send a copy of your Tor Log to the support team.
torlauncher.tor_exited2=Restarting Tor will not close your browser tabs.
torlauncher.tor_controlconn_failed=Could not connect to Tor control port.
torlauncher.tor_failed_to_start=Tor failed to start.
torlauncher.tor_control_failed=Failed to take control of Tor.
......@@ -30,7 +30,7 @@ torlauncher.error_bridge_bad_default_type=No provided bridges that have the tran
torlauncher.recommended_bridge=(recommended)
torlauncher.connect=Connect
torlauncher.reconnect=Reconnect
torlauncher.restart_tor=Restart Tor
torlauncher.quit=Quit
torlauncher.quit_win=Exit
torlauncher.done=Done
......
......@@ -105,6 +105,7 @@ wizardpage[pageid="errorPanel"] description,
font-size: 120%;
font-weight: bold;
white-space: pre-wrap;
text-align: center;
}
#restartButton {
......
......@@ -148,11 +148,21 @@ TorProcessService.prototype =
{
this.mProtocolSvc.TorCleanupConnection();
var s = TorLauncherUtil.getLocalizedString("tor_exited");
var s = TorLauncherUtil.getLocalizedString("tor_exited") + "\n\n"
+ TorLauncherUtil.getLocalizedString("tor_exited2");
TorLauncherLogger.log(4, s);
s += "\n" + TorLauncherUtil.getLocalizedString("tor_connection_lost");
var btnLabel = TorLauncherUtil.getLocalizedString("reconnect");
if (TorLauncherUtil.showConfirm(null, s, btnLabel) && !this.mIsQuitting)
var defaultBtnLabel = TorLauncherUtil.getLocalizedString("restart_tor");
var cancelBtnLabel = "OK";
try
{
const kSysBundleURI = "chrome://global/locale/commonDialogs.properties";
var sysBundle = Cc["@mozilla.org/intl/stringbundle;1"]
.getService(Ci.nsIStringBundleService).createBundle(kSysBundleURI);
cancelBtnLabel = sysBundle.GetStringFromName(cancelBtnLabel);
} catch(e) {}
if (TorLauncherUtil.showConfirm(null, s, defaultBtnLabel, cancelBtnLabel)
&& !this.mIsQuitting)
{
this._startTor();
this._controlTor();
......
......@@ -64,7 +64,8 @@ let TorLauncherUtil = // Public
// Returns true if user confirms; false if not.
// Note that no prompt is shown (and false is returned) if the Network Settings
// window is open.
showConfirm: function(aParentWindow, aMsg, aOKButtonLabel)
showConfirm: function(aParentWindow, aMsg, aDefaultButtonLabel,
aCancelButtonLabel)
{
try
{
......@@ -84,11 +85,12 @@ let TorLauncherUtil = // Public
var title = this.getLocalizedString("error_title");
var btnFlags = (ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING)
+ ps.BUTTON_POS_0_DEFAULT
+ (ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL);
+ (ps.BUTTON_POS_1 * ps.BUTTON_TITLE_IS_STRING);
var notUsed = { value: false };
var btnIndex = ps.confirmEx(aParentWindow, title, aMsg, btnFlags,
aOKButtonLabel, null, null, null, notUsed);
aDefaultButtonLabel, aCancelButtonLabel,
null, null, notUsed);
return (0 == btnIndex);
}
catch (e)
......
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