Commit b96bfc94 authored by Jan Grulich's avatar Jan Grulich

Better naming and minor coding style fixes

parent 292bf439
......@@ -85,5 +85,4 @@ 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)
project (kcm_mobile_wifi)
add_subdirectory(broadband)
add_subdirectory(wifi)
set (wifisettings_SRCS wifisettings.cpp)
add_library(kcm_mobile_wifi MODULE ${wifisettings_SRCS})
target_link_libraries(kcm_mobile_wifi
Qt5::DBus
Qt5::Gui
Qt5::Quick
Qt5::Qml
KF5::Plasma
KF5::I18n
KF5::QuickAddons
)
kcoreaddons_desktop_to_json(kcm_mobile_wifi "wifisettings.desktop")
install(FILES wifisettings.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(TARGETS kcm_mobile_wifi DESTINATION ${PLUGIN_INSTALL_DIR}/kcms)
kpackage_install_package(package kcm_mobile_wifi kcms)
project (kcm_mobile_broadband)
set (mobilebroadbandsettings_SRCS mobilebroadbandsettings.cpp)
add_library(kcm_mobile_broadband MODULE ${mobilebroadbandsettings_SRCS})
target_link_libraries(kcm_mobile_broadband
Qt5::DBus
Qt5::Gui
Qt5::Quick
Qt5::Qml
KF5::Plasma
KF5::I18n
KF5::QuickAddons
)
kcoreaddons_desktop_to_json(kcm_mobile_broadband "mobilebroadbandsettings.desktop")
install(FILES mobilebroadbandsettings.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(TARGETS kcm_mobile_broadband DESTINATION ${PLUGIN_INSTALL_DIR}/kcms)
kpackage_install_package(package kcm_mobile_broadband kcms)
......@@ -17,35 +17,35 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "celluralsettings.h"
#include "mobilebroadbandsettings.h"
#include <KPluginFactory>
#include <KLocalizedString>
#include <KAboutData>
K_PLUGIN_FACTORY_WITH_JSON(CelluralSettingsFactory, "mobile_cellural.json", registerPlugin<CelluralSettings>();)
K_PLUGIN_FACTORY_WITH_JSON(MobileBroadbandSettingsFactory, "mobilebroadbandsettings.json", registerPlugin<MobileBroadbandSettings>();)
CelluralSettings::CelluralSettings(QObject* parent, const QVariantList& args) : KQuickAddons::ConfigModule(parent, args)
MobileBroadbandSettings::MobileBroadbandSettings(QObject* parent, const QVariantList& args) : KQuickAddons::ConfigModule(parent, args)
{
KAboutData* about = new KAboutData("kcm_mobile_cellural", i18n("Configure cellural data network"),
KAboutData* about = new KAboutData("kcm_mobile_broadband", i18n("Configure mobile broadband"),
"0.1", QString(), KAboutLicense::GPL);
about->addAuthor(i18n("Martin Kacej"), QString(), "m.kacej@atlas.sk");
setAboutData(about);
}
CelluralSettings::~CelluralSettings()
MobileBroadbandSettings::~MobileBroadbandSettings()
{
}
bool CelluralSettings::mobileDataActive()
bool MobileBroadbandSettings::mobileDataActive()
{
return m_mobileDataActive;
}
void CelluralSettings::setMobileDataActive(bool active)
void MobileBroadbandSettings::setMobileDataActive(bool active)
{
m_mobileDataActive = active;
emit mobileDataActiveChanged(m_mobileDataActive);
}
#include "celluralsettings.moc"
#include "mobilebroadbandsettings.moc"
[Desktop Entry]
Name=Mobile data
Comment=Mobile cellural network setting
Name=Mobile broadband
Comment=Mobile broadband setting
Icon=smartphone
Exec=plasma-settings -m kcm_mobile_wifi
Exec=plasma-settings -m kcm_mobile_broadband
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_mobile_cellural
X-KDE-Library=kcm_mobile_broadband
X-KDE-ParentApp=kcontrol
X-KDE-FormFactors=handset,tablet,mediacenter
......
......@@ -17,25 +17,28 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CELLURALSETTINGS_H
#define CELLURALSETTINGS_H
#ifndef MOBILEBROADBANDSETTINGS_H
#define MOBILEBROADBANDSETTINGS_H
#include <KQuickAddons/ConfigModule>
class CelluralSettings : public KQuickAddons::ConfigModule
class MobileBroadbandSettings : public KQuickAddons::ConfigModule
{
Q_OBJECT
Q_PROPERTY(bool mobileDataActive READ mobileDataActive WRITE setMobileDataActive NOTIFY mobileDataActiveChanged)
public:
CelluralSettings(QObject *parent, const QVariantList &args);
virtual ~CelluralSettings();
MobileBroadbandSettings(QObject *parent, const QVariantList &args);
virtual ~MobileBroadbandSettings();
bool mobileDataActive();
void setMobileDataActive(bool active);
Q_SIGNAL void mobileDataActiveChanged(bool active);
Q_SIGNALS:
void mobileDataActiveChanged(bool active);
private:
bool m_mobileDataActive;
};
#endif // CELLURALSETTINGS_H
#endif // MOBILEBROADBANDSETTINGS_H
/*
* Copyright 2018 Martin Kacej <m.kacej@atlas.sk>
*
* 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.
*/
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.3
......
/*
* Copyright 2018 Martin Kacej <m.kacej@atlas.sk>
*
* 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.
*/
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
......
[Desktop Entry]
Name=Mobile data
Comment=Mobile cellural network setting
Name=Mobile Broadband
Comment=Mobile broadband setting
Encoding=UTF-8
Type=Service
Icon=smartphone
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_mobile_cellural
X-KDE-Library=kcm_mobile_broadband
X-KDE-PluginInfo-Author=Martin Kacej
X-KDE-PluginInfo-Email=m.kacej@atlas.sk
X-KDE-PluginInfo-Name=kcm_mobile_cellural
X-KDE-PluginInfo-Name=kcm_mobile_broadband
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
X-Plasma-Package=kcm_mobile_broadband
X-Plasma-MainScript=ui/main.qml
project (kcm_mobile_wifi)
set (wifisettings_SRCS wifisettings.cpp)
add_library(kcm_mobile_wifi MODULE ${wifisettings_SRCS})
target_link_libraries(kcm_mobile_wifi
Qt5::DBus
Qt5::Gui
Qt5::Quick
Qt5::Qml
KF5::Plasma
KF5::I18n
KF5::QuickAddons
)
kcoreaddons_desktop_to_json(kcm_mobile_wifi "wifisettings.desktop")
install(FILES wifisettings.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(TARGETS kcm_mobile_wifi DESTINATION ${PLUGIN_INSTALL_DIR}/kcms)
kpackage_install_package(package kcm_mobile_wifi kcms)
......@@ -20,11 +20,9 @@
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.kirigami 2.2 as Kirigami
Kirigami.ScrollablePage{
Kirigami.ScrollablePage {
property var details
property var str: 0
property var connection : ({})
......@@ -49,13 +47,13 @@ Kirigami.ScrollablePage{
placeholderText: i18n("None")
}
IpSetting {
IPAddressSetting {
id: editorIpSection
width: parent.width
//anchors.horizontalCenter: parent.horizontalCenter
}
WirelessSecuritySetting {
WirelessSecuritySetting {
id: editorSecuritySection
anchors.topMargin: units.gridUnit
//anchors.horizontalCenter: parent.horizontalCenter
......
......@@ -18,8 +18,8 @@
*/
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.2 as Controls
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
import org.kde.kirigami 2.2 as Kirigami
......@@ -36,10 +36,6 @@ Kirigami.SwipeListItem {
SecurityType == PlasmaNM.Enums.WpaPsk ||
SecurityType == PlasmaNM.Enums.Wpa2Psk)
onClicked: {
changeState()
}
RowLayout {
anchors.leftMargin: Kirigami.Units.largeSpacing * 5
Kirigami.Separator {}
......@@ -87,7 +83,7 @@ Kirigami.SwipeListItem {
text: ItemUniqueName
textFormat: Text.PlainText
}
PasswordField{
PasswordField {
id: connectionPasswordField
anchors.left: connectionNameLabel.left
height: units.gridUnit * 2
......@@ -129,6 +125,10 @@ Kirigami.SwipeListItem {
}
]
onClicked: {
changeState()
}
function getConfigureDialog() {
var item = applicationWindow().pageStack.push(networkDetailsViewComponent)
item.path = ConnectionPath
......
......@@ -18,10 +18,9 @@
*/
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.2 as Controls
import org.kde.kirigami 2.2 as Kirigami
import org.kde.plasma.components 2.0 as PlasmaComponents
ColumnLayout {
id: ipmain
......@@ -42,7 +41,6 @@ ColumnLayout {
width: implicitWidth
ColumnLayout {
Controls.Label {
anchors.left: parent.left
text: i18n("IP settings")
......@@ -66,7 +64,7 @@ ColumnLayout {
}
}
ColumnLayout{
ColumnLayout {
id: manualIPSettings
Layout.fillWidth: true
......
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2
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.ScrollablePage {
Kirigami.ScrollablePage {
anchors.leftMargin: Kirigami.Units.largeSpacing * 2
header: RowLayout {
......@@ -109,43 +109,41 @@ Kirigami.ScrollablePage {
}
*/
Kirigami.OverlayDrawer {
id: deleteConnectionDialog
property var name
property var dbusPath
edge: Qt.BottomEdge
contentItem: Item {
implicitHeight: childrenRect.height + Kirigami.Units.gridUnit
ColumnLayout{
anchors.centerIn: parent
Controls.Label {
anchors.horizontalCenter: parent.horizontalCenter
text: i18n("Delete connection ") + deleteConnectionDialog.name + " from device ?"
}
Controls.Button {
text: i18n("Delete")
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
handler.removeConnection(deleteConnectionDialog.dbusPath)
deleteConnectionDialog.close()
}
}
Controls.Button {
text: i18n("Cancel")
anchors.horizontalCenter: parent.horizontalCenter
onClicked: deleteConnectionDialog.close()
}
Item {
Layout.minimumHeight: Kirigami.Units.gridUnit * 4
}
id: deleteConnectionDialog
property var name
property var dbusPath
edge: Qt.BottomEdge
contentItem: Item {
implicitHeight: childrenRect.height + Kirigami.Units.gridUnit
ColumnLayout {
anchors.centerIn: parent
Controls.Label {
anchors.horizontalCenter: parent.horizontalCenter
text: i18n("Delete connection ") + deleteConnectionDialog.name + " from device ?"
}
onVisibleChanged: {
if (visible) {
} else {
deleteConnectionDialog.name = ""
deleteConnectionDialog.dbusPath = ""
Controls.Button {
text: i18n("Delete")
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
handler.removeConnection(deleteConnectionDialog.dbusPath)
deleteConnectionDialog.close()
}
}
Controls.Button {
text: i18n("Cancel")
anchors.horizontalCenter: parent.horizontalCenter
onClicked: deleteConnectionDialog.close()
}
Item {
Layout.minimumHeight: Kirigami.Units.gridUnit * 4
}
}
onVisibleChanged: {
if (!visible) {
deleteConnectionDialog.name = ""
deleteConnectionDialog.dbusPath = ""
}
}
}
}
}
......@@ -18,8 +18,8 @@
*/
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.2 as Controls
import org.kde.kirigami 2.2 as Kirigami
Kirigami.ScrollablePage{
......@@ -28,7 +28,7 @@ Kirigami.ScrollablePage{
property var activeMap: ({})
property bool enabledSave: true && detailsIP.enabledSave
header : ColumnLayout {
header: ColumnLayout {
width: parent.width
anchors.leftMargin: Kirigami.Units.largeSpacing * 2
Kirigami.Separator {}
......@@ -52,15 +52,16 @@ Kirigami.ScrollablePage{
Column {
id: detailsView
spacing: Kirigami.Units.gridUnit
WirelessSecuritySetting {
WirelessSecuritySetting {
id: detailsSecuritySection
anchors.bottomMargin: 10
}
IpSetting {
IPAddressSetting {
id: detailsIP
}
}
footer: Item {
height: Kirigami.Units.gridUnit * 4
RowLayout {
......
......@@ -19,13 +19,12 @@
*/
import QtQuick 2.6
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
import QtQuick.Controls 2.2 as Controls
PlasmaComponents.TextField {
Controls.TextField {
property int securityType
echoMode: TextInput.Password
revealPasswordButtonShown: true
placeholderText: i18n("Password...")
validator: RegExpValidator {
regExp: if (securityType == PlasmaNM.Enums.StaticWep) {
......
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2 as Controls
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
import org.kde.kirigami 2.2 as Kirigami
......@@ -9,11 +9,12 @@ Kirigami.ScrollablePage {
property var devicePath
property alias name: hotSpotName.text
header:
ColumnLayout {
header: ColumnLayout {
width: parent.width
anchors.leftMargin: Kirigami.Units.largeSpacing * 2
Kirigami.Separator {}
RowLayout{
Kirigami.Separator {}
Controls.Label {
......@@ -85,7 +86,7 @@ Kirigami.ScrollablePage {
loadSettings()
}
}
Column{
Column {
id: hotSpotSettings
width: parent.width / 2
visible: hotSpotConfigButton.checked
......@@ -189,7 +190,6 @@ Kirigami.ScrollablePage {
handler.activateConnection(connectPath,devicePath,"")
hotSpotStatus.text = i18n('Access point running: ') + name
hotSpotStatusIcon.source = "network-wireless-symbolic"
}
function disableTethering(){
......
......@@ -18,12 +18,12 @@
*/
import QtQuick 2.6
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2 as Layouts
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
import org.kde.kirigami 2.2 as Kirigami
Layouts.ColumnLayout {
ColumnLayout {
id:securitySectionView
property var securityMap: ({})
property var enabledSave: !wepWpaPasswordField.visible || (wepWpaPasswordField.visible && wepWpaPasswordField.acceptableInput)
......@@ -32,7 +32,7 @@ Layouts.ColumnLayout {
implicitWidth: Kirigami.Units.gridUnit * 20
width: implicitWidth
Column {
ColumnLayout {
id: securitySectionHeader
width: parent.width
......@@ -86,7 +86,7 @@ Layouts.ColumnLayout {
}
}
Layouts.ColumnLayout {
ColumnLayout {
id: eap
anchors.top: securitySectionHeader.bottom
Column {
......@@ -129,7 +129,7 @@ Layouts.ColumnLayout {
}
}
]
function setStateFromMap(){
function setStateFromMap() {
var x = securityMap["key-mgmt"]
switch (x) {
case "none":
......
......@@ -18,8 +18,8 @@
*/
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.2 as Controls
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
import org.kde.kirigami 2.2 as Kirigami
......@@ -75,26 +75,23 @@ Kirigami.ApplicationItem {
}
}
NetworkListView{
NetworkListView {
id: networkListview
anchors.fill: parent
}
Component {
id: connectionEditorDialogComponent
ConnectionEditor {
}
ConnectionEditor { }
}
Component {
id: networkDetailsViewComponent
NetworkSettings{
}
NetworkSettings { }
}
Component {
id: tetheringComponent
TetheringSettings {
}
TetheringSetting { }
}
}
......@@ -12,9 +12,8 @@ X-KDE-PluginInfo-Name=kcm_mobile_wifi
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_wifi
X-Plasma-MainScript=ui/mainWifi.qml
X-Plasma-MainScript=ui/main.qml
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)
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