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
1ec20628
Commit
1ec20628
authored
Mar 15, 2017
by
Gus Grubba
Committed by
GitHub
Mar 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4778 from DonLakeFlyer/CorePluginFix
Fix problems with core plugin virtually
parents
0dcb10c7
b564708d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
49 deletions
+70
-49
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+35
-19
QGCCorePlugin.h
src/api/QGCCorePlugin.h
+7
-2
QGCOptions.h
src/api/QGCOptions.h
+6
-6
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+0
-22
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+22
-0
No files found.
src/api/QGCCorePlugin.cc
View file @
1ec20628
...
...
@@ -29,10 +29,10 @@ public:
,
pOfflineMaps
(
NULL
)
,
pMAVLink
(
NULL
)
,
pConsole
(
NULL
)
#if defined(QT_DEBUG)
#if defined(QT_DEBUG)
,
pMockLink
(
NULL
)
,
pDebug
(
NULL
)
#endif
#endif
,
defaultOptions
(
NULL
)
{
}
...
...
@@ -89,10 +89,10 @@ QGCCorePlugin::QGCCorePlugin(QGCApplication *app)
void
QGCCorePlugin
::
setToolbox
(
QGCToolbox
*
toolbox
)
{
QGCTool
::
setToolbox
(
toolbox
);
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
QGCCorePlugin
>
(
"QGroundControl.QGCCorePlugin"
,
1
,
0
,
"QGCCorePlugin"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QGCOptions
>
(
"QGroundControl.QGCOptions"
,
1
,
0
,
"QGCOptions"
,
"Reference only"
);
QGCTool
::
setToolbox
(
toolbox
);
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
QGCCorePlugin
>
(
"QGroundControl.QGCCorePlugin"
,
1
,
0
,
"QGCCorePlugin"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QGCOptions
>
(
"QGroundControl.QGCOptions"
,
1
,
0
,
"QGCOptions"
,
"Reference only"
);
}
QVariantList
&
QGCCorePlugin
::
settingsPages
()
...
...
@@ -101,33 +101,33 @@ QVariantList &QGCCorePlugin::settingsPages()
if
(
!
_p
->
pGeneral
)
{
//-- Default Settings
_p
->
pGeneral
=
new
QGCSettings
(
tr
(
"General"
),
QUrl
::
fromUserInput
(
"qrc:/qml/GeneralSettings.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/gear-white.svg"
));
QUrl
::
fromUserInput
(
"qrc:/qml/GeneralSettings.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/gear-white.svg"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
((
QGCSettings
*
)
_p
->
pGeneral
));
_p
->
pCommLinks
=
new
QGCSettings
(
tr
(
"Comm Links"
),
QUrl
::
fromUserInput
(
"qrc:/qml/LinkSettings.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/waves.svg"
));
QUrl
::
fromUserInput
(
"qrc:/qml/LinkSettings.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/waves.svg"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
((
QGCSettings
*
)
_p
->
pCommLinks
));
_p
->
pOfflineMaps
=
new
QGCSettings
(
tr
(
"Offline Maps"
),
QUrl
::
fromUserInput
(
"qrc:/qml/OfflineMap.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/waves.svg"
));
QUrl
::
fromUserInput
(
"qrc:/qml/OfflineMap.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/waves.svg"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
((
QGCSettings
*
)
_p
->
pOfflineMaps
));
_p
->
pMAVLink
=
new
QGCSettings
(
tr
(
"MAVLink"
),
QUrl
::
fromUserInput
(
"qrc:/qml/MavlinkSettings.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/waves.svg"
));
QUrl
::
fromUserInput
(
"qrc:/qml/MavlinkSettings.qml"
),
QUrl
::
fromUserInput
(
"qrc:/res/waves.svg"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
((
QGCSettings
*
)
_p
->
pMAVLink
));
_p
->
pConsole
=
new
QGCSettings
(
tr
(
"Console"
),
QUrl
::
fromUserInput
(
"qrc:/qml/QGroundControl/Controls/AppMessages.qml"
));
QUrl
::
fromUserInput
(
"qrc:/qml/QGroundControl/Controls/AppMessages.qml"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
((
QGCSettings
*
)
_p
->
pConsole
));
#if defined(QT_DEBUG)
#if defined(QT_DEBUG)
//-- These are always present on Debug builds
_p
->
pMockLink
=
new
QGCSettings
(
tr
(
"Mock Link"
),
QUrl
::
fromUserInput
(
"qrc:/qml/MockLink.qml"
));
QUrl
::
fromUserInput
(
"qrc:/qml/MockLink.qml"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
((
QGCSettings
*
)
_p
->
pMockLink
));
_p
->
pDebug
=
new
QGCSettings
(
tr
(
"Debug"
),
QUrl
::
fromUserInput
(
"qrc:/qml/DebugWindow.qml"
));
QUrl
::
fromUserInput
(
"qrc:/qml/DebugWindow.qml"
));
_p
->
settingsList
.
append
(
QVariant
::
fromValue
((
QGCSettings
*
)
_p
->
pDebug
));
#endif
#endif
}
return
_p
->
settingsList
;
}
...
...
@@ -168,3 +168,19 @@ bool QGCCorePlugin::adjustSettingMetaData(FactMetaData& metaData)
return
true
;
// Show setting in ui
}
void
QGCCorePlugin
::
setShowTouchAreas
(
bool
show
)
{
if
(
show
!=
_showTouchAreas
)
{
_showTouchAreas
=
show
;
emit
showTouchAreasChanged
(
show
);
}
}
void
QGCCorePlugin
::
setShowAdvancedUI
(
bool
show
)
{
if
(
show
!=
_showAdvancedUI
)
{
_showAdvancedUI
=
show
;
emit
showAdvancedUIChanged
(
show
);
}
}
src/api/QGCCorePlugin.h
View file @
1ec20628
...
...
@@ -37,8 +37,8 @@ public:
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
)
Q_PROPERTY
(
bool
showTouchAreas
READ
showTouchAreas
WRITE
setShowTouchAreas
NOTIFY
showTouchAreasChanged
)
Q_PROPERTY
(
bool
showAdvancedUI
READ
showAdvancedUI
WRITE
setShowAdvancedUI
NOTIFY
showAdvancedUIChanged
)
Q_PROPERTY
(
QString
brandImageIndoor
READ
brandImageIndoor
CONSTANT
)
Q_PROPERTY
(
QString
brandImageOutdoor
READ
brandImageIndoor
CONSTANT
)
...
...
@@ -71,6 +71,11 @@ public:
/// Return the resource file which contains the brand image for for Outdoor theme.
virtual
QString
brandImageOutdoor
(
void
)
const
{
return
QString
();
}
bool
showTouchAreas
(
void
)
const
{
return
_showTouchAreas
;
}
bool
showAdvancedUI
(
void
)
const
{
return
_showAdvancedUI
;
}
void
setShowTouchAreas
(
bool
show
);
void
setShowAdvancedUI
(
bool
show
);
// Override from QGCTool
void
setToolbox
(
QGCToolbox
*
toolbox
);
...
...
src/api/QGCOptions.h
View file @
1ec20628
...
...
@@ -52,12 +52,12 @@ public:
virtual
CustomInstrumentWidget
*
instrumentWidget
();
/// By returning false you can hide the following sensor calibration pages
bool
showSensorCalibrationCompass
()
const
{
return
true
;
}
bool
showSensorCalibrationGyro
()
const
{
return
true
;
}
bool
showSensorCalibrationAccel
()
const
{
return
true
;
}
bool
showSensorCalibrationLevel
()
const
{
return
true
;
}
bool
showSensorCalibrationAirspeed
()
const
{
return
true
;
}
bool
showSensorCalibrationOrient
()
const
{
return
true
;
}
virtual
bool
showSensorCalibrationCompass
()
const
{
return
true
;
}
virtual
bool
showSensorCalibrationGyro
()
const
{
return
true
;
}
virtual
bool
showSensorCalibrationAccel
()
const
{
return
true
;
}
virtual
bool
showSensorCalibrationLevel
()
const
{
return
true
;
}
virtual
bool
showSensorCalibrationAirspeed
()
const
{
return
true
;
}
virtual
bool
showSensorCalibrationOrient
()
const
{
return
true
;
}
signals:
void
showSensorCalibrationCompassChanged
(
bool
show
);
...
...
src/ui/toolbar/MainToolBar.qml
View file @
1ec20628
...
...
@@ -67,28 +67,6 @@ Rectangle {
flyButton
.
checked
=
true
}
// Easter egg mechanism
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
console
.
log
(
"
easter egg click
"
,
++
_clickCount
)
eggTimer
.
restart
()
if
(
_clickCount
==
5
)
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
true
}
else
if
(
_clickCount
==
7
)
{
QGroundControl
.
corePlugin
.
showTouchAreas
=
true
}
}
property
int
_clickCount
:
0
Timer
{
id
:
eggTimer
interval
:
1000
onTriggered
:
parent
.
_clickCount
=
0
}
}
/// Bottom single pixel divider
Rectangle
{
anchors.left
:
parent
.
left
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
1ec20628
...
...
@@ -25,6 +25,28 @@ Item {
QGCPalette
{
id
:
qgcPal
}
// Easter egg mechanism
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
console
.
log
(
"
easter egg click
"
,
++
_clickCount
)
eggTimer
.
restart
()
if
(
_clickCount
==
5
)
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
true
}
else
if
(
_clickCount
==
7
)
{
QGroundControl
.
corePlugin
.
showTouchAreas
=
true
}
}
property
int
_clickCount
:
0
Timer
{
id
:
eggTimer
interval
:
1000
onTriggered
:
parent
.
_clickCount
=
0
}
}
QGCLabel
{
id
:
waitForVehicle
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
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