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,6 +5,7 @@
#include <QShortcut>
#include "sqlitedb.h"
#include <src/qhexedit.h>
#include "PreferencesDialog.h"
EditDialog::EditDialog(QWidget* parent)
: QDialog(parent),
@@ -70,7 +71,7 @@ void EditDialog::importData()
QString fileName = QFileDialog::getOpenFileName(
this,
tr("Choose a file"),
defaultlocation,
PreferencesDialog::getSettingsValue("db", "defaultlocation").toString(),
tr("Text files(*.txt);;Image files(%1);;All files(*)").arg(image_formats));
if(QFile::exists(fileName))
{
@@ -91,7 +92,7 @@ void EditDialog::exportData()
QString fileName = QFileDialog::getSaveFileName(
this,
tr("Choose a filename to export data"),
defaultlocation,
PreferencesDialog::getSettingsValue("db", "defaultlocation").toString(),
tr("Text files(*.txt);;All files(*)"));
if(fileName.size() > 0)