diff --git a/__init__.py b/__init__.py index 731b040..8416d04 100644 --- a/__init__.py +++ b/__init__.py @@ -211,9 +211,6 @@ def initialize(self): "mycroft.device.settings.homescreen", self.handle_device_homescreen_settings, ) - self.gui.register_handler( - "mycroft.device.settings.ssh", self.handle_device_ssh_settings - ) self.gui.register_handler( "mycroft.device.settings.reset", self.handle_device_factory_reset_settings, @@ -221,15 +218,6 @@ def initialize(self): self.gui.register_handler( "mycroft.device.settings.update", self.handle_device_update_settings ) - self.gui.register_handler( - "mycroft.device.settings.restart", self.handle_system_reboot - ) - self.gui.register_handler( - "mycroft.device.settings.poweroff", self.handle_system_shutdown - ) - self.gui.register_handler( - "mycroft.device.settings.wireless", self.handle_show_wifi_screen_intent - ) self.gui.register_handler( "mycroft.device.show.idle", self.resting_screen.show ) @@ -669,32 +657,18 @@ def handle_device_settings(self, _): self.gui["state"] = "settings/settingspage" self.gui.show_page("all.qml") - @intent_handler("device.wifi.settings.intent") - def handle_show_wifi_screen_intent(self, _): - """ display network selection page. """ - self.gui.clear() - self.gui["state"] = "settings/networking/SelectNetwork" - self.gui.show_page("all.qml") - @intent_handler("device.homescreen.settings.intent") def handle_device_homescreen_settings(self, _): """ display homescreen settings page """ - screens = [{"screenName": s, - "screenID": self.resting_screen.screens[s]} + screens = [{"screenName": s, "screenID": self.resting_screen.screens[s]} for s in self.resting_screen.screens] self.gui["idleScreenList"] = {"screenBlob": screens} self.gui["selectedScreen"] = self.gui["selected"] self.gui["state"] = "settings/homescreen_settings" self.gui.show_page("all.qml") - @intent_handler("device.ssh.settings.intent") - def handle_device_ssh_settings(self, _): - """ Display ssh settings page. """ - self.gui["state"] = "settings/ssh_settings" - self.gui.show_page("all.qml") - @intent_handler("device.reset.settings.intent") def handle_device_factory_reset_settings(self, _): """ Display device factory reset settings page. """ diff --git a/ui/settings/SettingsModel.qml b/ui/settings/SettingsModel.qml index 8e7e5a4..2fce67a 100644 --- a/ui/settings/SettingsModel.qml +++ b/ui/settings/SettingsModel.qml @@ -13,12 +13,6 @@ ListModel { settingEvent: "mycroft.device.settings.homescreen" settingCall: "show homescreen settings" } - ListElement { - settingIcon: "dialog-scripts" - settingName: "Enable SSH" - settingEvent: "mycroft.device.settings.ssh" - settingCall: "show ssh settings" - } ListElement { settingIcon: "circular-arrow-shape" settingName: "Factory Reset" @@ -31,16 +25,4 @@ ListModel { settingEvent: "mycroft.device.settings.update" settingCall: "" } - ListElement { - settingIcon: "view-refresh" - settingName: "Reboot" - settingEvent: "mycroft.device.settings.restart" - settingCall: "" - } - ListElement { - settingIcon: "lighttable" - settingName: "Shutdown" - settingEvent: "mycroft.device.settings.poweroff" - settingCall: "" - } } diff --git a/ui/settings/ssh_settings.qml b/ui/settings/ssh_settings.qml deleted file mode 100644 index ebedfc2..0000000 --- a/ui/settings/ssh_settings.qml +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2018 Aditya Mehra - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import QtQuick.Layouts 1.4 -import QtQuick 2.4 -import QtQuick.Controls 2.0 -import org.kde.kirigami 2.5 as Kirigami -import org.kde.plasma.core 2.0 as PlasmaCore -import Mycroft 1.0 as Mycroft - -Item { - id: sshSettingsView - anchors.fill: parent - property bool connectionActive: false - - Item { - id: topArea - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - height: Kirigami.Units.gridUnit * 2 - - Kirigami.Heading { - id: brightnessSettingPageTextHeading - level: 1 - wrapMode: Text.WordWrap - anchors.centerIn: parent - font.bold: true - text: "SSH Settings" - color: Kirigami.Theme.linkColor - } - } - - Item { - anchors.top: topArea.bottom - anchors.topMargin: Kirigami.Units.largeSpacing - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: areaSep.top - - ColumnLayout { - anchors.left: parent.left - anchors.right: parent.right - spacing: Kirigami.Units.smallSpacing - - Kirigami.Heading { - id: warnText - level: 3 - Layout.fillWidth: true - wrapMode: Text.WordWrap - text: "By enabling SSH Mode, anyone can access, change or delete anything on this device by connecting to it via another device." - } - - Item { - Layout.fillWidth: true - Layout.preferredHeight: Kirigami.Units.largeSpacing - } - - RowLayout { - Layout.fillWidth: true - Layout.preferredHeight: serviceActiveLabel.implicitHeight + Kirigami.Units.smallSpacing - Label { - id: serviceActiveLabel - Layout.fillWidth: true - Layout.alignment: Qt.AlignLeft - text: "Service Active:" - } - Label { - id: serviceActionState - Layout.alignment: Qt.AlignRight - text: connectionActive ? "Actived" : "Deactived" - color: connectionActive ? "Green" : "Red" - } - } - - Kirigami.Separator { - Layout.fillWidth: true - } - - RowLayout { - Layout.fillWidth: true - Layout.preferredHeight: enableServiceLabel.implicitHeight + Kirigami.Units.smallSpacing - Label { - id: enableServiceLabel - Layout.fillWidth: true - Layout.alignment: Qt.AlignLeft - text: "Enable SSH Service:" - } - - CheckBox { - Layout.alignment: Qt.AlignRight - checked: false - - onCheckedChanged: { - if(checked){ - connectionActive = true - } - else { - connectionActive = false - } - } - } - } - - - Kirigami.Separator { - Layout.fillWidth: true - } - - RowLayout { - Layout.fillWidth: true - - Label { - id: autoEnableServiceLabel - Layout.fillWidth: true - Layout.alignment: Qt.AlignLeft - text: "Enable On Boot:" - } - - CheckBox { - Layout.alignment: Qt.AlignRight - checked: false - enabled: connectionActive ? 1 : 0 - } - } - } - } - - Kirigami.Separator { - id: areaSep - anchors.bottom: bottomArea.top - anchors.left: parent.left - anchors.right: parent.right - height: 1 - } - - Item { - id: bottomArea - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.bottomMargin: Kirigami.Units.largeSpacing * 1.15 - height: backIcon.implicitHeight + Kirigami.Units.largeSpacing * 1.15 - - RowLayout { - anchors.fill: parent - - Kirigami.Icon { - id: backIcon - source: "go-previous" - Layout.preferredHeight: Kirigami.Units.iconSizes.medium - Layout.preferredWidth: Kirigami.Units.iconSizes.medium - } - - Kirigami.Heading { - level: 2 - wrapMode: Text.WordWrap - font.bold: true - text: "Device Settings" - Layout.fillWidth: true - Layout.preferredHeight: Kirigami.Units.gridUnit * 2 - } - } - - MouseArea { - anchors.fill: parent - onClicked: { - triggerGuiEvent("mycroft.device.settings", {}) - } - } - } -}