From b16105f25445e7270bd1ba7beecd84030e12ff9b Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Sun, 14 Aug 2022 17:36:40 +0300 Subject: [PATCH] Add a statusbar alert about onionservicesonly setting and schedule MyForm.setStatusIcon() 30 sec after it is shown --- src/bitmessageqt/__init__.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 0427ad82..bffccbbc 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1758,7 +1758,6 @@ class MyForm(settingsmixin.SMainWindow): connected = False def setStatusIcon(self, color): - # print 'setting status icon color' _notifications_enabled = not config.getboolean( 'bitmessagesettings', 'hidetrayconnectionnotifications') if color == 'red': @@ -1771,14 +1770,24 @@ class MyForm(settingsmixin.SMainWindow): 'Bitmessage', _translate("MainWindow", "Connection lost"), sound.SOUND_DISCONNECTED) - if not config.safeGetBoolean('bitmessagesettings', 'upnp') and \ - config.get('bitmessagesettings', 'socksproxytype') == "none": + proxy = config.safeGet( + 'bitmessagesettings', 'socksproxytype', 'none') + if proxy == 'none' and not config.safeGetBoolean( + 'bitmessagesettings', 'upnp'): self.updateStatusBar( _translate( "MainWindow", "Problems connecting? Try enabling UPnP in the Network" " Settings" )) + elif proxy == 'SOCKS5' and config.safeGetBoolean( + 'bitmessagesettings', 'onionservicesonly'): + self.updateStatusBar(( + _translate( + "MainWindow", + "With recent tor you may never connect having" + " 'onionservicesonly' set in your config."), 1 + )) self.connected = False if self.actionStatus is not None: @@ -4307,5 +4316,7 @@ def run(): # only show after wizards and connect dialogs have completed if not config.getboolean('bitmessagesettings', 'startintray'): myapp.show() + QtCore.QTimer.singleShot( + 30000, lambda: myapp.setStatusIcon(state.statusIconColor)) app.exec_()