mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-18 17:34:52 +00:00
Displays translation in interface, not logs or config (#2424)
Release/Nightly async/sync
This commit is contained in:
parent
46ef678f55
commit
d1e88c40d8
1 changed files with 19 additions and 14 deletions
|
@ -58,6 +58,7 @@ QStringList languageNames = {"Arabic",
|
||||||
|
|
||||||
const QVector<int> languageIndexes = {21, 23, 14, 6, 18, 1, 12, 22, 2, 4, 25, 24, 29, 5, 0, 9,
|
const QVector<int> languageIndexes = {21, 23, 14, 6, 18, 1, 12, 22, 2, 4, 25, 24, 29, 5, 0, 9,
|
||||||
15, 16, 17, 7, 26, 8, 11, 20, 3, 13, 27, 10, 19, 30, 28};
|
15, 16, 17, 7, 26, 8, 11, 20, 3, 13, 27, 10, 19, 30, 28};
|
||||||
|
QMap<QString, QString> channelMap;
|
||||||
|
|
||||||
SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
||||||
std::shared_ptr<CompatibilityInfoClass> m_compat_info,
|
std::shared_ptr<CompatibilityInfoClass> m_compat_info,
|
||||||
|
@ -71,6 +72,8 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
||||||
|
|
||||||
ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus();
|
ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus();
|
||||||
|
|
||||||
|
channelMap = {{tr("Release"), "Release"}, {tr("Nightly"), "Nightly"}};
|
||||||
|
|
||||||
// Add list of available GPUs
|
// Add list of available GPUs
|
||||||
ui->graphicsAdapterBox->addItem(tr("Auto Select")); // -1, auto selection
|
ui->graphicsAdapterBox->addItem(tr("Auto Select")); // -1, auto selection
|
||||||
for (const auto& device : physical_devices) {
|
for (const auto& device : physical_devices) {
|
||||||
|
@ -149,7 +152,11 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect(ui->updateComboBox, &QComboBox::currentTextChanged, this,
|
connect(ui->updateComboBox, &QComboBox::currentTextChanged, this,
|
||||||
[](const QString& channel) { Config::setUpdateChannel(channel.toStdString()); });
|
[this](const QString& channel) {
|
||||||
|
if (channelMap.contains(channel)) {
|
||||||
|
Config::setUpdateChannel(channelMap.value(channel).toStdString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
connect(ui->checkUpdateButton, &QPushButton::clicked, this, []() {
|
connect(ui->checkUpdateButton, &QPushButton::clicked, this, []() {
|
||||||
auto checkUpdate = new CheckUpdate(true);
|
auto checkUpdate = new CheckUpdate(true);
|
||||||
|
@ -373,8 +380,9 @@ void SettingsDialog::LoadValuesFromConfig() {
|
||||||
toml::find_or<bool>(data, "General", "separateUpdateEnabled", false));
|
toml::find_or<bool>(data, "General", "separateUpdateEnabled", false));
|
||||||
ui->gameSizeCheckBox->setChecked(toml::find_or<bool>(data, "GUI", "loadGameSizeEnabled", true));
|
ui->gameSizeCheckBox->setChecked(toml::find_or<bool>(data, "GUI", "loadGameSizeEnabled", true));
|
||||||
ui->showSplashCheckBox->setChecked(toml::find_or<bool>(data, "General", "showSplash", false));
|
ui->showSplashCheckBox->setChecked(toml::find_or<bool>(data, "General", "showSplash", false));
|
||||||
ui->logTypeComboBox->setCurrentText(
|
std::string logType = Config::getLogType();
|
||||||
QString::fromStdString(toml::find_or<std::string>(data, "General", "logType", "async")));
|
ui->logTypeComboBox->setCurrentText(logType == "async" ? tr("async")
|
||||||
|
: (logType == "sync" ? tr("sync") : ""));
|
||||||
ui->logFilterLineEdit->setText(
|
ui->logFilterLineEdit->setText(
|
||||||
QString::fromStdString(toml::find_or<std::string>(data, "General", "logFilter", "")));
|
QString::fromStdString(toml::find_or<std::string>(data, "General", "logFilter", "")));
|
||||||
ui->userNameLineEdit->setText(
|
ui->userNameLineEdit->setText(
|
||||||
|
@ -405,15 +413,12 @@ void SettingsDialog::LoadValuesFromConfig() {
|
||||||
ui->updateCheckBox->setChecked(toml::find_or<bool>(data, "General", "autoUpdate", false));
|
ui->updateCheckBox->setChecked(toml::find_or<bool>(data, "General", "autoUpdate", false));
|
||||||
ui->changelogCheckBox->setChecked(
|
ui->changelogCheckBox->setChecked(
|
||||||
toml::find_or<bool>(data, "General", "alwaysShowChangelog", false));
|
toml::find_or<bool>(data, "General", "alwaysShowChangelog", false));
|
||||||
std::string updateChannel = toml::find_or<std::string>(data, "General", "updateChannel", "");
|
|
||||||
if (updateChannel != "Release" && updateChannel != "Nightly") {
|
QString updateChannel = QString::fromStdString(Config::getUpdateChannel());
|
||||||
if (Common::isRelease) {
|
ui->updateComboBox->setCurrentText(
|
||||||
updateChannel = "Release";
|
channelMap.key(updateChannel != "Release" && updateChannel != "Nightly"
|
||||||
} else {
|
? (Common::isRelease ? "Release" : "Nightly")
|
||||||
updateChannel = "Nightly";
|
: updateChannel));
|
||||||
}
|
|
||||||
}
|
|
||||||
ui->updateComboBox->setCurrentText(QString::fromStdString(updateChannel));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string chooseHomeTab = toml::find_or<std::string>(data, "General", "chooseHomeTab", "");
|
std::string chooseHomeTab = toml::find_or<std::string>(data, "General", "chooseHomeTab", "");
|
||||||
|
@ -637,7 +642,7 @@ void SettingsDialog::UpdateSettings() {
|
||||||
Config::setisTrophyPopupDisabled(ui->disableTrophycheckBox->isChecked());
|
Config::setisTrophyPopupDisabled(ui->disableTrophycheckBox->isChecked());
|
||||||
Config::setPlayBGM(ui->playBGMCheckBox->isChecked());
|
Config::setPlayBGM(ui->playBGMCheckBox->isChecked());
|
||||||
Config::setAllowHDR(ui->enableHDRCheckBox->isChecked());
|
Config::setAllowHDR(ui->enableHDRCheckBox->isChecked());
|
||||||
Config::setLogType(ui->logTypeComboBox->currentText().toStdString());
|
Config::setLogType((ui->logTypeComboBox->currentText() == tr("async") ? "async" : "sync"));
|
||||||
Config::setLogFilter(ui->logFilterLineEdit->text().toStdString());
|
Config::setLogFilter(ui->logFilterLineEdit->text().toStdString());
|
||||||
Config::setUserName(ui->userNameLineEdit->text().toStdString());
|
Config::setUserName(ui->userNameLineEdit->text().toStdString());
|
||||||
Config::setTrophyKey(ui->trophyKeyLineEdit->text().toStdString());
|
Config::setTrophyKey(ui->trophyKeyLineEdit->text().toStdString());
|
||||||
|
@ -666,7 +671,7 @@ void SettingsDialog::UpdateSettings() {
|
||||||
Config::setCopyGPUCmdBuffers(ui->copyGPUBuffersCheckBox->isChecked());
|
Config::setCopyGPUCmdBuffers(ui->copyGPUBuffersCheckBox->isChecked());
|
||||||
Config::setAutoUpdate(ui->updateCheckBox->isChecked());
|
Config::setAutoUpdate(ui->updateCheckBox->isChecked());
|
||||||
Config::setAlwaysShowChangelog(ui->changelogCheckBox->isChecked());
|
Config::setAlwaysShowChangelog(ui->changelogCheckBox->isChecked());
|
||||||
Config::setUpdateChannel(ui->updateComboBox->currentText().toStdString());
|
Config::setUpdateChannel(channelMap.value(ui->updateComboBox->currentText()).toStdString());
|
||||||
Config::setChooseHomeTab(ui->chooseHomeTabComboBox->currentText().toStdString());
|
Config::setChooseHomeTab(ui->chooseHomeTabComboBox->currentText().toStdString());
|
||||||
Config::setCompatibilityEnabled(ui->enableCompatibilityCheckBox->isChecked());
|
Config::setCompatibilityEnabled(ui->enableCompatibilityCheckBox->isChecked());
|
||||||
Config::setCheckCompatibilityOnStartup(ui->checkCompatibilityOnStartupCheckBox->isChecked());
|
Config::setCheckCompatibilityOnStartup(ui->checkCompatibilityOnStartupCheckBox->isChecked());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue