UPnP recommendation notification fixes

- notify also if no connections and no change
This commit is contained in:
Peter Šurda 2017-02-27 16:18:22 +01:00
parent ff786725ed
commit 741ac5ca05
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
2 changed files with 2 additions and 3 deletions

View File

@ -1667,8 +1667,7 @@ class MyForm(settingsmixin.SMainWindow):
self.notifierShow('Bitmessage', unicode(_translate( self.notifierShow('Bitmessage', unicode(_translate(
"MainWindow", "Connection lost").toUtf8(),'utf-8'), "MainWindow", "Connection lost").toUtf8(),'utf-8'),
self.SOUND_DISCONNECTED, None) self.SOUND_DISCONNECTED, None)
if self.connected and \ if not BMConfigParser().safeGetBoolean('bitmessagesettings', 'upnp') and \
not BMConfigParser().safeGetBoolean('bitmessagesettings', 'upnp') and \
BMConfigParser().get('bitmessagesettings', 'socksproxytype') == "none": BMConfigParser().get('bitmessagesettings', 'socksproxytype') == "none":
self.statusBar().showMessage(_translate( self.statusBar().showMessage(_translate(
"MainWindow", "Problems connecting? Try enabling UPnP in the Network Settings"), 10000) "MainWindow", "Problems connecting? Try enabling UPnP in the Network Settings"), 10000)

View File

@ -116,7 +116,7 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin):
"networkstatus", "Total Connections: %1").arg(str(len(shared.connectedHostsList)))) "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. 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') self.window().setStatusIcon('yellow')
elif len(shared.connectedHostsList) == 0 and shared.statusIconColor != 'red': elif len(shared.connectedHostsList) == 0:
self.window().setStatusIcon('red') self.window().setStatusIcon('red')
# timer driven # timer driven