summaryrefslogtreecommitdiffstats
path: root/basicsuite
diff options
context:
space:
mode:
authorKimmo Ollila <kimmo.ollila@theqtcompany.com>2016-01-13 09:25:29 +0200
committerKimmo Ollila <kimmo.ollila@theqtcompany.com>2016-01-14 08:09:26 +0000
commite981ac3a5248439b2a7fdafef236dc432d61858f (patch)
treef4cc78377b724aff4f80c5f1522cfb2fc121bafa /basicsuite
parent4e7e83959734cea20141567cf3017cd35fab82cd (diff)
Renewed Launcher Settings
Task-number: QTRD-3776 Change-Id: I69bc4f0bb1628feb73b4acc35908950095eb4515 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
Diffstat (limited to 'basicsuite')
-rw-r--r--basicsuite/launchersettings/SettingTitle.qml60
-rw-r--r--basicsuite/launchersettings/SettingsButtonStyle.qml68
-rw-r--r--basicsuite/launchersettings/SettingsCheckBoxStyle.qml61
-rw-r--r--basicsuite/launchersettings/SettingsGroupBoxStyle.qml81
-rw-r--r--basicsuite/launchersettings/SettingsRadioButtonStyle.qml66
-rw-r--r--basicsuite/launchersettings/Spacer.qml33
-rw-r--r--basicsuite/launchersettings/WifiGroupBox.qml131
-rw-r--r--basicsuite/launchersettings/WifiNetworkList.qml188
-rw-r--r--basicsuite/launchersettings/images/Display_icon.pngbin0 -> 1217 bytes
-rw-r--r--basicsuite/launchersettings/images/Keyboard_Thumb_default.pngbin0 -> 14171 bytes
-rw-r--r--basicsuite/launchersettings/images/Keyboard_Thumb_retro.pngbin0 -> 58203 bytes
-rw-r--r--basicsuite/launchersettings/images/Keyboard_icon.pngbin0 -> 1471 bytes
-rw-r--r--basicsuite/launchersettings/images/Network_icon.pngbin0 -> 2327 bytes
-rw-r--r--basicsuite/launchersettings/images/Power_icon.pngbin0 -> 2065 bytes
-rw-r--r--basicsuite/launchersettings/images/button_default.pngbin1406 -> 0 bytes
-rw-r--r--basicsuite/launchersettings/images/button_pressed.pngbin1694 -> 0 bytes
-rw-r--r--basicsuite/launchersettings/images/groupbox.pngbin485 -> 0 bytes
-rw-r--r--basicsuite/launchersettings/main.qml480
-rw-r--r--basicsuite/launchersettings/preview_l.jpgbin35822 -> 43184 bytes
19 files changed, 488 insertions, 680 deletions
diff --git a/basicsuite/launchersettings/SettingTitle.qml b/basicsuite/launchersettings/SettingTitle.qml
new file mode 100644
index 0000000..31becd3
--- /dev/null
+++ b/basicsuite/launchersettings/SettingTitle.qml
@@ -0,0 +1,60 @@
+/******************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:COMM$
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** $QT_END_LICENSE$
+**
+******************************************************************************/
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 1.4
+
+RowLayout {
+ id: root
+ property alias iconSource: icon.source
+ property alias titleText: title.text
+ property alias smallText: additionalText.text
+
+ Layout.bottomMargin: engine.mm(6)
+ spacing: 0
+
+ Image {
+ id: icon
+ Layout.preferredWidth: mainLayout.width * .05
+ Layout.preferredHeight: width * sourceSize.width/sourceSize.height
+ source: ""
+ fillMode: Image.PreserveAspectFit
+ anchors.bottom: parent.bottom
+ }
+
+ Label {
+ id: title
+ text: "Display"
+ font.pixelSize: engine.titleFontSize() *.8
+ anchors.bottom: parent.bottom
+ Layout.leftMargin: mainLayout.defaultMargin * .5
+ Layout.preferredWidth: mainLayout.width * .5
+ }
+
+ Label {
+ id: additionalText
+ text: ""
+ font.pixelSize: engine.smallFontSize()
+ anchors.bottom: parent.bottom
+ Layout.fillWidth: true
+ elide: Label.ElideRight
+ }
+}
diff --git a/basicsuite/launchersettings/SettingsButtonStyle.qml b/basicsuite/launchersettings/SettingsButtonStyle.qml
deleted file mode 100644
index bebae48..0000000
--- a/basicsuite/launchersettings/SettingsButtonStyle.qml
+++ /dev/null
@@ -1,68 +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 2.2
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.2
-
-ButtonStyle {
- panel: Item {
- implicitHeight: engine.smallFontSize() * 2.4
- implicitWidth: engine.centimeter() * 5
-
- BorderImage {
- anchors.fill: parent
- antialiasing: true
- border.bottom: 8
- border.top: 8
- border.left: 8
- border.right: 8
- anchors.margins: control.pressed ? -4 : 0
- source: control.pressed ? "images/button_pressed.png" : "images/button_default.png"
- Text {
- text: control.text
- anchors.centerIn: parent
- color: "white"
- font.pixelSize: engine.smallFontSize()
- renderType: Text.NativeRendering
- }
- }
- }
-}
diff --git a/basicsuite/launchersettings/SettingsCheckBoxStyle.qml b/basicsuite/launchersettings/SettingsCheckBoxStyle.qml
deleted file mode 100644
index c7c55d0..0000000
--- a/basicsuite/launchersettings/SettingsCheckBoxStyle.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 QtQuick 2.2
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.2
-
-CheckBoxStyle {
- indicator: Rectangle {
- implicitWidth: engine.mm(7)
- implicitHeight: engine.mm(7)
- radius: 10
- border.color: "black"
- border.width: 2
- Rectangle {
- visible: control.checked
- color: "#45b7e2"
- border.color: "darkblue"
- radius: 10
- anchors.margins: engine.mm(1)
- anchors.fill: parent
- }
- }
-}
diff --git a/basicsuite/launchersettings/SettingsGroupBoxStyle.qml b/basicsuite/launchersettings/SettingsGroupBoxStyle.qml
deleted file mode 100644
index c5c71b5..0000000
--- a/basicsuite/launchersettings/SettingsGroupBoxStyle.qml
+++ /dev/null
@@ -1,81 +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 2.2
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.2
-import QtQuick.Controls.Private 1.0
-
-// GroupBoxStyle currently is not available as a public API,
-// so we write our own by importing private Styles API.
-Style {
- // The margin from the content item to the groupbox
- padding {
- top: (control.title.length > 0 ? TextSingleton.implicitHeight : 0) + 30
- left: 8
- right: 8
- bottom: 8
- }
- // The groupbox frame
- property Component panel: Item {
- anchors.fill: parent
-
- Text {
- id: label
- anchors.bottom: borderImage.top
- anchors.margins: 2
- text: control.title
- font.pixelSize: engine.smallFontSize() * 1.1
- color: "white"
- renderType: Text.NativeRendering
- }
-
- BorderImage {
- id: borderImage
- anchors.fill: parent
- anchors.topMargin: padding.top - 7
- source: "images/groupbox.png"
- border.left: 4
- border.right: 4
- border.top: 4
- border.bottom: 4
- }
- }
-}
diff --git a/basicsuite/launchersettings/SettingsRadioButtonStyle.qml b/basicsuite/launchersettings/SettingsRadioButtonStyle.qml
deleted file mode 100644
index 9959ea1..0000000
--- a/basicsuite/launchersettings/SettingsRadioButtonStyle.qml
+++ /dev/null
@@ -1,66 +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://qt.digia.com/
-**
-** 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 2.2
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.2
-
-RadioButtonStyle {
- indicator: Rectangle {
- implicitWidth: engine.mm(7)
- implicitHeight: engine.mm(7)
- radius: 40
- border.color: "black"
- border.width: 2
- Rectangle {
- anchors.fill: parent
- visible: control.checked
- color: "#45b7e2"
- border.color: "darkblue"
- radius: 40
- anchors.margins: engine.mm(1)
- }
- }
- label: Label {
- text: control.text
- font.pixelSize: engine.smallFontSize() * 0.8
- color: "white"
- }
-}
diff --git a/basicsuite/launchersettings/Spacer.qml b/basicsuite/launchersettings/Spacer.qml
new file mode 100644
index 0000000..be4c09d
--- /dev/null
+++ b/basicsuite/launchersettings/Spacer.qml
@@ -0,0 +1,33 @@
+/******************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:COMM$
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** $QT_END_LICENSE$
+**
+******************************************************************************/
+import QtQuick 2.2
+
+Item {
+ width: parent.width
+ height: 50
+
+ Rectangle {
+ width: parent.width
+ height: 3
+ color: "#eeeeee"
+ anchors.verticalCenter: parent.verticalCenter
+ }
+}
diff --git a/basicsuite/launchersettings/WifiGroupBox.qml b/basicsuite/launchersettings/WifiGroupBox.qml
index 5eab3f2..d2b93af 100644
--- a/basicsuite/launchersettings/WifiGroupBox.qml
+++ b/basicsuite/launchersettings/WifiGroupBox.qml
@@ -1,109 +1,110 @@
-/****************************************************************************
+/******************************************************************************
**
-** 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
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
-** This file is part of the examples of the Qt Enterprise Embedded.
+** This file is part of the Qt Enterprise Embedded.
**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** $QT_BEGIN_LICENSE:COMM$
**
-** "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."
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** $QT_END_LICENSE$
**
-****************************************************************************/
+******************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.2
+import QtQuick.Controls 1.4
import QtQuick.Layouts 1.0
import B2Qt.Wifi 1.0
ColumnLayout {
- anchors.fill: parent
-
- Binding {
- target: WifiManager
- property: "scanning"
- value: networkList.visible
- }
RowLayout {
- Button {
+ Label {
+ text: qsTr("Wi-Fi")
+ font.pixelSize: engine.titleFontSize() *.8
+ Layout.leftMargin: 0
+ Layout.preferredWidth: mainLayout.column1Width
+ }
+
+ Switch {
id: wifiOnOffButton
- Layout.fillWidth: true
- style: SettingsButtonStyle {}
- onClicked: {
- if (WifiManager.backendState === WifiManager.Running) {
+ Layout.bottomMargin: 0
+
+ onCheckedChanged: {
+ if (checked && WifiManager.backendState === WifiManager.NotRunning) {
+ WifiManager.start()
+ return
+ }
+
+ if (!checked && WifiManager.backendState === WifiManager.Running) {
if (networkList.visible)
networkList.visible = false
WifiManager.stop()
- } else if (WifiManager.backendState === WifiManager.NotRunning) {
- WifiManager.start()
}
}
function updateButtonText(backendState)
{
- if (backendState === WifiManager.Initializing)
- wifiOnOffButton.text = "Initializing..."
- if (backendState === WifiManager.Terminating)
- wifiOnOffButton.text = "Terminating..."
- if (backendState === WifiManager.NotRunning)
- wifiOnOffButton.text = "Switch On"
- if (backendState === WifiManager.Running)
- wifiOnOffButton.text = "Switch Off"
+ if (backendState === WifiManager.Initializing) {
+ wifiOnOffText.text = qsTr("Initializing...")
+ } else if (backendState === WifiManager.Terminating) {
+ wifiOnOffText.text = qsTr("Terminating...")
+ } else if (backendState === WifiManager.NotRunning) {
+ wifiOnOffText.text = qsTr("Off")
+ wifiOnOffButton.checked = false
+ } else if (backendState === WifiManager.Running) {
+ wifiOnOffText.text = qsTr("On")
+ wifiOnOffButton.checked = true
+ }
}
Component.onCompleted: updateButtonText(WifiManager.backendState)
+
Connections {
target: WifiManager
onBackendStateChanged: wifiOnOffButton.updateButtonText(backendState)
}
}
- Button {
- id: listNetworksButton
- Layout.fillWidth: true
- style: SettingsButtonStyle {}
- visible: WifiManager.backendState === WifiManager.Running
- text: networkList.visible ? "Hide wifi networks"
- : "List available wifi networks"
- onClicked: networkList.visible = !networkList.visible
+ Text {
+ id: wifiOnOffText
+ text: qsTr("%1%").arg(Math.round(brightnessSlider.value / brightnessSlider.maximumValue * 100))
+ font.pixelSize: engine.smallFontSize()
+ Layout.leftMargin: mainLayout.width * .05
}
}
+ Binding {
+ target: WifiManager
+ property: "scanning"
+ value: networkList.visible
+ }
+
+ Button {
+ id: listNetworksButton
+ Layout.leftMargin: mainLayout.column1Width
+ Layout.topMargin: engine.mm(6)
+ Layout.preferredWidth: mainLayout.width * .4
+ visible: WifiManager.backendState === WifiManager.Running
+ text: networkList.visible ? qsTr("Hide Wi-Fi networks")
+ : qsTr("List available Wi-Fi networks")
+ onClicked: networkList.visible = !networkList.visible
+ }
+
WifiNetworkList {
id: networkList
implicitHeight: engine.centimeter(7)
Layout.fillWidth: true
+ Layout.leftMargin: mainLayout.column1Width
visible: false
clip: true
}
}
-
diff --git a/basicsuite/launchersettings/WifiNetworkList.qml b/basicsuite/launchersettings/WifiNetworkList.qml
index b30d230..806b021 100644
--- a/basicsuite/launchersettings/WifiNetworkList.qml
+++ b/basicsuite/launchersettings/WifiNetworkList.qml
@@ -1,112 +1,98 @@
-/****************************************************************************
+/******************************************************************************
**
-** 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
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
-** This file is part of the examples of the Qt Enterprise Embedded.
+** This file is part of the Qt Enterprise Embedded.
**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** $QT_BEGIN_LICENSE:COMM$
**
-** "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."
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** $QT_END_LICENSE$
**
-****************************************************************************/
+******************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.2
+import QtQuick.Controls 1.4
import B2Qt.Wifi 1.0
Item {
+
Component {
id: listDelegate
+
Rectangle {
id: networkBox
property bool expanded: false
property bool isCurrentNetwork: WifiManager.currentSSID === ssid
property bool connected: isCurrentNetwork && WifiManager.networkState === WifiManager.Connected
property int notExpandedHeight: ssidLabel.height + bssidLabel.height + engine.mm(4)
- property int expandedHeight: notExpandedHeight + passwordInput.height + connectionButton.height + engine.mm(7)
- property int connectedExpandedHeight: notExpandedHeight + connectionButton.height + engine.mm(4)
- height: expanded ? (connected ? connectedExpandedHeight : expandedHeight) : notExpandedHeight
+ property int expandedHeight: notExpandedHeight + connectionButton.height + engine.mm(8)
+ height: expanded ? expandedHeight : notExpandedHeight
width: parent.width
clip: true
- color: "#5C5C5C"
- border.color: "black"
- border.width: 1
Component.onDestruction: if (expanded) networkView.expandedNetworkBox = null
onHeightChanged: if (expanded) networkView.positionViewAtIndex(index, ListView.Contain)
Behavior on height { NumberAnimation { duration: 500; easing.type: Easing.InOutCubic } }
- Text {
- id: ssidLabel
+ CheckBox {
+ id: connectedCheckBox
anchors.top: parent.top
anchors.left: parent.left
anchors.margins: engine.mm(1)
anchors.leftMargin: engine.mm(2)
+ checked: connected
+ }
+
+ Label {
+ id: ssidLabel
+ anchors.top: parent.top
+ anchors.left: connectedCheckBox.right
+ anchors.margins: engine.mm(1)
+ anchors.leftMargin: engine.mm(2)
font.pixelSize: engine.smallFontSize()
font.bold: true
- color: "#E6E6E6"
+ color: "black"
text: isCurrentNetwork ? ssid + networkView.networkStateText : ssid
Component.onCompleted: networkView.setNetworkStateText(WifiManager.networkState)
}
- Text {
+ Label {
id: bssidLabel
anchors.top: ssidLabel.bottom
- anchors.left: parent.left
+ anchors.left: connectedCheckBox.right
anchors.margins: engine.mm(1)
- anchors.leftMargin: engine.mm(6)
+ anchors.leftMargin: engine.mm(2)
text: bssid
- color: "#E6E6E6"
- font.pixelSize: ssidLabel.font.pixelSize * 0.8
+ color: "black"
+ font.pixelSize: ssidLabel.font.pixelSize
}
- Text {
+ Label {
id: flagsLabel
anchors.top: bssidLabel.top
- anchors.left: bssidLabel.right
- anchors.leftMargin: engine.mm(7)
- text: (supportsWPA2 ? "WPA2 " : "")
- + (supportsWPA ? "WPA " : "")
- + (supportsWEP ? "WEP " : "")
- + (supportsWPS ? "WPS " : "");
- color: "#E6E6E6"
- font.pixelSize: ssidLabel.font.pixelSize * 0.8
- font.italic: true
+ anchors.right: parent.right
+ text: (supportsWPA2 ? qsTr("WPA2 ") : "")
+ + (supportsWPA ? qsTr("WPA ") : "")
+ + (supportsWEP ? qsTr("WEP ") : "")
+ + (supportsWPS ? qsTr("WPS ") : "");
+ color: "black"
+ font.pixelSize: ssidLabel.font.pixelSize
+ font.bold: true
}
ProgressBar {
id: signalStrengthBar
height: engine.mm(3)
- width: networkBox.width * 0.5
+ width: networkBox.width * 0.25
anchors.margins: engine.mm(2)
anchors.right: parent.right
anchors.top: parent.top
@@ -136,25 +122,24 @@ Item {
TextField {
id: passwordInput
anchors.top: flagsLabel.bottom
- anchors.topMargin: engine.mm(3)
- anchors.horizontalCenter: parent.horizontalCenter
- width: parent.width * 0.36
- height: font.pixelSize * 2.4
- placeholderText: "Enter Password"
+ anchors.topMargin: engine.mm(6)
+ anchors.right: connectionButton.left
+ anchors.rightMargin: mainLayout.defaultMargin * .25
+ anchors.left: ssidLabel.left
+ placeholderText: qsTr("Enter Password")
visible: !connected
- font.pixelSize: engine.smallFontSize() * 0.8
+ font.pixelSize: engine.smallFontSize()
echoMode: TextInput.Password
inputMethodHints: Qt.ImhNoPredictiveText
}
Button {
id: connectionButton
- style: SettingsButtonStyle {}
- y: connected ? passwordInput.y
- : passwordInput.y + passwordInput.height + engine.mm(2)
- width: passwordInput.width
- anchors.horizontalCenter: parent.horizontalCenter
- text: connected ? "Disconnect" : "Connect"
+ width: parent.width * .4
+ anchors.right: parent.right
+ anchors.top: flagsLabel.bottom
+ anchors.topMargin: engine.mm(6)
+ text: connected ? qsTr("Disconnect") : qsTr("Connect")
onClicked: {
if (connected) {
WifiManager.disconnect()
@@ -179,34 +164,43 @@ Item {
id: config
}
- ListView {
- id: networkView
+ GroupBox {
anchors.fill: parent
- model: WifiManager.networks
- delegate: listDelegate
-
- property string networkStateText: ""
- property QtObject expandedNetworkBox: null
- property bool hasExpandedNetworkBox: expandedNetworkBox !== null
-
- function setNetworkStateText(networkState) {
- if (networkState === WifiManager.ObtainingIPAddress)
- networkView.networkStateText = " (obtaining ip..)"
- else if (networkState === WifiManager.DhcpRequestFailed)
- networkView.networkStateText = " (dhcp request failed)"
- else if (networkState === WifiManager.Connected)
- networkView.networkStateText = " (connected)"
- else if (networkState === WifiManager.Authenticating)
- networkView.networkStateText = " (authenticating..)"
- else if (networkState === WifiManager.HandshakeFailed)
- networkView.networkStateText = " (wrong password)"
- else if (networkState === WifiManager.Disconnected)
- networkView.networkStateText = ""
- }
- Connections {
- target: WifiManager
- onNetworkStateChanged: networkView.setNetworkStateText(networkState)
+ Item {
+ anchors.fill: parent
+ clip: true
+
+ ListView {
+ id: networkView
+ anchors.fill: parent
+ model: WifiManager.networks
+ delegate: listDelegate
+
+ property string networkStateText: ""
+ property QtObject expandedNetworkBox: null
+ property bool hasExpandedNetworkBox: expandedNetworkBox !== null
+
+ function setNetworkStateText(networkState) {
+ if (networkState === WifiManager.ObtainingIPAddress)
+ networkView.networkStateText = qsTr(" (obtaining ip..)")
+ else if (networkState === WifiManager.DhcpRequestFailed)
+ networkView.networkStateText = qsTr(" (dhcp request failed)")
+ else if (networkState === WifiManager.Connected)
+ networkView.networkStateText = qsTr(" (connected)")
+ else if (networkState === WifiManager.Authenticating)
+ networkView.networkStateText = qsTr(" (authenticating..)")
+ else if (networkState === WifiManager.HandshakeFailed)
+ networkView.networkStateText = qsTr(" (wrong password)")
+ else if (networkState === WifiManager.Disconnected)
+ networkView.networkStateText = ""
+ }
+
+ Connections {
+ target: WifiManager
+ onNetworkStateChanged: networkView.setNetworkStateText(networkState)
+ }
+ }
}
}
}
diff --git a/basicsuite/launchersettings/images/Display_icon.png b/basicsuite/launchersettings/images/Display_icon.png
new file mode 100644
index 0000000..1f6f80b
--- /dev/null
+++ b/basicsuite/launchersettings/images/Display_icon.png
Binary files differ
diff --git a/basicsuite/launchersettings/images/Keyboard_Thumb_default.png b/basicsuite/launchersettings/images/Keyboard_Thumb_default.png
new file mode 100644
index 0000000..c251028
--- /dev/null
+++ b/basicsuite/launchersettings/images/Keyboard_Thumb_default.png
Binary files differ
diff --git a/basicsuite/launchersettings/images/Keyboard_Thumb_retro.png b/basicsuite/launchersettings/images/Keyboard_Thumb_retro.png
new file mode 100644
index 0000000..bfbdc9b
--- /dev/null
+++ b/basicsuite/launchersettings/images/Keyboard_Thumb_retro.png
Binary files differ
diff --git a/basicsuite/launchersettings/images/Keyboard_icon.png b/basicsuite/launchersettings/images/Keyboard_icon.png
new file mode 100644
index 0000000..1384a42
--- /dev/null
+++ b/basicsuite/launchersettings/images/Keyboard_icon.png
Binary files differ
diff --git a/basicsuite/launchersettings/images/Network_icon.png b/basicsuite/launchersettings/images/Network_icon.png
new file mode 100644
index 0000000..808b632
--- /dev/null
+++ b/basicsuite/launchersettings/images/Network_icon.png
Binary files differ
diff --git a/basicsuite/launchersettings/images/Power_icon.png b/basicsuite/launchersettings/images/Power_icon.png
new file mode 100644
index 0000000..1a038c0
--- /dev/null
+++ b/basicsuite/launchersettings/images/Power_icon.png
Binary files differ
diff --git a/basicsuite/launchersettings/images/button_default.png b/basicsuite/launchersettings/images/button_default.png
deleted file mode 100644
index 6d6cfd9..0000000
--- a/basicsuite/launchersettings/images/button_default.png
+++ /dev/null
Binary files differ
diff --git a/basicsuite/launchersettings/images/button_pressed.png b/basicsuite/launchersettings/images/button_pressed.png
deleted file mode 100644
index ab78b6e..0000000
--- a/basicsuite/launchersettings/images/button_pressed.png
+++ /dev/null
Binary files differ
diff --git a/basicsuite/launchersettings/images/groupbox.png b/basicsuite/launchersettings/images/groupbox.png
deleted file mode 100644
index 98585ee..0000000
--- a/basicsuite/launchersettings/images/groupbox.png
+++ /dev/null
Binary files differ
diff --git a/basicsuite/launchersettings/main.qml b/basicsuite/launchersettings/main.qml
index f609724..dc63487 100644
--- a/basicsuite/launchersettings/main.qml
+++ b/basicsuite/launchersettings/main.qml
@@ -1,60 +1,38 @@
-/****************************************************************************
+/******************************************************************************
**
-** 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
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
-** This file is part of the examples of the Qt Enterprise Embedded.
+** This file is part of the Qt Enterprise Embedded.
**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** $QT_BEGIN_LICENSE:COMM$
**
-** "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."
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** $QT_END_LICENSE$
**
-****************************************************************************/
+******************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
-import QtQuick.Controls.Styles 1.2
-import QtQuick.Enterprise.VirtualKeyboard.Settings 1.2
+import QtQuick.Controls 1.4
+import QtQuick.Enterprise.VirtualKeyboard.Settings 2.0
import B2Qt.Wifi 1.0
import B2Qt.Utils 1.0
Rectangle {
anchors.fill: parent
- color: "#212126"
-
+ color: "white"
Flickable {
anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: engine.mm(5)
+ anchors.horizontalCenter: parent.horizontalCenter
height: parent.height
width: parent.width
contentHeight: mainLayout.height + engine.centimeter(2)
@@ -66,273 +44,291 @@ Rectangle {
id: mainLayout
width: Math.min(engine.screenWidth(), engine.screenHeight())
height: implicitHeight
- anchors.left: parent.left
- anchors.right: parent.right
- spacing: engine.mm(4)
+ anchors.horizontalCenter: parent.horizontalCenter
- GroupBox {
- id: powerOptions
- title: "Power"
- Layout.fillWidth: true
- style: SettingsGroupBoxStyle {}
- implicitWidth: 0
- height: implicitHeight
+ property int defaultMargin: width * .1
+ property int column1Width: width * .25
- RowLayout {
- anchors.fill: parent
+ Label {
+ text: qsTr("Demo Launcher Settings")
+ font.pixelSize: engine.titleFontSize()
+ Layout.topMargin: height
+ Layout.bottomMargin: height
+ }
- Button {
- style: SettingsButtonStyle {}
- text: "Shut Down"
- Layout.fillWidth: true
- onClicked: B2QtDevice.powerOff();
- }
+ SettingTitle {
+ titleText: qsTr("Network")
+ iconSource: "images/Network_icon.png"
+ smallText: qsTr("Current hostname: %1").arg(B2QtDevice.hostname)
+ }
- Button {
- style: SettingsButtonStyle {}
- text: "Reboot"
- Layout.fillWidth: true
- onClicked: B2QtDevice.reboot();
+ GridLayout {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ Layout.bottomMargin: engine.mm(3)
+ columns: 3
+ rows: 3
+
+ Label {
+ text: qsTr("Change Hostname:")
+ font.pixelSize: engine.smallFontSize()
+ Layout.preferredWidth: mainLayout.column1Width
+ Layout.leftMargin: mainLayout.defaultMargin
+ }
+
+ TextField {
+ id: hostname
+ text: B2QtDevice.hostname
+ placeholderText: qsTr("Enter hostname")
+ font.pixelSize: engine.smallFontSize()
+ inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhNoPredictiveText
+ Layout.fillWidth: true
+ Layout.rightMargin: mainLayout.defaultMargin * .25
+ onAccepted: {
+ Qt.inputMethod.commit()
+ Qt.inputMethod.hide()
+ B2QtDevice.setHostname(hostname.text)
+ hostname.focus = false
}
}
- }
- GroupBox {
- id: displayOptions
- title: "Display"
- style: SettingsGroupBoxStyle {}
- Layout.fillWidth: true
- implicitWidth: 0
- height: implicitHeight
+ Button {
+ id: hostnameButton
- GridLayout {
- rows: 2
- flow: GridLayout.TopToBottom
- anchors.fill: parent
-
- Label {
- text: "Brightness: "
- font.pixelSize: engine.smallFontSize() * 0.8
- color: "white"
- }
+ anchors.right: parent.right
+ text: qsTr("Change")
- Label {
- text: "Display FPS: "
- font.pixelSize: engine.smallFontSize() * 0.8
- color: "white"
- }
+ onClicked: hostname.accepted()
+ }
- Slider {
- id: brightnessSlider
- maximumValue: 255
- minimumValue: 1
- Layout.fillWidth: true
- value: B2QtDevice.displayBrightness
- style: SliderStyle {
- handle: Rectangle {
- anchors.centerIn: parent
- color: "white"
- border.color: "gray"
- border.width: 2
- width: engine.mm(6)
- height: engine.mm(6)
- radius: 20
- }
- }
- }
+ Label {
+ text: qsTr("IP Address:")
+ Layout.preferredWidth: parent.width * .2
+ font.pixelSize: engine.smallFontSize()
+ Layout.leftMargin: mainLayout.defaultMargin
+ }
- CheckBox {
- style: SettingsCheckBoxStyle {}
- checked: engine.fpsEnabled
- onCheckedChanged: engine.fpsEnabled = checked
- }
+ Label {
+ text: B2QtDevice.ipAddress
+ font.pixelSize: engine.smallFontSize()
}
}
- GroupBox {
- id: vkbOptions
- title: "Virtual Keyboard Style"
- style: SettingsGroupBoxStyle {}
+ ColumnLayout {
+ id: wifiOptions
Layout.fillWidth: true
+ Layout.leftMargin: mainLayout.defaultMargin
+ visible: false
- function updateVKBStyle(styleRadioButton) {
- VirtualKeyboardSettings.styleName = styleRadioButton.text.toLowerCase()
+ function createWifiGroupBox()
+ {
+ if (WifiDevice.wifiSupported()) {
+ var component = Qt.createComponent("WifiGroupBox.qml")
+ var wifi = component.createObject(wifiOptions)
+ if (wifi) {
+ wifiOptions.visible = true
+ } else {
+ print("Error creating WifiGroupBox")
+ }
+ }
}
+ Component.onCompleted: wifiOptions.createWifiGroupBox()
+ }
+
+ Spacer {}
+
+ SettingTitle {
+ id: vKBSettingsTitle
+ titleText: qsTr("Virtual Keyboard Style")
+ iconSource: "images/Keyboard_icon.png"
+ smallText: qsTr("Preview:")
+ }
+
+ RowLayout {
+ id: row1
+ spacing: 0
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ GridLayout {
+ id: vKBStyleSelection
+ anchors.left: parent.left
+ anchors.right: parent.horizontalCenter
+ columns: 2
+ rows: 2
+
+ function updateVKBStyle(style) {
+ VirtualKeyboardSettings.styleName = style.toLowerCase()
+ }
- Row {
- spacing: engine.mm(6)
ExclusiveGroup { id: vkbStyleGroup }
+
+ Label {
+ text: qsTr("Default")
+ Layout.preferredWidth: mainLayout.column1Width
+ font.pixelSize: engine.smallFontSize()
+ Layout.leftMargin: mainLayout.defaultMargin
+ }
+
RadioButton {
id: defaultStyle
- style: SettingsRadioButtonStyle {}
- text: "Default"
exclusiveGroup: vkbStyleGroup
- onClicked: vkbOptions.updateVKBStyle(defaultStyle)
+ checked: VirtualKeyboardSettings.styleName === "default"
+ onClicked: vKBStyleSelection.updateVKBStyle("default")
+ }
+
+ Label {
+ text: qsTr("Retro")
+ Layout.preferredWidth: mainLayout.column1Width
+ font.pixelSize: engine.smallFontSize()
+ Layout.leftMargin: mainLayout.defaultMargin
}
+
RadioButton {
id: retroStyle
- style: SettingsRadioButtonStyle {}
- text: "Retro"
exclusiveGroup: vkbStyleGroup
- onClicked: vkbOptions.updateVKBStyle(retroStyle)
+ checked: VirtualKeyboardSettings.styleName === "retro"
+ onClicked: vKBStyleSelection.updateVKBStyle("retro")
}
}
+ Image {
+ id: vKBPreviewThumbnail
+ anchors.right: parent.right
+ Layout.preferredWidth: mainLayout.width *.4
+ Layout.leftMargin: mainLayout.defaultMargin
+ source: VirtualKeyboardSettings.styleName === "retro" ?
+ "images/Keyboard_Thumb_retro.png" :
+ "images/Keyboard_Thumb_default.png"
+
+ fillMode: Image.PreserveAspectFit
+ }
+ }
+
+ Spacer {}
+
+ SettingTitle {
+ titleText: qsTr("Display")
+ iconSource: "images/Display_icon.png"
+ }
+
+ GridLayout {
+ id: gridLayout
+ anchors.left: parent.left
+ anchors.right: parent.right
+ columns: 3
+ rows: 3
+
+ Label {
+ text: qsTr("Brightness:")
+ font.pixelSize: engine.smallFontSize()
+ Layout.preferredWidth: mainLayout.column1Width
+ Layout.leftMargin: mainLayout.defaultMargin
+ }
+
+ Slider {
+ id: brightnessSlider
+ maximumValue: 255
+ minimumValue: 1
+ Layout.preferredWidth: physicalSizeSlider.width
+ value: B2QtDevice.displayBrightness
+ }
+
Binding {
target: B2QtDevice
property: "displayBrightness"
value: brightnessSlider.value
}
- Component.onCompleted: {
- if (VirtualKeyboardSettings.styleName == "default")
- defaultStyle.checked = true
- if (VirtualKeyboardSettings.styleName == "retro")
- retroStyle.checked = true
+ Text {
+ text: qsTr("%1%").arg(Math.round(brightnessSlider.value / brightnessSlider.maximumValue * 100))
+ font.pixelSize: engine.smallFontSize()
+ Layout.leftMargin: mainLayout.width * .05
+ }
+
+ Label {
+ text: qsTr("Display FPS:")
+ font.pixelSize: engine.smallFontSize()
+ Layout.preferredWidth: parent.width * .2
+ Layout.leftMargin: mainLayout.defaultMargin
+ }
+
+ CheckBox {
+ checked: engine.fpsEnabled
+ onCheckedChanged: engine.fpsEnabled = checked
}
}
- GroupBox {
- id: networkOptions
- title: "Network"
- style: SettingsGroupBoxStyle {}
- Layout.fillWidth: true
- implicitWidth: 0
- height: implicitHeight
+ Rectangle {
+ anchors.left: parent.left
+ anchors.leftMargin: mainLayout.defaultMargin
+ anchors.right: parent.right
+ height: advancedDisplaySettings.height + engine.mm(6)
+ color: "#efefef"
GridLayout {
- rows: 2
+ id: advancedDisplaySettings
+ anchors { left: parent.left; top:parent.top; right: parent.right }
+ anchors.margins: engine.mm(3)
columns: 3
- flow: GridLayout.TopToBottom
- anchors.fill: parent
+ rows: 3
Label {
- text: "Hostname: "
- font.pixelSize: engine.smallFontSize() * 0.8
- color: "white"
+ text: qsTr("Physical Screen Size:")
+ font.pixelSize: engine.smallFontSize()
+ wrapMode: Text.WordWrap
+ Layout.preferredWidth: mainLayout.width * .25 - advancedDisplaySettings.anchors.margins
}
- Label {
- text: "IP address: "
- font.pixelSize: engine.smallFontSize() * 0.8
- color: "white"
+ Slider {
+ id: physicalSizeSlider
+ maximumValue: 60
+ minimumValue: 4
+ Layout.fillWidth: true
+ value: B2QtDevice.physicalScreenSizeInch
}
- TextField {
- id: hostname
- text: B2QtDevice.hostname
- placeholderText: "Enter hostname"
+ Text {
+ text: qsTr("%1 inches").arg(Math.round(physicalSizeSlider.value))
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
- }
+ Layout.preferredWidth: mainLayout.width * .1
+ Layout.leftMargin: mainLayout.width * .05
}
Label {
- text: B2QtDevice.ipAddress
+ text: qsTr("Override\n(needs restart):")
font.pixelSize: engine.smallFontSize()
- color: "white"
- Layout.columnSpan: 2
+ wrapMode: Text.WordWrap
+ Layout.preferredWidth: mainLayout.width * .25 - advancedDisplaySettings.anchors.margins
}
- Button {
- id: hostnameButton
- style: SettingsButtonStyle {}
- text: "Change hostname"
- onClicked: hostname.accepted()
+ CheckBox {
+ checked: B2QtDevice.physicalScreenSizeOverride
+ onCheckedChanged: B2QtDevice.physicalScreenSizeOverride = checked
}
}
}
- GroupBox {
- id: dpiOptions
- title: "Physical screen size"
- style: SettingsGroupBoxStyle {}
- Layout.fillWidth: true
- implicitWidth: 0
- height: implicitHeight
-
- GridLayout {
- rows: 2
- columns: 2
- anchors.fill: parent
-
- RowLayout {
- Layout.columnSpan: 2
- Label {
- text: "Override (needs restart)"
- font.pixelSize: engine.smallFontSize() * 0.8
- color: "white"
- }
- CheckBox {
- id: physSizeCb
- style: SettingsCheckBoxStyle {}
- checked: B2QtDevice.physicalScreenSizeOverride
- onCheckedChanged: B2QtDevice.physicalScreenSizeOverride = checked
- }
- }
+ Spacer {}
- Label {
- visible: physSizeCb.checked
- text: "Size: " + physSizeSlider.value + " inches"
- font.pixelSize: engine.smallFontSize() * 0.8
- color: "white"
- }
-
- Slider {
- visible: physSizeCb.checked
- id: physSizeSlider
- maximumValue: 60
- minimumValue: 4
- Layout.fillWidth: true
- value: B2QtDevice.physicalScreenSizeInch
- stepSize: 1
- style: SliderStyle {
- handle: Rectangle {
- anchors.centerIn: parent
- color: "white"
- border.color: "gray"
- border.width: 2
- width: engine.mm(6)
- height: engine.mm(6)
- radius: 20
- }
- }
- }
- Binding {
- target: B2QtDevice
- property: "physicalScreenSizeInch"
- value: physSizeSlider.value
- }
- }
+ SettingTitle {
+ titleText: qsTr("Power")
+ iconSource: "images/Power_icon.png"
}
- GroupBox {
- id: wifiOptions
- title: "Wifi"
- style: SettingsGroupBoxStyle {}
- Layout.fillWidth: true
- visible: false
+ RowLayout {
+ spacing: mainLayout.defaultMargin *.25
- function createWifiGroupBox()
- {
- if (WifiDevice.wifiSupported()) {
- var component = Qt.createComponent("WifiGroupBox.qml")
- var wifi = component.createObject(wifiOptions.contentItem)
- if (wifi)
- wifiOptions.visible = true
- else
- print("Error creating WifiGroupBox")
- }
+ Button {
+ text: qsTr("Shut Down")
+ Layout.leftMargin: mainLayout.defaultMargin
+ onClicked: B2QtDevice.powerOff();
}
- Component.onCompleted: wifiOptions.createWifiGroupBox()
+ Button {
+ text: qsTr("Reboot")
+ onClicked: B2QtDevice.reboot();
+ }
}
}
}
diff --git a/basicsuite/launchersettings/preview_l.jpg b/basicsuite/launchersettings/preview_l.jpg
index 5b741a9..4cdb7c5 100644
--- a/basicsuite/launchersettings/preview_l.jpg
+++ b/basicsuite/launchersettings/preview_l.jpg
Binary files differ