aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-07-10 05:38:31 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2012-07-10 05:38:31 -0700
commit232393e3bda19392d1a9727c81bad1796b6061a8 (patch)
tree2572f25e548234e67729a8aad7cb0a0c9b147d42
parent4060d64fc9de6f11ae69f3961d4f1f0450dd8286 (diff)
parentddadf791f19cce8b20910b441e98bbc9bea597ac (diff)
Merge pull request #1569 from Diapolo/addressbookpage
replace some ugly code in addressbookpage.cpp
-rw-r--r--src/qt/addressbookpage.cpp10
-rw-r--r--src/qt/addressbookpage.h4
-rw-r--r--src/qt/bitcoingui.cpp5
-rw-r--r--src/qt/bitcoingui.h8
4 files changed, 16 insertions, 11 deletions
diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp
index e502d9bc31..7edf4b1ec6 100644
--- a/src/qt/addressbookpage.cpp
+++ b/src/qt/addressbookpage.cpp
@@ -190,10 +190,7 @@ void AddressBookPage::on_signMessage_clicked()
addr = address.toString();
}
- QObject *qoGUI = parent()->parent();
- BitcoinGUI *gui = qobject_cast<BitcoinGUI *>(qoGUI);
- if (gui)
- gui->gotoSignMessageTab(addr);
+ emit signMessage(addr);
}
void AddressBookPage::on_verifyMessage_clicked()
@@ -208,10 +205,7 @@ void AddressBookPage::on_verifyMessage_clicked()
addr = address.toString();
}
- QObject *qoGUI = parent()->parent();
- BitcoinGUI *gui = qobject_cast<BitcoinGUI *>(qoGUI);
- if (gui)
- gui->gotoVerifyMessageTab(addr);
+ emit verifyMessage(addr);
}
void AddressBookPage::on_newAddressButton_clicked()
diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h
index fae688fc9d..df87486949 100644
--- a/src/qt/addressbookpage.h
+++ b/src/qt/addressbookpage.h
@@ -76,6 +76,10 @@ private slots:
/** New entry/entries were added to address table */
void selectNewAddress(const QModelIndex &parent, int begin, int end);
+
+signals:
+ void signMessage(QString addr);
+ void verifyMessage(QString addr);
};
#endif // ADDRESSBOOKDIALOG_H
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 775d676ee5..53401b376f 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -165,6 +165,11 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
rpcConsole = new RPCConsole(this);
connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));
+ // Clicking on "Verify Message" in the address book sends you to the verify message tab
+ connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
+ // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
+ connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
+
gotoOverviewPage();
}
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 4a395012ee..9e0cd0c190 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -132,9 +132,6 @@ public slots:
void askFee(qint64 nFeeRequired, bool *payFee);
void handleURI(QString strURI);
- void gotoSignMessageTab(QString addr = "");
- void gotoVerifyMessageTab(QString addr = "");
-
private slots:
/** Switch to overview (home) page */
void gotoOverviewPage();
@@ -147,6 +144,11 @@ private slots:
/** Switch to send coins page */
void gotoSendCoinsPage();
+ /** Show Sign/Verify Message dialog and switch to sign message tab */
+ void gotoSignMessageTab(QString addr = "");
+ /** Show Sign/Verify Message dialog and switch to verify message tab */
+ void gotoVerifyMessageTab(QString addr = "");
+
/** Show configuration dialog */
void optionsClicked();
/** Show about dialog */