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

[or-cvs] r15095: Add pref to close remoting window for Torbrowser. Pref only (in torbutton/trunk/src: . chrome/content defaults/preferences)



Author: mikeperry
Date: 2008-06-09 23:33:54 -0400 (Mon, 09 Jun 2008)
New Revision: 15095

Modified:
   torbutton/trunk/src/chrome/content/torbutton.js
   torbutton/trunk/src/defaults/preferences/preferences.js
   torbutton/trunk/src/install.rdf
Log:

Add pref to close remoting window for Torbrowser. Pref only
works on Windows. Linux and Mac ports rolled their own
remoting code that is hidden somewhere else outside the
standard component. Fun!.



Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js	2008-06-09 22:15:08 UTC (rev 15094)
+++ torbutton/trunk/src/chrome/content/torbutton.js	2008-06-10 03:33:54 UTC (rev 15095)
@@ -1836,6 +1836,19 @@
 {
     if(m_tb_prefs.getBoolPref("extensions.torbutton.startup")) {
         torbutton_do_main_window_startup();
+
+        if(m_tb_prefs.getBoolPref("extensions.torbutton.block_remoting")) {
+            var appSupport = Cc["@mozilla.org/toolkit/native-app-support;1"]
+                .getService(Ci.nsINativeAppSupport);
+            if(!appSupport.stop()) {
+                torbutton_log(5, "Remoting stop() failed. Forcing quit");
+                // We really want this thing gone.
+                appSupport.quit();
+            } else {
+                torbutton_log(3, "Remoting window closed.");
+            }
+        }
+        
         m_tb_prefs.setBoolPref("extensions.torbutton.startup", false);
     }
 }

Modified: torbutton/trunk/src/defaults/preferences/preferences.js
===================================================================
--- torbutton/trunk/src/defaults/preferences/preferences.js	2008-06-09 22:15:08 UTC (rev 15094)
+++ torbutton/trunk/src/defaults/preferences/preferences.js	2008-06-10 03:33:54 UTC (rev 15095)
@@ -101,6 +101,7 @@
 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
+pref("extensions.torbutton.block_remoting",false);
 
 // User agent prefs:
 pref("extensions.torbutton.appname_override","Netscape");

Modified: torbutton/trunk/src/install.rdf
===================================================================
--- torbutton/trunk/src/install.rdf	2008-06-09 22:15:08 UTC (rev 15094)
+++ torbutton/trunk/src/install.rdf	2008-06-10 03:33:54 UTC (rev 15095)
@@ -6,7 +6,7 @@
         <em:name>Torbutton</em:name>
         <em:creator>Mike Perry &amp; Scott Squires</em:creator>
         <em:id>{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}</em:id>
-        <em:version>1.2.0rc2</em:version>
+        <em:version>1.2.0rc2tb</em:version>
         <em:homepageURL>https://torbutton.torproject.org/dev/</em:homepageURL>
         <em:optionsURL>chrome://torbutton/content/preferences.xul</em:optionsURL>
         <em:iconURL>chrome://torbutton/skin/tor.png</em:iconURL>