[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [akregator] /: Add plugins settings for the future
From:       Montel Laurent <montel () kde ! org>
Date:       2016-09-09 21:27:30
Message-ID: E1biTKc-0003ms-4O () code ! kde ! org
[Download RAW message or body]

Git commit 6b8766c5156993ab44f38631a9f830e9bb847937 by Montel Laurent.
Committed on 09/09/2016 at 21:27.
Pushed by mlaurent into branch 'master'.

Add plugins settings for the future

M  +27   -5    configuration/CMakeLists.txt
A  +66   -0    configuration/akregator_config_plugins.cpp     [License: GPL (v2+)]
A  +14   -0    configuration/akregator_config_plugins.desktop
A  +44   -0    configuration/akregator_config_plugins.h     [License: GPL (v2+)]
M  +1    -0    src/akregator_part.cpp

http://commits.kde.org/akregator/6b8766c5156993ab44f38631a9f830e9bb847937

diff --git a/configuration/CMakeLists.txt b/configuration/CMakeLists.txt
index ab4bae7..61bd5f6 100644
--- a/configuration/CMakeLists.txt
+++ b/configuration/CMakeLists.txt
@@ -20,7 +20,7 @@ target_link_libraries(akregator_config_general
     )
 
 install(FILES akregator_config_general.desktop DESTINATION \
                ${KDE_INSTALL_KSERVICES5DIR})
-kcoreaddons_desktop_to_json(akregator_config_general \
akregator_config_general.desktop DEFAULT_SERVICE_TYPE) \
+kcoreaddons_desktop_to_json(akregator_config_general \
akregator_config_general.desktop SERVICE_TYPES kcmodule.desktop)  install(TARGETS \
akregator_config_general DESTINATION ${KDE_INSTALL_PLUGINDIR})  
 ########### next target ###############
@@ -37,7 +37,7 @@ target_link_libraries(akregator_config_appearance
     KF5::I18n
     )
 
-kcoreaddons_desktop_to_json(akregator_config_appearance \
akregator_config_appearance.desktop DEFAULT_SERVICE_TYPE) \
+kcoreaddons_desktop_to_json(akregator_config_appearance \
akregator_config_appearance.desktop SERVICE_TYPES kcmodule.desktop)  install(FILES \
akregator_config_appearance.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})  \
install(TARGETS akregator_config_appearance DESTINATION ${KDE_INSTALL_PLUGINDIR})  
@@ -72,7 +72,7 @@ target_link_libraries(akregator_config_browser
     KF5::I18n
 
     )
-kcoreaddons_desktop_to_json(akregator_config_browser \
akregator_config_browser.desktop DEFAULT_SERVICE_TYPE) \
+kcoreaddons_desktop_to_json(akregator_config_browser \
akregator_config_browser.desktop SERVICE_TYPES kcmodule.desktop)  
 install(FILES akregator_config_browser.desktop DESTINATION \
${KDE_INSTALL_KSERVICES5DIR})  install(TARGETS akregator_config_browser DESTINATION \
${KDE_INSTALL_PLUGINDIR}) @@ -95,7 +95,7 @@ \
target_link_libraries(akregator_config_advanced  KF5::I18n
     )
 
-kcoreaddons_desktop_to_json(akregator_config_advanced \
akregator_config_advanced.desktop DEFAULT_SERVICE_TYPE) \
+kcoreaddons_desktop_to_json(akregator_config_advanced \
akregator_config_advanced.desktop SERVICE_TYPES kcmodule.desktop)  install(FILES \
akregator_config_advanced.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})  \
install(TARGETS akregator_config_advanced DESTINATION ${KDE_INSTALL_PLUGINDIR})  
@@ -116,6 +116,28 @@ target_link_libraries(akregator_config_webengineurlinterceptor
     KF5::WebEngineViewer
     )
 
