Added POW speed indicator

This commit is contained in:
Biryuzovye Kleshni 2018-07-22 08:51:23 +00:00
parent b2441c7830
commit c66156aeea
3 changed files with 56 additions and 31 deletions

View File

@ -53,6 +53,7 @@ import state
from network.asyncore_pollchoose import set_rates
import sound
import re
import bitmessage_icons_rc # Loads icon resources
try:
@ -627,6 +628,9 @@ class MyForm(settingsmixin.SMainWindow):
self.ui.horizontalSliderTTL.setMaximumSize(QtCore.QSize(105, self.ui.pushButtonSend.height()))
self.statusbar = self.statusBar()
self.statusbar.insertPermanentWidget(0, self.ui.rightStatusBar)
# Ask the user if we may delete their old version 1 addresses if they
# have any.
for addressInKeysFile in getSortedAccounts():
@ -750,11 +754,8 @@ class MyForm(settingsmixin.SMainWindow):
self.ui.blackwhitelist.rerenderBlackWhiteList()
# Put the colored icon on the status bar
# The coloured icon on the status bar
self.statusbar = self.statusBar()
self.statusbar.insertPermanentWidget(0, self.ui.pushButtonStatusIcon)
QtCore.QObject.connect(self.ui.pushButtonStatusIcon, QtCore.SIGNAL(
"clicked()"), self.click_pushButtonStatusIcon)
@ -1843,6 +1844,13 @@ class MyForm(settingsmixin.SMainWindow):
def updateWorkProverStatus(self, status):
self.POWTasksCount = status.tasksCount
if status.speed == 0:
self.ui.workProverSpeed.setText("")
else:
self.ui.workProverSpeed.setText(
_translate("MainWindow", "%1 kiH / s").arg("{:.1f}".format(status.speed / 1024))
)
def rerenderMessagelistFromLabels(self):
for messagelist in (self.ui.tableWidgetInbox, self.ui.tableWidgetInboxChans, self.ui.tableWidgetInboxSubscriptions):
for i in range(messagelist.rowCount()):

View File

@ -14,7 +14,7 @@
<string>Bitmessage</string>
</property>
<property name="windowIcon">
<iconset resource="bitmessageqt.bitmessage_icons.qrc">
<iconset>
<normaloff>:/newPrefix/images/can-icon-24px.png</normaloff>:/newPrefix/images/can-icon-24px.png</iconset>
</property>
<property name="tabShape">
@ -22,6 +22,42 @@
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout_10">
<item row="1" column="0">
<widget class="QWidget" name="rightStatusBar" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="workProverSpeed">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonStatusIcon">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/newPrefix/images/redicon.png</normaloff>:/newPrefix/images/redicon.png</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
@ -58,7 +94,7 @@
</property>
<widget class="QWidget" name="inbox">
<attribute name="icon">
<iconset resource="bitmessageqt.bitmessage_icons.qrc">
<iconset>
<normaloff>:/newPrefix/images/inbox.png</normaloff>:/newPrefix/images/inbox.png</iconset>
</attribute>
<attribute name="title">
@ -257,7 +293,7 @@
</widget>
<widget class="QWidget" name="send">
<attribute name="icon">
<iconset resource="bitmessageqt.bitmessage_icons.qrc">
<iconset>
<normaloff>:/newPrefix/images/send.png</normaloff>:/newPrefix/images/send.png</iconset>
</attribute>
<attribute name="title">
@ -621,7 +657,7 @@
</widget>
<widget class="QWidget" name="subscriptions">
<attribute name="icon">
<iconset resource="bitmessageqt.bitmessage_icons.qrc">
<iconset>
<normaloff>:/newPrefix/images/subscriptions.png</normaloff>:/newPrefix/images/subscriptions.png</iconset>
</attribute>
<attribute name="title">
@ -829,7 +865,7 @@
</widget>
<widget class="QWidget" name="chans">
<attribute name="icon">
<iconset resource="bitmessageqt.bitmessage_icons.qrc">
<iconset>
<normaloff>:/newPrefix/images/can-icon-16px.png</normaloff>:/newPrefix/images/can-icon-16px.png</iconset>
</attribute>
<attribute name="title">
@ -1043,7 +1079,7 @@
</widget>
<widget class="Blacklist" name="blackwhitelist">
<attribute name="icon">
<iconset resource="bitmessageqt.bitmessage_icons.qrc">
<iconset>
<normaloff>:/newPrefix/images/blacklist.png</normaloff>:/newPrefix/images/blacklist.png</iconset>
</attribute>
<attribute name="title">
@ -1052,7 +1088,7 @@
</widget>
<widget class="NetworkStatus" name="networkstatus">
<attribute name="icon">
<iconset resource="bitmessageqt.bitmessage_icons.qrc">
<iconset>
<normaloff>:/newPrefix/images/networkstatus.png</normaloff>:/newPrefix/images/networkstatus.png</iconset>
</attribute>
<attribute name="title">
@ -1061,20 +1097,6 @@
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButtonStatusIcon">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="bitmessageqt.bitmessage_icons.qrc">
<normaloff>:/newPrefix/images/redicon.png</normaloff>:/newPrefix/images/redicon.png</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
@ -1282,8 +1304,6 @@
<tabstop>textEditMessage</tabstop>
<tabstop>pushButtonAddSubscription</tabstop>
</tabstops>
<resources>
<include location="bitmessageqt.bitmessage_icons.qrc"/>
</resources>
<resources/>
<connections/>
</ui>

View File

@ -998,9 +998,6 @@
<tabstop>checkBoxSocksListen</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="bitmessageqt.bitmessage_icons.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>