diff options
Diffstat (limited to 'basicsuite/launchersettings')
-rw-r--r-- | basicsuite/launchersettings/BrightnessController.qml | 49 | ||||
-rw-r--r-- | basicsuite/launchersettings/NetworkController.qml | 61 | ||||
-rw-r--r-- | basicsuite/launchersettings/PoweroffAction.qml | 47 | ||||
-rw-r--r-- | basicsuite/launchersettings/RebootAction.qml | 47 | ||||
-rw-r--r-- | basicsuite/launchersettings/main.qml | 42 |
5 files changed, 23 insertions, 223 deletions
diff --git a/basicsuite/launchersettings/BrightnessController.qml b/basicsuite/launchersettings/BrightnessController.qml deleted file mode 100644 index 1d1abf8..0000000 --- a/basicsuite/launchersettings/BrightnessController.qml +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of the examples of the Qt Enterprise Embedded. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtDroid.Utils 1.0 -import QtQuick 2.0 - -QtObject { - function setBrightness(value) - { - DroidUtils.setDisplayBrightness(value) - } -} diff --git a/basicsuite/launchersettings/NetworkController.qml b/basicsuite/launchersettings/NetworkController.qml deleted file mode 100644 index a1b9141..0000000 --- a/basicsuite/launchersettings/NetworkController.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of the examples of the Qt Enterprise Embedded. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtDroid.Utils 1.0 -import QtQuick 2.0 - -QtObject { - - function getIPAddress() - { - return DroidUtils.getIPAddress() - } - - function getHostname() - { - return DroidUtils.getHostname() - } - - function setHostname(value) - { - return DroidUtils.setHostname(value) - } - -} diff --git a/basicsuite/launchersettings/PoweroffAction.qml b/basicsuite/launchersettings/PoweroffAction.qml deleted file mode 100644 index da65140..0000000 --- a/basicsuite/launchersettings/PoweroffAction.qml +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of the examples of the Qt Enterprise Embedded. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick.Controls 1.2 -import QtDroid.Utils 1.0 - -Action -{ - onTriggered: DroidUtils.powerOffSystem()(); -} diff --git a/basicsuite/launchersettings/RebootAction.qml b/basicsuite/launchersettings/RebootAction.qml deleted file mode 100644 index c99b2f5..0000000 --- a/basicsuite/launchersettings/RebootAction.qml +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: For any questions to Digia, please use the contact form at -** http://www.qt.io -** -** This file is part of the examples of the Qt Enterprise Embedded. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick.Controls 1.2 -import QtDroid.Utils 1.0 - -Action -{ - onTriggered: DroidUtils.rebootSystem(); -} diff --git a/basicsuite/launchersettings/main.qml b/basicsuite/launchersettings/main.qml index d067c91..c698aaf 100644 --- a/basicsuite/launchersettings/main.qml +++ b/basicsuite/launchersettings/main.qml @@ -44,15 +44,12 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.2 import QtQuick.Enterprise.VirtualKeyboard.Settings 1.2 import Qt.labs.wifi 0.1 as Wifi +import B2Qt.Utils 1.0 Rectangle { anchors.fill: parent color: "#212126" - Loader { id: rebootActionLoader; source: "RebootAction.qml" } - Loader { id: poweroffActionLoader; source: "PoweroffAction.qml" } - Loader { id: brightnessControllerLoader; source: "BrightnessController.qml" } - Loader { id: networkControllerLoader; source: "NetworkController.qml" } Flickable { anchors.top: parent.top @@ -88,16 +85,14 @@ Rectangle { style: SettingsButtonStyle {} text: "Shut Down" Layout.fillWidth: true - action: poweroffActionLoader.item; - enabled: action != undefined + onClicked: B2QtDevice.powerOff(); } Button { style: SettingsButtonStyle {} text: "Reboot" Layout.fillWidth: true - action: rebootActionLoader.item; - enabled: action != undefined + onClicked: B2QtDevice.reboot(); } } } @@ -128,15 +123,11 @@ Rectangle { } Slider { + id: brightnessSlider maximumValue: 255 minimumValue: 1 - value: 255 Layout.fillWidth: true - onValueChanged: { - if (brightnessControllerLoader.item != undefined) { - brightnessControllerLoader.item.setBrightness(value); - } - } + value: B2QtDevice.displayBrightness style: SliderStyle { handle: Rectangle { anchors.centerIn: parent @@ -149,6 +140,7 @@ Rectangle { } } } + CheckBox { style: SettingsCheckBoxStyle {} checked: engine.fpsEnabled @@ -186,6 +178,12 @@ Rectangle { } } + Binding { + target: B2QtDevice + property: "displayBrightness" + value: brightnessSlider.value + } + Component.onCompleted: { if (VirtualKeyboardSettings.styleName == "default") defaultStyle.checked = true @@ -222,14 +220,22 @@ Rectangle { TextField { id: hostname - text: if (networkControllerLoader.item != undefined) { networkControllerLoader.item.getHostname(); } + text: B2QtDevice.hostname + placeholderText: "Enter hostname" font.pixelSize: engine.smallFontSize() + inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhNoPredictiveText Layout.fillWidth: true Layout.preferredHeight: font.pixelSize * 2.4 + onAccepted: { + Qt.inputMethod.commit() + Qt.inputMethod.hide() + B2QtDevice.setHostname(hostname.text) + hostname.focus = false + } } Label { - text: if (networkControllerLoader.item != undefined) { networkControllerLoader.item.getIPAddress(); } + text: B2QtDevice.ipAddress font.pixelSize: engine.smallFontSize() color: "white" Layout.columnSpan: 2 @@ -239,10 +245,8 @@ Rectangle { id: hostnameButton style: SettingsButtonStyle {} text: "Change hostname" - onClicked: networkControllerLoader.item.setHostname(hostname.text); - enabled: networkControllerLoader.item != undefined + onClicked: hostname.accepted() } - } } |