From 52c4d4fe69461d6a79083de4e8fdaf968eb3e04a Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 14 Aug 2019 09:31:08 -0700 Subject: [PATCH] better FAQ --- .../qml/hifi/simplifiedUI/helpApp/HelpApp.qml | 15 +++++++- .../hifi/simplifiedUI/helpApp/faq/HelpFAQ.qml | 37 ++++++++++++++++++- .../simplifiedUI/settingsApp/SettingsApp.qml | 27 +++++++++++++- scripts/simplifiedUI/ui/simplifiedUI.js | 20 +++++++++- 4 files changed, 95 insertions(+), 4 deletions(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/helpApp/HelpApp.qml b/interface/resources/qml/hifi/simplifiedUI/helpApp/HelpApp.qml index fb97fe812f..d8238d35cf 100644 --- a/interface/resources/qml/hifi/simplifiedUI/helpApp/HelpApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/helpApp/HelpApp.qml @@ -34,6 +34,16 @@ Rectangle { } + onActiveTabViewChanged: { + for (var i = 0; i < tabListModel.count; i++) { + if (tabListModel.get(i).tabViewName === activeTabView) { + tabListView.currentIndex = i; + return; + } + } + } + + Rectangle { id: tabContainer anchors.top: parent.top @@ -108,7 +118,6 @@ Rectangle { MouseArea { anchors.fill: parent onClicked: { - tabListView.currentIndex = index; root.activeTabView = model.tabViewName; } } @@ -134,6 +143,10 @@ Rectangle { id: faqTabViewContainer visible: activeTabView === "faqTabView" anchors.fill: parent + + onSendToScript: { + root.sendToScript(message); + } } HelpAbout.HelpAbout { diff --git a/interface/resources/qml/hifi/simplifiedUI/helpApp/faq/HelpFAQ.qml b/interface/resources/qml/hifi/simplifiedUI/helpApp/faq/HelpFAQ.qml index f2180d49be..81edc9ff37 100644 --- a/interface/resources/qml/hifi/simplifiedUI/helpApp/faq/HelpFAQ.qml +++ b/interface/resources/qml/hifi/simplifiedUI/helpApp/faq/HelpFAQ.qml @@ -61,7 +61,7 @@ Item { } HifiStylesUit.GraphikRegular { - text: "You can find our frequently asked questions here:" + text: "You can find answers to all of our frequently asked questions by clicking the button below." Layout.preferredWidth: parent.width Layout.preferredHeight: paintedHeight Layout.topMargin: 8 @@ -81,5 +81,40 @@ Item { Qt.openUrlExternally("https://www.highfidelity.com/knowledge"); } } + + HifiStylesUit.GraphikSemiBold { + text: "Having problems with your audio?" + Layout.preferredWidth: parent.width + Layout.preferredHeight: paintedHeight + Layout.topMargin: 32 + size: 16 + color: simplifiedUI.colors.text.white + } + + HifiStylesUit.GraphikRegular { + text: "Quickly check your audio configuration and make changes to resolve any audio input/output issues." + Layout.preferredWidth: parent.width + Layout.preferredHeight: paintedHeight + Layout.topMargin: 4 + size: 18 + wrapMode: Text.Wrap + color: simplifiedUI.colors.text.white + } + + SimplifiedControls.Button { + Layout.topMargin: 8 + width: 200 + height: 32 + text: "TEST YOUR AUDIO" + + onClicked: { + root.sendToScript({ + "source": "HelpApp.qml", + "method": "goToAudioSettings" + }); + } + } } + + signal sendToScript(var message); } diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/SettingsApp.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/SettingsApp.qml index a9199ff5f1..ecc8bac2a7 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/SettingsApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/SettingsApp.qml @@ -49,6 +49,15 @@ Rectangle { } } + onActiveTabViewChanged: { + for (var i = 0; i < tabListModel.count; i++) { + if (tabListModel.get(i).tabViewName === activeTabView) { + tabListView.currentIndex = i; + return; + } + } + } + Component.onCompleted: { root.forceActiveFocus(); } @@ -138,7 +147,6 @@ Rectangle { MouseArea { anchors.fill: parent onClicked: { - tabListView.currentIndex = index; root.activeTabView = model.tabViewName; } } @@ -207,7 +215,24 @@ Rectangle { function fromScript(message) { + if (message.source !== "simplifiedUI.js") { + return; + } + switch (message.method) { + case "goToSettingsTab": + var tabToGoTo = message.data.settingsTab; + switch (tabToGoTo) { + case "audio": + activeTabView = "audioTabView"; + break; + + default: + console.log("A message was sent to the Settings window to change tabs, but an invalid tab was specified."); + break; + } + break; + default: console.log('SettingsApp.qml: Unrecognized message from JS'); break; diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index b249027b09..def3637e1c 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -188,6 +188,21 @@ function toggleSettingsApp() { } +function handleGoToAudioSettings() { + if (!settingsAppWindow) { + toggleSettingsApp(); + } + + settingsAppWindow.sendToQml({ + "source": "simplifiedUI.js", + "method": "goToSettingsTab", + "data": { + "settingsTab": "audio" + } + }); +} + + var HELP_APP_MESSAGE_SOURCE = "HelpApp.qml"; function onMessageFromHelpApp(message) { if (message.source !== HELP_APP_MESSAGE_SOURCE) { @@ -195,7 +210,10 @@ function onMessageFromHelpApp(message) { } switch (message.method) { - + case "goToAudioSettings": + handleGoToAudioSettings(); + break; + default: console.log("Unrecognized message from " + HELP_APP_MESSAGE_SOURCE + ": " + JSON.stringify(message)); break;