Merge from installer

--HG--
branch : compatibility-develop
hg/compatibility-develop
Inky 6 years ago
commit b8712f6791

@ -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;

@ -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;

@ -34,6 +34,7 @@ public:
QString executable;
QString arguments;
QString comments;
QString language;
bool desktopShortcut;
bool menuShortcut;

@ -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)
@ -170,7 +173,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()
@ -214,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);
@ -310,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();
}

@ -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;

@ -828,18 +828,23 @@ Drücke Weiter und folge den verschiedenen Schritten bis zum Ende.</translation>
<source>Open</source>
<translation>Öffnen</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Language:</source>
<translation>Sprache :</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Create shortcuts:</source>
<translation>Erstelle Verknüpfungen:</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="216"/>
<location filename="../ui/profilesdialog.ui" line="223"/>
<source>Desktop</source>
<translation>Desktop</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="223"/>
<location filename="../ui/profilesdialog.ui" line="230"/>
<source>Start Menu</source>
<translation>Start-Menü</translation>
</message>

@ -635,16 +635,21 @@ Just press Continue button and follow the different steps until everything is do
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Language:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="214"/>
<source>Create shortcuts:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="216"/>
<location filename="../ui/profilesdialog.ui" line="223"/>
<source>Desktop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="223"/>
<location filename="../ui/profilesdialog.ui" line="230"/>
<source>Start Menu</source>
<translation type="unfinished"></translation>
</message>

@ -841,16 +841,21 @@ Vous n&apos;avez qu&apos;à cliquer sur Suivant et suivre les différentes étap
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Language:</source>
<translation>Langage :</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="214"/>
<source>Create shortcuts:</source>
<translation>Créer les raccourcis :</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="216"/>
<location filename="../ui/profilesdialog.ui" line="223"/>
<source>Desktop</source>
<translation>Bureau</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="223"/>
<location filename="../ui/profilesdialog.ui" line="230"/>
<source>Start Menu</source>
<translation>Menu Démarrer</translation>
</message>

@ -807,16 +807,21 @@ Just press Continue button and follow the different steps until everything is do
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="207"/>
<source>Language:</source>
<translation>Язык:</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="214"/>
<source>Create shortcuts:</source>
<translation>Создать ярлыки:</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="216"/>
<location filename="../ui/profilesdialog.ui" line="223"/>
<source>Desktop</source>
<translation>Рабочий стол</translation>
</message>
<message>
<location filename="../ui/profilesdialog.ui" line="223"/>
<location filename="../ui/profilesdialog.ui" line="230"/>
<source>Start Menu</source>
<translation>меню Пуск</translation>
</message>

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>583</width>
<height>329</height>
<width>631</width>
<height>356</height>
</rect>
</property>
<property name="windowTitle">
@ -202,13 +202,20 @@
</layout>
</item>
<item row="7" column="0">
<widget class="QLabel" name="langLabel">
<property name="text">
<string>Language:</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="shortcutsLabel">
<property name="text">
<string>Create shortcuts:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="8" column="1">
<layout class="QVBoxLayout" name="shortcutsLayout">
<item>
<widget class="QCheckBox" name="desktopShortcutCheckBox">
@ -226,6 +233,35 @@
</item>
</layout>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="langComboBox">
<item>
<property name="text">
<string>English</string>
</property>
</item>
<item>
<property name="text">
<string>Francais</string>
</property>
</item>
<item>
<property name="text">
<string>Deutsch</string>
</property>
</item>
<item>
<property name="text">
<string>Español</string>
</property>
</item>
<item>
<property name="text">
<string>Russian (РУССКИЙ)</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
@ -250,10 +286,11 @@
<tabstop>serverComboBox</tabstop>
<tabstop>executableBrowseButton</tabstop>
<tabstop>argumentsEdit</tabstop>
<tabstop>commentsEdit</tabstop>
<tabstop>directoryButton</tabstop>
<tabstop>langComboBox</tabstop>
<tabstop>desktopShortcutCheckBox</tabstop>
<tabstop>menuShortcutCheckBox</tabstop>
<tabstop>commentsEdit</tabstop>
</tabstops>
<resources/>
<connections>

Loading…
Cancel
Save