diff options
Diffstat (limited to 'basicsuite/launchersettings/main.qml')
-rw-r--r-- | basicsuite/launchersettings/main.qml | 42 |
1 files changed, 23 insertions, 19 deletions
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() } - } } |