Tue, 28 Jun 2022 14:10:27 +0300
Disable language changing for now (translations won't go into 1.0)
--- a/src/main.cpp Tue Jun 28 13:03:21 2022 +0300 +++ b/src/main.cpp Tue Jun 28 14:10:27 2022 +0300 @@ -144,6 +144,7 @@ QObject::tr("LDraw models (*.ldr *.dat)")); } +#if 0 static const QString localeCode(const QString& locale) { if (locale == "system") { @@ -171,6 +172,7 @@ } } } +#endif static ModelData* findModelData(const DocumentManager* documents, ModelId modelId) { @@ -465,7 +467,7 @@ const auto restoreSettings = [&]{ recentlyOpenedFiles = setting<Setting::RecentFiles>(); renderPreferences = loadRenderPreferences(); - changeLanguage(setting<Setting::Locale>(), &translator); + //changeLanguage(setting<Setting::Locale>(), &translator); libraries.restoreFromSettings(); updateRecentlyOpenedDocumentsMenu(); colorTable = loadColors(&libraries);
--- a/src/settings.h Tue Jun 28 13:03:21 2022 +0300 +++ b/src/settings.h Tue Jun 28 14:10:27 2022 +0300 @@ -27,7 +27,7 @@ Q_DECLARE_METATYPE(QMdiArea::ViewMode) // Rendering options -SETTING(Locale, QString{"system"}) +//SETTING(Locale, QString{"system"}) SETTING(BackgroundColor, (QColor{48, 48, 48})) SETTING(MainColor, (QColor{255, 255, 64})) SETTING(SelectedColor, (QColor{32, 32, 224}))
--- a/src/settingseditor/settingseditor.cpp Tue Jun 28 13:03:21 2022 +0300 +++ b/src/settingseditor/settingseditor.cpp Tue Jun 28 14:10:27 2022 +0300 @@ -46,7 +46,7 @@ void SettingsEditor::saveSettings() { - setSetting<Setting::Locale>(this->ui.language->currentData().toString()); + //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()); @@ -63,6 +63,7 @@ void SettingsEditor::loadLocales() { + /* this->ui.language->clear(); QDir dir{":/locale"}; // Collect translation files in built-in resources @@ -81,12 +82,13 @@ 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->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>()); @@ -101,6 +103,7 @@ void SettingsEditor::setCurrentLanguage(const QString& localeCode) { + /* for (int i = 0; i < this->ui.language->count(); i += 1) { if (this->ui.language->itemData(i) == localeCode) @@ -109,4 +112,5 @@ break; } } + */ }
--- a/src/settingseditor/settingseditor.ui Tue Jun 28 13:03:21 2022 +0300 +++ b/src/settingseditor/settingseditor.ui Tue Jun 28 14:10:27 2022 +0300 @@ -31,7 +31,7 @@ <x>0</x> <y>0</y> <width>694</width> - <height>561</height> + <height>563</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> @@ -54,40 +54,28 @@ </property> <layout class="QFormLayout" name="formLayout"> <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Language:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QComboBox" name="language"> - <item> - <property name="text"> - <string>System language</string> - </property> - </item> - <item> - <property name="text"> - <string>English</string> - </property> - </item> - </widget> - </item> - </layout> - </item> - <item row="1" column="0"> <widget class="QLabel" name="label_6"> <property name="text"> <string>View mode:</string> </property> </widget> </item> - <item row="1" column="1"> + <item row="0" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> + <widget class="QRadioButton" name="viewModeSubWindows"> + <property name="toolTip"> + <string>Arrange opened documents using resizable and movable subwindows</string> + </property> + <property name="text"> + <string>Subwindows</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">viewModeButtonGroup</string> + </attribute> + </widget> + </item> + <item> <widget class="QRadioButton" name="viewModeTabs"> <property name="toolTip"> <string>Arrange opened documents using tabs</string> @@ -100,19 +88,6 @@ </attribute> </widget> </item> - <item> - <widget class="QRadioButton" name="viewModeSubWindows"> - <property name="toolTip"> - <string>Arrange opened documents using resizable and movable subwindows</string> - </property> - <property name="text"> - <string>Subwindows</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">viewModeButtonGroup</string> - </attribute> - </widget> - </item> </layout> </item> </layout>