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
f2b48518
Commit
f2b48518
authored
Jan 10, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed settings reset function, now tested and works.
parent
ae730288
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
Core.cc
src/Core.cc
+13
-4
MainWindow.cc
src/ui/MainWindow.cc
+1
-5
No files found.
src/Core.cc
View file @
f2b48518
...
...
@@ -39,6 +39,8 @@ This file is part of the QGROUNDCONTROL project
#include <QStyleFactory>
#include <QAction>
#include <QDebug>
#include "configuration.h"
#include "QGC.h"
#include "Core.h"
...
...
@@ -65,29 +67,37 @@ This file is part of the QGROUNDCONTROL project
Core
::
Core
(
int
&
argc
,
char
*
argv
[])
:
QApplication
(
argc
,
argv
)
{
// Set application name
this
->
setApplicationName
(
QGC_APPLICATION_NAME
);
this
->
setApplicationVersion
(
QGC_APPLICATION_VERSION
);
this
->
setOrganizationName
(
QLatin1String
(
"OPENMAV"
));
this
->
setOrganizationDomain
(
"http://qgroundcontrol.org"
);
this
->
setOrganizationDomain
(
"org.qgroundcontrol"
);
// Set settings format
QSettings
::
setDefaultFormat
(
QSettings
::
IniFormat
);
// Check application settings
// clear them if they mismatch
// QGC then falls back to default
QSettings
settings
;
settings
.
sync
();
if
(
settings
.
contains
(
"QGC_APPLICATION_VERSION_INT"
))
if
(
settings
.
contains
(
"QGC_APPLICATION_VERSION"
))
{
QString
qgcVersion
=
settings
.
value
(
"QGC_APPLICATION_VERSION"
).
toString
();
if
(
qgcVersion
!=
QGC_APPLICATION_VERSION
)
{
settings
.
clear
();
// Write current application version
settings
.
setValue
(
"QGC_APPLICATION_VERSION"
,
QGC_APPLICATION_VERSION
);
}
}
else
{
// If application version is not set, clear settings anyway
settings
.
clear
();
// Write current application version
settings
.
setValue
(
"QGC_APPLICATION_VERSION"
,
QGC_APPLICATION_VERSION
);
}
settings
.
sync
();
// Show splash screen
...
...
@@ -98,7 +108,6 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
splashScreen
->
show
();
splashScreen
->
showMessage
(
tr
(
"Loading application fonts"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
QSettings
::
setDefaultFormat
(
QSettings
::
IniFormat
);
// Exit main application when last window is closed
connect
(
this
,
SIGNAL
(
lastWindowClosed
()),
this
,
SLOT
(
quit
()));
...
...
src/ui/MainWindow.cc
View file @
f2b48518
...
...
@@ -66,12 +66,8 @@ MainWindow::MainWindow(QWidget *parent):
toolsMenuActions
(),
currentView
(
VIEW_ENGINEER
),
aboutToCloseFlag
(
false
),
changingViewsFlag
(
false
),
settings
()
changingViewsFlag
(
false
)
{
// Get current settings
settings
.
sync
();
if
(
!
settings
.
contains
(
"CURRENT_VIEW"
))
{
// Set this view as default view
...
...
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