Commit 533c9804 authored by Christian Dávid's avatar Christian Dávid
Browse files

Removed the ability to queue account updates of KBanking plugin

This is needed as the KBanking outbox will be removed (two outboxes are
confusing). Later this function is added again on KMyMoney side (but the
update operation must become a onlineJob first).
parent c93d2fd9
......@@ -52,7 +52,6 @@ void KBAccountSettings::loadUi(const MyMoneyKeyValueContainer& kvp)
{
d->ui.m_usePayeeAsIsButton->setChecked(true);
d->ui.m_transactionDownload->setChecked(kvp.value("kbanking-txn-download") != "no");
d->ui.m_preferredJobMethod->setCurrentIndex(kvp.value("kbanking-jobexec").toInt());
d->ui.m_preferredStatementDate->setCurrentIndex(kvp.value("kbanking-statementDate").toInt());
if (!kvp.value("kbanking-payee-regexp").isEmpty()) {
d->ui.m_extractPayeeButton->setChecked(true);
......@@ -69,6 +68,9 @@ void KBAccountSettings::loadKvp(MyMoneyKeyValueContainer& kvp)
kvp.deletePair("kbanking-memo-regexp");
kvp.deletePair("kbanking-payee-exceptions");
kvp.deletePair("kbanking-txn-download");
// The key "kbanking-jobexec" is not used since version 4.8 anymore
kvp.deletePair("kbanking-jobexec");
if (d->ui.m_extractPayeeButton->isChecked()
&& !d->ui.m_payeeRegExpEdit->text().isEmpty()
&& !d->ui.m_memoRegExpEdit->text().isEmpty()) {
......@@ -80,6 +82,5 @@ void KBAccountSettings::loadKvp(MyMoneyKeyValueContainer& kvp)
}
if (!d->ui.m_transactionDownload->isChecked())
kvp["kbanking-txn-download"] = "no";
kvp["kbanking-jobexec"] = QString("%1").arg(d->ui.m_preferredJobMethod->currentIndex());
kvp["kbanking-statementDate"] = QString("%1").arg(d->ui.m_preferredStatementDate->currentIndex());
}
......@@ -136,39 +136,7 @@
</item>
<item>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="textLabel1_2">
<property name="text">
<string>Default method for jobs for this institution</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="m_preferredJobMethod">
<property name="currentItem" stdset="0">
<number>0</number>
</property>
<item>
<property name="text">
<string>Ask user</string>
</property>
</item>
<item>
<property name="text">
<string>Execute</string>
</property>
</item>
<item>
<property name="text">
<string>Queue</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="m_preferredStatementDate">
<item>
<property name="text">
......@@ -192,13 +160,13 @@
</item>
</widget>
</item>
<item row="1" column="0">
<item row="0" column="0">
<widget class="QLabel" name="textLabel2_2">
<property name="text">
<string>Default start date for statement download</string>
</property>
<property name="wordWrap">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
......@@ -249,16 +217,16 @@
<extends>QGroupBox</extends>
<header>keditlistbox.h</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KTabWidget</class>
<extends>QTabWidget</extends>
......
......@@ -497,6 +497,7 @@ bool KBankingPlugin::updateAccount(const MyMoneyAccount& acc, bool moreAccounts)
if (psd->exec() != QDialog::Accepted) {
AB_Job_free(job);
delete psd;
/** @todo do not return here but check if something is in the queue which has to be executed */
return rc;
}
qd = psd->date();
......@@ -546,45 +547,8 @@ bool KBankingPlugin::updateAccount(const MyMoneyAccount& acc, bool moreAccounts)
// make sure, we have at least one job in the queue before we continue.
if (m_kbanking->getEnqueuedJobs().size() > 0) {
emit queueChanged();
// ask if the user want's to execute this job right away or spool it
// for later execution
KIconLoader *ic = KIconLoader::global();
KGuiItem executeButton(i18n("&Execute"),
KIcon(ic->loadIcon("tools-wizard",
KIconLoader::Small, KIconLoader::SizeSmall)),
i18n("Close this window"),
i18n("Use this button to close the window"));
KGuiItem queueButton(i18n("&Queue"),
KIcon(ic->loadIcon("document-export",
KIconLoader::Small, KIconLoader::SizeSmall)),
i18n("Close this window"),
i18n("Use this button to close the window"));
KMessageBox::ButtonCode result = KMessageBox::Cancel;
if (!moreAccounts) {
switch (acc.onlineBankingSettings().value("kbanking-jobexec").toInt()) {
case 1:
result = KMessageBox::Yes;
break;
case 2:
result = KMessageBox::No;
break;
default:
result = static_cast<KMessageBox::ButtonCode>(KMessageBox::questionYesNo(0,
i18n("Do you want to execute or queue this job in the outbox?"),
i18n("Execution"), executeButton, queueButton));
break;
}
} else {
result = KMessageBox::No;
}
if (result == KMessageBox::Yes) {
if (!moreAccounts)
executeQueue();
}
rc = true;
}
}
......
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