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) {
if(isPlanView) { settingsWindow.visible = false
setupWindow.visible = false
analyzeWindow.visible = false
rootBackground.visible = false rootBackground.visible = false
planViewLoader.visible = true planViewLoader.visible = false
if(toolbar.source !== _planToolbar) { if(isPlanView) {
toolbar.source = _planToolbar toolbar.source = _planToolbar
}
} else { } else {
rootBackground.visible = true
planViewLoader.visible = false
if(toolbar.source !== _mainToolbar) {
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
}
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
...@@ -320,10 +307,30 @@ ApplicationWindow { ...@@ -320,10 +307,30 @@ ApplicationWindow {
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- Current content //-- Settings
Loader { Loader {
id: mainContentWindow id: settingsWindow
anchors.fill: parent anchors.fill: parent
visible: false
source: "AppSettings.qml"
}
//-------------------------------------------------------------------------
//-- Setup
Loader {
id: setupWindow
anchors.fill: parent
visible: false
source: "SetupView.qml"
}
//-------------------------------------------------------------------------
//-- Analyze
Loader {
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