diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-09 22:41:53 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-09 22:41:53 -0700 |
commit | a2de039ec44585538a470d0c0be46d5cb1e0d543 (patch) | |
tree | d5911dc7ca8fd7d6ae59d86de6e87e942b856d32 /src | |
parent | e6fd96f054718e47688a5cd46337393056d32cb7 (diff) | |
parent | c8a3917089ec4ec96a7719cdab87260f266ee49e (diff) |
Merge pull request #1199 from laanwj/2012_05_signmessage_autoselect
signmessage: auto-select signature when field is focused/clicked
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/messagepage.cpp | 12 | ||||
-rw-r--r-- | src/qt/messagepage.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/qt/messagepage.cpp b/src/qt/messagepage.cpp index 57ad8292dc..236b67bf37 100644 --- a/src/qt/messagepage.cpp +++ b/src/qt/messagepage.cpp @@ -31,6 +31,7 @@ MessagePage::MessagePage(QWidget *parent) : #endif GUIUtil::setupAddressWidget(ui->signFrom, this); + ui->signature->installEventFilter(this); } MessagePage::~MessagePage() @@ -117,3 +118,14 @@ void MessagePage::on_clearButton_clicked() ui->message->clear(); ui->signature->clear(); } + +bool MessagePage::eventFilter(QObject *object, QEvent *event) +{ + if(object == ui->signature && (event->type() == QEvent::MouseButtonPress || + event->type() == QEvent::FocusIn)) + { + ui->signature->selectAll(); + return true; + } + return QDialog::eventFilter(object, event); +} diff --git a/src/qt/messagepage.h b/src/qt/messagepage.h index b5a38166da..d668ae98d0 100644 --- a/src/qt/messagepage.h +++ b/src/qt/messagepage.h @@ -23,6 +23,9 @@ public: void setAddress(QString); +protected: + bool eventFilter(QObject *object, QEvent *event); + private: Ui::MessagePage *ui; WalletModel *model; |