diff --git a/mobile/wifi/package/contents/ui/ConnectionEditor.qml b/mobile/wifi/package/contents/ui/ConnectionEditor.qml --- a/mobile/wifi/package/contents/ui/ConnectionEditor.qml +++ b/mobile/wifi/package/contents/ui/ConnectionEditor.qml @@ -31,10 +31,7 @@ title: i18n("Connection Editor") width: parent.width - ColumnLayout{ - id: columnlayout - // anchors.horizontalCenter: parent.horizontalCenter - + ColumnLayout { Controls.Label { text: i18n("SSID") font.weight: Font.Bold @@ -68,36 +65,18 @@ spacing: Kirigami.Units.gridUnit Controls.Button { enabled: enabledSaving - RowLayout { - anchors.centerIn: parent - Kirigami.Icon { - width: Kirigami.Units.iconSizes.smallMedium - height: width - source: "document-save" - } - Text { - text: i18n("Save") - } - } + text: i18n("Save") + icon.name: "document-save" onPressed: { save() - applicationWindow().pageStack.pop() + kcm.pop() } } Controls.Button { - RowLayout { - anchors.centerIn: parent - Kirigami.Icon { - width: Kirigami.Units.iconSizes.smallMedium - height: width - source: "dialog-cancel" - } - Text { - text: i18n("Cancel") - } - } + icon.name: "dialog-cancel" + text: i18n("Cancel") onPressed: { - applicationWindow().pageStack.pop() + kcm.pop() } } } diff --git a/mobile/wifi/package/contents/ui/TetheringSetting.qml b/mobile/wifi/package/contents/ui/TetheringSetting.qml --- a/mobile/wifi/package/contents/ui/TetheringSetting.qml +++ b/mobile/wifi/package/contents/ui/TetheringSetting.qml @@ -21,62 +21,14 @@ 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 +import org.kde.kirigami 2.10 as Kirigami Kirigami.ScrollablePage { property var connectPath property var devicePath property alias name: hotSpotName.text - header: ColumnLayout { - width: parent.width - anchors.leftMargin: Kirigami.Units.largeSpacing * 2 - - Kirigami.Separator {} - - RowLayout{ - Kirigami.Separator {} - Controls.Label { - anchors.leftMargin: Kirigami.Units.largeSpacing * 2 - text: i18n("Wi-fi hotspot") - Layout.fillWidth: true - font.weight: Font.Bold - } - Controls.Switch { - id: hotSpotSwitch - onCheckedChanged: { - if (checked) { - initTethering() - } else { - disableTethering() - } - } - } - Kirigami.Separator {} - Rectangle{ - height: 1 - Layout.fillWidth: true - color: "black" - } - } - } -// RowLayout { -// width: parent.width -// Controls.Label { -// text: "Wi-fi hotspot" -// Layout.fillWidth: true -// } -// Controls.Switch { -// id: hotSpotSwitch -// onCheckedChanged: { -// if (checked) { -// initTethering() -// } else { -// disableTethering() -// } -// } -// } -// } + title: i18n("Wi-Fi Hotspot") ColumnLayout { spacing: Kirigami.Units.gridUnit @@ -159,20 +111,23 @@ } } - footer: Item { - height: Kirigami.Units.gridUnit * 4 - Controls.Button { - anchors.centerIn: parent - Kirigami.Icon { - anchors.centerIn: parent - width: Kirigami.Units.iconSizes.medium - height: width - source: "dialog-close" - } - onPressed: { - applicationWindow().pageStack.pop() + actions { + main: Kirigami.Action { + icon.name: checked ? "network-wireless-disconnected" : "network-wireless-connected" + text: checked ? i18n("Disable Wi-Fi Hotspot") : i18n("Enable Wi-Fi Hotspot") + checkable: true + onCheckedChanged: { + if (checked) { + initTethering() + } else { + disableTethering() + } } - + } + right: Kirigami.Action { + icon.name: "dialog-close" + text: i18n("Cancel") + onTriggered: kcm.pop() } } diff --git a/mobile/wifi/package/contents/ui/main.qml b/mobile/wifi/package/contents/ui/main.qml --- a/mobile/wifi/package/contents/ui/main.qml +++ b/mobile/wifi/package/contents/ui/main.qml @@ -21,7 +21,7 @@ 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.5 as Kirigami +import org.kde.kirigami 2.10 as Kirigami import org.kde.kcm 1.1 SimpleKCM { @@ -93,8 +93,7 @@ currentIndex: -1 boundsBehavior: Flickable.StopAtBounds - header: Controls.Label { - leftPadding: Kirigami.Units.smallSpacing + header: Kirigami.ListSectionHeader { text: mobileProxyModel.showSavedMode ? i18n("Saved networks") : i18n("Available networks") } @@ -114,16 +113,16 @@ iconName: "edit" text: i18n("Add custom connection") onTriggered: { - applicationWindow().pageStack.push(connectionEditorDialogComponent) + kcm.push("ConnectionEditor.qml") contextDrawer.close() } }, Kirigami.Action { iconName: "edit" text: i18n("Create Hotspot") onTriggered: { - applicationWindow().pageStack.push(tetheringComponent) + kcm.push("TetheringSetting.qml") contextDrawer.close() } }, @@ -203,14 +202,4 @@ } } } - - Component { - id: connectionEditorDialogComponent - ConnectionEditor { } - } - - Component { - id: tetheringComponent - TetheringSetting { } - } }