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
7800a06a
Commit
7800a06a
authored
Nov 24, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add virtual joystick settings
Also reflow settings pane to take less space
parent
dbaa604b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
6 deletions
+55
-6
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+16
-2
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+8
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+31
-4
No files found.
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
7800a06a
...
...
@@ -29,7 +29,9 @@
#include <QSettings>
static
const
char
*
kQmlGlobalKeyName
=
"QGCQml"
;
static
const
char
*
kQmlGlobalKeyName
=
"QGCQml"
;
const
char
*
QGroundControlQmlGlobal
::
_virtualTabletJoystickKey
=
"VirtualTabletJoystick"
;
QGroundControlQmlGlobal
::
QGroundControlQmlGlobal
(
QGCToolbox
*
toolbox
,
QObject
*
parent
)
:
QObject
(
parent
)
...
...
@@ -37,8 +39,10 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCToolbox* toolbox, QObject* p
,
_linkManager
(
toolbox
->
linkManager
())
,
_homePositionManager
(
toolbox
->
homePositionManager
())
,
_flightMapSettings
(
toolbox
->
flightMapSettings
())
,
_virtualTabletJoystick
(
false
)
{
QSettings
settings
;
_virtualTabletJoystick
=
settings
.
value
(
_virtualTabletJoystickKey
,
false
).
toBool
();
}
void
QGroundControlQmlGlobal
::
saveGlobalSetting
(
const
QString
&
key
,
const
QString
&
value
)
...
...
@@ -204,3 +208,13 @@ void QGroundControlQmlGlobal::setIsVersionCheckEnabled(bool enable)
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
enableVersionCheck
(
enable
);
emit
isVersionCheckEnabledChanged
(
enable
);
}
void
QGroundControlQmlGlobal
::
setVirtualTabletJoystick
(
bool
enabled
)
{
if
(
_virtualTabletJoystick
!=
enabled
)
{
QSettings
settings
;
settings
.
setValue
(
_virtualTabletJoystickKey
,
enabled
);
_virtualTabletJoystick
=
enabled
;
emit
virtualTabletJoystickChanged
(
enabled
);
}
}
src/QmlControls/QGroundControlQmlGlobal.h
View file @
7800a06a
...
...
@@ -67,6 +67,7 @@ public:
Q_PROPERTY
(
bool
isHeartBeatEnabled
READ
isHeartBeatEnabled
WRITE
setIsHeartBeatEnabled
NOTIFY
isHeartBeatEnabledChanged
)
Q_PROPERTY
(
bool
isMultiplexingEnabled
READ
isMultiplexingEnabled
WRITE
setIsMultiplexingEnabled
NOTIFY
isMultiplexingEnabledChanged
)
Q_PROPERTY
(
bool
isVersionCheckEnabled
READ
isVersionCheckEnabled
WRITE
setIsVersionCheckEnabled
NOTIFY
isVersionCheckEnabledChanged
)
Q_PROPERTY
(
bool
virtualTabletJoystick
READ
virtualTabletJoystick
WRITE
setVirtualTabletJoystick
NOTIFY
virtualTabletJoystickChanged
)
Q_INVOKABLE
void
saveGlobalSetting
(
const
QString
&
key
,
const
QString
&
value
);
Q_INVOKABLE
QString
loadGlobalSetting
(
const
QString
&
key
,
const
QString
&
defaultValue
);
...
...
@@ -101,6 +102,7 @@ public:
bool
isHeartBeatEnabled
()
{
return
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
heartbeatsEnabled
();
}
bool
isMultiplexingEnabled
()
{
return
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
multiplexingEnabled
();
}
bool
isVersionCheckEnabled
()
{
return
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
versionCheckEnabled
();
}
bool
virtualTabletJoystick
()
{
return
_virtualTabletJoystick
;
}
//-- TODO: Make this into an actual preference.
bool
isAdvancedMode
()
{
return
false
;
}
...
...
@@ -113,6 +115,7 @@ public:
void
setIsHeartBeatEnabled
(
bool
enable
);
void
setIsMultiplexingEnabled
(
bool
enable
);
void
setIsVersionCheckEnabled
(
bool
enable
);
void
setVirtualTabletJoystick
(
bool
enabled
);
signals:
void
isDarkStyleChanged
(
bool
dark
);
...
...
@@ -123,6 +126,7 @@ signals:
void
isHeartBeatEnabledChanged
(
bool
enabled
);
void
isMultiplexingEnabledChanged
(
bool
enabled
);
void
isVersionCheckEnabledChanged
(
bool
enabled
);
void
virtualTabletJoystickChanged
(
bool
enabled
);
private:
#ifdef QT_DEBUG
...
...
@@ -133,6 +137,10 @@ private:
LinkManager
*
_linkManager
;
HomePositionManager
*
_homePositionManager
;
FlightMapSettings
*
_flightMapSettings
;
bool
_virtualTabletJoystick
;
static
const
char
*
_virtualTabletJoystickKey
;
};
#endif
src/ui/preferences/GeneralSettings.qml
View file @
7800a06a
...
...
@@ -54,17 +54,19 @@ Rectangle {
Column
{
id
:
settingsColumn
width
:
_generalRoot
.
width
spacing
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
2
QGCLabel
{
text
:
"
General Settings
"
font.pixelSize
:
ScreenTools
.
mediumFontPixelSize
}
Rectangle
{
height
:
1
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
color
:
qgcPal
.
button
}
//-----------------------------------------------------------------
//-- Audio preferences
QGCCheckBox
{
...
...
@@ -131,6 +133,12 @@ Rectangle {
}
}
}
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
}
//-----------------------------------------------------------------
//-- Map Providers
Row
{
...
...
@@ -182,6 +190,11 @@ Rectangle {
}
}
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
}
//-----------------------------------------------------------------
//-- Autoconnect settings
QGCLabel
{
text
:
"
Autoconnect to the following devices:
"
}
...
...
@@ -209,6 +222,20 @@ Rectangle {
checked
:
QGroundControl
.
linkManager
.
autoconnectUDP
onClicked
:
QGroundControl
.
linkManager
.
autoconnectUDP
=
checked
}
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
}
//-----------------------------------------------------------------
//-- Virtual joystick settings
QGCCheckBox
{
text
:
"
Thumb Joystick (WIP - be careful!)
"
checked
:
QGroundControl
.
virtualTabletJoystick
onClicked
:
QGroundControl
.
virtualTabletJoystick
=
checked
visible
:
ScreenTools
.
isMobile
}
}
}
}
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