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
9bfa9cec
Commit
9bfa9cec
authored
Nov 05, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete Settings from preferences
parent
ebe3f6a1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
0 deletions
+46
-0
QGCCore.cc
src/QGCCore.cc
+5
-0
QGCCore.h
src/QGCCore.h
+2
-0
QGCSettingsWidget.cc
src/ui/QGCSettingsWidget.cc
+20
-0
QGCSettingsWidget.h
src/ui/QGCSettingsWidget.h
+3
-0
QGCSettingsWidget.ui
src/ui/QGCSettingsWidget.ui
+16
-0
No files found.
src/QGCCore.cc
View file @
9bfa9cec
...
...
@@ -55,6 +55,7 @@ This file is part of the QGROUNDCONTROL project
#include "MAVLinkSimulationLink.h"
#include "SerialLink.h"
const
char
*
QGCCore
::
deleteAllSettingsKey
=
"DeleteAllSettingsNextBoot"
;
const
char
*
QGCCore
::
_settingsVersionKey
=
"SettingsVersion"
;
/**
...
...
@@ -99,9 +100,13 @@ QGCCore::QGCCore(int &argc, char* argv[]) :
QSettings
settings
;
// The setting will delete all settings on this boot
fClearSettingsOptions
|=
settings
.
contains
(
deleteAllSettingsKey
);
if
(
fClearSettingsOptions
)
{
// User requested settings to be cleared on command line
settings
.
clear
();
settings
.
setValue
(
_settingsVersionKey
,
QGC_SETTINGS_VERSION
);
settings
.
sync
();
}
...
...
src/QGCCore.h
View file @
9bfa9cec
...
...
@@ -60,6 +60,8 @@ public:
/// @brief Initialize the applicaation.
/// @return false: init failed, app should exit
bool
init
(
void
);
static
const
char
*
deleteAllSettingsKey
;
protected:
void
startLinkManager
();
...
...
src/ui/QGCSettingsWidget.cc
View file @
9bfa9cec
...
...
@@ -10,6 +10,7 @@
#include "MAVLinkProtocol.h"
#include "MAVLinkSettingsWidget.h"
#include "GAudioOutput.h"
#include "QGCCore.h"
QGCSettingsWidget
::
QGCSettingsWidget
(
JoystickInput
*
joystick
,
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QDialog
(
parent
,
flags
),
...
...
@@ -54,6 +55,8 @@ QGCSettingsWidget::QGCSettingsWidget(JoystickInput *joystick, QWidget *parent, Q
// Dock widget title bars
ui
->
titleBarCheckBox
->
setChecked
(
mainWindow
->
dockWidgetTitleBarsEnabled
());
connect
(
ui
->
titleBarCheckBox
,
SIGNAL
(
clicked
(
bool
)),
mainWindow
,
SLOT
(
enableDockWidgetTitleBars
(
bool
)));
connect
(
ui
->
deleteSettings
,
&
QAbstractButton
::
toggled
,
this
,
&
QGCSettingsWidget
::
_deleteSettingsToggled
);
// Custom mode
...
...
@@ -197,3 +200,20 @@ 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
::
_deleteSettingsToggled
(
bool
checked
)
{
if
(
checked
){
QMessageBox
::
StandardButton
answer
=
QMessageBox
::
question
(
this
,
tr
(
"Delete Settings"
),
tr
(
"All saved settgings will be deleted the next time you start QGroundControl. Is this really what you want?"
),
QMessageBox
::
Yes
|
QMessageBox
::
No
,
QMessageBox
::
No
);
if
(
answer
==
QMessageBox
::
Yes
)
{
QSettings
settings
;
settings
.
setValue
(
QGCCore
::
deleteAllSettingsKey
,
1
);
}
else
{
ui
->
deleteSettings
->
setChecked
(
false
);
}
}
}
src/ui/QGCSettingsWidget.h
View file @
9bfa9cec
...
...
@@ -24,6 +24,9 @@ public slots:
void
selectStylesheet
();
void
selectCustomMode
(
int
mode
);
private
slots
:
void
_deleteSettingsToggled
(
bool
checked
);
private:
MainWindow
*
mainWindow
;
Ui
::
QGCSettingsWidget
*
ui
;
...
...
src/ui/QGCSettingsWidget.ui
View file @
9bfa9cec
...
...
@@ -151,6 +151,22 @@
</layout>
</widget>
</item>
<item>
<widget
class=
"QGroupBox"
name=
"groupBox_2"
>
<property
name=
"title"
>
<string>
Danger Zone
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_4"
>
<item>
<widget
class=
"QCheckBox"
name=
"deleteSettings"
>
<property
name=
"text"
>
<string>
Delete all saved settings on next boot
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
...
...
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