commit 50c9830f794ae1f7e24668b95c63a166ecc44933
parent e462ef48cdcbf71cef126ec473988a69fd306bbb
Author: thomasv <thomasv@gitorious>
Date: Thu, 3 Oct 2013 18:43:33 +0200
show 'server lagging' icon if server lags and client does not use auto-connect
Diffstat:
5 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -535,6 +535,9 @@ class ElectrumWindow(QMainWindow):
if not self.wallet.up_to_date:
text = _("Synchronizing...")
icon = QIcon(":icons/status_waiting.png")
+ elif self.network.is_lagging:
+ text = _("Server is lagging")
+ icon = QIcon(":icons/status_lagging.png")
else:
c, u = self.wallet.get_account_balance(self.current_account)
text = _( "Balance" ) + ": %s "%( self.format_amount(c) ) + self.base_unit()
diff --git a/icons.qrc b/icons.qrc
@@ -15,6 +15,7 @@
<file>icons/status_connected.png</file>
<file>icons/status_disconnected.png</file>
<file>icons/status_waiting.png</file>
+ <file>icons/status_lagging.png</file>
<file>icons/switchgui.png</file>
<file>icons/unconfirmed.png</file>
<file>icons/network.png</file>
diff --git a/icons/status_lagging.png b/icons/status_lagging.png
Binary files differ.
diff --git a/lib/blockchain.py b/lib/blockchain.py
@@ -37,6 +37,7 @@ class Blockchain(threading.Thread):
self.set_local_height()
self.queue = Queue.Queue()
self.servers_height = {}
+ self.is_lagging = False
def stop(self):
@@ -91,15 +92,17 @@ class Blockchain(threading.Thread):
print_error("error", i.server)
# todo: dismiss that server
- self.network.trigger_callback('updated')
-
h = self.servers_height.get(self.network.interface.server)
if h is not None and h < height - 1:
print_error( "Server is lagging", height, h)
if self.config.get('auto_cycle'):
self.network.set_server(i.server)
else:
- self.network.interface.stop()
+ self.network.is_lagging = True
+ else:
+ self.network.is_lagging = False
+
+ self.network.trigger_callback('updated')
diff --git a/make_packages b/make_packages
@@ -10,7 +10,7 @@ if __name__ == '__main__':
sys.exit()
os.system("python mki18n.py")
- os.system("pyrcc4 icons.qrc -o gui/icons_rc.py")
+ os.system("pyrcc4 icons.qrc -o gui/qt/icons_rc.py")
os.system("python setup.py sdist --format=zip,gztar")
_tgz="Electrum-%s.tar.gz"%version