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
f58af567
Commit
f58af567
authored
Sep 17, 2017
by
Don Gagne
Committed by
GitHub
Sep 17, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5655 from bluerobotics/pr-brand-image
Allow user-selectable brand image
parents
54a181e8
ab798f87
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
250 additions
and
2 deletions
+250
-2
qgroundcontrol.pro
qgroundcontrol.pro
+2
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
App.SettingsGroup.json
src/Settings/App.SettingsGroup.json
+14
-0
BrandImage.SettingsGroup.json
src/Settings/BrandImage.SettingsGroup.json
+16
-0
BrandImageSettings.cc
src/Settings/BrandImageSettings.cc
+44
-0
BrandImageSettings.h
src/Settings/BrandImageSettings.h
+38
-0
SettingsManager.cc
src/Settings/SettingsManager.cc
+2
-0
SettingsManager.h
src/Settings/SettingsManager.h
+4
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+108
-0
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+21
-2
No files found.
qgroundcontrol.pro
View file @
f58af567
...
...
@@ -554,6 +554,7 @@ HEADERS += \
src
/
QtLocationPlugin
/
QMLControl
/
QGCMapEngineManager
.
h
\
src
/
Settings
/
AppSettings
.
h
\
src
/
Settings
/
AutoConnectSettings
.
h
\
src
/
Settings
/
BrandImageSettings
.
h
\
src
/
Settings
/
FlightMapSettings
.
h
\
src
/
Settings
/
GuidedSettings
.
h
\
src
/
Settings
/
RTKSettings
.
h
\
...
...
@@ -736,6 +737,7 @@ SOURCES += \
src
/
QtLocationPlugin
/
QMLControl
/
QGCMapEngineManager
.
cc
\
src
/
Settings
/
AppSettings
.
cc
\
src
/
Settings
/
AutoConnectSettings
.
cc
\
src
/
Settings
/
BrandImageSettings
.
cc
\
src
/
Settings
/
FlightMapSettings
.
cc
\
src
/
Settings
/
GuidedSettings
.
cc
\
src
/
Settings
/
RTKSettings
.
cc
\
...
...
qgroundcontrol.qrc
View file @
f58af567
...
...
@@ -222,6 +222,7 @@
<file alias="Vehicle/VibrationFact.json">src/Vehicle/VibrationFact.json</file>
<file alias="Vehicle/TemperatureFact.json">src/Vehicle/TemperatureFact.json</file>
<file alias="Vehicle/SubmarineFact.json">src/Vehicle/SubmarineFact.json</file>
<file alias="BrandImage.SettingsGroup.json">src/Settings/BrandImage.SettingsGroup.json</file>
</qresource>
<qresource prefix="/MockLink">
<file alias="APMArduCopterMockLink.params">src/comm/APMArduCopterMockLink.params</file>
...
...
src/Settings/App.SettingsGroup.json
View file @
f58af567
...
...
@@ -143,6 +143,20 @@
"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"
:
"MapboxToken"
,
"shortDescription"
:
"Access token to Mapbox maps"
,
...
...
src/Settings/BrandImage.SettingsGroup.json
0 → 100644
View file @
f58af567
[
{
"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"
:
""
}
]
src/Settings/BrandImageSettings.cc
0 → 100644
View file @
f58af567
/****************************************************************************
*
* (c) 2009-2017 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "BrandImageSettings.h"
#include <QQmlEngine>
#include <QtQml>
const
char
*
BrandImageSettings
::
brandImageSettingsGroupName
=
"BrandImage"
;
const
char
*
BrandImageSettings
::
userBrandImageIndoorName
=
"UserBrandImageIndoor"
;
const
char
*
BrandImageSettings
::
userBrandImageOutdoorName
=
"UserBrandImageOutdoor"
;
BrandImageSettings
::
BrandImageSettings
(
QObject
*
parent
)
:
SettingsGroup
(
brandImageSettingsGroupName
,
QString
()
/* root settings group */
,
parent
)
,
_userBrandImageIndoorFact
(
NULL
)
,
_userBrandImageOutdoorFact
(
NULL
)
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
BrandImageSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"BrandImageSettings"
,
"Reference only"
);
}
Fact
*
BrandImageSettings
::
userBrandImageIndoor
(
void
)
{
if
(
!
_userBrandImageIndoorFact
)
{
_userBrandImageIndoorFact
=
_createSettingsFact
(
userBrandImageIndoorName
);
}
return
_userBrandImageIndoorFact
;
}
Fact
*
BrandImageSettings
::
userBrandImageOutdoor
(
void
)
{
if
(
!
_userBrandImageOutdoorFact
)
{
_userBrandImageOutdoorFact
=
_createSettingsFact
(
userBrandImageOutdoorName
);
}
return
_userBrandImageOutdoorFact
;
}
src/Settings/BrandImageSettings.h
0 → 100644
View file @
f58af567
/****************************************************************************
*
* (c) 2009-2017 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#ifndef BrandImageSettings_H
#define BrandImageSettings_H
#include "SettingsGroup.h"
class
BrandImageSettings
:
public
SettingsGroup
{
Q_OBJECT
public:
BrandImageSettings
(
QObject
*
parent
=
NULL
);
Q_PROPERTY
(
Fact
*
userBrandImageIndoor
READ
userBrandImageIndoor
CONSTANT
)
Q_PROPERTY
(
Fact
*
userBrandImageOutdoor
READ
userBrandImageOutdoor
CONSTANT
)
Fact
*
userBrandImageIndoor
(
void
);
Fact
*
userBrandImageOutdoor
(
void
);
static
const
char
*
brandImageSettingsGroupName
;
static
const
char
*
userBrandImageIndoorName
;
static
const
char
*
userBrandImageOutdoorName
;
private:
SettingsFact
*
_userBrandImageIndoorFact
;
SettingsFact
*
_userBrandImageOutdoorFact
;
};
#endif
src/Settings/SettingsManager.cc
View file @
f58af567
...
...
@@ -21,6 +21,7 @@ SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox)
,
_flightMapSettings
(
NULL
)
,
_rtkSettings
(
NULL
)
,
_guidedSettings
(
NULL
)
,
_brandImageSettings
(
NULL
)
{
}
...
...
@@ -38,4 +39,5 @@ void SettingsManager::setToolbox(QGCToolbox *toolbox)
_flightMapSettings
=
new
FlightMapSettings
(
this
);
_rtkSettings
=
new
RTKSettings
(
this
);
_guidedSettings
=
new
GuidedSettings
(
this
);
_brandImageSettings
=
new
BrandImageSettings
(
this
);
}
src/Settings/SettingsManager.h
View file @
f58af567
...
...
@@ -21,6 +21,7 @@
#include "FlightMapSettings.h"
#include "RTKSettings.h"
#include "GuidedSettings.h"
#include "BrandImageSettings.h"
#include <QVariantList>
...
...
@@ -39,6 +40,7 @@ public:
Q_PROPERTY
(
QObject
*
flightMapSettings
READ
flightMapSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
rtkSettings
READ
rtkSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
guidedSettings
READ
guidedSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
brandImageSettings
READ
brandImageSettings
CONSTANT
)
// Override from QGCTool
virtual
void
setToolbox
(
QGCToolbox
*
toolbox
);
...
...
@@ -50,6 +52,7 @@ public:
FlightMapSettings
*
flightMapSettings
(
void
)
{
return
_flightMapSettings
;
}
RTKSettings
*
rtkSettings
(
void
)
{
return
_rtkSettings
;
}
GuidedSettings
*
guidedSettings
(
void
)
{
return
_guidedSettings
;
}
BrandImageSettings
*
brandImageSettings
(
void
)
{
return
_brandImageSettings
;
}
private:
AppSettings
*
_appSettings
;
...
...
@@ -59,6 +62,7 @@ private:
FlightMapSettings
*
_flightMapSettings
;
RTKSettings
*
_rtkSettings
;
GuidedSettings
*
_guidedSettings
;
BrandImageSettings
*
_brandImageSettings
;
};
#endif
src/ui/preferences/GeneralSettings.qml
View file @
f58af567
...
...
@@ -35,6 +35,8 @@ QGCView {
property
Fact
_percentRemainingAnnounce
:
QGroundControl
.
settingsManager
.
appSettings
.
batteryPercentRemainingAnnounce
property
Fact
_savePath
:
QGroundControl
.
settingsManager
.
appSettings
.
savePath
property
Fact
_appFontPointSize
:
QGroundControl
.
settingsManager
.
appSettings
.
appFontPointSize
property
Fact
_userBrandImageIndoor
:
QGroundControl
.
settingsManager
.
brandImageSettings
.
userBrandImageIndoor
property
Fact
_userBrandImageOutdoor
:
QGroundControl
.
settingsManager
.
brandImageSettings
.
userBrandImageOutdoor
property
real
_labelWidth
:
ScreenTools
.
defaultFontPixelWidth
*
15
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
30
property
Fact
_mapProvider
:
QGroundControl
.
settingsManager
.
flightMapSettings
.
mapProvider
...
...
@@ -656,6 +658,112 @@ QGCView {
}
}
//-----------------------------------------------------------------
//-- Custom Brand Image
Item
{
width
:
_qgcView
.
width
*
0.8
height
:
userBrandImageLabel
.
height
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
QGroundControl
.
settingsManager
.
brandImageSettings
.
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
:
QGroundControl
.
settingsManager
.
brandImageSettings
.
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
:
_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
}
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_userBrandImageOutdoor
.
visible
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
:
_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
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 @
f58af567
...
...
@@ -92,11 +92,30 @@ Item {
visible
:
x
>
indicatorRow
.
width
&&
!
_communicationLost
fillMode
:
Image
.
PreserveAspectFit
source
:
_outdoorPalette
?
_brandImageOutdoor
:
_brandImageIndoor
mipmap
:
true
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
.
brandImageSettings
.
userBrandImageIndoor
.
value
property
string
_userBrandImageOutdoor
:
QGroundControl
.
settingsManager
.
brandImageSettings
.
userBrandImageOutdoor
.
value
property
bool
_userBrandingIndoor
:
_userBrandImageIndoor
.
length
!=
0
property
bool
_userBrandingOutdoor
:
_userBrandImageOutdoor
.
length
!=
0
property
string
_brandImageIndoor
:
_userBrandingIndoor
?
_userBrandImageIndoor
:
(
_userBrandingOutdoor
?
_userBrandImageOutdoor
:
(
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageIndoor
:
(
_activeVehicle
?
_activeVehicle
.
brandImageIndoor
:
""
)
)
)
property
string
_brandImageOutdoor
:
_userBrandingOutdoor
?
_userBrandImageOutdoor
:
(
_userBrandingIndoor
?
_userBrandImageIndoor
:
(
_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