Commit 0ec67b8e authored by Thomas Baumgart's avatar Thomas Baumgart
Browse files

Maintain information in number field of schedules

The number field in schedules was cleared out when the payment method
was not 'write check'. This limitation has been removed.

FEATURE: 450965
FIXED-IN: 5.1.3
parent dcb4ef20
Pipeline #145825 passed with stage
in 7 minutes and 48 seconds
......@@ -313,17 +313,6 @@ TransactionEditor* KEditScheduleDlg::startEdit()
}
editor->setup(d->m_tabOrderWidgets, d->m_schedule.account(), action);
// if it's not a check, then we need to clear
// a possibly assigned check number
if (d->m_schedule.paymentType() != Schedule::PaymentType::WriteChecque) {
QWidget* w = editor->haveWidget("number");
if (w) {
if (auto numberWidget = dynamic_cast<KMyMoneyLineEdit*>(w)) {
numberWidget->loadText(QString());
}
}
}
Q_ASSERT(!d->m_tabOrderWidgets.isEmpty());
d->m_tabOrderWidgets.push_front(d->ui->m_paymentMethodEdit);
......@@ -385,9 +374,6 @@ TransactionEditor* KEditScheduleDlg::startEdit()
label->setText(i18n("Next due date"));
d->m_editor = editor;
slotSetPaymentMethod((int)d->m_schedule.paymentType());
connect(d->ui->m_paymentMethodEdit, &KMyMoneyGeneralCombo::itemSelected, this, &KEditScheduleDlg::slotSetPaymentMethod);
connect(editor, &TransactionEditor::operationTypeChanged, this, &KEditScheduleDlg::slotFilterPaymentType);
}
......@@ -681,20 +667,6 @@ void KEditScheduleDlg::slotPostDateChanged(const QDate& date)
}
}
void KEditScheduleDlg::slotSetPaymentMethod(int item)
{
Q_D(KEditScheduleDlg);
const bool isWriteCheck = item == (int)Schedule::PaymentType::WriteChecque;
if (auto numberEdit = dynamic_cast<KMyMoneyLineEdit*>(d->m_editor->haveWidget("number"))) {
numberEdit->setVisible(isWriteCheck);
// hiding the label does not work, because the label underneath will shine
// through. So we either write the label or a blank
if (auto label = dynamic_cast<QLabel *>(d->m_editor->haveWidget("number-label")))
label->setText(isWriteCheck ? i18n("Number") : QStringLiteral(" "));
}
}
void KEditScheduleDlg::slotFrequencyChanged(int item)
{
Q_D(KEditScheduleDlg);
......
......@@ -73,7 +73,6 @@ private Q_SLOTS:
void slotRemainingChanged(int);
void slotEndDateChanged(const QDate& date);
void slotPostDateChanged(const QDate& date);
void slotSetPaymentMethod(int);
void slotFrequencyChanged(int item);
void slotShowHelp();
void slotOccurrenceMultiplierChanged(int mult);
......
......@@ -307,12 +307,6 @@ TransactionEditor* KEnterScheduleDlg::startEdit()
if (w)
if (auto numberWidget = dynamic_cast<KMyMoneyLineEdit*>(w))
numberWidget->loadText(num);
} else {
// if it's not a check, then we need to clear
// a possibly assigned check number
if (w)
if (auto numberWidget = dynamic_cast<KMyMoneyLineEdit*>(w))
numberWidget->loadText(QString());
}
Q_ASSERT(!d->m_tabOrderWidgets.isEmpty());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment