diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-05-14 23:22:45 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-05-15 08:04:51 +0200 |
commit | 34aa3112c8d3366303873fbd217e23d9cba798e4 (patch) | |
tree | 6a91b9dcd7955ae8cecdf12dc78dcde5a9c1561b /src/qt/verifymessagedialog.cpp | |
parent | 2643ce97ae40d9ed6260b7d2608f7ca9181bb391 (diff) |
adapt user-experience from messagepage / move placeholderTexts from XML to source to avoid a problem with Qt < 4.7 / add eventFilter for address field to select text when clicking in / add Clear All button / rework strings
Diffstat (limited to 'src/qt/verifymessagedialog.cpp')
-rw-r--r-- | src/qt/verifymessagedialog.cpp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/src/qt/verifymessagedialog.cpp b/src/qt/verifymessagedialog.cpp index 8842908718..1f82e2ac31 100644 --- a/src/qt/verifymessagedialog.cpp +++ b/src/qt/verifymessagedialog.cpp @@ -22,7 +22,16 @@ VerifyMessageDialog::VerifyMessageDialog(AddressTableModel *addressModel, QWidge { ui->setupUi(this); +#if (QT_VERSION >= 0x040700) + /* Do not move this to the XML file, Qt before 4.7 will choke on it */ + ui->lnSig->setPlaceholderText(tr("Enter Bitcoin signature")); + ui->lnAddress->setPlaceholderText(tr("Click \"Apply\" to obtain address")); +#endif + GUIUtil::setupAddressWidget(ui->lnAddress, this); + ui->lnAddress->installEventFilter(this); + + ui->edMessage->setFocus(); } VerifyMessageDialog::~VerifyMessageDialog() @@ -63,13 +72,33 @@ bool VerifyMessageDialog::checkAddress() return true; } -void VerifyMessageDialog::on_buttonBox_clicked(QAbstractButton *button) +void VerifyMessageDialog::on_verifyMessage_clicked() { - if(ui->buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) - checkAddress(); + checkAddress(); } void VerifyMessageDialog::on_copyToClipboard_clicked() { QApplication::clipboard()->setText(ui->lnAddress->text()); } + +void VerifyMessageDialog::on_clearButton_clicked() +{ + ui->edMessage->clear(); + ui->lnSig->clear(); + ui->lnAddress->clear(); + ui->lblStatus->clear(); + + ui->edMessage->setFocus(); +} + +bool VerifyMessageDialog::eventFilter(QObject *object, QEvent *event) +{ + if(object == ui->lnAddress && (event->type() == QEvent::MouseButtonPress || + event->type() == QEvent::FocusIn)) + { + ui->lnAddress->selectAll(); + return true; + } + return QDialog::eventFilter(object, event); +} |