From 97f908e483d06796a1b9c8ce34de304fcc36c31f Mon Sep 17 00:00:00 2001 From: Celil Date: Fri, 15 Jul 2011 16:10:48 -0700 Subject: [PATCH 1/2] Suppress uninitialized warnings. --- bitcoin-qt.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 9af4c671..e1b85517 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -17,7 +17,7 @@ QMAKE_CXXFLAGS += -fstack-protector QMAKE_LFLAGS += -fstack-protector # disable quite some warnings because bitcoin core "sins" a lot -QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wno-invalid-offsetof -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -Wno-char-subscripts -Wno-unused-value -Wno-sequence-point -Wno-parentheses -Wno-unknown-pragmas -Wno-switch +QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wno-invalid-offsetof -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -Wno-char-subscripts -Wno-unused-value -Wno-sequence-point -Wno-parentheses -Wno-unknown-pragmas -Wno-switch -Wno-uninitialized # Input DEPENDPATH += src/qt src src/cryptopp src json/include From 2eac3a6decf3353e5db8a8b07f3307d04e77d329 Mon Sep 17 00:00:00 2001 From: Celil Date: Fri, 22 Jul 2011 16:55:50 -0700 Subject: [PATCH 2/2] Allow ammount field to be empty so that one can specify .05 instead of having to type the leading zero as in 0.05 --- src/qt/bitcoinamountfield.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index f9df91b3..ea0a98b7 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -11,7 +11,7 @@ BitcoinAmountField::BitcoinAmountField(QWidget *parent): QWidget(parent), amount(0), decimals(0) { amount = new QValidatedLineEdit(this); - amount->setValidator(new QRegExpValidator(QRegExp("[0-9]+"), this)); + amount->setValidator(new QRegExpValidator(QRegExp("[0-9]?"), this)); amount->setAlignment(Qt::AlignRight|Qt::AlignVCenter); amount->installEventFilter(this); amount->setMaximumWidth(100); @@ -64,11 +64,6 @@ void BitcoinAmountField::clear() bool BitcoinAmountField::validate() { bool valid = true; - if(amount->text().isEmpty()) - { - amount->setValid(false); - valid = false; - } if(decimals->text().isEmpty()) { decimals->setValid(false); @@ -79,10 +74,14 @@ bool BitcoinAmountField::validate() QString BitcoinAmountField::text() const { - if(amount->text().isEmpty() || decimals->text().isEmpty()) + if(decimals->text().isEmpty()) { return QString(); } + if(amount->text().isEmpty()) + { + return QString("0.") + decimals->text(); + } return amount->text() + QString(".") + decimals->text(); }