diff options
author | aavit <eirik.aavitsland@digia.com> | 2014-09-10 15:12:06 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@digia.com> | 2014-10-08 11:38:11 +0300 |
commit | dc12a6624b5f5a397e590d378bcf1f2a2f192e51 (patch) | |
tree | 21d39224c329c2cb8c3ae76d37aeda0f573457aa /basicsuite/launchersettings/main.qml | |
parent | 09ae8a5401ae5ff97b8b7b75437077651988b5a2 (diff) |
Update launchersettings for renamed DroidUtils->B2QtUtils
Also much simplification as the refactored API is better suited for
QML usage.
Depends on http://qt-gerrit.it.local/6317
Task-number: QTEE-704
Change-Id: I7491ada390d973a26cf8a2c2b668114eb87357c0
Reviewed-by: Samuli Piippo <samuli.piippo@digia.com>
Diffstat (limited to 'basicsuite/launchersettings/main.qml')
-rw-r--r-- | basicsuite/launchersettings/main.qml | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/basicsuite/launchersettings/main.qml b/basicsuite/launchersettings/main.qml index 8933598..085ec4d 100644 --- a/basicsuite/launchersettings/main.qml +++ b/basicsuite/launchersettings/main.qml @@ -45,6 +45,7 @@ import QtQuick.Layouts 1.0 import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Private 1.0 import QtQuick.Window 2.1 +import B2Qt.Utils 1.0 Rectangle { id: root @@ -122,10 +123,6 @@ Rectangle { } // ******************************** UI **************************************** - Loader { id: rebootActionLoader; source: "RebootAction.qml" } - Loader { id: poweroffActionLoader; source: "PoweroffAction.qml" } - Loader { id: brightnessControllerLoader; source: "BrightnessController.qml" } - Loader { id: networkControllerLoader; source: "NetworkController.qml" } Loader { id: wifiControllerLoader; source: "WifiController.qml" } Flickable { @@ -163,20 +160,16 @@ Rectangle { style: buttonStyle text: "Shut Down" Layout.fillWidth: true - action: poweroffActionLoader.item; - enabled: action != undefined - + onClicked: B2QtDevice.powerOff(); } Button { style: buttonStyle text: "Reboot" Layout.fillWidth: true - action: rebootActionLoader.item; - enabled: action != undefined + onClicked: B2QtDevice.reboot(); } } - } GroupBox { @@ -197,21 +190,24 @@ Rectangle { Label { text: "Display FPS: "; font.pixelSize: 18; color: "white" } Slider { + id: brightnessSlider maximumValue: 255 minimumValue: 1 - value: 255 Layout.fillWidth: true - onValueChanged: { - if (brightnessControllerLoader.item != undefined) { - brightnessControllerLoader.item.setBrightness(value); - } - } + value: B2QtDevice.displayBrightness } + CheckBox { checked: engine.fpsEnabled onCheckedChanged: engine.fpsEnabled = checked; } } + + Binding { + target: B2QtDevice + property: "displayBrightness" + value: brightnessSlider.value + } } GroupBox { @@ -235,13 +231,21 @@ Rectangle { TextField { id: hostname implicitHeight: hostnameButton.height - 8 - text: if (networkControllerLoader.item != undefined) { networkControllerLoader.item.getHostname(); } + text: B2QtDevice.hostname + placeholderText: "Enter hostname" + inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhNoPredictiveText font.pixelSize: 18 Layout.fillWidth: true + 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: 18 color: "white" Layout.columnSpan: 2 @@ -252,10 +256,8 @@ Rectangle { style: buttonStyle text: "Change hostname" implicitWidth: 260 - onClicked: networkControllerLoader.item.setHostname(hostname.text); - enabled: networkControllerLoader.item != undefined + onClicked: hostname.accepted() } - } } |