diff --git a/src/ui/SettingsDialog.cc b/src/ui/SettingsDialog.cc
index f6a8db6770ed20a9c2eb6ed0f8f418660c146fa7..0d9bc946ad97c5cf62dbdf2d7351399985f8aa3b 100644
--- a/src/ui/SettingsDialog.cc
+++ b/src/ui/SettingsDialog.cc
@@ -39,11 +39,8 @@
#include "MainToolBarController.h"
#include "FlightMapSettings.h"
-SettingsDialog::SettingsDialog(GAudioOutput* audioOutput, FlightMapSettings* flightMapSettings, QWidget *parent, int showTab, Qt::WindowFlags flags)
+SettingsDialog::SettingsDialog(QWidget *parent, int showTab, Qt::WindowFlags flags)
: QDialog(parent, flags)
- , _mainWindow(MainWindow::instance())
- , _audioOutput(audioOutput)
- , _flightMapSettings(flightMapSettings)
, _ui(new Ui::SettingsDialog)
{
_ui->setupUi(this);
@@ -66,43 +63,12 @@ SettingsDialog::SettingsDialog(GAudioOutput* audioOutput, FlightMapSettings* fli
this->window()->setWindowTitle(tr("QGroundControl Settings"));
- // Audio preferences
- _ui->audioMuteCheckBox->setChecked(_audioOutput->isMuted());
- connect(_ui->audioMuteCheckBox, SIGNAL(toggled(bool)), _audioOutput, SLOT(mute(bool)));
- connect(_audioOutput, SIGNAL(mutedChanged(bool)), _ui->audioMuteCheckBox, SLOT(setChecked(bool)));
-
- // Reconnect
- _ui->reconnectCheckBox->setChecked(_mainWindow->autoReconnectEnabled());
- connect(_ui->reconnectCheckBox, SIGNAL(clicked(bool)), _mainWindow, SLOT(enableAutoReconnect(bool)));
-
- // Low power mode
- _ui->lowPowerCheckBox->setChecked(_mainWindow->lowPowerModeEnabled());
- connect(_ui->lowPowerCheckBox, SIGNAL(clicked(bool)), _mainWindow, SLOT(enableLowPowerMode(bool)));
-
- connect(_ui->deleteSettings, &QAbstractButton::toggled, this, &SettingsDialog::_deleteSettingsToggled);
-
- // Application color style
- _ui->styleChooser->setCurrentIndex(qgcApp()->styleIsDark() ? 0 : 1);
-
_ui->savedFilesLocation->setText(qgcApp()->savedFilesLocation());
- _ui->promptFlightDataSave->setChecked(qgcApp()->promptFlightDataSave());
// Connect signals
- connect(_ui->styleChooser, SIGNAL(currentIndexChanged(int)), this, SLOT(styleChanged(int)));
connect(_ui->browseSavedFilesLocation, &QPushButton::clicked, this, &SettingsDialog::_selectSavedFilesDirectory);
connect(_ui->buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog::_validateBeforeClose);
- // Flight Map settings
-
- FlightMapSettings* fmSettings = _flightMapSettings;
- _ui->bingMapRadio->setChecked(fmSettings->mapProvider() == "Bing");
- _ui->googleMapRadio->setChecked(fmSettings->mapProvider() == "Google");
- _ui->openMapRadio->setChecked(fmSettings->mapProvider() == "Open");
-
- connect(_ui->bingMapRadio, &QRadioButton::clicked, this, &SettingsDialog::_bingMapRadioClicked);
- connect(_ui->googleMapRadio, &QRadioButton::clicked, this, &SettingsDialog::_googleMapRadioClicked);
- connect(_ui->openMapRadio, &QRadioButton::clicked, this, &SettingsDialog::_openMapRadioClicked);
-
switch (showTab) {
case ShowCommLinks:
_ui->tabWidget->setCurrentWidget(pLinkConf);
@@ -118,29 +84,6 @@ SettingsDialog::~SettingsDialog()
delete _ui;
}
-void SettingsDialog::styleChanged(int index)
-{
- qgcApp()->setStyle(index == 0);
-}
-
-void SettingsDialog::_deleteSettingsToggled(bool checked)
-{
- if (checked){
- QGCMessageBox::StandardButton answer =
- QGCMessageBox::question(tr("Delete Settings"),
- tr("All saved settings 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) {
- qgcApp()->deleteAllSettingsNextBoot();
- } else {
- _ui->deleteSettings->setChecked(false);
- }
- } else {
- qgcApp()->clearDeleteAllSettingsNextBoot();
- }
-}
-
/// @brief Validates the settings before closing
void SettingsDialog::_validateBeforeClose(void)
{
@@ -155,7 +98,7 @@ void SettingsDialog::_validateBeforeClose(void)
}
// Locations is valid, save
app->setSavedFilesLocation(saveLocation);
- qgcApp()->setPromptFlightDataSave(_ui->promptFlightDataSave->checkState() == Qt::Checked);
+
// Close dialog
accept();
}
@@ -170,30 +113,4 @@ void SettingsDialog::_selectSavedFilesDirectory(void)
if (!newLocation.isEmpty()) {
_ui->savedFilesLocation->setText(newLocation);
}
-
- // TODO:
- // Once a directory is selected, we need to display the various subdirectories used underneath:
- // * Flight data logs
- // * Parameters
-}
-
-void SettingsDialog::_bingMapRadioClicked(bool checked)
-{
- if (checked) {
- _flightMapSettings->setMapProvider("Bing");
- }
-}
-
-void SettingsDialog::_googleMapRadioClicked(bool checked)
-{
- if (checked) {
- _flightMapSettings->setMapProvider("Google");
- }
-}
-
-void SettingsDialog::_openMapRadioClicked(bool checked)
-{
- if (checked) {
- _flightMapSettings->setMapProvider("Open");
- }
}
diff --git a/src/ui/SettingsDialog.h b/src/ui/SettingsDialog.h
index 6878cff62941748c2e6c036111d036d04463a43c..cd7647103aae5c304a632c93257e935f9859d934 100644
--- a/src/ui/SettingsDialog.h
+++ b/src/ui/SettingsDialog.h
@@ -48,25 +48,14 @@ public:
ShowMavlink
};
- SettingsDialog(GAudioOutput* audioOuput, FlightMapSettings* flightMapSettings, QWidget *parent = 0, int showTab = ShowDefault, Qt::WindowFlags flags = Qt::Sheet);
+ SettingsDialog(QWidget *parent = 0, int showTab = ShowDefault, Qt::WindowFlags flags = Qt::Sheet);
~SettingsDialog();
-public slots:
- void styleChanged(int index);
-
private slots:
- void _deleteSettingsToggled(bool checked);
void _selectSavedFilesDirectory(void);
void _validateBeforeClose(void);
-
- void _bingMapRadioClicked(bool checked);
- void _googleMapRadioClicked(bool checked);
- void _openMapRadioClicked(bool checked);
private:
- MainWindow* _mainWindow;
- GAudioOutput* _audioOutput;
- FlightMapSettings* _flightMapSettings;
Ui::SettingsDialog* _ui;
};
diff --git a/src/ui/SettingsDialog.ui b/src/ui/SettingsDialog.ui
index 35bd7c87141645bd9280d95027184313bdc0b2df..d304d06bee1cfb4494e1c101570aa6b7650cf49a 100644
--- a/src/ui/SettingsDialog.ui
+++ b/src/ui/SettingsDialog.ui
@@ -36,184 +36,6 @@
General Settings
- -
-
-
-
- 0
- 0
-
-
-
- Mute all audio output
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Automatically reconnect last link on application startup
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Lowers all update rates to save battery power
-
-
- Enable low power mode
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Prompt to save Flight Data Log after each flight
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- Map Provider
-
-
-
-
-
-
- Bing
-
-
-
- -
-
-
- Google
-
-
-
- -
-
-
- Open Streets
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Style
-
-
- false
-
-
- false
-
-
-
- 8
-
-
- 8
-
-
-
-
-
- 0
-
-
- QLayout::SetDefaultConstraint
-
-
- 0
-
-
- 80
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 200
- 0
-
-
-
-
-
- Dark (for indoor use)
-
-
- -
-
- Light (for outdoor use)
-
-
-
-
-
-
-
-
-
-
@@ -281,37 +103,6 @@
- -
-
-
- Reset All Settings to Default
-
-
-
-
-
-
- Delete all saved settings on next boot
-
-
-
- -
-
-
-
- 11
-
-
-
- Note: You can also use --clear-settings as a command line option to accomplish this.
-
-
- true
-
-
-
-
-
-