Browse Source

Merge pull request #1204 from Diapolo/messagepage_focus_placeholder

GUI messagepage: add placeholder text to address field (like in sendcoins dialog)...
0.8
Wladimir J. van der Laan 13 years ago
parent
commit
b66737e6df
  1. 12
      src/qt/bitcoingui.cpp
  2. 3
      src/qt/bitcoingui.h
  3. 2
      src/qt/forms/messagepage.ui
  4. 5
      src/qt/messagepage.cpp

12
src/qt/bitcoingui.cpp

@ -728,8 +728,11 @@ void BitcoinGUI::gotoSendCoinsPage() @@ -728,8 +728,11 @@ void BitcoinGUI::gotoSendCoinsPage()
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
void BitcoinGUI::gotoMessagePage()
void BitcoinGUI::gotoMessagePage(QString addr)
{
if(!addr.isEmpty())
messagePage->setAddress(addr);
#ifdef FIRST_CLASS_MESSAGING
messageAction->setChecked(true);
centralWidget->setCurrentWidget(messagePage);
@ -738,16 +741,9 @@ void BitcoinGUI::gotoMessagePage() @@ -738,16 +741,9 @@ void BitcoinGUI::gotoMessagePage()
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
#else
messagePage->show();
messagePage->setFocus();
#endif
}
void BitcoinGUI::gotoMessagePage(QString addr)
{
gotoMessagePage();
messagePage->setAddress(addr);
}
void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
{
// Accept only URIs

3
src/qt/bitcoingui.h

@ -130,8 +130,7 @@ public slots: @@ -130,8 +130,7 @@ public slots:
void askFee(qint64 nFeeRequired, bool *payFee);
void handleURI(QString strURI);
void gotoMessagePage();
void gotoMessagePage(QString);
void gotoMessagePage(QString addr = "");
private slots:
/** Switch to overview (home) page */

2
src/qt/forms/messagepage.ui

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Message</string>
<string>Sign Message Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>

5
src/qt/messagepage.cpp

@ -27,11 +27,14 @@ MessagePage::MessagePage(QWidget *parent) : @@ -27,11 +27,14 @@ MessagePage::MessagePage(QWidget *parent) :
#if (QT_VERSION >= 0x040700)
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
ui->signFrom->setPlaceholderText(tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"));
ui->signature->setPlaceholderText(tr("Click \"Sign Message\" to get signature"));
#endif
GUIUtil::setupAddressWidget(ui->signFrom, this);
ui->signature->installEventFilter(this);
ui->signFrom->setFocus();
}
MessagePage::~MessagePage()
@ -117,6 +120,8 @@ void MessagePage::on_clearButton_clicked() @@ -117,6 +120,8 @@ void MessagePage::on_clearButton_clicked()
ui->signFrom->clear();
ui->message->clear();
ui->signature->clear();
ui->signFrom->setFocus();
}
bool MessagePage::eventFilter(QObject *object, QEvent *event)

Loading…
Cancel
Save