From 25072c010e09cc311c95f070ec4a13be7eaa9c23 Mon Sep 17 00:00:00 2001 From: adityapk00 Date: Sat, 26 Jan 2019 21:38:44 -0800 Subject: [PATCH] Add to confirm dialog --- src/confirm.ui | 16 ++++++++++++++++ src/mainwindow.h | 2 +- src/sendtab.cpp | 15 +++++++++++++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/confirm.ui b/src/confirm.ui index e4e1a78..e7de7d7 100644 --- a/src/confirm.ui +++ b/src/confirm.ui @@ -133,6 +133,22 @@ + + + + Recurring Payment + + + + + + TextLabel + + + + + + diff --git a/src/mainwindow.h b/src/mainwindow.h index c4e2de3..d4e0458 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -68,7 +68,7 @@ private: void removeExtraAddresses(); Tx createTxFromSendPage(); - bool confirmTx(Tx tx); + bool confirmTx(Tx tx, RecurringPaymentInfo* rpi); void turnstileDoMigration(QString fromAddr = ""); void turnstileProgress(); diff --git a/src/sendtab.cpp b/src/sendtab.cpp index 6cbcdbd..bfa877f 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -108,6 +108,8 @@ void MainWindow::editSchedule() { } else { + delete this->sendTxRecurringInfo; + this->sendTxRecurringInfo = recurringInfo; ui->lblRecurDesc->setText(recurringInfo->getScheduleDescription()); } @@ -492,7 +494,7 @@ Tx MainWindow::createTxFromSendPage() { return tx; } -bool MainWindow::confirmTx(Tx tx) { +bool MainWindow::confirmTx(Tx tx, RecurringPaymentInfo* rpi) { auto fnSplitAddressForWrap = [=] (const QString& a) -> QString { if (!a.startsWith("z")) return a; @@ -616,6 +618,15 @@ bool MainWindow::confirmTx(Tx tx) { } } + // Recurring payment info + if (rpi == nullptr) { + confirm.grpRecurring->setVisible(false); + } + else { + confirm.grpRecurring->setVisible(true); + confirm.lblRecurringDesc->setText(rpi->getScheduleDescription()); + } + // Syncing warning confirm.syncingWarning->setVisible(Settings::getInstance()->isSyncing()); @@ -657,7 +668,7 @@ void MainWindow::sendButton() { } // Show a dialog to confirm the Tx - if (confirmTx(tx)) { + if (confirmTx(tx, sendTxRecurringInfo)) { // And send the Tx rpc->executeTransaction(tx, [=] (QString opid) {