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

Preload Settings, Vehicle Setup and Analyze views

parent 62822013
...@@ -41,10 +41,6 @@ ApplicationWindow { ...@@ -41,10 +41,6 @@ ApplicationWindow {
readonly property string _mainToolbar: QGroundControl.corePlugin.options.mainToolbarUrl readonly property string _mainToolbar: QGroundControl.corePlugin.options.mainToolbarUrl
readonly property string _planToolbar: QGroundControl.corePlugin.options.planToolbarUrl 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 //-- Global Scope Variables
...@@ -76,50 +72,41 @@ ApplicationWindow { ...@@ -76,50 +72,41 @@ ApplicationWindow {
//-- Global Scope Functions //-- Global Scope Functions
function viewSwitch(isPlanView) { function viewSwitch(isPlanView) {
settingsWindow.visible = false
setupWindow.visible = false
analyzeWindow.visible = false
rootBackground.visible = false
planViewLoader.visible = false
if(isPlanView) { if(isPlanView) {
rootBackground.visible = false toolbar.source = _planToolbar
planViewLoader.visible = true
if(toolbar.source !== _planToolbar) {
toolbar.source = _planToolbar
}
} else { } else {
rootBackground.visible = true toolbar.source = _mainToolbar
planViewLoader.visible = false
if(toolbar.source !== _mainToolbar) {
toolbar.source = _mainToolbar
}
} }
} }
function showFlyView() { function showFlyView() {
viewSwitch(false) viewSwitch(false)
mainContentWindow.source = "" rootBackground.visible = true
} }
function showPlanView() { function showPlanView() {
viewSwitch(true) viewSwitch(true)
mainContentWindow.source = "" planViewLoader.visible = true
} }
function showAnalyzeView() { function showAnalyzeView() {
viewSwitch(false) viewSwitch(false)
if (mainContentWindow.source !== analyzeViewSource) { analyzeWindow.visible = true
mainContentWindow.source = analyzeViewSource
}
} }
function showSetupView() { function showSetupView() {
viewSwitch(false) viewSwitch(false)
if (mainContentWindow.source !== setupViewSource) { setupWindow.visible = true
mainContentWindow.source = setupViewSource
}
} }
function showSettingsView() { function showSettingsView() {
viewSwitch(false) viewSwitch(false)
if (mainContentWindow.source !== settingsViewSource) { settingsWindow.visible = true
mainContentWindow.source = settingsViewSource
}
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
...@@ -313,17 +300,37 @@ ApplicationWindow { ...@@ -313,17 +300,37 @@ ApplicationWindow {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- Plan View //-- Plan View
Loader { Loader {
id: planViewLoader id: planViewLoader
anchors.fill: parent anchors.fill: parent
visible: false visible: false
source: "PlanView.qml" 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 { Loader {
id: mainContentWindow id: analyzeWindow
anchors.fill: parent 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