summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kacej <[email protected]>2018-05-04 16:54:46 +0200
committerMartin Kacej <[email protected]>2018-05-04 16:54:46 +0200
commite98c601a2bbda8e4f31f5e6e8830383af4385b18 (patch)
tree2e4ee672c75da3ed75f4a2683c7dc8d4287d24e9
parent704a2680e583a273e31b5689894819071ab3e98c (diff)
base for mobile data settings section
-rw-r--r--CMakeLists.txt2
-rw-r--r--mobile_cellular/CMakeLists.txt21
-rw-r--r--mobile_cellular/celluralsettings.cpp40
-rw-r--r--mobile_cellular/celluralsettings.h32
-rwxr-xr-xmobile_cellular/mobile_cellural.desktop19
-rw-r--r--mobile_cellular/package/contents/ui/mainMobile.qml20
-rw-r--r--mobile_cellular/package/metadata.desktop20
7 files changed, 153 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a387ab..223071c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,5 +85,5 @@ add_subdirectory(kcm)
add_subdirectory(libs)
add_subdirectory(vpn)
add_subdirectory(mobile)
-
+add_subdirectory(mobile_cellular)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/mobile_cellular/CMakeLists.txt b/mobile_cellular/CMakeLists.txt
new file mode 100644
index 0000000..d61bd82
--- /dev/null
+++ b/mobile_cellular/CMakeLists.txt
@@ -0,0 +1,21 @@
+project (kcm_mobile_cellural)
+
+set (celluralsettings_SRCS celluralsettings.cpp)
+
+add_library(kcm_mobile_cellural MODULE ${celluralsettings_SRCS})
+
+target_link_libraries(kcm_mobile_cellural
+ Qt5::DBus
+ Qt5::Gui
+ Qt5::Quick
+ Qt5::Qml
+ KF5::Plasma
+ KF5::I18n
+ KF5::QuickAddons
+)
+
+kcoreaddons_desktop_to_json(kcm_mobile_cellural "mobile_cellural.desktop")
+
+install(FILES mobile_cellural.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install(TARGETS kcm_mobile_cellural DESTINATION ${PLUGIN_INSTALL_DIR}/kcms)
+kpackage_install_package(package kcm_mobile_cellural kcms)
diff --git a/mobile_cellular/celluralsettings.cpp b/mobile_cellular/celluralsettings.cpp
new file mode 100644
index 0000000..f86a78e
--- /dev/null
+++ b/mobile_cellular/celluralsettings.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2018 Martin Kacej <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 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 Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "celluralsettings.h"
+
+#include <KPluginFactory>
+#include <KLocalizedString>
+#include <KAboutData>
+
+K_PLUGIN_FACTORY_WITH_JSON(CelluralSettingsFactory, "mobile_cellural.json", registerPlugin<CelluralSettings>();)
+
+CelluralSettings::CelluralSettings(QObject* parent, const QVariantList& args) : KQuickAddons::ConfigModule(parent, args)
+{
+ KAboutData* about = new KAboutData("kcm_mobile_cellural", i18n("Configure cellural data network"),
+ "0.1", QString(), KAboutLicense::GPL);
+ about->addAuthor(i18n("Martin Kacej"), QString(), "[email protected]");
+ setAboutData(about);
+}
+
+CelluralSettings::~CelluralSettings()
+{
+}
+
+#include "celluralsettings.moc"
diff --git a/mobile_cellular/celluralsettings.h b/mobile_cellular/celluralsettings.h
new file mode 100644
index 0000000..e1d296f
--- /dev/null
+++ b/mobile_cellular/celluralsettings.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2018 Martin Kacej <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 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 Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef CELLURALSETTINGS_H
+#define CELLURALSETTINGS_H
+
+#include <KQuickAddons/ConfigModule>
+
+class CelluralSettings : public KQuickAddons::ConfigModule
+{
+public:
+ CelluralSettings(QObject *parent, const QVariantList &args);
+ virtual ~CelluralSettings();
+};
+
+#endif // CELLURALSETTINGS_H
diff --git a/mobile_cellular/mobile_cellural.desktop b/mobile_cellular/mobile_cellural.desktop
new file mode 100755
index 0000000..dfba898
--- /dev/null
+++ b/mobile_cellular/mobile_cellural.desktop
@@ -0,0 +1,19 @@
+[Desktop Entry]
+Name=Mobile data
+Comment=Mobile cellural network setting
+
+Icon=smartphone
+Exec=plasma-settings -m kcm_mobile_wifi
+
+Type=Service
+X-KDE-ServiceTypes=KCModule
+X-KDE-Library=kcm_mobile_cellural
+X-KDE-ParentApp=kcontrol
+X-KDE-FormFactors=handset,tablet,mediacenter
+
+X-KDE-System-Settings-Parent-Category=network
+X-KDE-Weight=70
+
+X-KDE-Keywords=mobile,data,network
+Categories=Qt;KDE;X-KDE-settings-system;
+
diff --git a/mobile_cellular/package/contents/ui/mainMobile.qml b/mobile_cellular/package/contents/ui/mainMobile.qml
new file mode 100644
index 0000000..3eaf089
--- /dev/null
+++ b/mobile_cellular/package/contents/ui/mainMobile.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.6
+import QtQuick.Controls 2.2 as Controls
+import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
+import org.kde.kirigami 2.2 as Kirigami
+
+Kirigami.ApplicationItem {
+ id: main
+ objectName: "mobileDataMain"
+
+ pageStack.defaultColumnWidth: Kirigami.Units.gridUnit * 25
+ //pageStack.initialPage:
+ Kirigami.Theme.colorSet: Kirigami.Theme.Window
+
+ anchors.fill: parent
+
+ Controls.Label {
+ text: i18n("Mobile data settings")
+ font.weight: Font.Bold
+ }
+}
diff --git a/mobile_cellular/package/metadata.desktop b/mobile_cellular/package/metadata.desktop
new file mode 100644
index 0000000..c9cc9aa
--- /dev/null
+++ b/mobile_cellular/package/metadata.desktop
@@ -0,0 +1,20 @@
+[Desktop Entry]
+Name=Mobile data
+Comment=Mobile cellural network setting
+Encoding=UTF-8
+Type=Service
+Icon=smartphone
+X-KDE-ServiceTypes=KCModule
+X-KDE-Library=kcm_mobile_cellural
+X-KDE-PluginInfo-Author=Martin Kacej
+X-KDE-PluginInfo-Name=kcm_mobile_cellural
+X-KDE-PluginInfo-Version=0.1
+X-KDE-PluginInfo-Website=https://plasma-mobile.org/
+X-KDE-PluginInfo-Category=System Information
+X-KDE-PluginInfo-Depends=
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
+X-KDE-FormFactors=handset,tablet,mediacenter
+X-Plasma-Package=kcm_mobile_cellural
+X-Plasma-MainScript=ui/mainMobile.qml