Move all settings logic to the preferences dialog

Read and write the settings only from the preferences dialog.

Remove all the copies of some settings which were stored in nearly every
dialog class individually.

Simplify the settings dialog code by removing all those not really
needed slots.
This commit is contained in:
Martin Kleusberg
2013-03-17 16:09:28 +01:00
parent 066356e5eb
commit 2165e544a2
9 changed files with 132 additions and 215 deletions

View File

@@ -5,12 +5,12 @@
#include "ExportCsvDialog.h"
#include "ui_ExportCsvDialog.h"
#include "sqlitedb.h"
#include "PreferencesDialog.h"
ExportCsvDialog::ExportCsvDialog(DBBrowserDB* db, const QString& deflocation, QWidget* parent)
ExportCsvDialog::ExportCsvDialog(DBBrowserDB* db, QWidget* parent)
: QDialog(parent),
ui(new Ui::ExportCsvDialog),
pdb(db),
defaultLocation(deflocation)
pdb(db)
{
// Create UI
ui->setupUi(this);
@@ -32,7 +32,7 @@ void ExportCsvDialog::accept()
QString fileName = QFileDialog::getSaveFileName(
this,
tr("Choose a filename to export data"),
defaultLocation,
PreferencesDialog::getSettingsValue("db", "defaultlocation").toString(),
tr("Text files(*.csv *.txt)"));
// Only if the user hasn't clicked the cancel button