From 337cf93b4ba4e0fb4bb72eaff9ad9b891965e823 Mon Sep 17 00:00:00 2001 From: mirrorwish Date: Thu, 17 Mar 2016 19:03:17 +0100 Subject: [PATCH] Fix byte formatting --- src/bitmessageqt/__init__.py | 11 ----------- src/bitmessageqt/networkstatus.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 6740c7cf..c6d15007 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1701,17 +1701,6 @@ class MyForm(settingsmixin.SMainWindow): self.actionShow.setChecked(not self.actionShow.isChecked()) self.appIndicatorShowOrHideWindow() - def formatBytes(self, num): - for x in ['bytes','KB','MB','GB']: - if num < 1000.0: - return "%3.0f %s" % (num, x) - num /= 1000.0 - return "%3.0f %s" % (num, 'TB') - - def formatByteRate(self, num): - num /= 1000 - return "%4.0f KB" % num - # Indicates whether or not there is a connection to the Bitmessage network connected = False diff --git a/src/bitmessageqt/networkstatus.py b/src/bitmessageqt/networkstatus.py index 96bc46f6..cadff96a 100644 --- a/src/bitmessageqt/networkstatus.py +++ b/src/bitmessageqt/networkstatus.py @@ -31,6 +31,17 @@ class NetworkStatus(QtGui.QWidget): self.timer.start(2000) # milliseconds QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.runEveryTwoSeconds) + def formatBytes(self, num): + for x in ['bytes','KB','MB','GB']: + if num < 1000.0: + return "%3.0f %s" % (num, x) + num /= 1000.0 + return "%3.0f %s" % (num, 'TB') + + def formatByteRate(self, num): + num /= 1000 + return "%4.0f KB" % num + def updateNumberOfMessagesProcessed(self): self.labelSyncStatus.setText(_translate("MainWindow", "Objects to be synced: %1").arg(str(sum(shared.numberOfObjectsThatWeHaveYetToGetPerPeer.itervalues())))) self.labelMessageCount.setText(_translate(