mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user