From 05bcf7089e0da090db0b09a35b25f7a87c8ca1dd Mon Sep 17 00:00:00 2001 From: Wladimir J. van der Laan Date: Sun, 31 Jul 2011 17:05:34 +0200 Subject: [PATCH] address icons --- doc/assets-attribution.txt | 3 +- src/qt/bitcoin.qrc | 4 + src/qt/res/icons/bitcoin.svg | 115 ---------------- src/qt/res/icons/clock1.svg | 261 ------------------------------------ src/qt/res/icons/clock2.svg | 262 ------------------------------------- src/qt/res/icons/clock3.svg | 261 ------------------------------------ src/qt/res/icons/clock4.svg | 261 ------------------------------------ src/qt/res/icons/clock5.svg | 262 ------------------------------------- src/qt/res/icons/clock_green.svg | 262 ------------------------------------- src/qt/res/icons/questionmark.svg | 159 ---------------------- src/qt/res/icons/tx_inout.png | Bin 0 -> 631 bytes src/qt/res/icons/tx_input.png | Bin 0 -> 594 bytes src/qt/res/icons/tx_mined.png | Bin 0 -> 754 bytes src/qt/res/icons/tx_output.png | Bin 0 -> 593 bytes src/qt/res/src/bitcoin.svg | 115 ++++++++++++++++ src/qt/res/src/clock1.svg | 261 ++++++++++++++++++++++++++++++++++++ src/qt/res/src/clock2.svg | 262 +++++++++++++++++++++++++++++++++++++ src/qt/res/src/clock3.svg | 261 ++++++++++++++++++++++++++++++++++++ src/qt/res/src/clock4.svg | 261 ++++++++++++++++++++++++++++++++++++ src/qt/res/src/clock5.svg | 262 +++++++++++++++++++++++++++++++++++++ src/qt/res/src/clock_green.svg | 262 +++++++++++++++++++++++++++++++++++++ src/qt/res/src/inout.svg | 122 +++++++++++++++++ src/qt/res/src/questionmark.svg | 159 ++++++++++++++++++++++ src/qt/transactiontablemodel.cpp | 69 ++++++----- src/qt/transactiontablemodel.h | 5 +- 25 files changed, 2012 insertions(+), 1877 deletions(-) delete mode 100644 src/qt/res/icons/bitcoin.svg delete mode 100644 src/qt/res/icons/clock1.svg delete mode 100644 src/qt/res/icons/clock2.svg delete mode 100644 src/qt/res/icons/clock3.svg delete mode 100644 src/qt/res/icons/clock4.svg delete mode 100644 src/qt/res/icons/clock5.svg delete mode 100644 src/qt/res/icons/clock_green.svg delete mode 100644 src/qt/res/icons/questionmark.svg create mode 100644 src/qt/res/icons/tx_inout.png create mode 100644 src/qt/res/icons/tx_input.png create mode 100644 src/qt/res/icons/tx_mined.png create mode 100644 src/qt/res/icons/tx_output.png create mode 100644 src/qt/res/src/bitcoin.svg create mode 100644 src/qt/res/src/clock1.svg create mode 100644 src/qt/res/src/clock2.svg create mode 100644 src/qt/res/src/clock3.svg create mode 100644 src/qt/res/src/clock4.svg create mode 100644 src/qt/res/src/clock5.svg create mode 100644 src/qt/res/src/clock_green.svg create mode 100644 src/qt/res/src/inout.svg create mode 100644 src/qt/res/src/questionmark.svg diff --git a/doc/assets-attribution.txt b/doc/assets-attribution.txt index c032337..0a719f1 100644 --- a/doc/assets-attribution.txt +++ b/doc/assets-attribution.txt @@ -1,4 +1,5 @@ -Icon: src/qt/res/icons/clock*.png +Icon: src/qt/res/icons/clock*.png, src/qt/res/icons/tx*.png, + src/qt/res/src/*.svg Designer: Wladimir van der Laan License: Creative Commons Attribution diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index 5199a8e..8d4bab5 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -30,6 +30,10 @@ res/icons/export.png res/icons/synced.png res/icons/remove.png + res/icons/tx_mined.png + res/icons/tx_input.png + res/icons/tx_output.png + res/icons/tx_inout.png res/images/about.png diff --git a/src/qt/res/icons/bitcoin.svg b/src/qt/res/icons/bitcoin.svg deleted file mode 100644 index 96f1017..0000000 --- a/src/qt/res/icons/bitcoin.svg +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/qt/res/icons/clock1.svg b/src/qt/res/icons/clock1.svg deleted file mode 100644 index 793dc7f..0000000 --- a/src/qt/res/icons/clock1.svg +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/qt/res/icons/clock2.svg b/src/qt/res/icons/clock2.svg deleted file mode 100644 index 6a78adf..0000000 --- a/src/qt/res/icons/clock2.svg +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/qt/res/icons/clock3.svg b/src/qt/res/icons/clock3.svg deleted file mode 100644 index 09ccc25..0000000 --- a/src/qt/res/icons/clock3.svg +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/qt/res/icons/clock4.svg b/src/qt/res/icons/clock4.svg deleted file mode 100644 index 7d9dc37..0000000 --- a/src/qt/res/icons/clock4.svg +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/qt/res/icons/clock5.svg b/src/qt/res/icons/clock5.svg deleted file mode 100644 index 9fd58d9..0000000 --- a/src/qt/res/icons/clock5.svg +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/qt/res/icons/clock_green.svg b/src/qt/res/icons/clock_green.svg deleted file mode 100644 index e31f0e7..0000000 --- a/src/qt/res/icons/clock_green.svg +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/qt/res/icons/questionmark.svg b/src/qt/res/icons/questionmark.svg deleted file mode 100644 index c03c159..0000000 --- a/src/qt/res/icons/questionmark.svg +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - ? - ? - - - ? - - diff --git a/src/qt/res/icons/tx_inout.png b/src/qt/res/icons/tx_inout.png new file mode 100644 index 0000000000000000000000000000000000000000..ff6bb1c5c3ed6049f5cbde02b95d53e7e4739a2f GIT binary patch literal 631 zcmV--0*L*IP)2 zCW_i=T*0MQ5TkDTiD`VW#99mn}3=_-H|nM`J0 z(rmlkeo68n$?LUR?bdjJ1LNb-#)>+w>kiWC^e#z_u!3tOZ`5kFI{-k>^DYCp7vcs0 zo|AkQ1i`m(j0+@>0@wlIOSjwITdh`uC{fH9^Ck#_H2_lpk^rnE8}=IY9MS!8Fc5BH zqtTd-$Kz)uodb{}IVWiwfR6y)NqP)msZc1q#_uHQZ_HM!mH3Bk6LZpY{t29v_VYB- RoqqrT002ovPDHLkV1oR%3Jd@M literal 0 HcmV?d00001 diff --git a/src/qt/res/icons/tx_input.png b/src/qt/res/icons/tx_input.png new file mode 100644 index 0000000000000000000000000000000000000000..1673d06ad33a333b0a7c6652a30c4e420e933dc2 GIT binary patch literal 594 zcmV-Y01T`nbwjKg&X^f zu#xEC58Ra$F6e;90!q4+*s^>Ql1mFAB!l9DjuaFDCq$$|$fSsU_b9lFE(f9UNTZ$I zH}m$*td^26kD0lu0i>hA^SrYpYXH_HtxC#}+?F&Z`OdcO4FG@1r6lxvy>*gx04M)* z*)GZF)oS(W5rS^FyJCzP$Ib-cGk`HkOVWiHwm+Rtm+STV!C?!=n5$uYV2rty$z(p3 z%jKU@LbKVto6qMjl6(SSF_lW?0DL(lAbBl(iLaGPeOm;vx-v)K}Wok&46z;h8nyWRFl-g6vhPtpTPPN`J7Bx%LA?PtjrB7*aA zKz|0~xURcvS=Jdzoe(;f;Iij=-vE3d`927O2}!G1EM6hm40C=UVQFK`W)KAX02Tq{ z0N9djk^q2c4efQ3fRfPZbWUZn+1rxt09YfrD(M7(?*O(Wy#cUZtJOXw2_WfT&VIkY ga13_DIq!G=4ZoY?i>Xjr?*IS*07*qoM6N<$f(sV~tN;K2 literal 0 HcmV?d00001 diff --git a/src/qt/res/icons/tx_mined.png b/src/qt/res/icons/tx_mined.png new file mode 100644 index 0000000000000000000000000000000000000000..a336868e8a89b553996f84ad63fba5aba551db06 GIT binary patch literal 754 zcmVoPDU@-W+qod+9=#H$FZdPbQPc%gV~$04y&r2jcPg-DEPE7LoUZgM)4V0CKt9*@cCL zeThV3PbQNg6bhw`F`of~!Qf4;HK|mpd}?ZHn^NkwwKlW{kWQyF6B84xuC7v1Q9*5O zZCBw<6{XY> z;H8LIpm~0NekqYi_(X)7nwn45)zv#RfXCx0)mkf`&nNZu^{2Gf=K-IHJO(uoEBO>ZTrStHmX?-DYps87 zZf>-ys_H~rTidMK=pR^X%S2=Z*q@hHfs>I)B)Wc9uNV6J`^$l6dGjLh6es~6IgZo5 zDPUk=pwjJjkBP`$AR{8j!r|~?rPN4%_P*mdXEp@HVzDZ>+x-IA4G7TQ+S>Z0si`Ro zM1a?T0{X1A7uEn`u~;~h$-EMgoq7FYab9E0FQwEW;3I!lf6H2X=`SFg&7K3c11P1s zB9X|Q^;wNEKb2AkfiD0e(q*mPQiyOJ7zKKaF;~}{iy$eN%XI*l0gf7Dz9Axr2#(|U kMMM?)&1!gfxU_Kp4ZR*Ocy4Rr_firTIcA}30GUJyf?$PY89+hOhNKfD4<(IBzP8rB18}TeNPn*e+QFeZ6X(pt(l4a4xP=XtZlV2m+au|6}#Tyq>}#adgi z)?RmAHy?&!p5(naW_dIk-KZpZrPQmOQ+SSsKY+0n|m=_G*f01hO*1kfs%%O8%-CuyE=Fc>)h f@Es8@`kns(Nci4D#R}x@00000NkvXXu0mjfcvt^1 literal 0 HcmV?d00001 diff --git a/src/qt/res/src/bitcoin.svg b/src/qt/res/src/bitcoin.svg new file mode 100644 index 0000000..96f1017 --- /dev/null +++ b/src/qt/res/src/bitcoin.svg @@ -0,0 +1,115 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/qt/res/src/clock1.svg b/src/qt/res/src/clock1.svg new file mode 100644 index 0000000..793dc7f --- /dev/null +++ b/src/qt/res/src/clock1.svg @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/qt/res/src/clock2.svg b/src/qt/res/src/clock2.svg new file mode 100644 index 0000000..6a78adf --- /dev/null +++ b/src/qt/res/src/clock2.svg @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/qt/res/src/clock3.svg b/src/qt/res/src/clock3.svg new file mode 100644 index 0000000..09ccc25 --- /dev/null +++ b/src/qt/res/src/clock3.svg @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/qt/res/src/clock4.svg b/src/qt/res/src/clock4.svg new file mode 100644 index 0000000..7d9dc37 --- /dev/null +++ b/src/qt/res/src/clock4.svg @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/qt/res/src/clock5.svg b/src/qt/res/src/clock5.svg new file mode 100644 index 0000000..9fd58d9 --- /dev/null +++ b/src/qt/res/src/clock5.svg @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/qt/res/src/clock_green.svg b/src/qt/res/src/clock_green.svg new file mode 100644 index 0000000..e31f0e7 --- /dev/null +++ b/src/qt/res/src/clock_green.svg @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/qt/res/src/inout.svg b/src/qt/res/src/inout.svg new file mode 100644 index 0000000..bfab8ef --- /dev/null +++ b/src/qt/res/src/inout.svg @@ -0,0 +1,122 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/src/qt/res/src/questionmark.svg b/src/qt/res/src/questionmark.svg new file mode 100644 index 0000000..c03c159 --- /dev/null +++ b/src/qt/res/src/questionmark.svg @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + ? + ? + + + ? + + diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 27e85ce..58ec2c7 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -340,58 +340,62 @@ QString TransactionTableModel::lookupAddress(const std::string &address, bool to return description; } -QVariant TransactionTableModel::formatTxType(const TransactionRecord *wtx) const +QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const { - QString description; - switch(wtx->type) { case TransactionRecord::RecvWithAddress: - description = tr("Received with"); - break; + return tr("Received with"); case TransactionRecord::RecvFromIP: - description = tr("Received from IP"); - break; + return tr("Received from IP"); case TransactionRecord::SendToAddress: - description = tr("Sent to"); - break; + return tr("Sent to"); case TransactionRecord::SendToIP: - description = tr("Sent to IP"); - break; + return tr("Sent to IP"); case TransactionRecord::SendToSelf: - description = tr("Payment to yourself"); - break; + return tr("Payment to yourself"); case TransactionRecord::Generated: - description = tr("Mined"); - break; + return tr("Mined"); + default: + return QString(); } - return QVariant(description); } -QVariant TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const +QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx) const { - QString description; + switch(wtx->type) + { + case TransactionRecord::Generated: + return QIcon(":/icons/tx_mined"); + case TransactionRecord::RecvWithAddress: + case TransactionRecord::RecvFromIP: + return QIcon(":/icons/tx_input"); + case TransactionRecord::SendToAddress: + case TransactionRecord::SendToIP: + return QIcon(":/icons/tx_output"); + default: + return QIcon(":/icons/tx_inout"); + } + return QVariant(); +} +QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const +{ switch(wtx->type) { case TransactionRecord::RecvFromIP: - description = QString::fromStdString(wtx->address); - break; + return QString::fromStdString(wtx->address); case TransactionRecord::RecvWithAddress: case TransactionRecord::SendToAddress: - description = lookupAddress(wtx->address, tooltip); - break; + return lookupAddress(wtx->address, tooltip); case TransactionRecord::SendToIP: - description = QString::fromStdString(wtx->address); - break; + return QString::fromStdString(wtx->address); case TransactionRecord::SendToSelf: - description = QString(); - break; + return QString(); case TransactionRecord::Generated: - description = QString(); - break; + default: + return QString(); } - return QVariant(description); } QVariant TransactionTableModel::addressColor(const TransactionRecord *wtx) const @@ -478,9 +482,12 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const if(role == Qt::DecorationRole) { - if(index.column() == Status) + switch(index.column()) { + case Status: return formatTxDecoration(rec); + case ToAddress: + return txAddressDecoration(rec); } } else if(role == Qt::DisplayRole) @@ -522,7 +529,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case Status: return formatTxStatus(rec); case ToAddress: - return formatTxToAddress(rec, true); + return formatTxType(rec) + QString(" ") + formatTxToAddress(rec, true); } } else if (role == Qt::TextAlignmentRole) diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index 3322ff4..71b0644 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -63,10 +63,11 @@ private: QVariant addressColor(const TransactionRecord *wtx) const; QVariant formatTxStatus(const TransactionRecord *wtx) const; QVariant formatTxDate(const TransactionRecord *wtx) const; - QVariant formatTxType(const TransactionRecord *wtx) const; - QVariant formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const; + QString formatTxType(const TransactionRecord *wtx) const; + QString formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const; QVariant formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true) const; QVariant formatTxDecoration(const TransactionRecord *wtx) const; + QVariant txAddressDecoration(const TransactionRecord *wtx) const; private slots: void update(); -- 1.7.1