From f5e17eeeaa425f0a4a0c79e0305087b2b16ed44f Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Wed, 24 Jul 2013 00:29:30 -0400 Subject: [PATCH] Moved code to add the sockslisten config option to a spot where it will actually work properly --- src/bitmessageqt/__init__.py | 2 +- src/class_sqlThread.py | 3 +++ src/helper_startup.py | 6 ------ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index d624a11b..b105881a 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1885,7 +1885,7 @@ class MyForm(QtGui.QMainWindow): if shared.config.get('bitmessagesettings', 'socksproxytype') == 'none' and str(self.settingsDialogInstance.ui.comboBoxProxyType.currentText())[0:5] == 'SOCKS': if shared.statusIconColor != 'red': QMessageBox.about(self, _translate("MainWindow", "Restart"), _translate( - "MainWindow", "Bitmessage will use your proxy from now on but you may want to manually restart Bitmessage now to close existing connections.")) + "MainWindow", "Bitmessage will use your proxy from now on but you may want to manually restart Bitmessage now to close existing connections (if any).")) if shared.config.get('bitmessagesettings', 'socksproxytype')[0:5] == 'SOCKS' and str(self.settingsDialogInstance.ui.comboBoxProxyType.currentText()) == 'none': self.statusBar().showMessage('') shared.config.set('bitmessagesettings', 'socksproxytype', str( diff --git a/src/class_sqlThread.py b/src/class_sqlThread.py index f1a428d2..e07850e4 100644 --- a/src/class_sqlThread.py +++ b/src/class_sqlThread.py @@ -186,6 +186,9 @@ class sqlThread(threading.Thread): self.cur.execute( '''update sent set status='broadcastqueued' where status='broadcastpending' ''') self.conn.commit() + + if not shared.config.has_option('bitmessagesettings', 'sockslisten'): + shared.config.set('bitmessagesettings', 'sockslisten', 'false') try: testpayload = '\x00\x00' diff --git a/src/helper_startup.py b/src/helper_startup.py index 46150d4d..f3069658 100644 --- a/src/helper_startup.py +++ b/src/helper_startup.py @@ -80,9 +80,3 @@ def loadConfig(): os.umask(0o077) with open(shared.appdata + 'keys.dat', 'wb') as configfile: shared.config.write(configfile) - - # Initialize settings that may be missing due to upgrades and could - # cause errors if missing. - if not shared.config.has_option('bitmessagesettings', 'sockslisten'): - shared.config.set('bitmessagesettings', 'sockslisten', 'false') -