aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletview.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-10-16 15:14:26 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2013-10-23 09:15:24 +0200
commit74fb765e29ed2b85ee7f6e61d16876c03b4abe9b (patch)
tree85f5c13d4a147c8deec135aa5eb576fb90c2fc1b /src/qt/walletview.cpp
parent58daa0162cb97209d87f3034a9351688a4631eac (diff)
qt: rework "receive coins" workflow
Diffstat (limited to 'src/qt/walletview.cpp')
-rw-r--r--src/qt/walletview.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp
index d7cef971ed..1b80ae34ed 100644
--- a/src/qt/walletview.cpp
+++ b/src/qt/walletview.cpp
@@ -9,6 +9,7 @@
#include "transactiontablemodel.h"
#include "addressbookpage.h"
#include "sendcoinsdialog.h"
+#include "receivecoinsdialog.h"
#include "signverifymessagedialog.h"
#include "clientmodel.h"
#include "walletmodel.h"
@@ -53,13 +54,11 @@ WalletView::WalletView(QWidget *parent):
vbox->addLayout(hbox_buttons);
transactionsPage->setLayout(vbox);
- addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
- receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
- sendCoinsPage = new SendCoinsDialog();
+ receiveCoinsPage = new ReceiveCoinsDialog(gui);
+ sendCoinsPage = new SendCoinsDialog(gui);
addWidget(overviewPage);
addWidget(transactionsPage);
- addWidget(addressBookPage);
addWidget(receiveCoinsPage);
addWidget(sendCoinsPage);
@@ -69,10 +68,6 @@ WalletView::WalletView(QWidget *parent):
// Double-clicking on a transaction on the transaction history page shows details
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
- // Clicking on "Send Coins" in the address book sends you to the send coins tab
- connect(addressBookPage, SIGNAL(sendCoins(QString)), this, SLOT(gotoSendCoinsPage(QString)));
- // Clicking on "Verify Message" in the address book opens the verify message tab in the Sign/Verify Message dialog
- connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
// Clicking on "Sign Message" in the receive coins page opens the sign message tab in the Sign/Verify Message dialog
connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
// Clicking on "Export" allows to export the transaction list
@@ -98,8 +93,6 @@ void WalletView::setClientModel(ClientModel *clientModel)
if (clientModel)
{
overviewPage->setClientModel(clientModel);
- addressBookPage->setOptionsModel(clientModel->getOptionsModel());
- receiveCoinsPage->setOptionsModel(clientModel->getOptionsModel());
}
}
@@ -114,8 +107,7 @@ void WalletView::setWalletModel(WalletModel *walletModel)
// Put transaction list in tabs
transactionView->setModel(walletModel);
overviewPage->setWalletModel(walletModel);
- addressBookPage->setModel(walletModel->getAddressTableModel());
- receiveCoinsPage->setModel(walletModel->getAddressTableModel());
+ receiveCoinsPage->setModel(walletModel);
sendCoinsPage->setModel(walletModel);
setEncryptionStatus();
@@ -156,11 +148,6 @@ void WalletView::gotoHistoryPage()
setCurrentWidget(transactionsPage);
}
-void WalletView::gotoAddressBookPage()
-{
- setCurrentWidget(addressBookPage);
-}
-
void WalletView::gotoReceiveCoinsPage()
{
setCurrentWidget(receiveCoinsPage);
@@ -270,3 +257,23 @@ void WalletView::unlockWallet()
dlg.exec();
}
}
+
+void WalletView::usedSendingAddresses()
+{
+ if(!walletModel)
+ return;
+ AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab, this);
+ dlg->setModel(walletModel->getAddressTableModel());
+ dlg->setAttribute(Qt::WA_DeleteOnClose);
+ dlg->show();
+}
+
+void WalletView::usedReceivingAddresses()
+{
+ if(!walletModel)
+ return;
+ AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this);
+ dlg->setModel(walletModel->getAddressTableModel());
+ dlg->setAttribute(Qt::WA_DeleteOnClose);
+ dlg->show();
+}