From cd0972c0f3f884cbcacbc84bf1af61bf361b3c9c Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Mon, 27 Feb 2017 15:30:19 +0100 Subject: [PATCH] Recommend enabling UPnP on network problems - it looks like there aren't enough listening nodes - if connection is dropped, notify non-proxy users about the UPnP option --- src/bitmessageqt/__init__.py | 5 +++++ src/bitmessageqt/networkstatus.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index b067d9d3..68eb0da0 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1667,6 +1667,11 @@ class MyForm(settingsmixin.SMainWindow): self.notifierShow('Bitmessage', unicode(_translate( "MainWindow", "Connection lost").toUtf8(),'utf-8'), self.SOUND_DISCONNECTED, None) + if self.connected and \ + not BMConfigParser().safeGetBoolean('bitmessagesettings', 'upnp') and \ + BMConfigParser().get('bitmessagesettings', 'socksproxytype') != "none": + self.statusBar().showMessage(_translate( + "MainWindow", "Problems connecting? Try enabling UPnP in the Network Settings"), 10000) self.connected = False if self.actionStatus is not None: diff --git a/src/bitmessageqt/networkstatus.py b/src/bitmessageqt/networkstatus.py index 7506b652..074420b7 100644 --- a/src/bitmessageqt/networkstatus.py +++ b/src/bitmessageqt/networkstatus.py @@ -116,7 +116,7 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin): "networkstatus", "Total Connections: %1").arg(str(len(shared.connectedHostsList)))) if len(shared.connectedHostsList) > 0 and shared.statusIconColor == 'red': # FYI: The 'singlelistener' thread sets the icon color to green when it receives an incoming connection, meaning that the user's firewall is configured correctly. self.window().setStatusIcon('yellow') - elif len(shared.connectedHostsList) == 0: + elif len(shared.connectedHostsList) == 0 and shared.statusIconColor != 'red': self.window().setStatusIcon('red') # timer driven