Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/forecast/forecastview.cpp
- This file was added.
1 | /*************************************************************************** | ||||
---|---|---|---|---|---|
2 | forecastview.cpp | ||||
3 | ------------------- | ||||
4 | | ||||
5 | copyright : (C) 2018 by Łukasz Wojniłowicz | ||||
6 | email : lukasz.wojnilowicz@gmail.com | ||||
7 | ***************************************************************************/ | ||||
8 | | ||||
9 | /*************************************************************************** | ||||
10 | * * | ||||
11 | * This program is free software; you can redistribute it and/or modify * | ||||
12 | * it under the terms of the GNU General Public License as published by * | ||||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||||
14 | * (at your option) any later version. * | ||||
15 | * * | ||||
16 | ***************************************************************************/ | ||||
17 | | ||||
18 | #include "forecastview.h" | ||||
19 | | ||||
20 | // ---------------------------------------------------------------------------- | ||||
21 | // QT Includes | ||||
22 | | ||||
23 | // ---------------------------------------------------------------------------- | ||||
24 | // KDE Includes | ||||
25 | | ||||
26 | #include <KPluginFactory> | ||||
27 | #include <KLocalizedString> | ||||
28 | | ||||
29 | // ---------------------------------------------------------------------------- | ||||
30 | // Project Includes | ||||
31 | | ||||
32 | #include "viewinterface.h" | ||||
33 | #include "kforecastview.h" | ||||
34 | #include "kmymoneyglobalsettings.h" | ||||
35 | | ||||
36 | ForecastView::ForecastView(QObject *parent, const QVariantList &args) : | ||||
37 | KMyMoneyPlugin::Plugin(parent, "forecastview"/*must be the same as X-KDE-PluginInfo-Name*/) | ||||
38 | { | ||||
39 | Q_UNUSED(args) | ||||
40 | setComponentName("forecastview", i18n("Forecast view")); | ||||
41 | // For information, announce that we have been loaded. | ||||
42 | qDebug("Plugins: forecastview loaded"); | ||||
43 | } | ||||
44 | | ||||
45 | ForecastView::~ForecastView() | ||||
46 | { | ||||
47 | qDebug("Plugins: forecastview unloaded"); | ||||
48 | } | ||||
49 | | ||||
50 | void ForecastView::injectExternalSettings(KMyMoneySettings* p) | ||||
51 | { | ||||
52 | KMyMoneyGlobalSettings::injectExternalSettings(p); | ||||
53 | } | ||||
54 | | ||||
55 | void ForecastView::plug() | ||||
56 | { | ||||
57 | m_view = new KForecastView; | ||||
58 | viewInterface()->addView(m_view, i18n("Forecast"), View::Forecast); | ||||
59 | } | ||||
60 | | ||||
61 | void ForecastView::unplug() | ||||
62 | { | ||||
63 | viewInterface()->removeView(View::Forecast); | ||||
64 | } | ||||
65 | | ||||
66 | K_PLUGIN_FACTORY_WITH_JSON(ForecastViewFactory, "forecastview.json", registerPlugin<ForecastView>();) | ||||
67 | | ||||
68 | #include "forecastview.moc" |