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

[or-cvs] r15068: Add "locked mode" pref to prevent accidental toggling; add a (in torbutton/trunk/src: chrome/content chrome/locale/ar chrome/locale/de-AT chrome/locale/de-CH chrome/locale/de-DE chrome/locale/el-GR chrome/locale/en-US chrome/locale/es chrome/locale/fa-IR chrome/locale/fr-FR chrome/locale/hr-HR chrome/locale/it-IT chrome/locale/nl-NL chrome/locale/pl-PL chrome/locale/pt-BR chrome/locale/ru chrome/locale/sl-SI chrome/locale/zh-CN chrome/locale/zh-TW defaults/preferences)



Author: mikeperry
Date: 2008-06-08 23:59:33 -0400 (Sun, 08 Jun 2008)
New Revision: 15068

Modified:
   torbutton/trunk/src/chrome/content/popup.xul
   torbutton/trunk/src/chrome/content/preferences.js
   torbutton/trunk/src/chrome/content/preferences.xul
   torbutton/trunk/src/chrome/content/torbutton.js
   torbutton/trunk/src/chrome/content/torbutton.xul
   torbutton/trunk/src/chrome/content/torbutton_tb.xul
   torbutton/trunk/src/chrome/locale/ar/torbutton.dtd
   torbutton/trunk/src/chrome/locale/de-AT/torbutton.dtd
   torbutton/trunk/src/chrome/locale/de-CH/torbutton.dtd
   torbutton/trunk/src/chrome/locale/de-DE/torbutton.dtd
   torbutton/trunk/src/chrome/locale/el-GR/torbutton.dtd
   torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd
   torbutton/trunk/src/chrome/locale/es/torbutton.dtd
   torbutton/trunk/src/chrome/locale/fa-IR/torbutton.dtd
   torbutton/trunk/src/chrome/locale/fr-FR/torbutton.dtd
   torbutton/trunk/src/chrome/locale/hr-HR/torbutton.dtd
   torbutton/trunk/src/chrome/locale/it-IT/torbutton.dtd
   torbutton/trunk/src/chrome/locale/nl-NL/torbutton.dtd
   torbutton/trunk/src/chrome/locale/pl-PL/torbutton.dtd
   torbutton/trunk/src/chrome/locale/pt-BR/torbutton.dtd
   torbutton/trunk/src/chrome/locale/ru/torbutton.dtd
   torbutton/trunk/src/chrome/locale/sl-SI/torbutton.dtd
   torbutton/trunk/src/chrome/locale/zh-CN/torbutton.dtd
   torbutton/trunk/src/chrome/locale/zh-TW/torbutton.dtd
   torbutton/trunk/src/defaults/preferences/preferences.js
Log:

Add "locked mode" pref to prevent accidental toggling; add a
pref to 'always' start in a specific Tor state; ruin Jake's
day with a bunch of new strings.



Modified: torbutton/trunk/src/chrome/content/popup.xul
===================================================================
--- torbutton/trunk/src/chrome/content/popup.xul	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/content/popup.xul	2008-06-09 03:59:33 UTC (rev 15068)
@@ -16,7 +16,7 @@
                   accesskey="&torbutton.context_menu.toggle.key;"
                   insertafter="context-stop"
                   key="torbutton-toggle-key"
-                  oncommand="torbutton_toggle()"/>
+                  oncommand="torbutton_toggle(true)"/>
         <menuitem id="torbutton-preferences"
                   label="&torbutton.context_menu.preferences;"
                   accesskey="&torbutton.context_menu.preferences.key;"

Modified: torbutton/trunk/src/chrome/content/preferences.js
===================================================================
--- torbutton/trunk/src/chrome/content/preferences.js	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/content/preferences.js	2008-06-09 03:59:33 UTC (rev 15068)
@@ -195,9 +195,25 @@
             doc.getElementById('torbutton_restoreNonTor');
     }
 
