Skip to content

Commit b16105f

Browse files
author
Lee Miller
committed
Add a statusbar alert about onionservicesonly setting
and schedule MyForm.setStatusIcon() 30 sec after it is shown
1 parent e6ecaa5 commit b16105f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/bitmessageqt/__init__.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,6 @@ def __icon_activated(self, reason):
17581758
connected = False
17591759

17601760
def setStatusIcon(self, color):
1761-
# print 'setting status icon color'
17621761
_notifications_enabled = not config.getboolean(
17631762
'bitmessagesettings', 'hidetrayconnectionnotifications')
17641763
if color == 'red':
@@ -1771,14 +1770,24 @@ def setStatusIcon(self, color):
17711770
'Bitmessage',
17721771
_translate("MainWindow", "Connection lost"),
17731772
sound.SOUND_DISCONNECTED)
1774-
if not config.safeGetBoolean('bitmessagesettings', 'upnp') and \
1775-
config.get('bitmessagesettings', 'socksproxytype') == "none":
1773+
proxy = config.safeGet(
1774+
'bitmessagesettings', 'socksproxytype', 'none')
1775+
if proxy == 'none' and not config.safeGetBoolean(
1776+
'bitmessagesettings', 'upnp'):
17761777
self.updateStatusBar(
17771778
_translate(
17781779
"MainWindow",
17791780
"Problems connecting? Try enabling UPnP in the Network"
17801781
" Settings"
17811782
))
1783+
elif proxy == 'SOCKS5' and config.safeGetBoolean(
1784+
'bitmessagesettings', 'onionservicesonly'):
1785+
self.updateStatusBar((
1786+
_translate(
1787+
"MainWindow",
1788+
"With recent tor you may never connect having"
1789+
" 'onionservicesonly' set in your config."), 1
1790+
))
17821791
self.connected = False
17831792

17841793
if self.actionStatus is not None:
@@ -4307,5 +4316,7 @@ def run():
43074316
# only show after wizards and connect dialogs have completed
43084317
if not config.getboolean('bitmessagesettings', 'startintray'):
43094318
myapp.show()
4319+
QtCore.QTimer.singleShot(
4320+
30000, lambda: myapp.setStatusIcon(state.statusIconColor))
43104321

43114322
app.exec_()

0 commit comments

Comments
 (0)