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
68462431
Commit
68462431
authored
Aug 23, 2017
by
dheideman
Committed by
Jacob Walser
Sep 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add user-selectable brand image capability
parent
6e388c70
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
199 additions
and
2 deletions
+199
-2
App.SettingsGroup.json
src/Settings/App.SettingsGroup.json
+21
-0
AppSettings.cc
src/Settings/AppSettings.cc
+33
-0
AppSettings.h
src/Settings/AppSettings.h
+12
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+127
-0
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+6
-2
No files found.
src/Settings/App.SettingsGroup.json
View file @
68462431
...
...
@@ -143,6 +143,27 @@
"type"
:
"string"
,
"defaultValue"
:
""
},
{
"name"
:
"UserBrandImageIndoor"
,
"shortDescription"
:
"User-selected brand image"
,
"longDescription"
:
"Location in file system of user-selected brand image (indoor)"
,
"type"
:
"string"
,
"defaultValue"
:
""
},
{
"name"
:
"UserBrandImageOutdoor"
,
"shortDescription"
:
"User-selected brand image"
,
"longDescription"
:
"Location in file system of user-selected brand image (outdoor)"
,
"type"
:
"string"
,
"defaultValue"
:
""
},
{
"name"
:
"UserBrandImageLinked"
,
"shortDescription"
:
"Link indoor/outdoor brand images"
,
"longDescription"
:
"Boolean option to use same image for indoor and outdoor brand images"
,
"type"
:
"bool"
,
"defaultValue"
:
true
},
{
"name"
:
"MapboxToken"
,
"shortDescription"
:
"Access token to Mapbox maps"
,
...
...
src/Settings/AppSettings.cc
View file @
68462431
...
...
@@ -32,6 +32,9 @@ const char* AppSettings::appFontPointSizeName = "BaseDev
const
char
*
AppSettings
::
indoorPaletteName
=
"StyleIsDark"
;
const
char
*
AppSettings
::
showLargeCompassName
=
"ShowLargeCompass"
;
const
char
*
AppSettings
::
savePathName
=
"SavePath"
;
const
char
*
AppSettings
::
userBrandImageIndoorName
=
"UserBrandImageIndoor"
;
const
char
*
AppSettings
::
userBrandImageOutdoorName
=
"UserBrandImageOutdoor"
;
const
char
*
AppSettings
::
userBrandImageLinkedName
=
"UserBrandImageLinked"
;
const
char
*
AppSettings
::
autoLoadMissionsName
=
"AutoLoadMissions"
;
const
char
*
AppSettings
::
mapboxTokenName
=
"MapboxToken"
;
const
char
*
AppSettings
::
esriTokenName
=
"EsriToken"
;
...
...
@@ -71,6 +74,9 @@ AppSettings::AppSettings(QObject* parent)
,
_indoorPaletteFact
(
NULL
)
,
_showLargeCompassFact
(
NULL
)
,
_savePathFact
(
NULL
)
,
_userBrandImageIndoorFact
(
NULL
)
,
_userBrandImageOutdoorFact
(
NULL
)
,
_userBrandImageLinkedFact
(
NULL
)
,
_autoLoadMissionsFact
(
NULL
)
,
_mapboxTokenFact
(
NULL
)
,
_esriTokenFact
(
NULL
)
...
...
@@ -331,6 +337,33 @@ QString AppSettings::videoSavePath(void)
return
fullPath
;
}
Fact
*
AppSettings
::
userBrandImageIndoor
(
void
)
{
if
(
!
_userBrandImageIndoorFact
)
{
_userBrandImageIndoorFact
=
_createSettingsFact
(
userBrandImageIndoorName
);
}
return
_userBrandImageIndoorFact
;
}
Fact
*
AppSettings
::
userBrandImageOutdoor
(
void
)
{
if
(
!
_userBrandImageOutdoorFact
)
{
_userBrandImageOutdoorFact
=
_createSettingsFact
(
userBrandImageOutdoorName
);
}
return
_userBrandImageOutdoorFact
;
}
Fact
*
AppSettings
::
userBrandImageLinked
(
void
)
{
if
(
!
_userBrandImageLinkedFact
)
{
_userBrandImageLinkedFact
=
_createSettingsFact
(
userBrandImageLinkedName
);
}
return
_userBrandImageLinkedFact
;
}
Fact
*
AppSettings
::
autoLoadMissions
(
void
)
{
if
(
!
_autoLoadMissionsFact
)
{
...
...
src/Settings/AppSettings.h
View file @
68462431
...
...
@@ -36,6 +36,9 @@ public:
Q_PROPERTY
(
Fact
*
indoorPalette
READ
indoorPalette
CONSTANT
)
Q_PROPERTY
(
Fact
*
showLargeCompass
READ
showLargeCompass
CONSTANT
)
Q_PROPERTY
(
Fact
*
savePath
READ
savePath
CONSTANT
)
Q_PROPERTY
(
Fact
*
userBrandImageIndoor
READ
userBrandImageIndoor
CONSTANT
)
Q_PROPERTY
(
Fact
*
userBrandImageOutdoor
READ
userBrandImageOutdoor
CONSTANT
)
Q_PROPERTY
(
Fact
*
userBrandImageLinked
READ
userBrandImageLinked
CONSTANT
)
Q_PROPERTY
(
Fact
*
autoLoadMissions
READ
autoLoadMissions
CONSTANT
)
Q_PROPERTY
(
Fact
*
mapboxToken
READ
mapboxToken
CONSTANT
)
Q_PROPERTY
(
Fact
*
esriToken
READ
esriToken
CONSTANT
)
...
...
@@ -71,6 +74,9 @@ public:
Fact
*
indoorPalette
(
void
);
Fact
*
showLargeCompass
(
void
);
Fact
*
savePath
(
void
);
Fact
*
userBrandImageIndoor
(
void
);
Fact
*
userBrandImageOutdoor
(
void
);
Fact
*
userBrandImageLinked
(
void
);
Fact
*
autoLoadMissions
(
void
);
Fact
*
mapboxToken
(
void
);
Fact
*
esriToken
(
void
);
...
...
@@ -103,6 +109,9 @@ public:
static
const
char
*
indoorPaletteName
;
static
const
char
*
showLargeCompassName
;
static
const
char
*
savePathName
;
static
const
char
*
userBrandImageIndoorName
;
static
const
char
*
userBrandImageOutdoorName
;
static
const
char
*
userBrandImageLinkedName
;
static
const
char
*
autoLoadMissionsName
;
static
const
char
*
mapboxTokenName
;
static
const
char
*
esriTokenName
;
...
...
@@ -150,6 +159,9 @@ private:
SettingsFact
*
_indoorPaletteFact
;
SettingsFact
*
_showLargeCompassFact
;
SettingsFact
*
_savePathFact
;
SettingsFact
*
_userBrandImageIndoorFact
;
SettingsFact
*
_userBrandImageOutdoorFact
;
SettingsFact
*
_userBrandImageLinkedFact
;
SettingsFact
*
_autoLoadMissionsFact
;
SettingsFact
*
_mapboxTokenFact
;
SettingsFact
*
_esriTokenFact
;
...
...
src/ui/preferences/GeneralSettings.qml
View file @
68462431
...
...
@@ -34,6 +34,9 @@ QGCView {
property
Fact
_percentRemainingAnnounce
:
QGroundControl
.
settingsManager
.
appSettings
.
batteryPercentRemainingAnnounce
property
Fact
_savePath
:
QGroundControl
.
settingsManager
.
appSettings
.
savePath
property
Fact
_userBrandImageIndoor
:
QGroundControl
.
settingsManager
.
appSettings
.
userBrandImageIndoor
property
Fact
_userBrandImageOutdoor
:
QGroundControl
.
settingsManager
.
appSettings
.
userBrandImageOutdoor
property
Fact
_userBrandImageLinked
:
QGroundControl
.
settingsManager
.
appSettings
.
userBrandImageLinked
property
Fact
_appFontPointSize
:
QGroundControl
.
settingsManager
.
appSettings
.
appFontPointSize
property
real
_labelWidth
:
ScreenTools
.
defaultFontPixelWidth
*
15
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
30
...
...
@@ -656,6 +659,130 @@ QGCView {
}
}
//-----------------------------------------------------------------
//-- Custom Brand Image
Item
{
width
:
_qgcView
.
width
*
0.8
height
:
userBrandImageLabel
.
height
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
!
ScreenTools
.
isMobile
QGCLabel
{
id
:
userBrandImageLabel
text
:
qsTr
(
"
Brand Image
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
}
Rectangle
{
height
:
userBrandImageCol
.
height
+
(
ScreenTools
.
defaultFontPixelHeight
*
2
)
width
:
_qgcView
.
width
*
0.8
color
:
qgcPal
.
windowShade
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
!
ScreenTools
.
isMobile
Column
{
id
:
userBrandImageCol
spacing
:
ScreenTools
.
defaultFontPixelWidth
anchors.centerIn
:
parent
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_userBrandImageIndoor
.
visible
QGCLabel
{
anchors.baseline
:
userBrandImageIndoorBrowse
.
baseline
width
:
_labelWidth
*
1.5
text
:
qsTr
(
"
Indoor Brand Image Path:
"
)
}
QGCTextField
{
anchors.baseline
:
userBrandImageIndoorBrowse
.
baseline
readOnly
:
true
width
:
_editFieldWidth
text
:
QGroundControl
.
settingsManager
.
appSettings
.
userBrandImageIndoor
.
valueString
.
replace
(
"
file:///
"
,
""
)
}
QGCButton
{
id
:
userBrandImageIndoorBrowse
text
:
"
Browse
"
onClicked
:
userBrandImageIndoorBrowseDialog
.
openForLoad
()
QGCFileDialog
{
id
:
userBrandImageIndoorBrowseDialog
qgcView
:
_qgcView
title
:
qsTr
(
"
Choose custom brand image file:
"
)
folder
:
_userBrandImageIndoor
.
rawValue
.
replace
(
"
file:///
"
,
""
)
selectExisting
:
true
selectFolder
:
false
onAcceptedForLoad
:
{
_userBrandImageIndoor
.
rawValue
=
"
file:///
"
+
file
if
(
_userBrandImageLinked
.
value
)
{
_userBrandImageOutdoor
.
rawValue
=
_userBrandImageIndoor
.
rawValue
}
}
}
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_userBrandImageOutdoor
.
visible
enabled
:
!
_userBrandImageLinked
.
value
QGCLabel
{
anchors.baseline
:
userBrandImageOutdoorBrowse
.
baseline
width
:
_labelWidth
*
1.5
text
:
qsTr
(
"
Outdoor Brand Image Path:
"
)
}
QGCTextField
{
anchors.baseline
:
userBrandImageOutdoorBrowse
.
baseline
readOnly
:
true
width
:
_editFieldWidth
text
:
QGroundControl
.
settingsManager
.
appSettings
.
userBrandImageOutdoor
.
valueString
.
replace
(
"
file:///
"
,
""
)
}
QGCButton
{
id
:
userBrandImageOutdoorBrowse
text
:
"
Browse
"
onClicked
:
userBrandImageOutdoorBrowseDialog
.
openForLoad
()
QGCFileDialog
{
id
:
userBrandImageOutdoorBrowseDialog
qgcView
:
_qgcView
title
:
qsTr
(
"
Choose custom brand image file:
"
)
folder
:
_userBrandImageOutdoor
.
rawValue
.
replace
(
"
file:///
"
,
""
)
selectExisting
:
true
selectFolder
:
false
onAcceptedForLoad
:
_userBrandImageOutdoor
.
rawValue
=
"
file:///
"
+
file
}
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_userBrandImageIndoor
.
visible
FactCheckBox
{
text
:
qsTr
(
"
Link Brand Images
"
)
width
:
_labelWidth
*
1.5
visible
:
_userBrandImageLinked
.
visible
fact
:
_userBrandImageLinked
onClicked
:
{
if
(
_userBrandImageLinked
.
value
)
{
_userBrandImageOutdoor
.
rawValue
=
_userBrandImageIndoor
.
rawValue
}
}
}
QGCButton
{
id
:
userBrandImageReset
text
:
"
Reset Default Brand Image
"
onClicked
:
{
_userBrandImageIndoor
.
rawValue
=
""
_userBrandImageOutdoor
.
rawValue
=
""
}
}
}
}
}
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
qsTr
(
"
%1 Version: %2
"
).
arg
(
QGroundControl
.
appName
).
arg
(
QGroundControl
.
qgcVersion
)
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
68462431
...
...
@@ -95,8 +95,12 @@ Item {
property
bool
_outdoorPalette
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
property
bool
_corePluginBranding
:
QGroundControl
.
corePlugin
.
brandImageIndoor
.
length
!=
0
property
string
_brandImageIndoor
:
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageIndoor
:
(
_activeVehicle
?
_activeVehicle
.
brandImageIndoor
:
""
)
property
string
_brandImageOutdoor
:
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageOutdoor
:
(
_activeVehicle
?
_activeVehicle
.
brandImageOutdoor
:
""
)
property
string
_userBrandImageIndoor
:
QGroundControl
.
settingsManager
.
appSettings
.
userBrandImageIndoor
.
value
property
string
_userBrandImageOutdoor
:
QGroundControl
.
settingsManager
.
appSettings
.
userBrandImageOutdoor
.
value
property
bool
_userBrandingIndoor
:
_userBrandImageIndoor
.
length
!=
0
property
bool
_userBrandingOutdoor
:
_userBrandImageOutdoor
.
length
!=
0
property
string
_brandImageIndoor
:
_userBrandingIndoor
?
_userBrandImageIndoor
:
(
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageIndoor
:
(
_activeVehicle
?
_activeVehicle
.
brandImageIndoor
:
""
)
)
property
string
_brandImageOutdoor
:
_userBrandingOutdoor
?
_userBrandImageOutdoor
:
(
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageOutdoor
:
(
_activeVehicle
?
_activeVehicle
.
brandImageOutdoor
:
""
)
)
}
Row
{
...
...
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