-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This implements a three step wizard that leads the user through the process of selecting inputs, selecting a destination, and then reviewing the overall transaction. Select Inputs: The select inputs screen uses similar code to that in coincontroldialog to support the consolidate button there. Pointers to the coincontrol data structures constructed in sendcoinsdialog are passed into both coincontrol and the consolidateunspentwizard to faciliate using the underlying machinery in a unified manner. This is possible because both coincontrol and consolidateunspendwizard are called with the sendcoinsdialog and are modal. Note that there is a stop sign and the next button is disabled if more than 600 outputs are selected. The next button is also disabled if less than 2 outputs are selected (as it makes no sense to consolidate when there is no consolidation achievable based on the selection). If a filter operation is applied based on the filter criteria, and that criteria would result in more than 600 inputs being selected, the selection is reduced to 600 inputs and a warning triangle is presented. Select Destination Address: If all of the inputs selected in the prior page are from one address, then that address will already be preselected (but allow the opportunity for it to be changed by the user prior to pressing next). If the inputs selected correspond to more than one address, an address will NOT be pre-selected, and the user will be required to pick an address to proceed. The next button will be disabled until a valid address is selected for the destination. Confirmation: The final screen presents the details of the intended transaction for review by the user. When the "Finish" button is pressed, the transaction to send is filled in in the send dialog sreen, and the user can review the details again if desired and press the send button to send.
- Loading branch information
1 parent
851744b
commit e17906a
Showing
19 changed files
with
1,956 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#include "coincontroldialog.h" | ||
#include "consolidateunspentwizard.h" | ||
#include "consolidateunspentdialog.h" | ||
#include "ui_consolidateunspentwizard.h" | ||
|
||
#include "util.h" | ||
|
||
|
||
ConsolidateUnspentWizard::ConsolidateUnspentWizard(QWidget *parent, | ||
CCoinControl *coinControl, | ||
QList<qint64> *payAmounts, | ||
size_t inputSelectionLimit) : | ||
QWizard(parent), | ||
ui(new Ui::ConsolidateUnspentWizard), | ||
coinControl(coinControl), | ||
payAmounts(payAmounts), | ||
m_inputSelectionLimit(inputSelectionLimit) | ||
{ | ||
ui->setupUi(this); | ||
this->setStartId(SelectInputsPage); | ||
|
||
ui->selectInputsPage->setCoinControl(coinControl); | ||
ui->selectInputsPage->setPayAmounts(payAmounts); | ||
|
||
connect(this, SIGNAL(setModelSignal(WalletModel*)), ui->selectInputsPage, SLOT(setModel(WalletModel*))); | ||
connect(this, SIGNAL(setModelSignal(WalletModel*)), ui->sendPage, SLOT(setModel(WalletModel*))); | ||
|
||
connect(ui->selectInputsPage, SIGNAL(setAddressListSignal(std::map<QString, QString>)), | ||
ui->selectDestinationPage, SLOT(SetAddressList(const std::map<QString, QString>))); | ||
|
||
connect(ui->selectInputsPage, SIGNAL(setDefaultAddressSignal(QString)), | ||
ui->selectDestinationPage, SLOT(setDefaultAddressSelection(QString))); | ||
|
||
connect(this->button(QWizard::FinishButton), SIGNAL(clicked()), ui->sendPage, SLOT(onFinishButtonClicked())); | ||
connect(ui->sendPage, SIGNAL(selectedConsolidationRecipientSignal(SendCoinsRecipient)), | ||
this, SIGNAL(selectedConsolidationRecipientSignal(SendCoinsRecipient))); | ||
} | ||
|
||
ConsolidateUnspentWizard::~ConsolidateUnspentWizard() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void ConsolidateUnspentWizard::accept() | ||
{ | ||
QDialog::accept(); | ||
//emit sendConsolidationTransactionSignal(); | ||
} | ||
|
||
void ConsolidateUnspentWizard::setModel(WalletModel *model) | ||
{ | ||
this->model = model; | ||
emit setModelSignal(model); | ||
} | ||
|
||
WalletModel* ConsolidateUnspentWizard::getModel() | ||
{ | ||
return this->model; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#ifndef CONSOLIDATEUNSPENTWIZARD_H | ||
#define CONSOLIDATEUNSPENTWIZARD_H | ||
|
||
#include "walletmodel.h" | ||
|
||
#include <QDialogButtonBox> | ||
#include <QDialog> | ||
#include <QWizard> | ||
#include <QString> | ||
#include <QLabel> | ||
|
||
namespace Ui { | ||
class ConsolidateUnspentWizard; | ||
} | ||
|
||
class CoinControlDialog; | ||
|
||
class ConsolidateUnspentWizard : public QWizard | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
enum Pages | ||
{ | ||
SelectInputsPage, | ||
SelectDestinationPage, | ||
SendPage | ||
}; | ||
|
||
explicit ConsolidateUnspentWizard(QWidget *parent = nullptr, | ||
CCoinControl *coinControl = nullptr, | ||
QList<qint64> *payAmounts = nullptr, | ||
size_t inputSelectionLimit = 600); | ||
~ConsolidateUnspentWizard(); | ||
|
||
void setModel(WalletModel *model); | ||
WalletModel* getModel(); | ||
|
||
void accept() override; | ||
|
||
signals: | ||
void setModelSignal(WalletModel*); | ||
void passCoinControlSignal(CCoinControl*); | ||
void selectedConsolidationRecipientSignal(SendCoinsRecipient); | ||
void sendConsolidationTransactionSignal(); | ||
|
||
private: | ||
Ui::ConsolidateUnspentWizard *ui; | ||
CCoinControl *coinControl; | ||
QList<qint64> *payAmounts; | ||
WalletModel *model; | ||
|
||
size_t m_inputSelectionLimit; | ||
}; | ||
|
||
#endif // CONSOLIDATEUNSPENTWIZARD_H |
Oops, something went wrong.