Warning, /plasma-bigscreen/mycroft-bigscreen-setup/ui/ConfigIntro.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 * Copyright 2018 Aditya Mehra <aix.m@outlook.com> 0003 * 0004 * Licensed under the Apache License, Version 2.0 (the "License"); 0005 * you may not use this file except in compliance with the License. 0006 * You may obtain a copy of the License at 0007 * 0008 * http://www.apache.org/licenses/LICENSE-2.0 0009 * 0010 * Unless required by applicable law or agreed to in writing, software 0011 * distributed under the License is distributed on an "AS IS" BASIS, 0012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0013 * See the License for the specific language governing permissions and 0014 * limitations under the License. 0015 * 0016 */ 0017 0018 import QtQuick.Layouts 1.4 0019 import QtQuick 2.4 0020 import QtQuick.Controls 2.0 0021 import org.kde.kirigami 2.5 as Kirigami 0022 import org.kde.plasma.core 2.0 as PlasmaCore 0023 import Mycroft 1.0 as Mycroft 0024 0025 Item { 0026 id: backendView 0027 anchors.fill: parent 0028 property int speakConfig: sessionData.firstConfigDialog 0029 property bool configurePtt: sessionData.configurePtt 0030 0031 onConfigurePttChanged: { 0032 if(configurePtt){ 0033 console.log("I should configure PTT") 0034 } 0035 } 0036 0037 onSpeakConfigChanged: { 0038 if(speakConfig == 1){ 0039 console.log("I am only 1") 0040 triggerGuiEvent("mycroft.device.speak.first.config", {}) 0041 } 0042 } 0043 0044 Component.onCompleted: { 0045 pos2.forceActiveFocus() 0046 } 0047 0048 Row { 0049 anchors.fill: parent 0050 0051 Rectangle { 0052 id: pos1 0053 color: Qt.rgba(0, 0, 0, 1) 0054 width: root.width / 3 0055 height: parent.height 0056 0057 ColumnLayout { 0058 anchors.fill: parent 0059 anchors.margins: Kirigami.Units.largeSpacing 0060 Item { 0061 Layout.fillWidth: true 0062 Layout.fillHeight: true 0063 0064 Label { 0065 anchors.fill: parent 0066 wrapMode: Text.WordWrap 0067 color: "white" 0068 font.bold: true 0069 minimumPixelSize: height * 0.15 0070 fontSizeMode: Text.Fit 0071 font.pixelSize: height * 0.25 0072 text: "Welcome To Mycroft Setup" 0073 } 0074 } 0075 0076 Item { 0077 Layout.fillWidth: true 0078 Layout.fillHeight: true 0079 0080 Label { 0081 anchors.fill: parent 0082 wrapMode: Text.WordWrap 0083 color: "white" 0084 minimumPixelSize: height * 0.05 0085 fontSizeMode: Text.Fit 0086 font.pixelSize: height * 0.15 0087 text: "This setup will take you through various steps to get your device ready" 0088 } 0089 } 0090 0091 Item { 0092 Layout.fillWidth: true 0093 Layout.fillHeight: true 0094 0095 Label { 0096 anchors.fill: parent 0097 wrapMode: Text.WordWrap 0098 color: "white" 0099 minimumPixelSize: height * 0.05 0100 fontSizeMode: Text.Fit 0101 font.pixelSize: height * 0.15 0102 text: "Let's get started with configuring how you would like to interact with Mycroft" 0103 } 0104 } 0105 0106 Kirigami.Separator { 0107 Layout.fillWidth: true 0108 Layout.preferredHeight: 1 0109 color: "white" 0110 } 0111 0112 Item { 0113 Layout.fillWidth: true 0114 Layout.fillHeight: true 0115 Layout.alignment: Qt.AlignBottom 0116 0117 Label { 0118 anchors.fill: parent 0119 wrapMode: Text.WordWrap 0120 color: "white" 0121 minimumPixelSize: height * 0.05 0122 fontSizeMode: Text.Fit 0123 font.pixelSize: height * 0.10 0124 text: "Change options using ◄ and ► arrow keys, Select one to continue" 0125 } 0126 } 0127 } 0128 } 0129 0130 Rectangle { 0131 id: pos2 0132 color: "#45c5f7" 0133 width: root.width / 3 0134 height: parent.height 0135 focus: true 0136 border.width: pos2.activeFocus ? Kirigami.Units.smallSpacing : 0 0137 border.color: pos2.activeFocus ? "white" : "transparent" 0138 KeyNavigation.right: pos3 0139 0140 ColumnLayout { 0141 anchors.fill: parent 0142 anchors.margins: Kirigami.Units.largeSpacing 0143 0144 Kirigami.Icon { 0145 source: Qt.resolvedUrl("images/tv.svg") 0146 Layout.fillWidth: true 0147 Layout.preferredHeight: parent.height / 4.5 0148 color: "white" 0149 } 0150 Kirigami.Icon { 0151 source: Qt.resolvedUrl("images/remote.svg") 0152 Layout.fillWidth: true 0153 Layout.preferredHeight: parent.height / 4.5 0154 color: "white" 0155 } 0156 Item { 0157 Layout.fillWidth: true 0158 Layout.fillHeight: true 0159 0160 Label { 0161 anchors.fill: parent 0162 wrapMode: Text.WordWrap 0163 color: "white" 0164 minimumPixelSize: height * 0.05 0165 horizontalAlignment: Text.AlignHCenter 0166 fontSizeMode: Text.Fit 0167 font.pixelSize: height * 0.25 0168 text: "Push-To-Talk + Wakeword" 0169 } 0170 } 0171 0172 Item { 0173 Layout.fillWidth: true 0174 Layout.fillHeight: true 0175 0176 Label { 0177 anchors.fill: parent 0178 wrapMode: Text.WordWrap 0179 color: "white" 0180 minimumPixelSize: height * 0.05 0181 horizontalAlignment: Text.AlignHCenter 0182 fontSizeMode: Text.Fit 0183 font.pixelSize: height * 0.15 0184 text: "Allows you to activate mycroft with the push of a button in addition to the 'Hey Mycroft' wakeword" 0185 } 0186 } 0187 0188 Kirigami.Icon { 0189 source: Qt.resolvedUrl("images/greentick.svg") 0190 visible: pos2.activeFocus 0191 Layout.fillWidth: true 0192 Layout.preferredHeight: parent.height * 0.08 0193 } 0194 } 0195 0196 Keys.onReturnPressed: { 0197 triggerGuiEvent("mycroft.device.set.first.config", {"config": "pttwakeword"}) 0198 } 0199 0200 MouseArea { 0201 anchors.fill: parent 0202 onClicked: { 0203 triggerGuiEvent("mycroft.device.set.first.config", {"config": "pttwakeword"}) 0204 } 0205 } 0206 } 0207 0208 Rectangle { 0209 id: pos3 0210 color: "#4577f7" 0211 width: root.width / 3 0212 height: parent.height 0213 border.width: pos3.activeFocus ? Kirigami.Units.smallSpacing : 0 0214 border.color: pos3.activeFocus ? "white" : "transparent" 0215 0216 ColumnLayout { 0217 anchors.fill: parent 0218 anchors.margins: Kirigami.Units.largeSpacing 0219 0220 Kirigami.Icon { 0221 source: Qt.resolvedUrl("images/tv.svg") 0222 Layout.fillWidth: true 0223 Layout.preferredHeight: parent.height / 4.5 0224 color: "white" 0225 } 0226 Kirigami.Icon { 0227 source: Qt.resolvedUrl("images/micarray.svg") 0228 Layout.fillWidth: true 0229 Layout.preferredHeight: parent.height / 4.5 0230 color: "white" 0231 } 0232 Item { 0233 Layout.fillWidth: true 0234 Layout.fillHeight: true 0235 0236 Label { 0237 anchors.fill: parent 0238 wrapMode: Text.WordWrap 0239 color: "white" 0240 minimumPixelSize: height * 0.05 0241 horizontalAlignment: Text.AlignHCenter 0242 fontSizeMode: Text.Fit 0243 font.pixelSize: height * 0.25 0244 text: "Wakeword Only" 0245 } 0246 } 0247 0248 Item { 0249 Layout.fillWidth: true 0250 Layout.fillHeight: true 0251 0252 Label { 0253 anchors.fill: parent 0254 wrapMode: Text.WordWrap 0255 color: "white" 0256 minimumPixelSize: height * 0.05 0257 horizontalAlignment: Text.AlignHCenter 0258 fontSizeMode: Text.Fit 0259 font.pixelSize: height * 0.15 0260 text: "Allows you to activate mycroft with only 'Hey Mycroft' wakeword" 0261 } 0262 } 0263 0264 Kirigami.Icon { 0265 source: Qt.resolvedUrl("images/greentick.svg") 0266 visible: pos3.activeFocus 0267 Layout.fillWidth: true 0268 Layout.preferredHeight: parent.height * 0.08 0269 } 0270 } 0271 0272 Keys.onReturnPressed: { 0273 triggerGuiEvent("mycroft.device.set.first.config", {"config": "wakeword"}) 0274 } 0275 0276 MouseArea { 0277 anchors.fill: parent 0278 onClicked: { 0279 triggerGuiEvent("mycroft.device.set.first.config", {"config": "wakeword"}) 0280 } 0281 } 0282 } 0283 } 0284 }