Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
7c20424b
Commit
7c20424b
authored
Mar 10, 2017
by
Don Gagne
Committed by
GitHub
Mar 10, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4741 from DonLakeFlyer/Advanced
Correct handling of Advanced mode for App Settings
parents
6b10539a
7b33c740
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
86 additions
and
115 deletions
+86
-115
QGCMouseArea.qml
src/QmlControls/QGCMouseArea.qml
+1
-1
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+0
-2
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+0
-11
SubMenuButton.qml
src/QmlControls/SubMenuButton.qml
+2
-1
SetupView.qml
src/VehicleSetup/SetupView.qml
+50
-72
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+5
-1
QGCCorePlugin.h
src/api/QGCCorePlugin.h
+16
-3
AppSettings.qml
src/ui/AppSettings.qml
+10
-22
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+2
-2
No files found.
src/QmlControls/QGCMouseArea.qml
View file @
7c20424b
...
...
@@ -25,7 +25,7 @@ MouseArea {
Rectangle
{
anchors.fill
:
parent
border.color
:
"
red
"
border.width
:
QGroundControl
.
showTouchAreas
?
1
:
0
border.width
:
QGroundControl
.
corePlugin
.
showTouchAreas
?
1
:
0
color
:
"
transparent
"
}
}
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
7c20424b
...
...
@@ -32,8 +32,6 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app)
,
_corePlugin
(
NULL
)
,
_firmwarePluginManager
(
NULL
)
,
_settingsManager
(
NULL
)
,
_showTouchAreas
(
false
)
,
_showAdvancedUI
(
false
)
{
// We clear the parent on this object since we run into shutdown problems caused by hybrid qml app. Instead we let it leak on shutdown.
setParent
(
NULL
);
...
...
src/QmlControls/QGroundControlQmlGlobal.h
View file @
7c20424b
...
...
@@ -73,9 +73,6 @@ public:
Q_PROPERTY
(
QString
qgcVersion
READ
qgcVersion
CONSTANT
)
Q_PROPERTY
(
bool
showTouchAreas
MEMBER
_showTouchAreas
NOTIFY
showTouchAreasChanged
)
Q_PROPERTY
(
bool
showAdvancedUI
MEMBER
_showAdvancedUI
NOTIFY
showAdvancedUIChanged
)
Q_INVOKABLE
void
saveGlobalSetting
(
const
QString
&
key
,
const
QString
&
value
);
Q_INVOKABLE
QString
loadGlobalSetting
(
const
QString
&
key
,
const
QString
&
defaultValue
);
Q_INVOKABLE
void
saveBoolGlobalSetting
(
const
QString
&
key
,
bool
value
);
...
...
@@ -156,9 +153,6 @@ public:
QString
qgcVersion
(
void
)
const
{
return
qgcApp
()
->
applicationVersion
();
}
bool
showTouchAreas
(
void
)
const
{
return
_showTouchAreas
;
}
///< Show visible extents of touch areas
bool
showAdvancedUI
(
void
)
const
{
return
_showAdvancedUI
;
}
///< Show hidden advanced UI
// Overrides from QGCTool
virtual
void
setToolbox
(
QGCToolbox
*
toolbox
);
...
...
@@ -168,8 +162,6 @@ signals:
void
mavlinkSystemIDChanged
(
int
id
);
void
flightMapPositionChanged
(
QGeoCoordinate
flightMapPosition
);
void
flightMapZoomChanged
(
double
flightMapZoom
);
void
showTouchAreasChanged
(
bool
showTouchAreas
);
void
showAdvancedUIChanged
(
bool
showAdvancedUI
);
private:
FlightMapSettings
*
_flightMapSettings
;
...
...
@@ -186,9 +178,6 @@ private:
QGeoCoordinate
_flightMapPosition
;
double
_flightMapZoom
;
bool
_showTouchAreas
;
bool
_showAdvancedUI
;
};
#endif
src/QmlControls/SubMenuButton.qml
View file @
7c20424b
...
...
@@ -7,7 +7,7 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
ScreenTools
1.0
Button
{
id
:
_rootButton
id
:
_rootButton
property
bool
setupComplete
:
true
///< true: setup complete indicator shows as completed
property
bool
setupIndicator
:
true
///< true: show setup complete indicator
property
string
imageResource
:
"
/qmlimages/subMenuButtonImage.png
"
///< Button image
...
...
@@ -17,6 +17,7 @@ Button {
checkable
:
true
implicitHeight
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
3.5
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
implicitWidth
:
__panel
.
implicitWidth
style
:
ButtonStyle
{
id
:
buttonStyle
...
...
src/VehicleSetup/SetupView.qml
View file @
7c20424b
...
...
@@ -7,13 +7,9 @@
*
****************************************************************************/
/// @file
/// @brief Setup View
/// @author Don Gagne <don@thegagnes.com>
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Layouts
1.2
import
QGroundControl
1.0
import
QGroundControl
.
AutoPilotPlugin
1.0
...
...
@@ -217,36 +213,10 @@ Rectangle {
flickableDirection
:
Flickable
.
VerticalFlick
clip
:
true
Column
{
Column
Layout
{
id
:
buttonColumn
width
:
_maxButtonWidth
spacing
:
_defaultTextHeight
/
2
property
real
_maxButtonWidth
:
0
Component.onCompleted
:
reflowWidths
()
Connections
{
target
:
componentRepeater
onModelChanged
:
buttonColumn
.
reflowWidths
()
}
// I don't know why this does not work
Connections
{
target
:
QGroundControl
.
settingsManager
.
appSettings
.
appFontPointSize
onValueChanged
:
buttonColumn
.
reflowWidths
()
}
function
reflowWidths
()
{
buttonColumn
.
_maxButtonWidth
=
0
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
buttonColumn
.
_maxButtonWidth
=
Math
.
max
(
buttonColumn
.
_maxButtonWidth
,
children
[
i
].
width
)
}
for
(
var
j
=
0
;
j
<
children
.
length
;
j
++
)
{
children
[
j
].
width
=
buttonColumn
.
_maxButtonWidth
}
}
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
...
...
@@ -257,56 +227,62 @@ Rectangle {
}
Repeater
{
model
:
QGroundControl
.
corePlugin
.
settings
model
:
QGroundControl
.
corePlugin
.
settings
Pages
visible
:
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
SubMenuButton
{
imageResource
:
modelData
.
icon
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
text
:
modelData
.
title
visible
:
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
onClicked
:
panelLoader
.
setSource
(
modelData
.
url
)
imageResource
:
modelData
.
icon
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
text
:
modelData
.
title
visible
:
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
onClicked
:
panelLoader
.
setSource
(
modelData
.
url
)
Layout.fillWidth
:
true
}
}
SubMenuButton
{
id
:
summaryButton
imageResource
:
"
/qmlimages/VehicleSummaryIcon.png
"
setupIndicator
:
false
checked
:
true
exclusiveGroup
:
setupButtonGroup
text
:
"
Summary
"
id
:
summaryButton
imageResource
:
"
/qmlimages/VehicleSummaryIcon.png
"
setupIndicator
:
false
checked
:
true
exclusiveGroup
:
setupButtonGroup
text
:
"
Summary
"
Layout.fillWidth
:
true
onClicked
:
showSummaryPanel
()
}
SubMenuButton
{
id
:
firmwareButton
imageResource
:
"
/qmlimages/FirmwareUpgradeIcon.png
"
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
!
ScreenTools
.
isMobile
text
:
"
Firmware
"
id
:
firmwareButton
imageResource
:
"
/qmlimages/FirmwareUpgradeIcon.png
"
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
!
ScreenTools
.
isMobile
text
:
"
Firmware
"
Layout.fillWidth
:
true
onClicked
:
showFirmwarePanel
()
}
SubMenuButton
{
id
:
px4FlowButton
exclusiveGroup
:
setupButtonGroup
visible
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
genericFirmware
:
false
setupIndicator
:
false
text
:
"
PX4Flow
"
id
:
px4FlowButton
exclusiveGroup
:
setupButtonGroup
visible
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
genericFirmware
:
false
setupIndicator
:
false
text
:
"
PX4Flow
"
Layout.fillWidth
:
true
onClicked
:
showPX4FlowPanel
()
}
SubMenuButton
{
id
:
joystickButton
setupIndicator
:
true
setupComplete
:
joystickManager
.
activeJoystick
?
joystickManager
.
activeJoystick
.
calibrated
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
_fullParameterVehicleAvailable
&&
joystickManager
.
joysticks
.
length
!=
0
text
:
"
Joystick
"
id
:
joystickButton
setupIndicator
:
true
setupComplete
:
joystickManager
.
activeJoystick
?
joystickManager
.
activeJoystick
.
calibrated
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
_fullParameterVehicleAvailable
&&
joystickManager
.
joysticks
.
length
!=
0
text
:
"
Joystick
"
Layout.fillWidth
:
true
onClicked
:
showJoystickPanel
()
}
...
...
@@ -316,22 +292,24 @@ Rectangle {
model
:
_fullParameterVehicleAvailable
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
:
0
SubMenuButton
{
imageResource
:
modelData
.
iconResource
setupIndicator
:
modelData
.
requiresSetup
setupComplete
:
modelData
.
setupComplete
exclusiveGroup
:
setupButtonGroup
text
:
modelData
.
name
visible
:
modelData
.
setupSource
.
toString
()
!=
""
imageResource
:
modelData
.
iconResource
setupIndicator
:
modelData
.
requiresSetup
setupComplete
:
modelData
.
setupComplete
exclusiveGroup
:
setupButtonGroup
text
:
modelData
.
name
visible
:
modelData
.
setupSource
.
toString
()
!=
""
Layout.fillWidth
:
true
onClicked
:
showVehicleComponentPanel
(
modelData
)
}
}
SubMenuButton
{
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
QGroundControl
.
multiVehicleManager
.
parameterReadyVehicleAvailable
text
:
"
Parameters
"
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
QGroundControl
.
multiVehicleManager
.
parameterReadyVehicleAvailable
text
:
"
Parameters
"
Layout.fillWidth
:
true
onClicked
:
showParametersPanel
()
}
...
...
src/api/QGCCorePlugin.cc
View file @
7c20424b
...
...
@@ -36,6 +36,7 @@ public:
,
defaultOptions
(
NULL
)
{
}
~
QGCCorePlugin_p
()
{
if
(
pGeneral
)
...
...
@@ -57,6 +58,7 @@ public:
if
(
defaultOptions
)
delete
defaultOptions
;
}
QGCSettings
*
pGeneral
;
QGCSettings
*
pCommLinks
;
QGCSettings
*
pOfflineMaps
;
...
...
@@ -79,6 +81,8 @@ QGCCorePlugin::~QGCCorePlugin()
QGCCorePlugin
::
QGCCorePlugin
(
QGCApplication
*
app
)
:
QGCTool
(
app
)
,
_showTouchAreas
(
false
)
,
_showAdvancedUI
(
false
)
{
_p
=
new
QGCCorePlugin_p
;
}
...
...
@@ -91,7 +95,7 @@ void QGCCorePlugin::setToolbox(QGCToolbox *toolbox)
qmlRegisterUncreatableType
<
QGCOptions
>
(
"QGroundControl.QGCOptions"
,
1
,
0
,
"QGCOptions"
,
"Reference only"
);
}
QVariantList
&
QGCCorePlugin
::
settings
()
QVariantList
&
QGCCorePlugin
::
settings
Pages
()
{
//-- If this hasn't been overridden, create default set of settings
if
(
!
_p
->
pGeneral
)
{
...
...
src/api/QGCCorePlugin.h
View file @
7c20424b
...
...
@@ -33,13 +33,16 @@ public:
QGCCorePlugin
(
QGCApplication
*
app
);
~
QGCCorePlugin
();
Q_PROPERTY
(
QVariantList
settings
READ
settings
CONSTANT
)
Q_PROPERTY
(
QVariantList
settings
Pages
READ
settingsPages
NOTIFY
settingsPagesChanged
)
Q_PROPERTY
(
int
defaultSettings
READ
defaultSettings
CONSTANT
)
Q_PROPERTY
(
QGCOptions
*
options
READ
options
CONSTANT
)
Q_PROPERTY
(
bool
showTouchAreas
MEMBER
_showTouchAreas
NOTIFY
showTouchAreasChanged
)
Q_PROPERTY
(
bool
showAdvancedUI
MEMBER
_showAdvancedUI
NOTIFY
showAdvancedUIChanged
)
/// The list of settings under the Settings Menu
/// @return A list of QGCSettings
virtual
QVariantList
&
settings
();
virtual
QVariantList
&
settings
Pages
();
/// The default settings panel to show
/// @return The settings index
...
...
@@ -61,6 +64,16 @@ public:
// Override from QGCTool
void
setToolbox
(
QGCToolbox
*
toolbox
);
signals:
void
settingsPagesChanged
(
void
);
void
showTouchAreasChanged
(
bool
showTouchAreas
);
void
showAdvancedUIChanged
(
bool
showAdvancedUI
);
protected:
bool
_showTouchAreas
;
bool
_showAdvancedUI
;
private:
QGCCorePlugin_p
*
_p
;
QGCCorePlugin_p
*
_p
;
};
src/ui/AppSettings.qml
View file @
7c20424b
...
...
@@ -10,12 +10,11 @@
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
Qt
Positioning
5.3
import
Qt
Quick
.
Layouts
1.2
import
QGroundControl
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
FlightDisplay
1.0
import
QGroundControl
.
ScreenTools
1.0
Rectangle
{
...
...
@@ -28,7 +27,6 @@ Rectangle {
readonly
property
real
_horizontalMargin
:
_defaultTextWidth
/
2
readonly
property
real
_verticalMargin
:
_defaultTextHeight
/
2
readonly
property
real
_buttonHeight
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
3
:
ScreenTools
.
defaultFontPixelHeight
*
2
readonly
property
real
_buttonWidth
:
ScreenTools
.
defaultFontPixelWidth
*
10
property
bool
_first
:
true
...
...
@@ -36,7 +34,7 @@ Rectangle {
Component.onCompleted
:
{
//-- Default Settings
__rightPanel
.
source
=
QGroundControl
.
corePlugin
.
settings
[
QGroundControl
.
corePlugin
.
defaultSettings
].
url
__rightPanel
.
source
=
QGroundControl
.
corePlugin
.
settings
Pages
[
QGroundControl
.
corePlugin
.
defaultSettings
].
url
}
QGCFlickable
{
...
...
@@ -53,25 +51,12 @@ Rectangle {
ExclusiveGroup
{
id
:
panelActionGroup
}
Column
{
Column
Layout
{
id
:
buttonColumn
width
:
_maxButtonWidth
spacing
:
_verticalMargin
property
real
_maxButtonWidth
:
0
Component.onCompleted
:
reflowWidths
()
function
reflowWidths
()
{
buttonColumn
.
_maxButtonWidth
=
0
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
buttonColumn
.
_maxButtonWidth
=
Math
.
max
(
buttonColumn
.
_maxButtonWidth
,
children
[
i
].
width
)
}
for
(
var
j
=
0
;
j
<
children
.
length
;
j
++
)
{
children
[
j
].
width
=
buttonColumn
.
_maxButtonWidth
}
}
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
...
...
@@ -82,17 +67,20 @@ Rectangle {
}
Repeater
{
model
:
QGroundControl
.
corePlugin
.
settings
model
:
QGroundControl
.
corePlugin
.
settings
Pages
QGCButton
{
height
:
_buttonHeight
text
:
modelData
.
title
exclusiveGroup
:
panelActionGroup
height
:
_buttonHeight
text
:
modelData
.
title
exclusiveGroup
:
panelActionGroup
Layout.fillWidth
:
true
onClicked
:
{
if
(
__rightPanel
.
source
!==
modelData
.
url
)
{
__rightPanel
.
source
=
modelData
.
url
}
checked
=
true
}
Component.onCompleted
:
{
if
(
_first
)
{
_first
=
false
...
...
src/ui/toolbar/MainToolBar.qml
View file @
7c20424b
...
...
@@ -74,9 +74,9 @@ Rectangle {
console
.
log
(
"
easter egg click
"
,
++
_clickCount
)
eggTimer
.
restart
()
if
(
_clickCount
==
5
)
{
QGroundControl
.
showAdvancedUI
=
true
QGroundControl
.
corePlugin
.
showAdvancedUI
=
true
}
else
if
(
_clickCount
==
7
)
{
QGroundControl
.
showTouchAreas
=
true
QGroundControl
.
corePlugin
.
showTouchAreas
=
true
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment