From 56da8888d50cf736b28b02476438d1a95354fbca Mon Sep 17 00:00:00 2001 From: Inky Date: Fri, 24 May 2019 23:30:33 +0300 Subject: [PATCH 1/5] Fixed: prevent bad index and duplicata after profile deletion --HG-- branch : installer --- .../ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp index 866be074d..d4d94457e 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp @@ -170,7 +170,9 @@ void CProfilesDialog::deleteProfile(int index) profilesListView->setCurrentIndex(m_model->index(index, 0)); displayProfile(index); - // TODO: delete files for delete profile + // delete files for delete profile + COperationDialog dialog(this); + dialog.setOperation(OperationUpdateProfiles); } void CProfilesDialog::addProfile() From 18adc2f52914eb1bff373e6429b39522746f04ad Mon Sep 17 00:00:00 2001 From: Inky Date: Fri, 24 May 2019 23:38:06 +0300 Subject: [PATCH 2/5] Changed: allow tab to select all widgets before been captured by editBox --HG-- branch : installer --- code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui b/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui index 6f6cc7de8..becc0f635 100644 --- a/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui +++ b/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui @@ -250,10 +250,10 @@ serverComboBox executableBrowseButton argumentsEdit - commentsEdit directoryButton desktopShortcutCheckBox menuShortcutCheckBox + commentsEdit From e4ea12409bacfee6d85a1002c8cb0301d894d593 Mon Sep 17 00:00:00 2001 From: Inky Date: Sat, 25 May 2019 00:01:52 +0300 Subject: [PATCH 3/5] Changed: added QComboBox widget to change profile language --HG-- branch : installer --- .../ryzom_installer/ui/profilesdialog.ui | 43 +++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui b/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui index becc0f635..209ab6a76 100644 --- a/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui +++ b/code/ryzom/tools/client/ryzom_installer/ui/profilesdialog.ui @@ -6,8 +6,8 @@ 0 0 - 583 - 329 + 631 + 356 @@ -202,13 +202,20 @@ + + + Language: + + + + Create shortcuts: - + @@ -226,6 +233,35 @@ + + + + + English + + + + + Francais + + + + + Deutsch + + + + + Español + + + + + Russian (РУССКИЙ) + + + + @@ -251,6 +287,7 @@ executableBrowseButton argumentsEdit directoryButton + langComboBox desktopShortcutCheckBox menuShortcutCheckBox commentsEdit From 85be9aed362f27c42ef08fcd3f31f5b67c02aebe Mon Sep 17 00:00:00 2001 From: Inky Date: Sat, 25 May 2019 00:15:00 +0300 Subject: [PATCH 4/5] Changed: added language support per profiles --HG-- branch : installer --- .../ryzom_installer/src/operationdialog.cpp | 2 ++ .../client/ryzom_installer/src/profile.cpp | 4 ++- .../client/ryzom_installer/src/profile.h | 1 + .../ryzom_installer/src/profilesdialog.cpp | 26 +++++++++++++++++++ .../ryzom_installer/src/profilesdialog.h | 4 +++ 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index fe01509ab..9017ea2d1 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -877,6 +877,8 @@ bool COperationDialog::createDefaultProfile() profile.comments = "Default profile created by Ryzom Installer"; profile.desktopShortcut = false; profile.menuShortcut = false; + // default use locale + profile.language = config->getLanguage(); #ifdef Q_OS_WIN32 QStringList paths; diff --git a/code/ryzom/tools/client/ryzom_installer/src/profile.cpp b/code/ryzom/tools/client/ryzom_installer/src/profile.cpp index bc90bba56..e6c9aff64 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profile.cpp @@ -33,6 +33,7 @@ void CProfile::loadFromSettings(const QSettings &settings) executable = settings.value("executable").toString(); arguments = settings.value("arguments").toString(); comments = settings.value("comments").toString(); + language = settings.value("language").toString(); desktopShortcut = settings.value("desktop_shortcut").toBool(); menuShortcut = settings.value("menu_shortcut").toBool(); } @@ -45,6 +46,7 @@ void CProfile::saveToSettings(QSettings &settings) const settings.setValue("executable", executable); settings.setValue("arguments", arguments); settings.setValue("comments", comments); + settings.setValue("language", language); settings.setValue("desktop_shortcut", desktopShortcut); settings.setValue("menu_shortcut", menuShortcut); } @@ -175,7 +177,7 @@ bool CProfile::createClientConfig() const // create the 2 initial lines of client.cfg QString rootConfigFilenameLine = QString("RootConfigFilename = \"%1\";").arg(s.getDefaultClientConfigFullPath()); - QString languageCodeline = QString("LanguageCode = \"%1\";\n").arg(CConfigFile::getInstance()->getLanguage()); + QString languageCodeline = QString("LanguageCode = \"%1\";\n").arg(language); QString content; diff --git a/code/ryzom/tools/client/ryzom_installer/src/profile.h b/code/ryzom/tools/client/ryzom_installer/src/profile.h index 5b7f8158f..cad701643 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/profile.h @@ -34,6 +34,7 @@ public: QString executable; QString arguments; QString comments; + QString language; bool desktopShortcut; bool menuShortcut; diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp index d4d94457e..ff1f0c0bc 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp @@ -108,6 +108,7 @@ void CProfilesDialog::displayProfile(int index) serverComboBox->setEnabled(enabled); argumentsEdit->setEnabled(enabled); commentsEdit->setEnabled(enabled); + langComboBox->setEnabled(enabled); if (index < 0) return; @@ -134,6 +135,7 @@ void CProfilesDialog::displayProfile(int index) directoryPathLabel->setText(profileDirectory); desktopShortcutCheckBox->setChecked(profile.desktopShortcut); menuShortcutCheckBox->setChecked(profile.menuShortcut); + langComboBox->setCurrentIndex(getIndexFromProfileLanguage(profile.language)); // disable click on button if directory doesn't exist directoryButton->setEnabled(QFile::exists(profileDirectory)); @@ -155,6 +157,7 @@ void CProfilesDialog::saveProfile(int index) profile.comments = commentsEdit->toPlainText(); profile.desktopShortcut = desktopShortcutCheckBox->isChecked(); profile.menuShortcut = menuShortcutCheckBox->isChecked(); + profile.language = getProfileLanguageFromIndex(langComboBox->currentIndex()); } void CProfilesDialog::deleteProfile(int index) @@ -216,6 +219,7 @@ void CProfilesDialog::addProfile() // set default parameters profile.id = QString::number(nextId); profile.server = server.id; + profile.language = config->getLanguage(); // locale profilesListView->setCurrentIndex(m_model->index(index, 0)); displayProfile(index); @@ -312,3 +316,25 @@ void CProfilesDialog::onProfileDirectoryClicked() QDesktopServices::openUrl(QUrl::fromLocalFile(profileDirectory)); } + +int CProfilesDialog::getIndexFromProfileLanguage(const QString &lang) const +{ + if (lang == "en") return 0; + if (lang == "fr") return 1; + if (lang == "de") return 2; + if (lang == "es") return 3; + if (lang == "ru") return 4; + + return -1; +} + +QString CProfilesDialog::getProfileLanguageFromIndex(int index) const +{ + if (index == 0) return "en"; + if (index == 1) return "fr"; + if (index == 2) return "de"; + if (index == 3) return "es"; + if (index == 4) return "ru"; + // locale + return CConfigFile::getInstance()->getLanguage(); +} diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.h b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.h index 9f364f4ae..29540a68d 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.h @@ -54,6 +54,10 @@ private slots: void onExecutableDefaultClicked(); void onExecutableBrowseClicked(); + int getIndexFromProfileLanguage(const QString &langId) const; + + QString getProfileLanguageFromIndex(int index) const; + private: CProfilesModel *m_model; CServersModel *m_serversModel; From e513b4f8fa404b87634c82e59622320b9619c142 Mon Sep 17 00:00:00 2001 From: Inky Date: Sat, 25 May 2019 00:17:11 +0300 Subject: [PATCH 5/5] Changed: added language text label translation --HG-- branch : installer --- .../ryzom_installer/translations/ryzom_installer_de.ts | 9 +++++++-- .../ryzom_installer/translations/ryzom_installer_es.ts | 9 +++++++-- .../ryzom_installer/translations/ryzom_installer_fr.ts | 9 +++++++-- .../ryzom_installer/translations/ryzom_installer_ru.ts | 9 +++++++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_de.ts b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_de.ts index 1f7ba41c0..7d77da44c 100644 --- a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_de.ts +++ b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_de.ts @@ -828,18 +828,23 @@ Drücke Weiter und folge den verschiedenen Schritten bis zum Ende. Open Öffnen + + + Language: + Sprache : + Create shortcuts: Erstelle Verknüpfungen: - + Desktop Desktop - + Start Menu Start-Menü diff --git a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_es.ts b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_es.ts index 493fbc7c9..d9ccd35d0 100644 --- a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_es.ts +++ b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_es.ts @@ -635,16 +635,21 @@ Just press Continue button and follow the different steps until everything is do + Language: + + + + Create shortcuts: - + Desktop - + Start Menu diff --git a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_fr.ts b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_fr.ts index b2499b8b5..906c22aab 100644 --- a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_fr.ts +++ b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_fr.ts @@ -841,16 +841,21 @@ Vous n'avez qu'à cliquer sur Suivant et suivre les différentes étap + Language: + Langage : + + + Create shortcuts: Créer les raccourcis : - + Desktop Bureau - + Start Menu Menu Démarrer diff --git a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_ru.ts b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_ru.ts index 88f2dccfb..4c9b0465c 100644 --- a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_ru.ts +++ b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_ru.ts @@ -807,16 +807,21 @@ Just press Continue button and follow the different steps until everything is do + Language: + Язык: + + + Create shortcuts: Создать ярлыки: - + Desktop Рабочий стол - + Start Menu меню Пуск