]> git.lizzy.rs Git - torbrowser-launcher.git/commitdiff
make tor settings checkbox default to the right value, set environment vars both...
authorMicah Lee <micah@micahflee.com>
Tue, 8 Jul 2014 00:55:58 +0000 (17:55 -0700)
committerMicah Lee <micah@micahflee.com>
Tue, 8 Jul 2014 00:55:58 +0000 (17:55 -0700)
torbrowser-launcher

index 4afa0f8bf92c2fcdeedb468cdc018e445355d681..4ca33fae03740ab5a0e5b61e33858e9e37a2240d 100755 (executable)
@@ -430,6 +430,7 @@ class TBLSettings:
 
         # Set callback for system tor and update over tor
         self.system_tor_checkbox.connect('clicked', self.on_system_tor_clicked)
+        self.on_system_tor_clicked(None)
 
         # check for updates
         self.update_checkbox = gtk.CheckButton(_("Check for updates next launch"))
@@ -598,6 +599,11 @@ class TBLLauncher:
             os.putenv("TOR_SKIP_LAUNCH", "1")
             os.putenv("TOR_SOCKS_HOST", "127.0.0.1")
             os.putenv("TOR_SOCKS_PORT", "9050")
+            # need to manually set os.environ because os.putenv doesn't update it
+            # https://docs.python.org/2/library/os.html#os.putenv
+            os.environ["TOR_SKIP_LAUNCH"] = "1"
+            os.environ["TOR_SOCKS_HOST"] = "127.0.0.1"
+            os.environ["TOR_SOCKS_PORT"] = "9050"
 
         try:
             import txsocksx
@@ -973,7 +979,7 @@ class TBLLauncher:
         self.progressbar.show()
         self.refresh_gtk()
 
-        if self.common.settings['update_over_tor']:
+        if self.common.settings['use_system_tor'] and self.common.settings['update_over_tor']:
             from twisted.internet.endpoints import TCP4ClientEndpoint 
             from txsocksx.http import SOCKS5Agent