Browse Source

remove recurring from ui Issue #77

pull/130/head
DenioD 4 years ago
parent
commit
f46068681c
  1. 31
      src/mainwindow.ui
  2. 66
      src/sendtab.cpp

31
src/mainwindow.ui

@ -59,7 +59,7 @@
<item row="0" column="0" colspan="2">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>5</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -426,7 +426,7 @@
<x>0</x>
<y>0</y>
<width>1226</width>
<height>488</height>
<height>493</height>
</rect>
</property>
<layout class="QVBoxLayout" name="sendToLayout">
@ -611,33 +611,6 @@
</item>
<item>
<layout class="QHBoxLayout" name="layoutSendRecurring">
<item>
<widget class="QCheckBox" name="chkRecurring">
<property name="text">
<string>Recurring payment</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblRecurDesc">
<property name="text">
<string>Every month, starting 12-May-2012, for 6 payments</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnRecurSchedule">
<property name="text">
<string>Edit Schedule</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">

66
src/sendtab.cpp

@ -138,7 +138,7 @@ void MainWindow::setupSendTab() {
ui->MemoTxt1->setFont(f);
// Recurring button
QObject::connect(ui->chkRecurring, &QCheckBox::stateChanged, [=] (int checked) {
/*QObject::connect(ui->chkRecurring, &QCheckBox::stateChanged, [=] (int checked) {
if (checked) {
ui->btnRecurSchedule->setEnabled(true);
@ -150,23 +150,23 @@ void MainWindow::setupSendTab() {
ui->btnRecurSchedule->setEnabled(false);
ui->lblRecurDesc->setText("");
}
});
});*/
// Recurring schedule button
QObject::connect(ui->btnRecurSchedule, &QPushButton::clicked, this, &MainWindow::editSchedule);
// QObject::connect(ui->btnRecurSchedule, &QPushButton::clicked, this, &MainWindow::editSchedule);
// Set the default state for the whole page
clearSendForm();
}
void MainWindow::disableRecurring() {
if (!Settings::getInstance()->isTestnet()) {
/* if (!Settings::getInstance()->isTestnet()) {
ui->chkRecurring->setVisible(false);
ui->chkRecurring->setEnabled(false);
ui->btnRecurSchedule->setVisible(false);
ui->btnRecurSchedule->setEnabled(false);
ui->action_Recurring_Payments->setVisible(false);
}
ui->action_Recurring_Payments->setVisible(false);*/
// }
}
void MainWindow::editSchedule() {
@ -185,21 +185,21 @@ void MainWindow::editSchedule() {
}
// Open the edit schedule dialog
auto recurringInfo = Recurring::getInstance()->getNewRecurringFromTx(this, this,
createTxFromSendPage(), this->sendTxRecurringInfo);
if (recurringInfo == nullptr) {
// auto recurringInfo = Recurring::getInstance()->getNewRecurringFromTx(this, this,
// createTxFromSendPage(), this->sendTxRecurringInfo);
// if (recurringInfo == nullptr) {
// User pressed cancel.
// If there is no existing recurring info, uncheck the recurring box
if (sendTxRecurringInfo == nullptr) {
ui->chkRecurring->setCheckState(Qt::Unchecked);
}
}
else {
delete this->sendTxRecurringInfo;
// if (sendTxRecurringInfo == nullptr) {
// ui->chkRecurring->setCheckState(Qt::Unchecked);
// }
// }
// else {
// delete this->sendTxRecurringInfo;
this->sendTxRecurringInfo = recurringInfo;
ui->lblRecurDesc->setText(recurringInfo->getScheduleDescription());
}
// this->sendTxRecurringInfo = recurringInfo;
// ui->lblRecurDesc->setText(recurringInfo->getScheduleDescription());
//}
}
void MainWindow::updateLabelsAutoComplete() {
@ -311,11 +311,11 @@ void MainWindow::addAddressSection() {
// Disable recurring payments if a address section is added, since recurring payments
// aren't supported for more than 1 address
delete sendTxRecurringInfo;
sendTxRecurringInfo = nullptr;
ui->lblRecurDesc->setText("");
ui->chkRecurring->setChecked(false);
ui->chkRecurring->setEnabled(false);
// delete sendTxRecurringInfo;
// sendTxRecurringInfo = nullptr;
// ui->lblRecurDesc->setText("");
// ui->chkRecurring->setChecked(false);
// ui->chkRecurring->setEnabled(false);
// Set focus into the address
Address1->setFocus();
@ -358,10 +358,10 @@ void MainWindow::amountChanged(int item, const QString& text) {
}
// If there is a recurring payment, update the info there as well
if (sendTxRecurringInfo != nullptr) {
Recurring::getInstance()->updateInfoWithTx(sendTxRecurringInfo, createTxFromSendPage());
ui->lblRecurDesc->setText(sendTxRecurringInfo->getScheduleDescription());
}
//if (sendTxRecurringInfo != nullptr) {
// Recurring::getInstance()->updateInfoWithTx(sendTxRecurringInfo, createTxFromSendPage());
// ui->lblRecurDesc->setText(sendTxRecurringInfo->getScheduleDescription());
// }
}
void MainWindow::setMemoEnabled(int number, bool enabled) {
@ -457,14 +457,14 @@ void MainWindow::clearSendForm() {
// Reset the recurring button
if (Settings::getInstance()->isTestnet()) {
ui->chkRecurring->setEnabled(true);
// ui->chkRecurring->setEnabled(true);
}
ui->chkRecurring->setCheckState(Qt::Unchecked);
ui->btnRecurSchedule->setEnabled(false);
ui->lblRecurDesc->setText("");
delete sendTxRecurringInfo;
sendTxRecurringInfo = nullptr;
// ui->chkRecurring->setCheckState(Qt::Unchecked);
// ui->btnRecurSchedule->setEnabled(false);
// ui->lblRecurDesc->setText("");
// delete sendTxRecurringInfo;
// sendTxRecurringInfo = nullptr;
}
void MainWindow::maxAmountChecked(int checked) {

Loading…
Cancel
Save