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
b600e360
Commit
b600e360
authored
Nov 02, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #951 from DonLakeFlyer/Versioning
More work on versioning
parents
ef726502
b263cb96
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
34 additions
and
69 deletions
+34
-69
QGC.cc
src/QGC.cc
+0
-5
QGC.h
src/QGC.h
+0
-1
QGCConfig.h
src/QGCConfig.h
+17
-14
QGCCore.cc
src/QGCCore.cc
+9
-4
SerialLink.cc
src/comm/SerialLink.cc
+2
-2
MainWindow.cc
src/ui/MainWindow.cc
+4
-4
QGCSettingsWidget.cc
src/ui/QGCSettingsWidget.cc
+0
-13
QGCSettingsWidget.h
src/ui/QGCSettingsWidget.h
+0
-1
QGCSettingsWidget.ui
src/ui/QGCSettingsWidget.ui
+0
-23
terminalconsole.cpp
src/ui/configuration/terminalconsole.cpp
+2
-2
No files found.
src/QGC.cc
View file @
b600e360
...
...
@@ -94,9 +94,4 @@ double limitAngleToPMPId(double angle)
return
angle
;
}
int
applicationVersion
()
{
return
APPLICATIONVERSION
;
}
}
src/QGC.h
View file @
b600e360
...
...
@@ -93,7 +93,6 @@ qreal groundTimeSeconds();
float
limitAngleToPMPIf
(
float
angle
);
/** @brief Returns the angle limited to -pi - pi */
double
limitAngleToPMPId
(
double
angle
);
int
applicationVersion
();
const
static
int
MAX_FLIGHT_TIME
=
60
*
60
*
24
*
21
;
...
...
src/QGCConfig.h
View file @
b600e360
...
...
@@ -12,24 +12,27 @@
// If you need to make an incompatible changes to stored settings, bump this version number
// up by 1. This will caused store settings to be cleared on next boot.
#define QGC_SETTINGS_VERSION
1
#define QGC_SETTINGS_VERSION
2
#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_APPLICATION_VERSION_BASE "v2.0.3"
#define QGC_ORG_NAME "QGroundControl.org"
#define QGC_ORG_DOMAIN "org.qgroundcontrol"
#
ifdef QGC_APPLICATION_VERSION_SUFFIX
#define QGC_APPLICATION_VERSION QGC_APPLICATION_VERSION_BASE QGC_APPLICATION_VERSION_SUFFIX
#else
#define QGC_APPLICATION_VERSION QGC_APPLICATION_VERSION_BASE " (Developer Build)"
#endif
#
define QGC_APPLICATION_VERSION_MAJOR 2
#define QGC_APPLICATION_VERSION_MINOR 1
// The following #definess can be overriden from the command line so that automated build systems can
// add additional build identification.
namespace
QGC
// Only comes from command line
//#define QGC_APPLICATION_VERSION_COMMIT "..."
{
const
QString
APPNAME
=
"QGROUNDCONTROL"
;
const
QString
ORG_NAME
=
"QGROUNDCONTROL.ORG"
;
//can be customized by forks to e.g. mycompany.com to maintain separate Settings for customized apps
const
QString
ORG_DOMAIN
=
"org.qgroundcontrol"
;
//can be customized by forks
const
int
APPLICATIONVERSION
=
203
;
// 2.0.3
}
#ifndef QGC_APPLICATION_VERSION_BUILDNUMBER
#define QGC_APPLICATION_VERSION_BUILDNUMBER 0
#endif
#ifndef QGC_APPLICATION_VERSION_BUILDTYPE
#define QGC_APPLICATION_VERSION_BUILDTYPE "(Developer Build)"
#endif
#endif // QGC_CONFIGURATION_H
src/QGCCore.cc
View file @
b600e360
...
...
@@ -72,11 +72,16 @@ QGCCore::QGCCore(int &argc, char* argv[]) :
QApplication
(
argc
,
argv
),
_mainWindow
(
NULL
)
{
// Set application
name
// Set application
information
this
->
setApplicationName
(
QGC_APPLICATION_NAME
);
this
->
setApplicationVersion
(
QGC_APPLICATION_VERSION
);
this
->
setOrganizationName
(
QGC
::
ORG_NAME
);
this
->
setOrganizationDomain
(
QGC
::
ORG_DOMAIN
);
this
->
setOrganizationName
(
QGC_ORG_NAME
);
this
->
setOrganizationDomain
(
QGC_ORG_DOMAIN
);
// Version string is build from component parts. Format is:
// vMajor.Minor.BuildNumber BuildType
QString
versionString
(
"v%1.%2.%3 %4"
);
versionString
=
versionString
.
arg
(
QGC_APPLICATION_VERSION_MAJOR
).
arg
(
QGC_APPLICATION_VERSION_MINOR
).
arg
(
QGC_APPLICATION_VERSION_BUILDNUMBER
).
arg
(
QGC_APPLICATION_VERSION_BUILDTYPE
);
this
->
setApplicationVersion
(
versionString
);
// Set settings format
QSettings
::
setDefaultFormat
(
QSettings
::
IniFormat
);
...
...
src/comm/SerialLink.cc
View file @
b600e360
...
...
@@ -139,7 +139,7 @@ bool SerialLink::isBootloader()
void
SerialLink
::
loadSettings
()
{
// Load defaults from settings
QSettings
settings
(
QGC
::
ORG_NAME
,
QGC
::
APPNAME
)
;
QSettings
settings
;
settings
.
sync
();
if
(
settings
.
contains
(
"SERIALLINK_COMM_PORT"
))
{
...
...
@@ -157,7 +157,7 @@ void SerialLink::loadSettings()
void
SerialLink
::
writeSettings
()
{
// Store settings
QSettings
settings
(
QGC
::
ORG_NAME
,
QGC
::
APPNAME
)
;
QSettings
settings
;
settings
.
setValue
(
"SERIALLINK_COMM_PORT"
,
getPortName
());
settings
.
setValue
(
"SERIALLINK_COMM_BAUD"
,
getBaudRateType
());
settings
.
setValue
(
"SERIALLINK_COMM_PARITY"
,
getParityType
());
...
...
src/ui/MainWindow.cc
View file @
b600e360
...
...
@@ -984,7 +984,7 @@ void MainWindow::storeSettings()
// Save the last current view in any case
settings
.
setValue
(
"CURRENT_VIEW"
,
currentView
);
// Save the current window state, but only if a system is connected (else no real number of widgets would be present))
if
(
UASManager
::
instance
()
->
getUASList
().
length
()
>
0
)
settings
.
setValue
(
getWindowStateKey
(),
saveState
(
QGC
::
applicationVersion
()
));
if
(
UASManager
::
instance
()
->
getUASList
().
length
()
>
0
)
settings
.
setValue
(
getWindowStateKey
(),
saveState
());
// Save the current view only if a UAS is connected
if
(
UASManager
::
instance
()
->
getUASList
().
length
()
>
0
)
settings
.
setValue
(
"CURRENT_VIEW_WITH_UAS_CONNECTED"
,
currentView
);
// Save the current power mode
...
...
@@ -1439,7 +1439,7 @@ void MainWindow::setActiveUAS(UASInterface* uas)
if
(
settings
.
contains
(
getWindowStateKey
()))
{
SubMainWindow
*
win
=
qobject_cast
<
SubMainWindow
*>
(
centerStack
->
currentWidget
());
win
->
restoreState
(
settings
.
value
(
getWindowStateKey
()).
toByteArray
()
,
QGC
::
applicationVersion
()
);
win
->
restoreState
(
settings
.
value
(
getWindowStateKey
()).
toByteArray
());
}
}
...
...
@@ -1596,7 +1596,7 @@ void MainWindow::storeViewState()
widgetnames
=
widgetnames
.
mid
(
0
,
widgetnames
.
length
()
-
1
);
settings
.
setValue
(
getWindowStateKey
()
+
"WIDGETS"
,
widgetnames
);
settings
.
setValue
(
getWindowStateKey
(),
win
->
saveState
(
QGC
::
applicationVersion
()
));
settings
.
setValue
(
getWindowStateKey
(),
win
->
saveState
());
settings
.
setValue
(
getWindowStateKey
()
+
"CENTER_WIDGET"
,
centerStack
->
currentIndex
());
// Although we want save the state of the window, we do not want to change the top-leve state (minimized, maximized, etc)
// therefore this state is stored here and restored after applying the rest of the settings in the new
...
...
@@ -1685,7 +1685,7 @@ void MainWindow::loadViewState()
if
(
settings
.
contains
(
getWindowStateKey
()))
{
SubMainWindow
*
win
=
qobject_cast
<
SubMainWindow
*>
(
centerStack
->
currentWidget
());
win
->
restoreState
(
settings
.
value
(
getWindowStateKey
()).
toByteArray
()
,
QGC
::
applicationVersion
()
);
win
->
restoreState
(
settings
.
value
(
getWindowStateKey
()).
toByteArray
());
}
}
void
MainWindow
::
setAdvancedMode
(
bool
isAdvancedMode
)
...
...
src/ui/QGCSettingsWidget.cc
View file @
b600e360
...
...
@@ -38,9 +38,6 @@ QGCSettingsWidget::QGCSettingsWidget(JoystickInput *joystick, QWidget *parent, Q
this
->
window
()
->
setWindowTitle
(
tr
(
"QGroundControl Settings"
));
// Settings reset
connect
(
ui
->
resetSettingsButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
resetSettings
()));
// Audio preferences
ui
->
audioMuteCheckBox
->
setChecked
(
GAudioOutput
::
instance
()
->
isMuted
());
connect
(
ui
->
audioMuteCheckBox
,
SIGNAL
(
toggled
(
bool
)),
GAudioOutput
::
instance
(),
SLOT
(
mute
(
bool
)));
...
...
@@ -200,13 +197,3 @@ void QGCSettingsWidget::selectCustomMode(int mode)
MainWindow
::
instance
()
->
setCustomMode
(
static_cast
<
enum
MainWindow
::
CUSTOM_MODE
>
(
ui
->
customModeComboBox
->
itemData
(
mode
).
toInt
()));
MainWindow
::
instance
()
->
showInfoMessage
(
tr
(
"Please restart QGroundControl"
),
tr
(
"The optimization selection was changed. The application needs to be closed and restarted to put all optimizations into effect."
));
}
void
QGCSettingsWidget
::
resetSettings
()
{
QSettings
settings
;
settings
.
sync
();
settings
.
clear
();
// Write current application version
settings
.
setValue
(
"QGC_APPLICATION_VERSION"
,
QGC_APPLICATION_VERSION
);
settings
.
sync
();
}
src/ui/QGCSettingsWidget.h
View file @
b600e360
...
...
@@ -23,7 +23,6 @@ public slots:
void
setDefaultStyle
();
void
selectStylesheet
();
void
selectCustomMode
(
int
mode
);
void
resetSettings
();
private:
MainWindow
*
mainWindow
;
...
...
src/ui/QGCSettingsWidget.ui
View file @
b600e360
...
...
@@ -164,29 +164,6 @@
</property>
</spacer>
</item>
<item>
<widget
class=
"QGroupBox"
name=
"groupBox_2"
>
<property
name=
"title"
>
<string>
Danger Zone
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
columnstretch=
"10,0"
>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Delete all settings, layouts and restore defaults
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"resetSettingsButton"
>
<property
name=
"text"
>
<string>
Reset Settings
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
...
...
src/ui/configuration/terminalconsole.cpp
View file @
b600e360
...
...
@@ -266,7 +266,7 @@ void TerminalConsole::setLink(int index)
void
TerminalConsole
::
loadSettings
()
{
// Load defaults from settings
QSettings
settings
(
QGC
::
ORG_NAME
,
QGC
::
APPNAME
)
;
QSettings
settings
;
settings
.
sync
();
if
(
settings
.
contains
(
"TERMINALCONSOLE_COMM_PORT"
))
{
...
...
@@ -288,7 +288,7 @@ void TerminalConsole::loadSettings()
void
TerminalConsole
::
writeSettings
()
{
// Store settings
QSettings
settings
(
QGC
::
ORG_NAME
,
QGC
::
APPNAME
)
;
QSettings
settings
;
settings
.
setValue
(
"TERMINALCONSOLE_COMM_PORT"
,
m_settings
.
name
);
settings
.
setValue
(
"TERMINALCONSOLE_COMM_BAUD"
,
m_settings
.
baudRate
);
settings
.
setValue
(
"TERMINALCONSOLE_COMM_PARITY"
,
m_settings
.
parity
);
...
...
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