From 741ac5ca053d98f28460f56a3e73bf54a8b60255 Mon Sep 17 00:00:00 2001
From: Peter Surda <surda@economicsofbitcoin.com>
Date: Mon, 27 Feb 2017 16:18:22 +0100
Subject: [PATCH] UPnP recommendation notification fixes

- notify also if no connections and no change
---
 src/bitmessageqt/__init__.py      | 3 +--
 src/bitmessageqt/networkstatus.py | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py
index 17f391aa..48cff7e5 100644
--- a/src/bitmessageqt/__init__.py
+++ b/src/bitmessageqt/__init__.py
@@ -1667,8 +1667,7 @@ 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 \
+            if 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)
diff --git a/src/bitmessageqt/networkstatus.py b/src/bitmessageqt/networkstatus.py
index 074420b7..7506b652 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 and shared.statusIconColor != 'red':
+        elif len(shared.connectedHostsList) == 0:
             self.window().setStatusIcon('red')
 
     # timer driven