Commit 515b2bc1 authored by Cristian Oneț's avatar Cristian Oneț
Browse files

Fix any initial state of the loan editor represented by group buttons.

Use QAbstractButton::click instead of QAbstractButton::animateClick
to set the initial state of some values. This is needed because when
animateClick is used the value is only set after 100 ms thus possibly
overwriting any initial values set by KEditLoanWizard::loadWidgets
which is called immediately after creating the wizard pages (thus
before the click would actually occur).

This fixes the state of loan type ('lending' or 'borrowing') in the
wizard.

BUG: 343348
parent 8475926b
......@@ -44,5 +44,5 @@ EditSelectionWizardPage::EditSelectionWizardPage(QWidget *parent)
registerField("editOtherInfoButton", m_editOtherInfoButton);
registerField("editAttributesButton", m_editAttributesButton);
m_editInterestRateButton->animateClick();
m_editInterestRateButton->click();
}
......@@ -40,5 +40,5 @@ InterestCalculationWizardPage::InterestCalculationWizardPage(QWidget *parent)
registerField("interestOnReceptionButton", m_interestOnReceptionButton);
registerField("interestOnPaymentButton", m_interestOnPaymentButton);
m_interestOnReceptionButton->animateClick();
m_interestOnReceptionButton->click();
}
......@@ -40,5 +40,5 @@ InterestTypeWizardPage::InterestTypeWizardPage(QWidget *parent)
registerField("fixedInterestButton", m_fixedInterestButton);
registerField("variableInterestButton", m_variableInterestButton);
m_fixedInterestButton->animateClick();
m_fixedInterestButton->click();
}
......@@ -109,9 +109,9 @@ void KEditLoanWizard::loadWidgets(const MyMoneyAccount& /* account */)
//FIXME: port
if (m_account.fixedInterestRate()) {
m_interestTypePage->m_fixedInterestButton->animateClick();
m_interestTypePage->m_fixedInterestButton->click();
} else {
m_interestTypePage->m_variableInterestButton->animateClick();
m_interestTypePage->m_variableInterestButton->click();
}
QString institutionName = file->institution(m_account.institutionId()).name();
......
......@@ -41,5 +41,5 @@ LendBorrowWizardPage::LendBorrowWizardPage(QWidget *parent)
registerField("borrowButton", m_borrowButton);
registerField("lendButton", m_lendButton);
m_borrowButton->animateClick();
m_borrowButton->click();
}
......@@ -40,5 +40,5 @@ PreviousPaymentsWizardPage::PreviousPaymentsWizardPage(QWidget *parent)
registerField("noPreviousPaymentButton", m_noPreviousPaymentButton);
registerField("previousPaymentButton", m_previousPaymentButton);
m_noPreviousPaymentButton->animateClick();
m_noPreviousPaymentButton->click();
}
......@@ -40,11 +40,11 @@ RecordPaymentWizardPage::RecordPaymentWizardPage(QWidget *parent)
registerField("allPaymentsButton", m_allPaymentsButton);
registerField("thisYearPaymentButton", m_thisYearPaymentButton);
m_allPaymentsButton->animateClick();
m_allPaymentsButton->click();
}
void RecordPaymentWizardPage::initializePage()
{
if (field("noPreviousPaymentButton").toBool())
m_allPaymentsButton->animateClick();
m_allPaymentsButton->click();
}
Markdown is supported
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