Commit 34e648df authored by Christian Dávid's avatar Christian Dávid
Browse files

Removed KBanking outbox

Two outboxes are one to much. The previous commits made the outbox
unnecessary.
parent b81ddc73
......@@ -4,15 +4,12 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/dialogs
${CMAKE_CURRENT_BINARY_DIR}/dialogs
${CMAKE_CURRENT_SOURCE_DIR}/views
${CMAKE_CURRENT_BINARY_DIR}/views
${CMAKE_CURRENT_SOURCE_DIR}/widgets
${CMAKE_CURRENT_BINARY_DIR}/widgets
${GWENHYWFAR_INCLUDE_DIRS}
${AQBANKING_INCLUDE_DIRS})
add_subdirectory( dialogs )
add_subdirectory( views )
add_subdirectory( widgets )
add_subdirectory( qml )
add_subdirectory( tasksettings )
......@@ -41,7 +38,6 @@ kde4_add_plugin(kmm_kbanking ${kmm_kbanking_PART_SRCS})
target_link_libraries(kmm_kbanking
kmm_kbanking_dialogs
kmm_kbanking_views
kmm_kbanking_widgets
kmm_kbanking_settings
kmm_kbanking_tasksettings
......
......@@ -2,6 +2,7 @@
* Copyright 2004 Martin Preuss aquamaniac@users.sourceforge.net *
* Copyright 2009 Cristian Onet onet.cristian@gmail.com *
* Copyright 2010 Thomas Baumgart ipwizard@users.sourceforge.net *
* Copyright 2015 Christian David christian-david@web.de *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
......@@ -78,7 +79,6 @@
#include "mymoney/onlinejob.h"
#include "kbjobview.h"
#include "kbaccountsettings.h"
#include "kbmapaccount.h"
#include "mymoneyfile.h"
......@@ -173,9 +173,6 @@ KBankingPlugin::KBankingPlugin(QObject *parent, const QVariantList&) :
// get certificate handling and dialog settings management
AB_Gui_Extend(gui->getCInterface(), m_kbanking->getCInterface());
// create view
createJobView();
// create actions
createActions();
......@@ -256,15 +253,6 @@ MyMoneyKeyValueContainer KBankingPlugin::onlineBankingSettings(const MyMoneyKeyV
return kvp;
}
void KBankingPlugin::createJobView(void)
{
KMyMoneyViewBase* view = viewInterface()->addPage(i18nc("Label for icon in KMyMoney's view pane", "Outbox"), "online-banking");
QWidget* w = new KBJobView(m_kbanking, this, view, "JobView");
viewInterface()->addWidget(view, w);
connect(viewInterface(), SIGNAL(viewStateChanged(bool)), view, SLOT(setEnabled(bool)));
connect(this, SIGNAL(queueChanged()), w, SLOT(slotQueueUpdated()));
}
void KBankingPlugin::createActions(void)
{
KAction *settings_aqbanking = actionCollection()->addAction("settings_aqbanking");
......
......@@ -92,11 +92,6 @@ public:
void sendOnlineJob(QList<onlineJob>& jobs);
private:
/**
* creates the job view and hooks it into the main view
*/
void createJobView(void);
/**
* creates the action objects available through the application menus
*/
......
########### next target ###############
set(kmm_kbanking_views_la_SOURCES
kbjobview.cpp
)
set(kmm_kbanking_views_UI
kbjobview.ui
)
kde4_add_ui_files(kmm_kbanking_views_la_SOURCES ${kmm_kbanking_views_UI})
kde4_add_library(kmm_kbanking_views STATIC ${kmm_kbanking_views_la_SOURCES})
target_link_libraries( kmm_kbanking_views
kmm_kbanking_dialogs
)
/***************************************************************************
* Copyright 2004 Martin Preuss aquamaniac@users.sourceforge.net *
* Copyright 2009 Cristian Onet onet.cristian@gmail.com *
* Copyright 2010 Thomas Baumgart ipwizard@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License or (at your option) version 3 or any later version *
* accepted by the membership of KDE e.V. (or its successor approved *
* by the membership of KDE e.V.), which shall act as a proxy *
* defined in Section 14 of version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/> *
***************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config-kmymoney.h>
#endif
#include "kbjobview.h"
#include <QEvent>
#include <QLayout>
#include <QToolTip>
#include <QHBoxLayout>
#include <QDebug>
#include <KPushButton>
#include <KGuiItem>
#include <KLocale>
#include <KGlobal>
#include <KIconLoader>
#include <KMessageBox>
#include <aqbanking/jobgetbalance.h>
#include <aqbanking/jobgettransactions.h>
#include <gwenhywfar/debug.h>
#include <ui_kbjobview.h>
struct KBJobView::Private {
Ui::KBJobView ui;
};
KBJobView::KBJobView(KMyMoneyBanking *kb,
KBankingPlugin *kbp,
QWidget* parent,
const char* name,
Qt::WFlags fl) :
QWidget(parent, fl),
d(new Private),
m_app(kb),
m_plugin(kbp)
{
assert(kb);
setObjectName(name);
d->ui.setupUi(this);
// Manually create and add layout here because the .ui-generated
// QGroupBox doesn't have one.
QBoxLayout *jobBoxLayout = new QHBoxLayout(d->ui.jobBox);
jobBoxLayout->setAlignment(Qt::AlignTop);
m_jobList = new KBJobListView(d->ui.jobBox);
jobBoxLayout->addWidget(m_jobList);
QObject::connect(d->ui.executeButton, SIGNAL(clicked()),
this, SLOT(slotExecute()));
QObject::connect(d->ui.dequeueButton, SIGNAL(clicked()),
this, SLOT(slotDequeue()));
connect(m_jobList, SIGNAL(itemSelectionChanged()),
this, SLOT(slotSelectionChanged()));
// add some icons to the buttons
KIconLoader* il = KIconLoader::global();
KGuiItem dequeueItem(i18n("Dequeue"),
KIcon(il->loadIcon("edit-delete-shred", KIconLoader::Small, KIconLoader::SizeSmall)),
i18n("Dequeue selected job"),
i18n("Remove the selected job from the list"));
KGuiItem executeItem(i18n("Execute"),
KIcon(il->loadIcon("system-run", KIconLoader::Small, KIconLoader::SizeSmall)),
i18n("Execute all jobs in the queue"),
i18n("Execute all jobs in the queue"));
d->ui.dequeueButton->setGuiItem(dequeueItem);
d->ui.executeButton->setGuiItem(executeItem);
d->ui.dequeueButton->setToolTip(dequeueItem.toolTip());
d->ui.executeButton->setToolTip(executeItem.toolTip());
d->ui.dequeueButton->setEnabled(false);
d->ui.executeButton->setEnabled(false);
#ifdef CHIPTAN_INPUT_TEST
KPushButton* chipTanButton = new KPushButton("Open ChipTan Input", this);
d->ui.buttonLayout->addWidget(chipTanButton);
connect(chipTanButton, SIGNAL(clicked()), this, SLOT(slotOpenChipTanInput()));
#endif
}
#ifdef CHIPTAN_INPUT_TEST
#include "chiptandialog.h"
void KBJobView::slotOpenChipTanInput()
{
chipTanDialog dialog;
dialog.setHhdCode("1042481200");
dialog.setInfoText("This function is for debug purposes only. You can enter a tan which is between three and six characters long.");
dialog.setTanLimits(3,6);
dialog.exec();
}
#endif
KBJobView::~KBJobView()
{
delete d;
}
void KBJobView::slotSelectionChanged(void)
{
d->ui.dequeueButton->setEnabled(false);
if (m_jobList->currentItem())
d->ui.dequeueButton->setEnabled(m_jobList->currentItem()->isSelected() != 0);
}
bool KBJobView::init()
{
slotQueueUpdated();
return true;
}
bool KBJobView::fini()
{
return true;
}
void KBJobView::slotQueueUpdated()
{
DBG_NOTICE(0, "Job queue updated");
m_jobList->clear();
std::list<AB_JOB*> jl;
jl = m_app->getEnqueuedJobs();
m_jobList->addJobs(jl);
d->ui.executeButton->setEnabled(jl.size() > 0);
slotSelectionChanged();
}
void KBJobView::slotExecute()
{
if (m_app->getEnqueuedJobs().size() == 0) {
KMessageBox::warningContinueCancel(this,
i18nc("Warning message", "There are no jobs in the queue."),
i18nc("Message title", "No Jobs"));
return;
}
DBG_NOTICE(0, "Executing queue");
AB_IMEXPORTER_CONTEXT *ctx;
ctx = AB_ImExporterContext_new();
int rv = m_app->executeQueue(ctx);
if (rv == 0)
m_app->importContext(ctx, 0);
else {
DBG_ERROR(0, "Error: %d", rv);
}
AB_ImExporterContext_free(ctx);
}
void KBJobView::slotDequeue()
{
KBJobListViewItem* p = dynamic_cast<KBJobListViewItem*>(m_jobList->currentItem());
if (p && p->isSelected()) {
AB_JOB* job = p->getJob();
if (job) {
m_app->dequeueJob(job);
}
}
}
/***************************************************************************
* Copyright 2009 Cristian Onet onet.cristian@gmail.com *
* Copyright 2004 Martin Preuss aquamaniac@users.sourceforge.net *
* Copyright 2010 Thomas Baumgart ipwizard@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License or (at your option) version 3 or any later version *
* accepted by the membership of KDE e.V. (or its successor approved *
* by the membership of KDE e.V.), which shall act as a proxy *
* defined in Section 14 of version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/> *
***************************************************************************/
#ifndef KBANKING_KBJOBVIEW_H
#define KBANKING_KBJOBVIEW_H
#include <QWidget>
class KBJobView;
class KBankingPlugin;
#include "kbjoblist.h"
#include "mymoneybanking.h"
/* For easier debugging and testing this makro adds a button to open the chiptan dialog */
#define CHIPTAN_INPUT_TEST
class KBJobView: public QWidget
{
Q_OBJECT
public:
/** @todo if transfer can detect plugin by itself, remove KBankingPlugin param */
explicit KBJobView(KMyMoneyBanking *kb, KBankingPlugin *kbp,
QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0);
~KBJobView();
bool init();
bool fini();
private:
/// \internal d-pointer class.
struct Private;
/// \internal d-pointer instance.
Private* const d;
KMyMoneyBanking *m_app;
KBankingPlugin *m_plugin;
KBJobListView *m_jobList;
protected slots:
void slotQueueUpdated();
void slotExecute();
void slotDequeue();
void slotSelectionChanged();
#ifdef CHIPTAN_INPUT_TEST
void slotOpenChipTanInput();
#endif
};
#endif /* KBANKING_KBJOBVIEW_H */
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KBJobView</class>
<widget class="QWidget" name="KBJobView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>744</width>
<height>484</height>
</rect>
</property>
<property name="windowTitle">
<string>Jobs</string>
</property>
<layout class="QHBoxLayout">
<item>
<widget class="QGroupBox" name="jobBox">
<property name="title">
<string>Jobs</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="buttonLayout">
<item>
<widget class="KPushButton" name="dequeueButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Dequeue</string>
</property>
</widget>
</item>
<item>
<widget class="KPushButton" name="executeButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Execute</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>241</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
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