add connection meter
This commit is contained in:
parent
a790ec5884
commit
b1ef1b24ce
@ -5,6 +5,11 @@
|
||||
<file alias="quit">res/icons/quit.png</file>
|
||||
<file alias="send">res/icons/send.png</file>
|
||||
<file alias="toolbar">res/icons/toolbar.png</file>
|
||||
<file alias="connect0">res/icons/connect0_16.png</file>
|
||||
<file alias="connect1">res/icons/connect1_16.png</file>
|
||||
<file alias="connect2">res/icons/connect2_16.png</file>
|
||||
<file alias="connect3">res/icons/connect3_16.png</file>
|
||||
<file alias="connect4">res/icons/connect4_16.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/images">
|
||||
<file alias="about">res/images/about.png</file>
|
||||
|
@ -108,12 +108,12 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
|
||||
|
||||
// Create status bar
|
||||
statusBar();
|
||||
|
||||
|
||||
labelConnections = new QLabel();
|
||||
labelConnections->setFrameStyle(QFrame::Panel | QFrame::Sunken);
|
||||
labelConnections->setMinimumWidth(130);
|
||||
labelConnections->setMinimumWidth(150);
|
||||
labelConnections->setToolTip(tr("Number of connections to other clients"));
|
||||
|
||||
|
||||
labelBlocks = new QLabel();
|
||||
labelBlocks->setFrameStyle(QFrame::Panel | QFrame::Sunken);
|
||||
labelBlocks->setMinimumWidth(130);
|
||||
@ -345,7 +345,17 @@ void BitcoinGUI::setAddress(const QString &addr)
|
||||
|
||||
void BitcoinGUI::setNumConnections(int count)
|
||||
{
|
||||
labelConnections->setText(QLocale::system().toString(count)+" "+tr("connections(s)", "", count));
|
||||
QString icon;
|
||||
switch(count)
|
||||
{
|
||||
case 0: icon = ":/icons/connect0"; break;
|
||||
case 1: icon = ":/icons/connect1"; break;
|
||||
case 2: icon = ":/icons/connect2"; break;
|
||||
case 3: icon = ":/icons/connect3"; break;
|
||||
default: icon = ":/icons/connect4"; break;
|
||||
}
|
||||
labelConnections->setTextFormat(Qt::RichText);
|
||||
labelConnections->setText("<img src=\""+icon+"\"> " + QLocale::system().toString(count)+" "+tr("connection(s)", "", count));
|
||||
}
|
||||
|
||||
void BitcoinGUI::setNumBlocks(int count)
|
||||
|
@ -40,6 +40,7 @@ private:
|
||||
QLineEdit *address;
|
||||
QLabel *labelBalance;
|
||||
QLabel *labelConnections;
|
||||
QLabel *labelConnectionsIcon;
|
||||
QLabel *labelBlocks;
|
||||
QLabel *labelTransactions;
|
||||
|
||||
|
BIN
src/qt/res/icons/connect0_16.png
Normal file
BIN
src/qt/res/icons/connect0_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 702 B |
BIN
src/qt/res/icons/connect1_16.png
Normal file
BIN
src/qt/res/icons/connect1_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 612 B |
BIN
src/qt/res/icons/connect2_16.png
Normal file
BIN
src/qt/res/icons/connect2_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 623 B |
BIN
src/qt/res/icons/connect3_16.png
Normal file
BIN
src/qt/res/icons/connect3_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 625 B |
BIN
src/qt/res/icons/connect4_16.png
Normal file
BIN
src/qt/res/icons/connect4_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 611 B |
Loading…
Reference in New Issue
Block a user