--- 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<Setting::Locale>(this->ui.language->currentData().toString()); setSetting<Setting::MainColor>(this->ui.mainColorButton->color()); setSetting<Setting::BackgroundColor>(this->ui.backgroundColorButton->color()); setSetting<Setting::SelectedColor>(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<QString> 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<Setting::Locale>()); this->ui.mainColorButton->setColor(setting<Setting::MainColor>()); this->ui.backgroundColorButton->setColor(setting<Setting::BackgroundColor>()); this->ui.selectedColorButton->setColor(setting<Setting::SelectedColor>()); @@ -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; - } - } - */ -}