gui: Add console language to settings

This commit is contained in:
Dzmitry Dubrova 2024-08-09 18:19:35 +03:00
parent 96fb00d411
commit 3163cd135b
4 changed files with 289 additions and 13 deletions

View File

@ -162,6 +162,10 @@ void setFullscreenMode(bool enable) {
isFullscreen = enable; isFullscreen = enable;
} }
void setLanguage(u32 language) {
m_language = language;
}
void setNeoMode(bool enable) { void setNeoMode(bool enable) {
isNeo = enable; isNeo = enable;
} }
@ -432,6 +436,7 @@ void setDefaultValues() {
vblankDivider = 1; vblankDivider = 1;
vkValidation = false; vkValidation = false;
rdocEnable = false; rdocEnable = false;
m_language = 1;
} }
} // namespace Config } // namespace Config

View File

@ -38,6 +38,7 @@ void setVblankDiv(u32 value);
void setScreenWidth(u32 width); void setScreenWidth(u32 width);
void setScreenHeight(u32 height); void setScreenHeight(u32 height);
void setFullscreenMode(bool enable); void setFullscreenMode(bool enable);
void setLanguage(u32 language);
void setNeoMode(bool enable); void setNeoMode(bool enable);
void setLogType(std::string type); void setLogType(std::string type);

View File

