Browse Source

signmessage: auto-select signature when field is focused/clicked

0.8
Wladimir J. van der Laan 13 years ago
parent
commit
c8a3917089
  1. 12
      src/qt/messagepage.cpp
  2. 3
      src/qt/messagepage.h

12
src/qt/messagepage.cpp

@ -26,6 +26,7 @@ MessagePage::MessagePage(QWidget *parent) : @@ -26,6 +26,7 @@ MessagePage::MessagePage(QWidget *parent) :
ui->setupUi(this);
GUIUtil::setupAddressWidget(ui->signFrom, this);
ui->signature->installEventFilter(this);
}
MessagePage::~MessagePage()
@ -112,3 +113,14 @@ void MessagePage::on_clearButton_clicked() @@ -112,3 +113,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);
}

3
src/qt/messagepage.h

@ -23,6 +23,9 @@ public: @@ -23,6 +23,9 @@ public:
void setAddress(QString);
protected:
bool eventFilter(QObject *object, QEvent *event);
private:
Ui::MessagePage *ui;
WalletModel *model;

Loading…
Cancel
Save