+    switch(o_torprefs.getIntPref('startup_state')) {
+        case 0: // non-tor
+            doc.getElementById("torbutton_startupStateGroup").selectedItem =
+                doc.getElementById('torbutton_startNonTor');
+            break;
+        case 1: // tor
+            doc.getElementById("torbutton_startupStateGroup").selectedItem =
+                doc.getElementById('torbutton_startTor');
+            break;
+        case 2: // shutdown state
+            doc.getElementById("torbutton_startupStateGroup").selectedItem =
+                doc.getElementById('torbutton_startPrevious');
+            break;
+    }
+
     doc.getElementById('torbutton_noTorSessionStore').checked = o_torprefs.getBoolPref('notor_sessionstore');
 
-    doc.getElementById('torbutton_reloadCrashedJar').checked = o_torprefs.getBoolPref('reload_crashed_jar');
+    //doc.getElementById('torbutton_reloadCrashedJar').checked = o_torprefs.getBoolPref('reload_crashed_jar');
+    
     doc.getElementById('torbutton_blockTorHRead').checked = o_torprefs.getBoolPref('block_thread');
     doc.getElementById('torbutton_blockTorHWrite').checked = o_torprefs.getBoolPref('block_thwrite');
     doc.getElementById('torbutton_blockNonTorHRead').checked = o_torprefs.getBoolPref('block_nthread');
@@ -215,6 +231,8 @@
     doc.getElementById('torbutton_clearHttpAuth').checked = o_torprefs.getBoolPref('clear_http_auth');
     doc.getElementById('torbutton_blockJSHistory').checked = o_torprefs.getBoolPref('block_js_history');
     doc.getElementById('torbutton_blockFileNet').checked = o_torprefs.getBoolPref('block_file_net');
