From b1ef1b24ced1e8360d1bf62b9fefbc960cdd19be Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 14 Jun 2011 21:34:51 +0200 Subject: [PATCH] add connection meter --- src/qt/bitcoin.qrc | 5 +++++ src/qt/bitcoingui.cpp | 18 ++++++++++++++---- src/qt/bitcoingui.h | 1 + src/qt/res/icons/connect0_16.png | Bin 0 -> 702 bytes src/qt/res/icons/connect1_16.png | Bin 0 -> 612 bytes src/qt/res/icons/connect2_16.png | Bin 0 -> 623 bytes src/qt/res/icons/connect3_16.png | Bin 0 -> 625 bytes src/qt/res/icons/connect4_16.png | Bin 0 -> 611 bytes 8 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/qt/res/icons/connect0_16.png create mode 100644 src/qt/res/icons/connect1_16.png create mode 100644 src/qt/res/icons/connect2_16.png create mode 100644 src/qt/res/icons/connect3_16.png create mode 100644 src/qt/res/icons/connect4_16.png diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index 80904b34..8cf6c325 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -5,6 +5,11 @@ res/icons/quit.png res/icons/send.png res/icons/toolbar.png + res/icons/connect0_16.png + res/icons/connect1_16.png + res/icons/connect2_16.png + res/icons/connect3_16.png + res/icons/connect4_16.png res/images/about.png diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 23640fe6..96afa41a 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -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(" " + QLocale::system().toString(count)+" "+tr("connection(s)", "", count)); } void BitcoinGUI::setNumBlocks(int count) diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 96452ef1..e1b3ef17 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -40,6 +40,7 @@ private: QLineEdit *address; QLabel *labelBalance; QLabel *labelConnections; + QLabel *labelConnectionsIcon; QLabel *labelBlocks; QLabel *labelTransactions; diff --git a/src/qt/res/icons/connect0_16.png b/src/qt/res/icons/connect0_16.png new file mode 100644 index 0000000000000000000000000000000000000000..66f3ae4f86a864755c59d0622cfb1bec43b018d2 GIT binary patch literal 702 zcmV;v0zv(WP)9K!-r$RAa3cUz=h$kx*p%C;S)QeO+MyOGc6l=R-OQ@Re53~ES`+5kQCRIByFqiqf zna@0ewkVZK_lw2iTV2!L? zP6z=21VI4b_u)8B6QHW9>@6jIAmGw5EldilF1}iS65Lkm(kVL z)dUD3Mt630vX0|iI&%235CVgPgNR0>sMqUoT^B-#rUToyVOiFd;zF43`{10zbzOL# z_gA82S^qU30zA({KA%6RR4S&TC~zF-pksniTD!bZTCCAPVrdDLg@yCr^wd0+`hO{{Pp!2Due)I42&@-iUL`dJDMq_pa86L8DDZa3`|Ub zA06TQ+8TZbL4*_vg?ZO?M^#k?V=TP?O~%-DLdY>8@6;0cybb- zb2;&KZmviG;QjJ)^l3Jm;G8FH+wO5)_jPx7_hZ8_^2ua!(cItXrKzd;YyJIqzin-S z4GoF2TFv;W>(35w7&@TB#=yqVr2_~C7G9tW z8!WsBQ+WUeCY~Yb5~x&?CY39Kt426~pmN*DwYm2m1~MRJC_VEzAN`KbQCzb`!x zh@z-6i>L>KK~-xV02%Q0@bJ(A>fe5Ee|!6B+Gso%ty$gL`t)uxnE(bbX_|(;UT+G- zfK#v6L#31gJiwGnCC7`K%_lcDH(wUhDc_n+JzZb_I0K5&Xyld4i#^JhCtp66k;S~Wlp*f0!3W6Z*AB^v}m#k;6fOfAbW zN|7%v+M*~bMNwpqsR7n?UB_Bm1{MM1`+iBi+1R-IeSiNU!0r3@Tki*h yDewRgrBrJ?9t&^}Kq>WQd3o6Z9s!P0>hmAqc@oq2xll4QHqyuv1=lpU`&ZD@XMC2Bb z0Su6EE($m^zXMK0J`BTVv)QzPKG64l-#HiHd0u=Lxm&B%EZ_GN zzyOHq^?Ee1Lht>;i%z%m2!X5Di=VzU8jZQRxg+3oe}CW6TBm?9P^(s}mnIUlyT`AJ zH)mIh#TzTFAMIy5J39&B1Q;|LjdZ8e5ugg_>FMe01mHM`L65+UI2w%cJkJJ(KvXW5 zM`0KOSb!xWlPe4Y0}_LY8H5nWaS8~5?Y+G{1E_!RoyzL!)BeWBbBSZFEH8ho{9Xsq zAckQCySuw1zyqv8q2MZ|6yN|lkw{pMS1LWZwzTwe6a*ZUN^x)xL=2cQ!D&P~opym7 zU~;)!+8C4M?>lSPbzSGz;USmT)-X!ZOC||!k0A~LA&4NG&1QiJFs|#mTI;E^N+y*` zWt?FqqjO=1R*EQ}H-oSzBbfr=bUYNxveF`w1B`9kmN6y`vaDU$3T>l)mfja<7sjo9LGZyd=u#{4pe*n6I6nJ9G$GZRk002ov JPDHLkV1jPI6o&u+ literal 0 HcmV?d00001 diff --git a/src/qt/res/icons/connect3_16.png b/src/qt/res/icons/connect3_16.png new file mode 100644 index 0000000000000000000000000000000000000000..a211700785d4f811bd535432234fcb76acdf2f46 GIT binary patch literal 625 zcmV-%0*?KOP)2L+d?h)FCT*>tVx`haXp0VY(7~xtJ1Dq`;M_mp z;tz217jzMX;_RTfH-lITF(rf0q&34iNli&|PR{51z7BQ}GK4sxUAaqya4C{zVG|PnGWXvu3^! zMKPsx05T$oGCa?-ff10kTCHRXaJIMhve)lDLBow(x4(}2ZRWEP$b=x0NGXdz1{^h; z&ABOn-#>r7w6wg5%II``*HIbd5vZ6j(e!#f4Kx8&tJNw~8JveX$P`q{V3aY5CCC`1 z6yqQwiXs35Ftpajl!H;IKvZQHO;>h)(gH#c9UVaRd4o`(-WYXvGJoFt@< zg)j}!noJ2?*LC?HCQ1lV0;+&?9LE-K*49=!jmATO z<@NO+$Hk+{&);%Y02?dj!JYZsuK!|H15ela{_fi~A9w^9LWqOE9sC=h=ivQ^00000 LNkvXXu0mjfwnP^- literal 0 HcmV?d00001 diff --git a/src/qt/res/icons/connect4_16.png b/src/qt/res/icons/connect4_16.png new file mode 100644 index 0000000000000000000000000000000000000000..e2fe97d49646f10ac7815fc2eb4ff020adc82644 GIT binary patch literal 611 zcmV-p0-XJcP)&26vgrXGc!B8z$ysQM2!#0?W+K%=2=u1#}dI)7|3ya&rt`{DYz>>9ZXO z1zF)JtOa*W5M}qIxCk69Prux6@6Vxd`|iCjr|nIKT^B+{Rs_6($|?KpeX^pu2<)|w z-i(fp&m)elKYRVDIPe8XNnR;g$QkOM(qDrpjxKI+lzRvk#M0?HdS!r6A|jk-1!WLo z1IB<8E&|j3mzrlqfm#7$7aOHVRi7i&gPgkJDs-c3(WY^|+50vMl}`M%LuZ~puprVQ|K xBK|Qp>}#!GOeyeWhSgn9-})9)s_=M{)&JcgLd%V)K7arK002ovPDHLkV1im!2{`}& literal 0 HcmV?d00001