add connection meter

This commit is contained in:
Wladimir J. van der Laan 2011-06-14 21:34:51 +02:00
parent a790ec5884
commit b1ef1b24ce
8 changed files with 20 additions and 4 deletions

View File

@ -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>

View File

@ -111,7 +111,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
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();
@ -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)

View File

@ -40,6 +40,7 @@ private:
QLineEdit *address;
QLabel *labelBalance;
QLabel *labelConnections;
QLabel *labelConnectionsIcon;
QLabel *labelBlocks;
QLabel *labelTransactions;

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B