diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 2cdb2c97..034043c8 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -118,6 +118,10 @@ class MyForm(QtGui.QMainWindow): self.ui.labelSendBroadcastWarning.setVisible(False) + self.timer = QtCore.QTimer() + self.timer.start(2000) # milliseconds + QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.runEveryTwoSeconds) + # FILE MENU and other buttons QtCore.QObject.connect(self.ui.actionExit, QtCore.SIGNAL( "triggered()"), self.quit) @@ -1292,6 +1296,12 @@ class MyForm(QtGui.QMainWindow): elif len(shared.connectedHostsList) == 0: self.setStatusIcon('red') + # timer driven + def runEveryTwoSeconds(self): + self.ui.labelLookupsPerSecond.setText(_translate( + "MainWindow", "Inventory lookups per second: %1").arg(str(shared.numberOfInventoryLookupsPerformed/2))) + shared.numberOfInventoryLookupsPerformed = 0 + # Indicates whether or not there is a connection to the Bitmessage network connected = False diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index 74505f38..f6a76ce1 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'bitmessageui.ui' # -# Created: Thu Aug 15 14:19:52 2013 -# by: PyQt4 UI code generator 4.10 +# Created: Tue Sep 03 15:17:26 2013 +# by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! @@ -430,13 +430,16 @@ class Ui_MainWindow(object): self.labelBroadcastCount = QtGui.QLabel(self.networkstatus) self.labelBroadcastCount.setGeometry(QtCore.QRect(350, 150, 351, 16)) self.labelBroadcastCount.setObjectName(_fromUtf8("labelBroadcastCount")) + self.labelLookupsPerSecond = QtGui.QLabel(self.networkstatus) + self.labelLookupsPerSecond.setGeometry(QtCore.QRect(320, 210, 291, 16)) + self.labelLookupsPerSecond.setObjectName(_fromUtf8("labelLookupsPerSecond")) icon9 = QtGui.QIcon() icon9.addPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/images/networkstatus.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.tabWidget.addTab(self.networkstatus, icon9, _fromUtf8("")) self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 795, 23)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 795, 18)) self.menubar.setObjectName(_fromUtf8("menubar")) self.menuFile = QtGui.QMenu(self.menubar) self.menuFile.setObjectName(_fromUtf8("menuFile")) @@ -554,8 +557,8 @@ class Ui_MainWindow(object): self.textEditMessage.setHtml(_translate("MainWindow", "\n" "
\n" -"