Add post-confirmation screen
This commit is contained in:
@@ -489,8 +489,6 @@ bool MainWindow::confirmTx(Tx tx, RecurringPaymentInfo* rpi) {
|
||||
confirm.setupUi(&d);
|
||||
Settings::saveRestore(&d);
|
||||
|
||||
const QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
|
||||
|
||||
// Remove all existing address/amt qlabels on the confirm dialog.
|
||||
int totalConfirmAddrItems = confirm.sendToAddrs->children().size();
|
||||
for (int i = 0; i < totalConfirmAddrItems / 3; i++) {
|
||||
@@ -526,7 +524,6 @@ bool MainWindow::confirmTx(Tx tx, RecurringPaymentInfo* rpi) {
|
||||
Addr->setObjectName(QString("Addr") % QString::number(i + 1));
|
||||
Addr->setWordWrap(true);
|
||||
Addr->setText(fnSplitAddressForWrap(toAddr.addr));
|
||||
Addr->setFont(fixedFont);
|
||||
confirm.gridLayout->addWidget(Addr, row, 0, 1, 1);
|
||||
|
||||
// Amount (ZEC)
|
||||
@@ -644,11 +641,36 @@ void MainWindow::sendButton() {
|
||||
// Then delete the additional fields from the sendTo tab
|
||||
clearSendForm();
|
||||
|
||||
// Create a new Dialog to show that we are computing/sending the Tx
|
||||
auto d = new QDialog(this);
|
||||
auto connD = new Ui_ConnectionDialog();
|
||||
connD->setupUi(d);
|
||||
QPixmap logo(":/img/res/logobig.gif");
|
||||
connD->topIcon->setBasePixmap(logo.scaled(256, 256, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
|
||||
connD->status->setText(tr("Please wait..."));
|
||||
connD->statusDetail->setText(tr("Computing your transaction"));
|
||||
|
||||
d->show();
|
||||
|
||||
// And send the Tx
|
||||
rpc->executeTransaction(tx,
|
||||
[=] (QString txid) {
|
||||
ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid);
|
||||
|
||||
connD->status->setText(tr("Done!"));
|
||||
connD->statusDetail->setText(txid);
|
||||
|
||||
QTimer::singleShot(1000, [=]() {
|
||||
d->accept();
|
||||
d->close();
|
||||
delete connD;
|
||||
delete d;
|
||||
});
|
||||
|
||||
// Force a UI update so we get the unconfirmed Tx
|
||||
rpc->refresh(true);
|
||||
|
||||
// If this was a recurring payment, update the payment with the info
|
||||
if (!recurringPaymentHash.isEmpty()) {
|
||||
// Since this is the send button payment, this is the first payment
|
||||
@@ -659,6 +681,11 @@ void MainWindow::sendButton() {
|
||||
// Errored out
|
||||
[=] (QString opid, QString errStr) {
|
||||
ui->statusBar->showMessage(QObject::tr(" Tx ") % opid % QObject::tr(" failed"), 15 * 1000);
|
||||
|
||||
d->accept();
|
||||
d->close();
|
||||
delete connD;
|
||||
delete d;
|
||||
|
||||
if (!opid.isEmpty())
|
||||
errStr = QObject::tr("The transaction with id ") % opid % QObject::tr(" failed. The error was") + ":\n\n" + errStr;
|
||||
|
||||
Reference in New Issue
Block a user