diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-10-25 04:27:05 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-10-25 04:27:05 -0700 |
commit | 081c0cdeb2b8c1e8db449f3b38837c4ca3b4ba73 (patch) | |
tree | 21559f88288cda3543659d5c06622613284dfa3f /src/qt/walletview.cpp | |
parent | 48cc4fc326fa916954967580ca49c24044d55754 (diff) | |
parent | 70b14636cd60529c87b2cc61516f5d1bf49299a5 (diff) | |
download | bitcoin-081c0cdeb2b8c1e8db449f3b38837c4ca3b4ba73.tar.xz |
Merge pull request #3099 from laanwj/2013_10_new_receive_flow
qt: improve "receive coins" workflow
Diffstat (limited to 'src/qt/walletview.cpp')
-rw-r--r-- | src/qt/walletview.cpp | 41 |
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(); +} |