Qt-GUI: Adding User Name selection

This commit is contained in:
Xphalnos 2024-08-15 12:12:32 +02:00
parent 8c77d4dde6
commit 5e1cd74598
4 changed files with 36 additions and 0 deletions

View File

@ -197,6 +197,10 @@ void setLogFilter(std::string type) {
logFilter = type; logFilter = type;
} }
void setUserName(std::string type) {
userName = type;
}
void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) { void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) {
main_window_geometry_x = x; main_window_geometry_x = x;
main_window_geometry_y = y; main_window_geometry_y = y;
@ -453,6 +457,7 @@ void setDefaultValues() {
screenHeight = 720; screenHeight = 720;
logFilter = ""; logFilter = "";
logType = "async"; logType = "async";
userName = "shadPS4";
isDebugDump = false; isDebugDump = false;
isShowSplash = false; isShowSplash = false;
isNullGpu = false; isNullGpu = false;

View File

@ -43,6 +43,7 @@ void setScreenHeight(u32 height);
void setFullscreenMode(bool enable); void setFullscreenMode(bool enable);
void setLanguage(u32 language); void setLanguage(u32 language);
void setNeoMode(bool enable); void setNeoMode(bool enable);
void setUserName(std::string type);
void setLogType(std::string type); void setLogType(std::string type);
void setLogFilter(std::string type); void setLogFilter(std::string type);

View File

@ -43,6 +43,9 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
{ {
connect(ui->consoleLanguageComboBox, &QComboBox::currentIndexChanged, this, connect(ui->consoleLanguageComboBox, &QComboBox::currentIndexChanged, this,
[](int index) { Config::setLanguage(index); }); [](int index) { Config::setLanguage(index); });
connect(ui->userNameLineEdit, &QLineEdit::textChanged, this,
[](const QString& text) { Config::setUserName(text.toStdString()); });
} }
// GPU TAB // GPU TAB
@ -121,6 +124,7 @@ void SettingsDialog::LoadValuesFromConfig() {
ui->ps4proCheckBox->setChecked(Config::isNeoMode()); ui->ps4proCheckBox->setChecked(Config::isNeoMode());
ui->logTypeComboBox->setCurrentText(QString::fromStdString(Config::getLogType())); ui->logTypeComboBox->setCurrentText(QString::fromStdString(Config::getLogType()));
ui->logFilterLineEdit->setText(QString::fromStdString(Config::getLogFilter())); ui->logFilterLineEdit->setText(QString::fromStdString(Config::getLogFilter()));
ui->userNameLineEdit->setText(QString::fromStdString(Config::setUserName()));
ui->debugDump->setChecked(Config::debugDump()); ui->debugDump->setChecked(Config::debugDump());
ui->vkValidationCheckBox->setChecked(Config::vkValidationEnabled()); ui->vkValidationCheckBox->setChecked(Config::vkValidationEnabled());

View File

@ -655,6 +655,32 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QVBoxLayout" name="vLayoutUserName">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="hLayoutUserName">
<item>
<widget class="QGroupBox" name="userName">
<property name="title">
<string>User Name</string>
</property>
<layout class="QVBoxLayout" name="userNameLayout">
<item>
<widget class="QLineEdit" name="userNameLineEdit"/>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item> <item>
<spacer name="emulatorTabSpacerLeft"> <spacer name="emulatorTabSpacerLeft">
<property name="orientation"> <property name="orientation">