Mercurial > hg > bitcoin
changeset 1245:6597bf99c530 draft
show last few transactions on overview page
author | Wladimir J. van der Laan <laanwj@gmail.com> |
---|---|
date | Wed, 03 Aug 2011 20:52:18 +0200 |
parents | 12a1b939263c |
children | 979c79cb302e |
files | src/qt/forms/overviewpage.ui src/qt/guiutil.cpp src/qt/guiutil.h src/qt/overviewpage.cpp src/qt/overviewpage.h src/qt/res/icons/tx_inout.png src/qt/res/icons/tx_input.png src/qt/res/icons/tx_mined.png src/qt/res/icons/tx_output.png src/qt/transactionfilterproxy.cpp src/qt/transactionfilterproxy.h src/qt/transactiontablemodel.cpp src/qt/transactiontablemodel.h |
diffstat | 13 files changed, 269 insertions(+), 77 deletions(-) [+] |
line wrap: on
line diff
--- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -13,82 +13,146 @@ <property name="windowTitle"> <string>Form</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1"> <item> - <widget class="QFrame" name="frame"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QFormLayout" name="formLayout_2"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <property name="horizontalSpacing"> - <number>12</number> - </property> - <property name="verticalSpacing"> - <number>12</number> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Balance:</string> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QFrame" name="frame"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QFormLayout" name="formLayout_2"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="labelBalance"> - <property name="text"> - <string>123.456 BTC</string> + <property name="horizontalSpacing"> + <number>12</number> + </property> + <property name="verticalSpacing"> + <number>12</number> </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Number of transactions:</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLabel" name="labelNumTransactions"> - <property name="text"> - <string>0</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Unconfirmed:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLabel" name="labelUnconfirmed"> - <property name="text"> - <string>0 BTC</string> - </property> - </widget> - </item> - </layout> - </widget> + <item row="2" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Balance:</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="labelBalance"> + <property name="text"> + <string>123.456 BTC</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Number of transactions:</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLabel" name="labelNumTransactions"> + <property name="text"> + <string>0</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Unconfirmed:</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLabel" name="labelUnconfirmed"> + <property name="text"> + <string>0 BTC</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Wallet</span></p></body></html></string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> </item> <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QFrame" name="frame_2"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string><b>Recent transactions</b></string> + </property> + </widget> + </item> + <item> + <widget class="QListView" name="listTransactions"> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> </item> </layout> </widget>
--- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -11,7 +11,11 @@ QString GUIUtil::DateTimeStr(qint64 nTime) { - QDateTime date = QDateTime::fromTime_t((qint32)nTime); + return DateTimeStr(QDateTime::fromTime_t((qint32)nTime)); +} + +QString GUIUtil::DateTimeStr(const QDateTime &date) +{ return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm"); }
--- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -7,12 +7,14 @@ class QFont; class QLineEdit; class QWidget; +class QDateTime; QT_END_NAMESPACE class GUIUtil { public: static QString DateTimeStr(qint64 nTime); + static QString DateTimeStr(const QDateTime &datetime); // Render bitcoin addresses in monospace font static QFont bitcoinAddressFont();
--- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -4,14 +4,87 @@ #include "walletmodel.h" #include "bitcoinunits.h" #include "optionsmodel.h" +#include "transactiontablemodel.h" +#include "transactionfilterproxy.h" +#include "guiutil.h" +#include "guiconstants.h" #include <QDebug> +#include <QItemDelegate> +#include <QPainter> + +#define DECORATION_SIZE 64 +class TxViewDelegate : public QItemDelegate +{ + //Q_OBJECT +public: + TxViewDelegate(): QItemDelegate(), unit(BitcoinUnits::BTC) + { + + } + + inline void paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index ) const + { + //QItemDelegate::paint(painter, option, index); + painter->save(); + + QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole)); + QRect mainRect = option.rect; + QRect decorationRect(mainRect.topLeft(), QSize(DECORATION_SIZE, DECORATION_SIZE)); + int xspace = DECORATION_SIZE + 8; + int ypad = 6; + int halfheight = (mainRect.height() - 2*ypad)/2; + QRect amountRect(mainRect.left() + xspace, mainRect.top()+ypad, mainRect.width() - xspace, halfheight); + QRect addressRect(mainRect.left() + xspace, mainRect.top()+ypad+halfheight, mainRect.width() - xspace, halfheight); + icon.paint(painter, decorationRect); + + QDateTime date = index.data(TransactionTableModel::DateRole).toDateTime(); + QString address = index.data(Qt::DisplayRole).toString(); + qint64 amount = index.data(TransactionTableModel::AmountRole).toLongLong(); + bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool(); + QVariant value = index.data(Qt::ForegroundRole); + QColor foreground = option.palette.color(QPalette::Text); + if(qVariantCanConvert<QColor>(value)) + { + foreground = qvariant_cast<QColor>(value); + } + + painter->setPen(foreground); + painter->drawText(addressRect, Qt::AlignLeft|Qt::AlignVCenter, address); + + if(amount < 0) + { + foreground = COLOR_NEGATIVE; + } + else + { + foreground = option.palette.color(QPalette::Text); + } + painter->setPen(foreground); + QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true); + if(!confirmed) + { + amountText = QString("[") + amountText + QString("]"); + } + painter->drawText(amountRect, Qt::AlignRight|Qt::AlignVCenter, amountText); + + painter->setPen(option.palette.color(QPalette::Text)); + painter->drawText(amountRect, Qt::AlignLeft|Qt::AlignVCenter, GUIUtil::DateTimeStr(date)); + + painter->restore(); + } + + int unit; + +}; OverviewPage::OverviewPage(QWidget *parent) : QWidget(parent), ui(new Ui::OverviewPage), currentBalance(-1), - currentUnconfirmedBalance(-1) + currentUnconfirmedBalance(-1), + txdelegate(new TxViewDelegate()) { ui->setupUi(this); @@ -27,9 +100,11 @@ ui->labelNumTransactions->setToolTip(tr("Total number of transactions in wallet")); - // Overview page should show: - // Last received transaction(s) - // Last sent transaction(s) + // Recent transactions + ui->listTransactions->setStyleSheet("background:transparent"); + ui->listTransactions->setItemDelegate(txdelegate); + ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE)); + ui->listTransactions->setSelectionMode(QAbstractItemView::NoSelection); } OverviewPage::~OverviewPage() @@ -55,6 +130,18 @@ { this->model = model; + // Set up transaction list + + TransactionFilterProxy *filter = new TransactionFilterProxy(); + filter->setSourceModel(model->getTransactionTableModel()); + filter->setLimit(3); + filter->setDynamicSortFilter(true); + filter->setSortRole(Qt::EditRole); + filter->sort(TransactionTableModel::Status, Qt::DescendingOrder); + + ui->listTransactions->setModel(filter); + ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress); + // Keep up to date with wallet setBalance(model->getBalance(), model->getUnconfirmedBalance()); connect(model, SIGNAL(balanceChanged(qint64, qint64)), this, SLOT(setBalance(qint64, qint64))); @@ -69,4 +156,7 @@ { if(currentBalance != -1) setBalance(currentBalance, currentUnconfirmedBalance); + + txdelegate->unit = model->getOptionsModel()->getDisplayUnit(); + ui->listTransactions->update(); }
--- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -7,6 +7,7 @@ class OverviewPage; } class WalletModel; +class TxViewDelegate; class OverviewPage : public QWidget { @@ -28,6 +29,8 @@ qint64 currentBalance; qint64 currentUnconfirmedBalance; + TxViewDelegate *txdelegate; + private slots: void displayUnitChanged(); };
index ff6bb1c5c3ed6049f5cbde02b95d53e7e4739a2f..5f092f97aa3db749e5e7f490158a489e16cbf4cd GIT binary patch literal 2442 zc$@)>33c{~P)<h;3K|Lk000e1NJLTq002M$002M;1^@s6s%dfF00004b3#c}2nYxW zd<bNS00009a7bBm000MK000MK0XTY@+W-In8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H12?t3;K~#90?VEp$+hrZcU!SMD^^U-nop?AFAV30>FdS2i4#krI z$;jMwh4UvwP?AF(?cI$?5W=j&A7~uy_o{IiB$|jyL)+bs4M7M5A}AXh=TM`YGGv62 zT{%z2?XLYkAOC23>$=|cdu_MQY_FubZ@<s;`8=QRyU+7{pI;}c%886=b^y)hqyWth zpxK-hpxFU5o09@GJAh_$!V55`UI)o!av`wH7_&@O&lZt(pj}nl3)ii{7%--)V<IvJ zjETs<thKKKuMQ6n?^?HRovk;PT9Da}1e3|+c_MP1h;)j`GFAOh1L8OU>;zsBku5%- z@9C8*SH9l>zg6)hz~JEEg|6#fFCy0gmmc+?L=FN^TWg0@bto7NzIoKjnn3_bCX?41 zV{QjJk5&L4*$xa@Yc~ah!L2~UCNM_`uw}~@|K#N4jjGxYe7I2sH3|`VTU8$i9t;Em zf2!ACc_%0n6BEP01@$^US`_-6uLG9=AFtQnVXwhdD)kAD<A*QfvQ#QncdUmAAR=F= z*Wt0m81t37eUw~_s$O5O!()l6Hco(KGPztt7S-#pjQ;|=$oJxJ0d9l+pFcP_cu74D zraD2N&-a-cm&Yc6=YTCDvRhU6S!?&XuKP}RclUT{#z-V$F1qNV4!_^OP*oQKX97!A z^=fMDdtBGO6d10>7D@zA)yrpL_m-+|7LmuZ+3fGTySv}>VpJIJz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xC&-)K^SGgvEuO^epmli5tdBp^6*2~%gf-Jok3I!b; z9DGwmen0JWQAEDty6($<<tvZCxgY^8_ak78Y4@{fZEdvx*4kf`PhA6glF8(uKy?5V zi^bQ27^~{KAa=DNl}fEv)h&K@<KyEB(9+V90<NfP%yr$Np!G~Gk7u*lOMtK9z~59g zt*VD&vDj-tEAr#`@#9VTeEw7AohKc@!@x?va-*Z8t-E&ZngH0dXV1NZgM)uvOubVA zWHOmoMdS;MjQgKJ+8C2A6bi4+UI|)=rQYy#L}a47ySsI9A<twgbBf4WV6g(M1rpZU zM00a9*=+V5-~y$UqYEN(K}4>UCtcf(G3~1QK}s#H-53*U1gNT)!jy-Z0=!;>t@C%3 zKlfF-*3%~{>aaEct*{QJMp~Zdoek@(0sK0wgDC-wF@fF$HxkB};m|%R2hnJBR8=p8 zb-0YY(bd&;%HM2ZW=u9TH#a{dB0mBGjSU*ac~wmqV?u3=s8DsE;PCM9ipj~zuZu`r zRoB;|q8jk3h$K&+K7FK?+iLxGib^({eMCgIt7<2uQQ2~#zzJ0y0@B;JZ?DU;+@kgh z4-E}%1in-j<3Vb$*?JaZ!0$vPCnATty1Fjb*#8_By;-_KDwS%9L?Y`w&)W!WEblQ` z53~WdQ<~7MMgbTFF01OFMdXYzX2e=M5{*XRSW++{Sh4_qq*AGskw|1!u~=LMV67d! zdiCmPrQd#|P&WboU%2W2W8{_qjSisE+!CPC0W_MMUV#4rIZ-5KWNQ<_00000NkvXX Hu0mjf+T;As
--- a/src/qt/transactionfilterproxy.cpp +++ b/src/qt/transactionfilterproxy.cpp @@ -15,7 +15,8 @@ dateTo(MAX_DATE), addrPrefix(), typeFilter(ALL_TYPES), - minAmount(0) + minAmount(0), + limitRows(-1) { } @@ -65,3 +66,20 @@ this->minAmount = minimum; invalidateFilter(); } + +void TransactionFilterProxy::setLimit(int limit) +{ + this->limitRows = limit; +} + +int TransactionFilterProxy::rowCount(const QModelIndex &parent) const +{ + if(limitRows != -1) + { + return std::min(QSortFilterProxyModel::rowCount(parent), limitRows); + } + else + { + return QSortFilterProxyModel::rowCount(parent); + } +}
--- a/src/qt/transactionfilterproxy.h +++ b/src/qt/transactionfilterproxy.h @@ -26,6 +26,10 @@ void setTypeFilter(quint32 modes); void setMinAmount(qint64 minimum); + // Set maximum number of rows returned, -1 if unlimited + void setLimit(int limit); + + int rowCount(const QModelIndex &parent = QModelIndex()) const; protected: bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const; @@ -35,6 +39,7 @@ QString addrPrefix; quint32 typeFilter; qint64 minAmount; + int limitRows; signals: