diff --git a/mobile/broadband/package/contents/ui/MobileSettings.qml b/mobile/broadband/package/contents/ui/MobileSettings.qml deleted file mode 100644 --- a/mobile/broadband/package/contents/ui/MobileSettings.qml +++ /dev/null @@ -1,82 +0,0 @@ - -/* - * Copyright 2018 Martin Kacej - * - * 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 -import org.kde.plasma.networkmanagement 0.2 as PlasmaNM -import org.kde.kirigami 2.2 as Kirigami - -Kirigami.Page { - ColumnLayout { - width: parent.width - spacing: Kirigami.Units.gridUnit * 1.5 - RowLayout { - width: parent.width - Controls.Label { - text: i18n("Enable mobile data network") - font.weight: Font.Bold - Layout.fillWidth: true - } - Controls.CheckBox { - id: mobileDataCheckbox - enabled: enabledConnections.wwanHwEnabled && availableDevices.modemDeviceAvailable - anchors.rightMargin: Kirigami.Units.gridUnit - } - } - RowLayout { - width: parent.width - enabled: mobileDataCheckbox.checked - Controls.Label { - text: i18n("Enable data roaming") - font.weight: Font.Bold - color: parent.enabled ? Kirigami.Theme.textColor : Kirigami.Theme.disabledTextColor - Layout.fillWidth: true - } - Controls.CheckBox { - enabled: parent.enabled - checked: false - anchors.rightMargin: Kirigami.Units.gridUnit - onEnabledChanged: { - if (!enabled) - checked = false - } - } - } - Kirigami.Separator {} - Column { - Controls.Label { - text: i18n("Access point name") - font.weight: Font.Bold - } - Row { - Controls.TextField { - text: kcm.getAPN() - } - Controls.ToolButton { - text: i18n("Edit APN") - } - } - } - Controls.Button { - text: i18n("Data usage") - } - } -} diff --git a/mobile/broadband/package/contents/ui/main.qml b/mobile/broadband/package/contents/ui/main.qml --- a/mobile/broadband/package/contents/ui/main.qml +++ b/mobile/broadband/package/contents/ui/main.qml @@ -20,17 +20,12 @@ 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 +import org.kde.kirigami 2.4 as Kirigami +import org.kde.kcm 1.2 -Kirigami.ApplicationItem { - id: main - objectName: "mobileDataMain" - - pageStack.defaultColumnWidth: Kirigami.Units.gridUnit * 25 - pageStack.initialPage: MobileSettings {} - Kirigami.Theme.colorSet: Kirigami.Theme.Window - anchors.fill: parent +SimpleKCM { + id: main PlasmaNM.Handler { id: handler @@ -51,4 +46,34 @@ mobileDataCheckbox.enabled = enabled && availableDevices.modemDeviceAvailable } } + + Kirigami.FormLayout { + Controls.CheckBox { + id: mobileDataCheckbox + enabled: enabledConnections.wwanHwEnabled && availableDevices.modemDeviceAvailable + Kirigami.FormData.label: i18n("Enable mobile data network") + } + Controls.CheckBox { + enabled: mobileDataCheckbox.enabled + checked: false + onEnabledChanged: { + if (!enabled) + checked = false + } + Kirigami.FormData.label: i18n("Enable data roaming") + } + + Controls.TextField { + text: kcm.getAPN() + Kirigami.FormData.label: i18n("Access point name:") + } + + Controls.Button { + text: i18n("Edit APN") + } + + Controls.Button { + text: i18n("Data usage") + } + } }