Commit 0806f857 authored by Gus Grubba's avatar Gus Grubba

Preload Settings, Vehicle Setup and Analyze views

parent 62822013
......@@ -41,10 +41,6 @@ ApplicationWindow {
readonly property string _mainToolbar: QGroundControl.corePlugin.options.mainToolbarUrl
readonly property string _planToolbar: QGroundControl.corePlugin.options.planToolbarUrl
readonly property string settingsViewSource: "AppSettings.qml"
readonly property string setupViewSource: "SetupView.qml"
readonly property string analyzeViewSource: !ScreenTools.isMobile ? "AnalyzeView.qml" : "MavlinkConsolePage.qml"
//-------------------------------------------------------------------------
//-- Global Scope Variables
......@@ -76,50 +72,41 @@ ApplicationWindow {
//-- Global Scope Functions
function viewSwitch(isPlanView) {
settingsWindow.visible = false
setupWindow.visible = false
analyzeWindow.visible = false
rootBackground.visible = false
planViewLoader.visible = false
if(isPlanView) {
rootBackground.visible = false
planViewLoader.visible = true
if(toolbar.source !== _planToolbar) {
toolbar.source = _planToolbar
}
toolbar.source = _planToolbar
} else {
rootBackground.visible = true
planViewLoader.visible = false
if(toolbar.source !== _mainToolbar) {
toolbar.source = _mainToolbar
}
toolbar.source = _mainToolbar
}
}
function showFlyView() {
viewSwitch(false)
mainContentWindow.source = ""
rootBackground.visible = true
}
function showPlanView() {
viewSwitch(true)
mainContentWindow.source = ""
planViewLoader.visible = true
}
function showAnalyzeView() {
viewSwitch(false)
if (mainContentWindow.source !== analyzeViewSource) {
mainContentWindow.source = analyzeViewSource
}
analyzeWindow.visible = true
}
function showSetupView() {
viewSwitch(false)
if (mainContentWindow.source !== setupViewSource) {
mainContentWindow.source = setupViewSource
}
setupWindow.visible = true
}
function showSettingsView() {
viewSwitch(false)
if (mainContentWindow.source !== settingsViewSource) {
mainContentWindow.source = settingsViewSource
}
settingsWindow.visible = true
}
//-------------------------------------------------------------------------
......@@ -313,17 +300,37 @@ ApplicationWindow {
//-------------------------------------------------------------------------
//-- Plan View
Loader {
id: planViewLoader
anchors.fill: parent
visible: false
source: "PlanView.qml"
id: planViewLoader
anchors.fill: parent
visible: false
source: "PlanView.qml"
}
//-------------------------------------------------------------------------
//-- Settings
Loader {
id: settingsWindow
anchors.fill: parent
visible: false
source: "AppSettings.qml"
}
//-------------------------------------------------------------------------
//-- Setup
Loader {
id: setupWindow
anchors.fill: parent
visible: false
source: "SetupView.qml"
}
//-------------------------------------------------------------------------
//-- Current content
//-- Analyze
Loader {
id: mainContentWindow
id: analyzeWindow
anchors.fill: parent
visible: false
source: "AnalyzeView.qml"
}
//-------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment