File indexing completed on 2024-06-09 05:03:31

0001 /*
0002     SPDX-FileCopyrightText: 2010 Fernando Vilas <kmymoney-devel@kde.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #include "interesteditwizardpage.h"
0007 
0008 // ----------------------------------------------------------------------------
0009 // QT Includes
0010 
0011 
0012 // ----------------------------------------------------------------------------
0013 // KDE Includes
0014 
0015 
0016 // ----------------------------------------------------------------------------
0017 // Project Includes
0018 
0019 #include "ui_interesteditwizardpage.h"
0020 
0021 InterestEditWizardPage::InterestEditWizardPage(QWidget *parent)
0022     : QWizardPage(parent),
0023       ui(new Ui::InterestEditWizardPage)
0024 {
0025     ui->setupUi(this);
0026 
0027     // Register the fields with the QWizard and connect the
0028     // appropriate signals to update the "Next" button correctly
0029     registerField("newInterestRateEdit", ui->m_newInterestRateEdit, "value", SIGNAL(textChanged(QString)));
0030     connect(ui->m_newInterestRateEdit, &AmountEdit::textChanged, this, &QWizardPage::completeChanged);
0031 
0032     ui->m_newInterestRateEdit->setAllowEmpty(true);
0033 }
0034 
0035 InterestEditWizardPage::~InterestEditWizardPage()
0036 {
0037     delete ui;
0038 }
0039 
0040 /**
0041  * Update the "Next" button
0042  */
0043 bool InterestEditWizardPage::isComplete() const
0044 {
0045     //FIXME: this only exists in the EditLoanWizard subclass
0046     return field("newPaymentEditValid").toBool()
0047            || ui->m_newInterestRateEdit->isValid();
0048 }