From beb038e82d085b6a0ce61a3172a0874046b4da4d Mon Sep 17 00:00:00 2001 From: adityapk00 Date: Tue, 22 Jan 2019 20:42:26 -0800 Subject: [PATCH] Recurring Dialogs --- src/mainwindow.ui | 43 +++++--- src/newrecurring.ui | 216 +++++++++++++++++++++++++++++++++++++++++ src/recurring.cpp | 14 +++ src/recurring.h | 22 +++++ src/recurringdialog.ui | 92 ++++++++++++++++++ src/rpc.cpp | 8 +- zec-qt-wallet.pro | 10 +- 7 files changed, 387 insertions(+), 18 deletions(-) create mode 100644 src/newrecurring.ui create mode 100644 src/recurring.cpp create mode 100644 src/recurring.h create mode 100644 src/recurringdialog.ui diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 7e758d1..799fc90 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -22,7 +22,7 @@ - 2 + 1 @@ -346,8 +346,8 @@ 0 0 - 920 - 334 + 928 + 380 @@ -552,13 +552,6 @@ - - - - - - - @@ -572,6 +565,34 @@ + + + + + + + + + + + This transaction does not recur + + + + + + + Setup Recurring Payment + + + + + + + + + + @@ -992,7 +1013,7 @@ 0 0 968 - 22 + 19 diff --git a/src/newrecurring.ui b/src/newrecurring.ui new file mode 100644 index 0000000..d1b70fa --- /dev/null +++ b/src/newrecurring.ui @@ -0,0 +1,216 @@ + + + Dialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + To + + + + + + + From + + + + + + + Schedule + + + + + + + Number of payments + + + + + + + Amount + + + + + + + Next Payment + + + + + + + TextLabel + + + + + + + Payment Description + + + + + + + + + + + + Every + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + Forever + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/recurring.cpp b/src/recurring.cpp new file mode 100644 index 0000000..032794a --- /dev/null +++ b/src/recurring.cpp @@ -0,0 +1,14 @@ +#include "recurring.h" +#include "ui_recurringdialog.h" + +RecurringDialog::RecurringDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::RecurringDialog) +{ + ui->setupUi(this); +} + +RecurringDialog::~RecurringDialog() +{ + delete ui; +} diff --git a/src/recurring.h b/src/recurring.h new file mode 100644 index 0000000..2cc86ae --- /dev/null +++ b/src/recurring.h @@ -0,0 +1,22 @@ +#ifndef RECURRING_H +#define RECURRING_H + +#include + +namespace Ui { +class RecurringDialog; +} + +class RecurringDialog : public QDialog +{ + Q_OBJECT + +public: + explicit RecurringDialog(QWidget *parent = nullptr); + ~RecurringDialog(); + +private: + Ui::RecurringDialog *ui; +}; + +#endif // RECURRING_H diff --git a/src/recurringdialog.ui b/src/recurringdialog.ui new file mode 100644 index 0000000..c957d87 --- /dev/null +++ b/src/recurringdialog.ui @@ -0,0 +1,92 @@ + + + RecurringDialog + + + + 0 + 0 + 601 + 438 + + + + Dialog + + + + + + + + + + + Add + + + + + + + Edit + + + + + + + Delete + + + + + + + Qt::Vertical + + + QDialogButtonBox::Close + + + + + + + + + + + buttonBox + accepted() + RecurringDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + RecurringDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/rpc.cpp b/src/rpc.cpp index 1527502..738e3fa 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -535,6 +535,9 @@ void RPC::getInfoThenRefresh(bool force) { // Something changed, so refresh everything. lastBlock = curBlock; + // See if the turnstile migration has any steps that need to be done. + turnstile->executeMigrationStep(); + refreshBalances(); refreshAddresses(); // This calls refreshZSentTransactions() and refreshReceivedZTrans() refreshTransactions(); @@ -667,10 +670,7 @@ void RPC::refreshAddresses() { } // Function to create the data model and update the views, used below. -void RPC::updateUI(bool anyUnconfirmed) { - // See if the turnstile migration has any steps that need to be done. - turnstile->executeMigrationStep(); - +void RPC::updateUI(bool anyUnconfirmed) { ui->unconfirmedWarning->setVisible(anyUnconfirmed); // Update balances model data, which will update the table too diff --git a/zec-qt-wallet.pro b/zec-qt-wallet.pro index 730c9bd..1d9c835 100644 --- a/zec-qt-wallet.pro +++ b/zec-qt-wallet.pro @@ -51,7 +51,8 @@ SOURCES += \ src/fillediconlabel.cpp \ src/addressbook.cpp \ src/logger.cpp \ - src/addresscombo.cpp + src/addresscombo.cpp \ + src/recurring.cpp HEADERS += \ src/mainwindow.h \ @@ -71,7 +72,8 @@ HEADERS += \ src/fillediconlabel.h \ src/addressbook.h \ src/logger.h \ - src/addresscombo.h + src/addresscombo.h \ + src/recurring.h FORMS += \ src/mainwindow.ui \ @@ -84,7 +86,9 @@ FORMS += \ src/memodialog.ui \ src/connection.ui \ src/zboard.ui \ - src/addressbook.ui + src/addressbook.ui \ + src/recurringdialog.ui \ + src/newrecurring.ui TRANSLATIONS = res/zec_qt_wallet_es.ts \