-kcoreaddons_desktop_to_json(akregator_config_webengineurlinterceptor \
akregator_config_webengineurlinterceptor.desktop DEFAULT_SERVICE_TYPE) \
+kcoreaddons_desktop_to_json(akregator_config_webengineurlinterceptor \
akregator_config_webengineurlinterceptor.desktop SERVICE_TYPES kcmodule.desktop)  \
install(FILES akregator_config_webengineurlinterceptor.desktop DESTINATION \
${KDE_INSTALL_KSERVICES5DIR})  install(TARGETS \
akregator_config_webengineurlinterceptor DESTINATION ${KDE_INSTALL_PLUGINDIR}) +
+
+########### next target ###############
+
+set(kcm_config_plugins_SRCS
+    akregator_config_plugins.cpp
+    )
+
+add_library(akregator_config_plugins MODULE ${kcm_config_plugins_SRCS})
+
+target_link_libraries(akregator_config_plugins
+    akregatorinterfaces
+    KF5::KCMUtils
+    KF5::I18n
+    KF5::IconThemes
+    KF5::WebEngineViewer
+    )
+
+kcoreaddons_desktop_to_json(akregator_config_plugins \
akregator_config_plugins.desktop SERVICE_TYPES kcmodule.desktop) +install(FILES \
akregator_config_plugins.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) \
+install(TARGETS akregator_config_plugins DESTINATION ${KDE_INSTALL_PLUGINDIR}) +
diff --git a/configuration/akregator_config_plugins.cpp \
b/configuration/akregator_config_plugins.cpp new file mode 100644
index 0000000..846a444
--- /dev/null
+++ b/configuration/akregator_config_plugins.cpp
@@ -0,0 +1,66 @@
+/*
+   Copyright (C) 2016 Montel Laurent <montel@kde.org>
+
+   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) any later version.
+
+   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; see the file COPYING.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#include "akregator_config_plugins.h"
+#include "akregatorconfig.h"
+#include <KAboutData>
+#include <KPluginFactory>
+#include <KLocalizedString>
+
+#include <QVBoxLayout>
+
+using namespace Akregator;
+
+K_PLUGIN_FACTORY(KCMAkregatorPluginsConfigFactory, \
registerPlugin<KCMAkregatorPluginsConfig>();) +
+KCMAkregatorPluginsConfig::KCMAkregatorPluginsConfig(QWidget *parent, const \
QVariantList &args) +    : KCModule(parent, args)
+{
+    QHBoxLayout *lay = new QHBoxLayout(this);
+    lay->setMargin(0);
+
+    KAboutData *about = new KAboutData(QStringLiteral("kcmakrpluginsconfig"),
+                                       i18n("Configure Plugins"),
+                                       QString(), QString(), KAboutLicense::GPL,
+                                       i18n("(c), 2016 Laurent Montel"));
+
+    about->addAuthor(i18n("Laurent Montel"), QString(), \
QStringLiteral("montel@kde.org")); +
+    setAboutData(about);
+    //TODO
+}
+
+void KCMAkregatorPluginsConfig::slotConfigChanged()
+{
+    Q_EMIT changed(true);
+}
+
+void KCMAkregatorPluginsConfig::save()
+{
+}
+
+void KCMAkregatorPluginsConfig::load()
+{
+}
+
+void KCMAkregatorPluginsConfig::defaults()
+{
+}
+
+#include "akregator_config_plugins.moc"
diff --git a/configuration/akregator_config_plugins.desktop \
b/configuration/akregator_config_plugins.desktop new file mode 100644
index 0000000..6180c5c
--- /dev/null
+++ b/configuration/akregator_config_plugins.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Icon=preferences-plugin
+Type=Service
+X-KDE-ServiceTypes=KCModule
+
+X-KDE-Library=akregator_config_plugins
+X-KDE-ParentApp=akregator
+X-KDE-ParentComponents=akregator,kontact_akregatorplugin
+X-KDE-CfgDlgHierarchy=Akregator
+X-KDE-Weight=100
+
+Name=Plugins
+Comment=Configure Plugins
+X-KDE-Keywords=akregator, configure, settings, webEngine, plugins
diff --git a/configuration/akregator_config_plugins.h \
b/configuration/akregator_config_plugins.h new file mode 100644
index 0000000..6a4b9e0
--- /dev/null
+++ b/configuration/akregator_config_plugins.h
@@ -0,0 +1,44 @@
+/*
+   Copyright (C) 2016 Montel Laurent <montel@kde.org>
+
+   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) any later version.
+
+   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; see the file COPYING.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KCMAkregatorPluginsConfig_H
+#define KCMAkregatorPluginsConfig_H
+
+#include <KCModule>
+
+#include <QVariant>
+namespace WebEngineViewer
+{
+class NetworkPluginUrlInterceptorConfigureWidget;
+}
+namespace Akregator
+{
+class KCMAkregatorPluginsConfig : public KCModule
+{
+    Q_OBJECT
+public:
+    KCMAkregatorPluginsConfig(QWidget *parent, const QVariantList &args);
+    void load() Q_DECL_OVERRIDE;
+    void save() Q_DECL_OVERRIDE;
+    void defaults() Q_DECL_OVERRIDE;
+private Q_SLOTS:
+    void slotConfigChanged();
+};
+}
+#endif // KCMAkregatorPluginsConfig_H
diff --git a/src/akregator_part.cpp b/src/akregator_part.cpp
index dda9b5d..3add8c5 100644
--- a/src/akregator_part.cpp
+++ b/src/akregator_part.cpp
@@ -687,6 +687,7 @@ void Part::showOptions()
         m_dialog->addModule(QStringLiteral("akregator_config_browser"));
         m_dialog->addModule(QStringLiteral("akregator_config_advanced"));
         m_dialog->addModule(QStringLiteral("akregator_config_webengineurlinterceptor"));
 +        m_dialog->addModule(QStringLiteral("akregator_config_plugins"));
     }
 
     m_dialog->show();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic