diff -r 4241d948af28 -r 38f6fad61bad src/settingseditor/settingseditor.cpp --- a/src/settingseditor/settingseditor.cpp Tue Jun 28 19:25:45 2022 +0300 +++ b/src/settingseditor/settingseditor.cpp Tue Jun 28 19:31:55 2022 +0300 @@ -22,7 +22,6 @@ this->ui.keyboardShortcutsView->setModel(new KeyboardShortcutsEditor{parent, this}); this->ui.viewModeButtonGroup->setId(this->ui.viewModeTabs, int{QMdiArea::TabbedView}); this->ui.viewModeButtonGroup->setId(this->ui.viewModeSubWindows, int{QMdiArea::SubWindowView}); - this->loadLocales(); this->loadSettings(); this->setWindowTitle(tr("Settings")); this->setWindowIcon(QIcon{":/icons/settings-outline.png"}); @@ -46,7 +45,6 @@ void SettingsEditor::saveSettings() { - //setSetting(this->ui.language->currentData().toString()); setSetting(this->ui.mainColorButton->color()); setSetting(this->ui.backgroundColorButton->color()); setSetting(this->ui.selectedColorButton->color()); @@ -61,34 +59,9 @@ Q_EMIT this->settingsChanged(); } -void SettingsEditor::loadLocales() -{ - /* - this->ui.language->clear(); - QDir dir{":/locale"}; - // Collect translation files in built-in resources - QVector localeCodes = {"en"}; // English is the default locale - for (const QFileInfo& file : dir.entryInfoList(QDir::Files)) - { - localeCodes.append(file.baseName()); - } - std::sort(localeCodes.begin(), localeCodes.end()); - this->ui.language->addItem(tr("System language"), "system"); - for (const QString& localeCode : localeCodes) - { - const QLocale locale{localeCode}; - const QString languageName = QLocale::languageToString(locale.language()); - const QIcon flag{":/flags/" + localeCode + ".png"}; - this->ui.language->addItem(languageName, localeCode); - this->ui.language->setItemIcon(this->ui.language->count() - 1, flag); - } - */ -} - void SettingsEditor::loadSettings() { this->libraries.restoreFromSettings(); - //this->setCurrentLanguage(setting()); this->ui.mainColorButton->setColor(setting()); this->ui.backgroundColorButton->setColor(setting()); this->ui.selectedColorButton->setColor(setting()); @@ -100,17 +73,3 @@ viewModeButton->setChecked(true); } } - -void SettingsEditor::setCurrentLanguage(const QString& localeCode) -{ - /* - for (int i = 0; i < this->ui.language->count(); i += 1) - { - if (this->ui.language->itemData(i) == localeCode) - { - this->ui.language->setCurrentIndex(i); - break; - } - } - */ -}