Divide PreferencesDialog in two classes

This forces PreferencesDialog to serve only for UI needs.
Plus, this opens the door for adding another class for shortcut
management without pain.
This commit is contained in:
Vladislav Tronko
2016-09-03 22:28:28 +03:00
parent 11bff0ded8
commit 3a06395f88
16 changed files with 414 additions and 389 deletions

View File

@@ -8,7 +8,7 @@
#include "Application.h"
#include "MainWindow.h"
#include "PreferencesDialog.h"
#include "Settings.h"
Application::Application(int& argc, char** argv) :
QApplication(argc, argv)
@@ -26,7 +26,7 @@ Application::Application(int& argc, char** argv) :
// Load translations
bool ok;
QString name = PreferencesDialog::getSettingsValue("General", "language").toString();
QString name = Settings::getSettingsValue("General", "language").toString();
// First of all try to load the application translation file.
m_translatorApp = new QTranslator(this);
@@ -38,7 +38,7 @@ Application::Application(int& argc, char** argv) :
}
if (ok == true) {
PreferencesDialog::setSettingsValue("General", "language", name);
Settings::setSettingsValue("General", "language", name);
installTranslator(m_translatorApp);
// The application translation file has been found and loaded.
@@ -58,7 +58,7 @@ Application::Application(int& argc, char** argv) :
// Set the correct locale so that the program won't erroneously detect
// a language change when the user toggles settings for the first time.
// (it also prevents the program from always looking for a translation on launch)
PreferencesDialog::setSettingsValue("General", "language", "en_US");
Settings::setSettingsValue("General", "language", "en_US");
}
// Parse command line