commit 270bb21f252f144780eb8304bee944c7a3ae5b1c Author: Kathleen Brade brade@pearlcrescent.com Date: Tue Apr 30 14:11:24 2013 -0400
Improve Windows and Linux look and feel. --- src/chrome/content/network-settings-overlay.xul | 1 + src/chrome/content/network-settings-wizard.xul | 16 +++++++----- src/chrome/content/network-settings.js | 29 ++++++++++++++++------ src/chrome/content/network-settings.xul | 6 ++-- src/chrome/content/progress.js | 2 +- src/chrome/content/progress.xul | 6 ++-- src/chrome/skin/network-settings.css | 8 ++++++ 7 files changed, 46 insertions(+), 22 deletions(-)
diff --git a/src/chrome/content/network-settings-overlay.xul b/src/chrome/content/network-settings-overlay.xul index 64dc366..05479d0 100644 --- a/src/chrome/content/network-settings-overlay.xul +++ b/src/chrome/content/network-settings-overlay.xul @@ -49,6 +49,7 @@ <hbox align="center"> <menulist id="proxyType" oncommand="onProxyTypeChange()"> <menupopup id="proxyType_menuPopup"> + <menuitem label="-" value="" selected="true" /> <menuitem label="&torsettings.useProxy.type.socks4;" value="SOCKS4"/> <menuitem label="&torsettings.useProxy.type.socks5;" diff --git a/src/chrome/content/network-settings-wizard.xul b/src/chrome/content/network-settings-wizard.xul index 2316db6..1b163f3 100644 --- a/src/chrome/content/network-settings-wizard.xul +++ b/src/chrome/content/network-settings-wizard.xul @@ -18,7 +18,7 @@ title="&torsettings.dialog.title;" windowtype="TorLauncher:NetworkSettings" persist="screenX screenY" - buttonlabelextra1="&torsettings.copyLog;" + buttonlabelextra2="&torsettings.copyLog;" onwizardfinish="return applySettings();" onwizardcancel="return onCancel();" onload="initDialog();"> @@ -26,7 +26,8 @@ <script type="application/x-javascript" src="chrome://torlauncher/content/network-settings.js"/>
- <wizardpage label=" " pageid="proxy" next="firewall" onextra1="onCopyLog();" + <wizardpage label=" " pageid="proxy" next="firewall" onextra2="onCopyLog();" + onpageshow="showOrHideButton('next', true, true)" onpageadvanced="return onWizardProxyNext(this);"> <hbox class="tbb-header"> <vbox class="tbb-logo-box" align="start"> @@ -51,7 +52,7 @@ </hbox> </wizardpage>
- <wizardpage pageid="proxyYES" next="firewall" onextra1="onCopyLog();" + <wizardpage pageid="proxyYES" next="firewall" onextra2="onCopyLog();" onpageadvanced="return (getAndValidateProxySettings() != null)"> <vbox class="tbb-logo-box" align="start"> <image class="tbb-logo" /> @@ -61,7 +62,8 @@ <groupbox id="proxySpecificSettings" /> </wizardpage>
- <wizardpage pageid="firewall" next="bridges" onextra1="onCopyLog();" + <wizardpage pageid="firewall" next="bridges" onextra2="onCopyLog();" + onpageshow="showOrHideButton('next', true, true)" onpageadvanced="return onWizardFirewallNext(this);"> <vbox class="tbb-logo-box" align="start"> <image class="tbb-logo" /> @@ -80,7 +82,7 @@ </hbox> </wizardpage>
- <wizardpage pageid="firewallYES" next="bridges" onextra1="onCopyLog();" + <wizardpage pageid="firewallYES" next="bridges" onextra2="onCopyLog();" onpageadvanced="return (getAndValidateFirewallSettings() != null)"> <vbox class="tbb-logo-box" align="start"> <image class="tbb-logo" /> @@ -92,7 +94,7 @@ </vbox> </wizardpage>
- <wizardpage label=" " pageid="bridges" onextra1="onCopyLog();" + <wizardpage label=" " pageid="bridges" onextra2="onCopyLog();" onpageshow="showOrHideButton('finish', true, true)"> <vbox class="tbb-logo-box" align="start"> <image class="tbb-logo" /> @@ -115,7 +117,7 @@ </wizardpage>
<wizardpage label=" " pageid="errorPanel" next="notUsed" - onextra1="onCopyLog();"> + onextra2="onCopyLog();"> </wizardpage>
<wizardpage class="help" label=" " pageid="bridgeHelp" next="notUsed" diff --git a/src/chrome/content/network-settings.js b/src/chrome/content/network-settings.js index 6123b15..b2c94a4 100644 --- a/src/chrome/content/network-settings.js +++ b/src/chrome/content/network-settings.js @@ -104,11 +104,11 @@ function initDialog() if (haveWizard) { // Set "Copy Tor Log" label and move it after the Quit (cancel) button. - var copyLogBtn = document.documentElement.getButton("extra1"); + var copyLogBtn = document.documentElement.getButton("extra2"); if (copyLogBtn) { - copyLogBtn.label = wizardElem.getAttribute("buttonlabelextra1"); - if (cancelBtn && !TorLauncherUtil.isWindows) + copyLogBtn.label = wizardElem.getAttribute("buttonlabelextra2"); + if (cancelBtn && TorLauncherUtil.isMac) cancelBtn.parentNode.insertBefore(copyLogBtn, cancelBtn.nextSibling); }
@@ -119,6 +119,19 @@ function initDialog() var finishBtn = document.documentElement.getButton("finish"); if (finishBtn) finishBtn.label = TorLauncherUtil.getLocalizedString("connect"); + + // Add label and access key to Help button. + var helpBtn = document.documentElement.getButton("help"); + if (helpBtn) + { + var strBundle = Cc["@mozilla.org/intl/stringbundle;1"] + .getService(Ci.nsIStringBundleService) + .createBundle("chrome://global/locale/dialog.properties"); + helpBtn.setAttribute("label", strBundle.GetStringFromName("button-help")); + var accessKey = strBundle.GetStringFromName("accesskey-help"); + if (accessKey) + helpBtn.setAttribute("accesskey", accessKey); + } }
gObsService.addObserver(gObserver, kTorBootstrapErrorTopic, false); @@ -250,7 +263,7 @@ function showPanel(aPanelID) if (deckElem) { deckElem.selectedPanel = document.getElementById(aPanelID); - showOrHideButton("extra1", (aPanelID != "bridgeHelp"), false); + showOrHideButton("extra2", (aPanelID != "bridgeHelp"), false); } else getWizard().goTo(aPanelID); @@ -270,7 +283,7 @@ function wizardShowCopyLogButton() { if (getWizard()) { - var copyLogBtn = document.documentElement.getButton("extra1"); + var copyLogBtn = document.documentElement.getButton("extra2"); if (copyLogBtn) { copyLogBtn.setAttribute("wizardCanCopyLog", true); @@ -423,7 +436,7 @@ function onOpenHelp() { showOrHideButton("cancel", false, false); showOrHideButton("back", false, false); - showOrHideButton("extra1", false, false); + showOrHideButton("extra2", false, false); overrideButtonLabel("next", "done"); } else @@ -442,7 +455,7 @@ function closeHelp() { showOrHideButton("cancel", true, false); showOrHideButton("back", true, false); - var copyLogBtn = document.documentElement.getButton("extra1"); + var copyLogBtn = document.documentElement.getButton("extra2"); if (copyLogBtn && copyLogBtn.hasAttribute("wizardCanCopyLog")) copyLogBtn.removeAttribute("hidden"); restoreButtonLabel("next"); @@ -876,7 +889,7 @@ function showSaveSettingsAlert(aDetails) "failed_to_save_settings", [aDetails], 1); TorLauncherUtil.showAlert(window, s);
- showOrHideButton("extra1", true, false); + showOrHideButton("extra2", true, false); gWizIsCopyLogBtnShowing = true; }
diff --git a/src/chrome/content/network-settings.xul b/src/chrome/content/network-settings.xul index f88b178..d05f4e8 100644 --- a/src/chrome/content/network-settings.xul +++ b/src/chrome/content/network-settings.xul @@ -18,11 +18,11 @@ title="&torsettings.dialog.title;" windowtype="TorLauncher:NetworkSettings" persist="screenX screenY" - buttons="accept,cancel,extra1,help" - buttonlabelextra1="&torsettings.copyLog;" + buttons="accept,cancel,extra2,help" + buttonlabelextra2="&torsettings.copyLog;" ondialogaccept="return applySettings();" ondialogcancel="return onCancel();" - ondialogextra1="onCopyLog();" + ondialogextra2="onCopyLog();" ondialoghelp="onOpenHelp();" onload="initDialog();">
diff --git a/src/chrome/content/progress.js b/src/chrome/content/progress.js index 803399f..3a40dbf 100644 --- a/src/chrome/content/progress.js +++ b/src/chrome/content/progress.js @@ -41,7 +41,7 @@ function initDialog() if (gOpenerCallbackFunc) { // Dialog was opened from network settings: hide Open Settings button. - var extraBtn = document.documentElement.getButton("extra1"); + var extraBtn = document.documentElement.getButton("extra2"); extraBtn.setAttribute("hidden", true); } else diff --git a/src/chrome/content/progress.xul b/src/chrome/content/progress.xul index 198f20f..d322c1d 100644 --- a/src/chrome/content/progress.xul +++ b/src/chrome/content/progress.xul @@ -16,10 +16,10 @@ title="&torprogress.dialog.title;" windowtype="TorLauncher:Progress" persist="screenX screenY" - buttons="cancel,extra1" - buttonlabelextra1="&torprogress.openSettings;" + buttons="cancel,extra2" + buttonlabelextra2="&torprogress.openSettings;" ondialogcancel="return onCancel();" - ondialogextra1="onOpenSettings();" + ondialogextra2="onOpenSettings();" onload="initDialog();">
<script type="application/x-javascript" diff --git a/src/chrome/skin/network-settings.css b/src/chrome/skin/network-settings.css index c826358..a7064eb 100644 --- a/src/chrome/skin/network-settings.css +++ b/src/chrome/skin/network-settings.css @@ -18,7 +18,15 @@ wizard { padding-top: 0px; }
+.wizard-page-box { + padding: 0px; + margin: 20px; +} + +wizard .wizard-header { display: none; } + #forAssistance { + margin-left: 12px; margin-bottom: 6px; -moz-user-select: text; -moz-user-focus: normal;
tor-commits@lists.torproject.org