+
+    doc.getElementById('torbutton_lockedMode').checked = o_torprefs.getBoolPref('locked_mode');
     /*
     doc.getElementById('torbutton_jarCerts').checked = o_torprefs.getBoolPref('jar_certs');
     doc.getElementById('torbutton_jarCACerts').checked = o_torprefs.getBoolPref('jar_ca_certs');
@@ -297,8 +315,18 @@
             doc.getElementById('torbutton_restoreTorGroup').selectedItem ==
             doc.getElementById('torbutton_restoreTor'));
 
+    if(doc.getElementById('torbutton_startupStateGroup').selectedItem ==
+            doc.getElementById('torbutton_startNonTor')) {
+        o_torprefs.setIntPref('startup_state', 0);
+    } else if(doc.getElementById('torbutton_startupStateGroup').selectedItem ==
+            doc.getElementById('torbutton_startTor')) {
+        o_torprefs.setIntPref('startup_state', 1);
+    } else {
+        o_torprefs.setIntPref('startup_state', 2);
+    }
+
     o_torprefs.setBoolPref('notor_sessionstore', doc.getElementById('torbutton_noTorSessionStore').checked);
-    o_torprefs.setBoolPref('reload_crashed_jar', doc.getElementById('torbutton_reloadCrashedJar').checked);
+    //o_torprefs.setBoolPref('reload_crashed_jar', doc.getElementById('torbutton_reloadCrashedJar').checked);
     o_torprefs.setBoolPref('block_thread', doc.getElementById('torbutton_blockTorHRead').checked);
     o_torprefs.setBoolPref('block_thwrite', doc.getElementById('torbutton_blockTorHWrite').checked);
     o_torprefs.setBoolPref('block_nthread', doc.getElementById('torbutton_blockNonTorHRead').checked);
@@ -313,6 +341,8 @@
     o_torprefs.setBoolPref('set_uagent', doc.getElementById('torbutton_setUagent').checked);
     o_torprefs.setBoolPref('disable_referer', doc.getElementById('torbutton_noReferer').checked);
     o_torprefs.setBoolPref('spoof_english', doc.getElementById('torbutton_spoofEnglish').checked);
+    
+    o_torprefs.setBoolPref('locked_mode', doc.getElementById('torbutton_lockedMode').checked);
     /*
     o_torprefs.setBoolPref('jar_certs', doc.getElementById('torbutton_jarCerts').checked);
     o_torprefs.setBoolPref('jar_ca_certs',

Modified: torbutton/trunk/src/chrome/content/preferences.xul
===================================================================
--- torbutton/trunk/src/chrome/content/preferences.xul	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/content/preferences.xul	2008-06-09 03:59:33 UTC (rev 15068)
@@ -24,6 +24,7 @@
      </tabs>
      <tabpanels>
     <tabpanel>
+        <vbox>
         <radiogroup id="torbutton_settingsMethod">
             <radio value="recommended" id="torbutton_useRecommendedSettings"
                    label="&torbutton.prefs.recommended_settings;"
@@ -97,6 +98,11 @@
                 </rows>
             </grid>
         </radiogroup>
+
+        <checkbox id="torbutton_lockedMode"
+        label="&torbutton.prefs.locked_mode;"
+        oncommand="torbutton_prefs_set_field_attributes(document)"/>
+       </vbox>
 <!--
         <label value="&torbutton.prefs.non_socks;" control="nonsocks_proxy"/>
         <textbox id="nonsocks_proxy"/>
@@ -205,7 +211,7 @@
           </tabpanel>
           <tabpanel id="shutdown">
            <vbox>
-            <radiogroup id="torbutton_shutdownGroup">
+            <radiogroup align="start" flex="1" id="torbutton_shutdownGroup">
              <radio id="torbutton_noShutdown" 
                    label="&torbutton.prefs.no_shutdown;" 
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
@@ -216,14 +222,31 @@
                    label="&torbutton.prefs.all_shutdown;" 
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
             </radiogroup>
+            <!-- 
+            This shouldn't be a user-changeable pref. Unless something is broken,
+            it should always be true        
             <checkbox id="torbutton_reloadCrashedJar" label="&torbutton.prefs.reload_crashed_jar;" 
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
-             
-            <checkbox id="torbutton_noTorSessionStore" label="&torbutton.prefs.notor_sessionstore;" 
+             -->
+            <vbox flex="1">
+            <hbox>
+             <label value="&torbutton.prefs.startup_state;" control="torbutton_startupStateGroup"/>
+             <radiogroup orient="horizontal" id="torbutton_startupStateGroup">
+              <radio id="torbutton_startTor" 
+                   label="&torbutton.prefs.tor;" 
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
-            <hbox align="center" flex="1">
-             <label align="center" value="&torbutton.prefs.restore_tor;" control="torbutton_restoreTorGroup"/>
-             <radiogroup align="center" orient="horizontal" id="torbutton_restoreTorGroup">
+              <radio id="torbutton_startNonTor" 
+                   label="&torbutton.prefs.non_tor;" 
+                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
+              <radio id="torbutton_startPrevious" 
+                   label="&torbutton.prefs.shutdown_state;" 
+                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
+             </radiogroup>
+            </hbox>
+
+            <hbox>
+             <label value="&torbutton.prefs.restore_tor;" control="torbutton_restoreTorGroup"/>
+             <radiogroup orient="horizontal" id="torbutton_restoreTorGroup">
               <radio id="torbutton_restoreTor" 
                    label="&torbutton.prefs.tor;" 
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
@@ -231,7 +254,11 @@
                    label="&torbutton.prefs.non_tor;" 
                    oncommand="torbutton_prefs_set_field_attributes(document)"/>
              </radiogroup>
-             </hbox>
+            </hbox>
+            <checkbox class="indent" id="torbutton_noTorSessionStore" label="&torbutton.prefs.notor_sessionstore;" 
+                   oncommand="torbutton_prefs_set_field_attributes(document)"/>
+            
+            </vbox>
            </vbox>
           </tabpanel>
           <tabpanel id="headers">

Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2008-06-09 03:59:33 UTC (rev 15068)
@@ -200,8 +200,14 @@
     o_statuspanel.setAttribute('class','statusbarpanel-' + panel_style);
 }
 
-function torbutton_toggle() {
+function torbutton_toggle(force) {
     var o_toolbutton = false;
+
+    // Only toggle if lock mode is set if the user goes out of their way.
+    if(!force && m_tb_prefs.getBoolPref("extensions.torbutton.locked_mode")) {
+        return;
+    }
+
     o_toolbutton = torbutton_get_toolbutton();
 
     torbutton_log(3, 'called toggle()');
@@ -658,6 +664,8 @@
         }
     }
 
+    // XXX: All updates are now required to be authenticated on FF3.. 
+    // Perhaps this should be a diff pref.. or default to off?
     if (torprefs.getBoolPref("no_updates")) {
         m_tb_prefs.setBoolPref("extensions.update.enabled", !mode);
         m_tb_prefs.setBoolPref("app.update.enabled", !mode);
@@ -1631,6 +1639,7 @@
             torbutton_conditional_set(false);
         m_tb_prefs.setBoolPref("extensions.torbutton.crashed", false);
     }
+
     torbutton_log(3, "End crash recover check");
 }
 
@@ -1807,6 +1816,16 @@
     if(m_tb_prefs.getBoolPref("extensions.torbutton.startup")) {
         torbutton_do_main_window_startup();
         m_tb_prefs.setBoolPref("extensions.torbutton.startup", false);
+
+        if(!m_tb_prefs.getBoolPref("extensions.torbutton.crashed")) {
+            var startup_state = m_tb_pref.getIntPref("extensions.torbutton.tor_startup");
+
+            if(startup_state == 0) {
+                torbutton_conditional_set(false); // must be boolean
+            } else if(startup_state == 1) {
+                torbutton_conditional_set(true);
+            } // 2 means leave it as it was
+        }
     }
 }
 

Modified: torbutton/trunk/src/chrome/content/torbutton.xul
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.xul	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/content/torbutton.xul	2008-06-09 03:59:33 UTC (rev 15068)
@@ -24,11 +24,11 @@
             label="Torbutton"
             tooltiptext="&torbutton.button.tooltip;" 
             context="torbutton-context-menu"
-            oncommand="torbutton_toggle();" />
+            oncommand="torbutton_toggle(false);" />
     </toolbarpalette>
 
     <commandset id="mainCommandSet">
-        <command id="torbutton-toggle-cmd" oncommand="torbutton_toggle();"/>
+        <command id="torbutton-toggle-cmd" oncommand="torbutton_toggle(false);"/>
     </commandset>
 
     <keyset id="mainKeyset">
@@ -40,7 +40,7 @@
         <statusbarpanel id="torbutton-panel"
             insertbefore="statusbar-updates"
                         context="torbutton-context-menu"
-            onclick="if (event.button == 0) torbutton_toggle()"/>
+            onclick="if (event.button == 0) torbutton_toggle(false)"/>
 
         <popup id="torbutton-context-menu"/>
 <!--        <statusbarpanel context="clipmenu" class="statusbarpanel-iconic" id="plugins-status" tooltip="plugin-tooltip" onclick="torbutton_toggle_plugins();"/> -->

Modified: torbutton/trunk/src/chrome/content/torbutton_tb.xul
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton_tb.xul	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/content/torbutton_tb.xul	2008-06-09 03:59:33 UTC (rev 15068)
@@ -6,6 +6,7 @@
 
 <overlay id="torbutton-overlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";>
+    <script type="application/x-javascript" src="chrome://torbutton/content/torbutton_util.js" />
     <script type="application/x-javascript" src="chrome://torbutton/content/torbutton.js" />
     <script language="JavaScript">
         //onLoad Hander
@@ -23,7 +24,7 @@
             label="Torbutton"
             tooltiptext="&torbutton.button.tooltip;" 
             context="torbutton-context-menu"
-            oncommand="torbutton_toggle();" />
+            oncommand="torbutton_toggle(false);" />
     </toolbarpalette>
 
     <toolbarpalette id="MsgComposeToolbarPalette">
@@ -33,11 +34,11 @@
             label="Torbutton"
             tooltiptext="&torbutton.button.tooltip;" 
             context="torbutton-context-menu"
-            oncommand="torbutton_toggle();" />
+            oncommand="torbutton_toggle(false);" />
     </toolbarpalette>
 
     <commandset id="mainCommandSet">
-        <command id="torbutton-toggle-cmd" oncommand="torbutton_toggle();"/>
+        <command id="torbutton-toggle-cmd" oncommand="torbutton_toggle(false);"/>
     </commandset>
 
     <keyset id="mainKeyset">
@@ -49,7 +50,7 @@
         <statusbarpanel id="torbutton-panel"
             insertbefore="statusbar-updates"
                         context="torbutton-context-menu"
-            onclick="if (event.button == 0) torbutton_toggle()"/>
+            onclick="if (event.button == 0) torbutton_toggle(false)"/>
 
         <popup id="torbutton-context-menu"/>
    </statusbar>

Modified: torbutton/trunk/src/chrome/locale/ar/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/ar/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/ar/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "أغلق كل نوافذ و ألسنة غير تور عند اغير الحالة (اختياري)">
 <!ENTITY torbutton.prefs.block_file_net     "امنع النفاذ إلى الشبكة من مسارات file:// (محبّذ)">
 <!ENTITY torbutton.prefs.block_links        "امنع نقر الروابط و إعادة تحميل الصفحات بين حالات تور المختلفة (اختياري)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/de-AT/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/de-AT/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/de-AT/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/de-CH/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/de-CH/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/de-CH/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/de-DE/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/de-DE/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/de-DE/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/el-GR/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/el-GR/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/el-GR/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/en-US/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -63,7 +63,7 @@
 <!ENTITY torbutton.prefs.notor_sessionstore    "Prevent session store from saving Tor-loaded tabs (recommended)">
 <!ENTITY torbutton.prefs.tor    "Tor">
 <!ENTITY torbutton.prefs.non_tor    "Non-Tor">
-<!ENTITY torbutton.prefs.restore_tor   "After a crash, restore saved session via:">
+<!ENTITY torbutton.prefs.restore_tor   "On crash recovery or session restored startup, restore via:">
 <!ENTITY torbutton.prefs.reload_crashed_jar   "Reload cookie jar/clear cookies on Firefox crash (recommended)">
 <!ENTITY torbutton.prefs.dual_cookie_jars        "Store both Tor and Non-Tor cookies in protected jars (dangerous)">
 <!ENTITY torbutton.prefs.clear_http_auth        "Clear HTTP auth sessions (recommended)">
@@ -75,3 +75,6 @@
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
 <!ENTITY torbutton.prefs.jar_certs        "Store SSL certs in seperate jars for Tor/Non-Tor (recommended)">
 <!ENTITY torbutton.prefs.jar_ca_certs        "Store CA certs in seperate jars for Tor/Non-Tor (recommended)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/es/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/es/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/es/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Cerrar las ventanas y pestañas que no sean de Tor al cambiar el estado (opcional)">
 <!ENTITY torbutton.prefs.block_file_net     "Bloquear el acceso a la red desde archivos en direcciones file:// (recomendado)">
 <!ENTITY torbutton.prefs.block_links        "Bloquear clicks en vínculos y recargas de páginas desde distintos estados de Tor (opcional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/fa-IR/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/fa-IR/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/fa-IR/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "بستن همه پنجره های غیرتُر در ضامن (اختیاری)">
 <!ENTITY torbutton.prefs.block_file_net     "بازداشتن دسترسی به شبکه از file:// نشانی های وب (توصیه شده)">
 <!ENTITY torbutton.prefs.block_links        "بازداشتن فشاردادن پیوند و بازگذاری مجدد برگه از وضعیت های مختلف تُر (اختیاری)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/fr-FR/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/fr-FR/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/fr-FR/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor			"Fermer toutes les fenêtres et onglets Non-Tor à l'activation/désactivation (optionnel)">
 <!ENTITY torbutton.prefs.block_file_net			"Bloquer l'accès au réseau des urls de type file:// (recommendé)">
 <!ENTITY torbutton.prefs.block_links			"Bloquer les liens cliquables et le rechargement des pages depuis différents états Tor (optionnel)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/hr-HR/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/hr-HR/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/hr-HR/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/it-IT/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/it-IT/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/it-IT/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -75,3 +75,6 @@
 <!ENTITY torbutton.prefs.block_links "Blocca i clic sui link e la ricarica delle pagine da stati Tor differenti (facoltativo)">
 <!ENTITY torbutton.prefs.jar_certs "Conserva i certificati SSL in depositi separati per Tor/Non-Tor (consigliato)">
 <!ENTITY torbutton.prefs.jar_ca_certs "Conserva i certificati delle CA in depositi separati per Tor/Non-Tor (consigliato)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/nl-NL/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/nl-NL/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/nl-NL/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/pl-PL/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/pl-PL/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/pl-PL/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/pt-BR/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/pt-BR/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/pt-BR/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/ru/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/ru/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/ru/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Закрывать все окна и вкладки не-Tor при переключении режимов (необяз.)">
 <!ENTITY torbutton.prefs.block_file_net     "Блокировать доступ к сети по адресам типа file:// (желательно)">
 <!ENTITY torbutton.prefs.block_links        "Блокировать щелчки по ссылкам и перезагрузку страниц из разных режимов Tor (необяз.)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/sl-SI/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/sl-SI/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/sl-SI/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/zh-CN/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/zh-CN/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/zh-CN/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/chrome/locale/zh-TW/torbutton.dtd
===================================================================
--- torbutton/trunk/src/chrome/locale/zh-TW/torbutton.dtd	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/chrome/locale/zh-TW/torbutton.dtd	2008-06-09 03:59:33 UTC (rev 15068)
@@ -73,3 +73,6 @@
 <!ENTITY torbutton.prefs.close_nontor       "Close all Non-Tor windows and tabs on toggle (optional)">
 <!ENTITY torbutton.prefs.block_file_net     "Block access to network from file:// urls (recommended)">
 <!ENTITY torbutton.prefs.block_links        "Block link clicks and page reloads from different Tor states (optional)">
+<!ENTITY torbutton.prefs.locked_mode        "Disable Button and Hotkeys to prevent accidental toggle">
+<!ENTITY torbutton.prefs.startup_state      "On normal startup, set Tor state to:">
+<!ENTITY torbutton.prefs.shutdown_state      "Shutdown state">

Modified: torbutton/trunk/src/defaults/preferences/preferences.js
===================================================================
--- torbutton/trunk/src/defaults/preferences/preferences.js	2008-06-09 02:31:45 UTC (rev 15067)
+++ torbutton/trunk/src/defaults/preferences/preferences.js	2008-06-09 03:59:33 UTC (rev 15068)
@@ -21,6 +21,7 @@
 pref("extensions.torbutton.gopher_port",0);
 pref("extensions.torbutton.socks_host","");
 pref("extensions.torbutton.socks_port",0);
+pref("extensions.torbutton.locked_mode",false);
 
 // XXX: wtf prefs? These seem not actually connected, but govern
 // if user wants own tor proxy settings
@@ -97,6 +98,7 @@
 pref("extensions.torbutton.block_file_net",true);
 pref("extensions.torbutton.jar_certs",false);
 pref("extensions.torbutton.jar_ca_certs",false);
+pref("extensions.torbutton.startup_state", 2); // 0=non-tor, 1=tor, 2=last
 
 // User agent prefs:
 pref("extensions.torbutton.appname_override","Netscape");