mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-20 04:36:08 +01:00
qt: rework "receive coins" workflow
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user