@ -32,6 +32,12 @@ SettingsDialog::SettingsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Se
ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus(); ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus();
}); });
// EMULATOR TAB
{
connect(ui->consoleLanguageComboBox, &QComboBox::currentIndexChanged, this,
[](int index) { Config::setLanguage(index); });
}
// GPU TAB // GPU TAB
{ {
// TODO: Implement graphics device changing // TODO: Implement graphics device changing
@ -90,6 +96,8 @@ SettingsDialog::SettingsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Se
} }
void SettingsDialog::LoadValuesFromConfig() { void SettingsDialog::LoadValuesFromConfig() {
ui->consoleLanguageComboBox->setCurrentIndex(Config::GetLanguage());
ui->widthSpinBox->setValue(Config::getScreenWidth()); ui->widthSpinBox->setValue(Config::getScreenWidth());
ui->heightSpinBox->setValue(Config::getScreenHeight()); ui->heightSpinBox->setValue(Config::getScreenHeight());
ui->vblankSpinBox->setValue(Config::vblankDiv()); ui->vblankSpinBox->setValue(Config::vblankDiv());

View File

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later -->
<ui version="4.0"> <ui version="4.0">
<class>SettingsDialog</class> <class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog"> <widget class="QDialog" name="SettingsDialog">
@ -54,31 +57,182 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="gpuTab"> <widget class="QWidget" name="emulatorTab">
<attribute name="title"> <attribute name="title">
<string>GPU</string> <string>Emulator</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="gpuTabLayout" stretch="0,0"> <layout class="QVBoxLayout" name="emulatorTabVLayout" stretch="0,0">
<item> <item>
<layout class="QHBoxLayout" name="gpuTabLayout" stretch="1,1,1"> <layout class="QHBoxLayout" name="emulatorTabHLayout" stretch="1,1,1">
<item> <item>
<layout class="QVBoxLayout" name="gpuTabLayoutLeft"> <layout class="QVBoxLayout" name="emulatorTabLayoutLeft">
<item> <item>
<widget class="QGroupBox" name="graphicsAdapterGroupBox"> <widget class="QGroupBox" name="consoleLanguageGroupBox">
<property name="title"> <property name="title">
<string>Graphics Device</string> <string>Console Language</string>
</property> </property>
<layout class="QVBoxLayout" name="graphicsAdapterLayout"> <layout class="QVBoxLayout" name="settingsLayout">
<item> <item>
<widget class="QComboBox" name="graphicsAdapterBox"/> <widget class="QComboBox" name="consoleLanguageComboBox">
<item>
<property name="text">
<string>Japanese</string>
</property>
</item>
<item>
<property name="text">
<string>English (United States)</string>
</property>
</item>
<item>
<property name="text">
<string>French (France)</string>
</property>
</item>
<item>
<property name="text">
<string>Spanish (Spain)</string>
</property>
</item>
<item>
<property name="text">
<string>German</string>
</property>
</item>
<item>
<property name="text">
<string>Italian</string>
</property>
</item>
<item>
<property name="text">
<string>Dutch</string>
</property>
</item>
<item>
<property name="text">
<string>Portuguese (Portugal)</string>
</property>
</item>
<item>
<property name="text">
<string>Russian</string>
</property>
</item>
<item>
<property name="text">
<string>Korean</string>
</property>
</item>
<item>
<property name="text">
<string>Traditional Chinese</string>
</property>
</item>
<item>
<property name="text">
<string>Simplified Chinese</string>
</property>
</item>
<item>
<property name="text">
<string>Finnish</string>
</property>
</item>
<item>
<property name="text">
<string>Swedish</string>
</property>
</item>
<item>
<property name="text">
<string>Danish</string>
</property>
</item>
<item>
<property name="text">
<string>Norwegian</string>
</property>
</item>
<item>
<property name="text">
<string>Polish</string>
</property>
</item>
<item>
<property name="text">
<string>Portuguese (Brazil)</string>
</property>
</item>
<item>
<property name="text">
<string>English (United Kingdom)</string>
</property>
</item>
<item>
<property name="text">
<string>Turkish</string>
</property>
</item>
<item>
<property name="text">
<string>Spanish (Latin America)</string>
</property>
</item>
<item>
<property name="text">
<string>Arabic</string>
</property>
</item>
<item>
<property name="text">
<string>French (Canada)</string>
</property>
</item>
<item>
<property name="text">
<string>Czech</string>
</property>
</item>
<item>
<property name="text">
<string>Hungarian</string>
</property>
</item>
<item>
<property name="text">
<string>Greek</string>
</property>
</item>
<item>
<property name="text">
<string>Romanian</string>
</property>
</item>
<item>
<property name="text">
<string>Thai</string>
</property>
</item>
<item>
<property name="text">
<string>Vietnamese</string>
</property>
</item>
<item>
<property name="text">
<string>Indonesian</string>
</property>
</item>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QWidget" name="widgetGpuTop" native="true"> <widget class="QWidget" name="widgetSettingsTop" native="true">
<layout class="QHBoxLayout" name="widgetGpuTopLayout"> <layout class="QHBoxLayout" name="widgetGpuTopLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
@ -96,7 +250,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QWidget" name="widgetGpuBottom" native="true"> <widget class="QWidget" name="widgetSettingsBottom" native="true">
<layout class="QHBoxLayout" name="widgetGpuBottomLayout"> <layout class="QHBoxLayout" name="widgetGpuBottomLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
@ -113,6 +267,114 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<spacer name="emulator_tab_layout_right_spacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="emulatorTabLayoutMiddle_2"/>
</item>
<item>
<layout class="QVBoxLayout" name="emulatorTabLayoutRight">
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="emulatorTabSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="gpuTab">
<attribute name="title">
<string>GPU</string>
</attribute>
<layout class="QVBoxLayout" name="gpuTabVLayout" stretch="0,0">
<item>
<layout class="QHBoxLayout" name="gpuTabHLayout" stretch="1,1,1">
<item>
<layout class="QVBoxLayout" name="gpuTabLayoutLeft">
<item>
<widget class="QGroupBox" name="graphicsAdapterGroupBox">
<property name="title">
<string>Graphics Device</string>
</property>
<layout class="QVBoxLayout" name="graphicsAdapterLayout">
<item>
<widget class="QComboBox" name="graphicsAdapterBox"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widgetGpuTop" native="true">
<layout class="QHBoxLayout" name="widgetGpuTopHLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widgetGpuBottom" native="true">
<layout class="QHBoxLayout" name="widgetGpuBottomHLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item> <item>
<spacer name="gpu_tab_layout_right_spacer"> <spacer name="gpu_tab_layout_right_spacer">
<property name="orientation"> <property name="orientation">
@ -294,7 +556,7 @@
<property name="alignment"> <property name="alignment">
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set> <set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
</property> </property>
<layout class="QVBoxLayout" name="additionalSettingsVLayout"> <layout class="QVBoxLayout" name="additionalSettingsLayout">
<item> <item>
<widget class="QCheckBox" name="dumpShadersCheckBox"> <widget class="QCheckBox" name="dumpShadersCheckBox">
<property name="text"> <property name="text">