diff options
author | Celil <celil.kj@gmail.com> | 2011-07-22 15:44:53 -0700 |
---|---|---|
committer | Celil <celil.kj@gmail.com> | 2011-07-22 15:44:53 -0700 |
commit | 64c991da2a235ae8d6544ed5cce01c24b233b929 (patch) | |
tree | 7e14cc93a34145e30f951a2ff6b5d2750b87ea00 /src | |
parent | 29f9e4e4006e626dc72df0f41b89b83f78a3b764 (diff) | |
parent | 7beada58cd24b1e1121d038bbb61436ebc782770 (diff) |
Merge branch 'master' of https://github.com/laanwj/bitcoin-qt
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 1 | ||||
-rw-r--r-- | src/makefile.vc | 9 | ||||
-rw-r--r-- | src/qt/bitcoinamountfield.cpp | 6 | ||||
-rw-r--r-- | src/qt/bitcoinamountfield.h | 2 | ||||
-rw-r--r-- | src/qt/qvalidatedlineedit.cpp | 6 | ||||
-rw-r--r-- | src/qt/qvalidatedlineedit.h | 1 | ||||
-rw-r--r-- | src/qt/sendcoinsentry.cpp | 2 | ||||
-rw-r--r-- | src/qt/transactionview.cpp | 51 | ||||
-rw-r--r-- | src/qt/transactionview.h | 9 |
9 files changed, 81 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp index 3a482e7cfa..54ef85e7c3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2574,6 +2574,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) vGetData.clear(); } } + mapAlreadyAskedFor[inv] = nNow; pto->mapAskFor.erase(pto->mapAskFor.begin()); } if (!vGetData.empty()) diff --git a/src/makefile.vc b/src/makefile.vc index b25ba60c50..c050deb6ed 100644 --- a/src/makefile.vc +++ b/src/makefile.vc @@ -41,12 +41,12 @@ DEFS=$(DEFS) /DUSE_UPNP=$(USE_UPNP) !ENDIF LIBS=$(LIBS) \ - kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib + kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib iphlpapi.lib DEBUGFLAGS=/Os CFLAGS=/MD /c /nologo /EHsc /GR /Zm300 $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \ - script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h wallet.h keystore.h + script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h wallet.h keystore.h crypter.h OBJS= \ obj\util.obj \ @@ -58,7 +58,8 @@ OBJS= \ obj\main.obj \ obj\wallet.obj \ obj\rpc.obj \ - obj\init.obj + obj\init.obj \ + obj\crypter.obj CRYPTOPP_OBJS= \ cryptopp\obj\sha.obj \ @@ -93,6 +94,8 @@ obj\rpc.obj: $(HEADERS) obj\init.obj: $(HEADERS) +obj\crypter.obj: $(HEADERS) + obj\ui.obj: $(HEADERS) obj\uibase.obj: $(HEADERS) diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index d545dc52e8..f9df91b333 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -55,6 +55,12 @@ void BitcoinAmountField::setText(const QString &text) } } +void BitcoinAmountField::clear() +{ + amount->clear(); + decimals->clear(); +} + bool BitcoinAmountField::validate() { bool valid = true; diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index 2a0ef4bd99..fd09ab2c9b 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -18,6 +18,8 @@ public: void setText(const QString &text); QString text() const; + + void clear(); bool validate(); // Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907) // Hence we have to set it up manually diff --git a/src/qt/qvalidatedlineedit.cpp b/src/qt/qvalidatedlineedit.cpp index 4b5acd8b07..2430cc9fb5 100644 --- a/src/qt/qvalidatedlineedit.cpp +++ b/src/qt/qvalidatedlineedit.cpp @@ -35,3 +35,9 @@ void QValidatedLineEdit::markValid() { setValid(true); } + +void QValidatedLineEdit::clear() +{ + setValid(true); + QLineEdit::clear(); +} diff --git a/src/qt/qvalidatedlineedit.h b/src/qt/qvalidatedlineedit.h index 9fc026fab1..f7b9486a6e 100644 --- a/src/qt/qvalidatedlineedit.h +++ b/src/qt/qvalidatedlineedit.h @@ -10,6 +10,7 @@ class QValidatedLineEdit : public QLineEdit Q_OBJECT public: explicit QValidatedLineEdit(QWidget *parent = 0); + void clear(); protected: void focusInEvent(QFocusEvent *evt); diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index 6e87e9cf99..2d4fe9b123 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -68,7 +68,7 @@ void SendCoinsEntry::clear() { ui->payTo->clear(); ui->addAsLabel->clear(); - ui->payAmount->setText(QString()); + ui->payAmount->clear(); ui->payTo->setFocus(); } diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 8aa43395e7..50291fea42 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -25,6 +25,8 @@ #include <QMenu> #include <QApplication> #include <QClipboard> +#include <QLabel> +#include <QDateTimeEdit> #include <QDebug> @@ -90,6 +92,7 @@ TransactionView::TransactionView(QWidget *parent) : QTableView *view = new QTableView(this); vlayout->addLayout(hlayout); + vlayout->addWidget(createDateRangeWidget()); vlayout->addWidget(view); vlayout->setSpacing(0); int width = view->verticalScrollBar()->sizeHint().width(); @@ -167,6 +170,7 @@ void TransactionView::setModel(WalletModel *model) void TransactionView::chooseDate(int idx) { QDate current = QDate::currentDate(); + dateRangeWidget->setVisible(false); switch(dateWidget->itemData(idx).toInt()) { case All: @@ -203,10 +207,10 @@ void TransactionView::chooseDate(int idx) TransactionFilterProxy::MAX_DATE); break; case Range: - // TODO ask specific range + dateRangeWidget->setVisible(true); + dateRangeChanged(); break; } - } void TransactionView::chooseType(int idx) @@ -337,3 +341,46 @@ void TransactionView::showDetails() dlg.exec(); } } + +QWidget *TransactionView::createDateRangeWidget() +{ + dateRangeWidget = new QFrame(); + dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised); + dateRangeWidget->setContentsMargins(1,1,1,1); + QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget); + layout->setContentsMargins(0,0,0,0); + layout->addSpacing(23); + layout->addWidget(new QLabel("Range:")); + + dateFrom = new QDateTimeEdit(this); + dateFrom->setDisplayFormat("dd/MM/yy"); + dateFrom->setCalendarPopup(true); + dateFrom->setMinimumWidth(100); + dateFrom->setDate(QDate::currentDate().addDays(-7)); + layout->addWidget(dateFrom); + layout->addWidget(new QLabel("to")); + + dateTo = new QDateTimeEdit(this); + dateTo->setDisplayFormat("dd/MM/yy"); + dateTo->setCalendarPopup(true); + dateTo->setMinimumWidth(100); + dateTo->setDate(QDate::currentDate()); + layout->addWidget(dateTo); + layout->addStretch(); + + // Hide by default + dateRangeWidget->setVisible(false); + + // Notify on change + connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged())); + connect(dateTo, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged())); + + return dateRangeWidget; +} + +void TransactionView::dateRangeChanged() +{ + transactionProxyModel->setDateRange( + QDateTime(dateFrom->date()), + QDateTime(dateTo->date()).addDays(1)); +} diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index f02751a074..54925f2855 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -12,6 +12,8 @@ class QComboBox; class QLineEdit; class QModelIndex; class QMenu; +class QFrame; +class QDateTimeEdit; QT_END_NAMESPACE class TransactionView : public QWidget @@ -45,8 +47,15 @@ private: QMenu *contextMenu; + QFrame *dateRangeWidget; + QDateTimeEdit *dateFrom; + QDateTimeEdit *dateTo; + + QWidget *createDateRangeWidget(); + private slots: void contextualMenu(const QPoint &); + void dateRangeChanged(); signals: void doubleClicked(const QModelIndex&); |