[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10270: [darcs-to-svn @ add connection settings overlay to prevent m (in torbutton/trunk/src: . chrome/content chrome/locale/en-US)



Author: squires
Date: 2007-05-22 01:25:53 -0400 (Tue, 22 May 2007)
New Revision: 10270

Added:
   torbutton/trunk/src/chrome/content/pref-connection-info.xul
   torbutton/trunk/src/chrome/content/pref-connection.xul
Modified:
   torbutton/trunk/src/chrome.manifest
   torbutton/trunk/src/chrome/content/contents.rdf
   torbutton/trunk/src/chrome/content/torbutton.js
   torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd
Log:
[darcs-to-svn @ add connection settings overlay to prevent modification of settings while enabled]
In anticipation of adding functionality to save the non-Tor proxy settings, this will help prevent confusion about which settings are being changed through the proxy settings window.

Original author: squires@xxxxxxxxx
Date: 2006-10-28 17:59:42+00:00

Modified: torbutton/trunk/src/chrome/content/contents.rdf
===================================================================
--- torbutton/trunk/src/chrome/content/contents.rdf	2007-05-22 05:25:38 UTC (rev 10269)
+++ torbutton/trunk/src/chrome/content/contents.rdf	2007-05-22 05:25:53 UTC (rev 10270)
@@ -17,6 +17,7 @@
     <Seq about="urn:mozilla:overlays">
         <!-- firefox -->
         <li resource="chrome://browser/content/browser.xul"/>
+        <li resource="chrome://browser/content/preferences/connection.xul"/>
         <!-- thunderbird -->
         <li resource="chrome://messenger/content/messenger.xul"/>
         <li resource="chrome://messenger/content/messengercompose/messengercompose.xul"/>
@@ -28,6 +29,9 @@
     <Seq about="chrome://browser/content/browser.xul">
         <li>chrome://torbutton/content/torbutton.xul</li>
     </Seq>
+    <Seq about="chrome://browser/content/preferences/connection.xul"/>
+        <li>chrome://torbutton/content/pref-connection.xul</li>
+    </Seq>
 
     <!-- thunderbird -->
     <Seq about="chrome://messenger/content/messenger.xul">

Added: torbutton/trunk/src/chrome/content/pref-connection-info.xul
===================================================================
--- torbutton/trunk/src/chrome/content/pref-connection-info.xul	2007-05-22 05:25:38 UTC (rev 10269)
+++ torbutton/trunk/src/chrome/content/pref-connection-info.xul	2007-05-22 05:25:53 UTC (rev 10270)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+
+<!DOCTYPE overlay SYSTEM "chrome://torbutton/locale/torbutton.dtd">
+
+<dialog id="torbutton-pref-connection-more-info"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+        xmlns:html="http://www.w3.org/1999/xhtml";
+        title="&torbutton.pref_connection_more_info.title;"
+        maxwidth="500"
+        buttons="accept"
+        persist="screenX screenY"
+        onload="sizeToContent();">
+
+    <stringbundleset id="extensionsSet">
+        <stringbundle id="extensionsStrings" src="chrome://mozapps/locale/extensions/extensions.properties"/>
+    </stringbundleset>
+    <vbox flex="1">
+        <description>
+            &torbutton.pref_connection_more_info.text;
+        </description>
+    </vbox>
+
+</dialog>

Added: torbutton/trunk/src/chrome/content/pref-connection.xul
===================================================================
--- torbutton/trunk/src/chrome/content/pref-connection.xul	2007-05-22 05:25:38 UTC (rev 10269)
+++ torbutton/trunk/src/chrome/content/pref-connection.xul	2007-05-22 05:25:53 UTC (rev 10270)
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE overlay SYSTEM "chrome://torbutton/locale/torbutton.dtd">
+
+<overlay id="torbutton-prefs-notice"
+         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";>
+
+    <script type="application/x-javascript" src="chrome://torbutton/content/torbutton.js" />
+    <script language="JavaScript">
+        // onload handler
+        try{window.addEventListener("load", torbutton_browser_proxy_prefs_init, false);}catch(e){}
+    </script>
+
+    <stringbundleset id="extensionsSet">
+        <stringbundle id="extensionsStrings" src="chrome://mozapps/locale/extensions/extensions.properties"/>
+    </stringbundleset>
+
+    <radiogroup id="networkProxyType">
+        <label id="torbutton-pref-connection-notice" position="1">
+            &torbutton.pref_connection.notice;
+        </label>
+        <label id="torbutton-pref-connection-more-info" position="2"
+               class="url"
+               style="color: blue; text-decoration: underline;"
+               onclick="window.openDialog('chrome://torbutton/content/pref-connection-info.xul','torbutton-pref-connection-more-info','centerscreen,chrome,modal=yes,dialog=yes');">
+            &torbutton.pref_connection.more_info;
+        </label>
+    </radiogroup>
+
+</overlay>

Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2007-05-22 05:25:38 UTC (rev 10269)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2007-05-22 05:25:53 UTC (rev 10270)
@@ -484,6 +484,34 @@
     return versionComparator.compare(aVersion, geckoVersion);
 }
 
+function torbutton_browser_proxy_prefs_init()
+{
+  var _elementIDs = ["networkProxyType",
+                     "networkProxyFTP", "networkProxyFTP_Port",
+                     "networkProxyGopher", "networkProxyGopher_Port",
+                     "networkProxyHTTP", "networkProxyHTTP_Port",
+                     "networkProxySOCKS", "networkProxySOCKS_Port",
+                     "networkProxySOCKSVersion",
+                     "networkProxySOCKSVersion4", "networkProxySOCKSVersion5",
+                     "networkProxySSL", "networkProxySSL_Port",
+                     "networkProxyNone", "networkProxyAutoconfigURL", "shareAllProxies"];
+
+  torbutton_log(3, 'called torbutton_browser_proxy_prefs_init()');
+  if (!torbutton_check_status())
+  {
+    document.getElementById('torbutton-pref-connection-notice').hidden = true;
+    document.getElementById('torbutton-pref-connection-more-info').hidden = true;
+  }
+  else
+  {
+    document.getElementById('networkProxyType').disabled = true;
+    for (i = 0; i < _elementIDs.length; i++)
+        document.getElementById(_elementIDs[i]).setAttribute( "disabled", "true" );
+  }
+
+  // window.sizeToContent();
+}
+
 function torbutton_log(nLevel, sMsg) {
     var o_log_mgr    = false;
     var o_tb_logger  = false;

Modified: torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd	2007-05-22 05:25:38 UTC (rev 10269)
+++ torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd	2007-05-22 05:25:53 UTC (rev 10270)
@@ -1,25 +1,29 @@
-<!ENTITY torbutton.prefs.title			"Torbutton Preferences">
-<!ENTITY torbutton.prefs.display_settings	"Display Settings">
-<!ENTITY torbutton.prefs.display_panel		"Display Tor proxy setting in the status bar">
-<!ENTITY torbutton.prefs.panel_format		"Status bar display format:">
-<!ENTITY torbutton.prefs.panel_text_format	"Text">
-<!ENTITY torbutton.prefs.panel_icon_format	"Icon">
-<!ENTITY torbutton.prefs.tor_settings		"Proxy Settings">
-<!ENTITY torbutton.prefs.recommended_settings	"Use the recommended proxy settings for my version of Firefox">
-<!ENTITY torbutton.prefs.use_privoxy		"Use Privoxy">
-<!ENTITY torbutton.prefs.custom_settings	"Use custom proxy settings">
-<!ENTITY torbutton.prefs.proxy.host.http	"HTTP Proxy:">
-<!ENTITY torbutton.prefs.proxy.host.https	"SSL Proxy:">
-<!ENTITY torbutton.prefs.proxy.host.ftp		"FTP Proxy:">
-<!ENTITY torbutton.prefs.proxy.host.gopher	"Gopher Proxy:">
-<!ENTITY torbutton.prefs.proxy.host.socks	"SOCKS Host:">
-<!ENTITY torbutton.prefs.proxy.port		"Port:">
-<!ENTITY torbutton.about.title			"About Torbutton">
-<!ENTITY torbutton.context_menu.toggle		"Toggle Tor status">
-<!ENTITY torbutton.context_menu.toggle.key	"T">
-<!ENTITY torbutton.context_menu.preferences	"Preferences...">
-<!ENTITY torbutton.context_menu.preferences.key	"P">
-<!ENTITY torbutton.context_menu.about		"About Torbutton...">
-<!ENTITY torbutton.context_menu.about.key	"A">
-<!ENTITY torbutton.button.label			"Torbutton">
-<!ENTITY torbutton.button.tooltip		"Click to initialize Torbutton">
+<!ENTITY torbutton.prefs.title                          "Torbutton Preferences">
+<!ENTITY torbutton.prefs.display_settings               "Display Settings">
+<!ENTITY torbutton.prefs.display_panel                  "Display Tor proxy setting in the status bar">
+<!ENTITY torbutton.prefs.panel_format                   "Status bar display format:">
+<!ENTITY torbutton.prefs.panel_text_format              "Text">
+<!ENTITY torbutton.prefs.panel_icon_format              "Icon">
+<!ENTITY torbutton.prefs.tor_settings                   "Proxy Settings">
+<!ENTITY torbutton.prefs.recommended_settings           "Use the recommended proxy settings for my version of Firefox">
+<!ENTITY torbutton.prefs.use_privoxy                    "Use Privoxy">
+<!ENTITY torbutton.prefs.custom_settings                "Use custom proxy settings">
+<!ENTITY torbutton.prefs.proxy.host.http                "HTTP Proxy:">
+<!ENTITY torbutton.prefs.proxy.host.https               "SSL Proxy:">
+<!ENTITY torbutton.prefs.proxy.host.ftp                 "FTP Proxy:">
+<!ENTITY torbutton.prefs.proxy.host.gopher              "Gopher Proxy:">
+<!ENTITY torbutton.prefs.proxy.host.socks               "SOCKS Host:">
+<!ENTITY torbutton.prefs.proxy.port                     "Port:">
+<!ENTITY torbutton.about.title                          "About Torbutton">
+<!ENTITY torbutton.pref_connection.notice               "Disable Torbutton to change these settings.">
+<!ENTITY torbutton.pref_connection.more_info            "More information">
+<!ENTITY torbutton.pref_connection_more_info.title      "Help">
+<!ENTITY torbutton.pref_connection_more_info.text       "Torbutton is currently enabled.  If you would like to change your non-Tor proxy settings, please disable Torbutton and return here.  If you would like to change your Tor settings, please use the Torbutton preference window.">
+<!ENTITY torbutton.context_menu.toggle                  "Toggle Tor status">
+<!ENTITY torbutton.context_menu.toggle.key              "T">
+<!ENTITY torbutton.context_menu.preferences             "Preferences...">
+<!ENTITY torbutton.context_menu.preferences.key         "P">
+<!ENTITY torbutton.context_menu.about                   "About Torbutton...">
+<!ENTITY torbutton.context_menu.about.key               "A">
+<!ENTITY torbutton.button.label                         "Torbutton">
+<!ENTITY torbutton.button.tooltip                       "Click to initialize Torbutton">

Modified: torbutton/trunk/src/chrome.manifest
===================================================================
--- torbutton/trunk/src/chrome.manifest	2007-05-22 05:25:38 UTC (rev 10269)
+++ torbutton/trunk/src/chrome.manifest	2007-05-22 05:25:53 UTC (rev 10270)
@@ -1,5 +1,6 @@
 content torbutton chrome/content/
 overlay chrome://browser/content/browser.xul chrome://torbutton/content/torbutton.xul
+overlay chrome://browser/content/preferences/connection.xul chrome://torbutton/content/pref-connection.xul
 overlay chrome://messenger/content/messenger.xul chrome://torbutton/content/torbutton_tb.xul
 overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://torbutton/content/torbutton_tb.xul