Qt-GUI: Adding User Name selection (#440)

* Qt-GUI: Adding User Name selection

* fix

* fix 2

* fix 3 (thanks Poly)

* Change the username emplacement
This commit is contained in:
¥IGA 2024-08-15 14:06:09 +02:00 committed by GitHub
parent 8c77d4dde6
commit a0fb47b0ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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::getUserName()));
ui->debugDump->setChecked(Config::debugDump()); ui->debugDump->setChecked(Config::debugDump());
ui->vkValidationCheckBox->setChecked(Config::vkValidationEnabled()); ui->vkValidationCheckBox->setChecked(Config::vkValidationEnabled());

View File

@ -231,6 +231,32 @@
</layout> </layout>
</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>Username</string>
</property>
<layout class="QVBoxLayout" name="userNameLayout">
<item>
<widget class="QLineEdit" name="userNameLineEdit"/>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item> <item>
<widget class="QWidget" name="widgetSettingsTop" native="true"> <widget class="QWidget" name="widgetSettingsTop" native="true">
<layout class="QHBoxLayout" name="widgetGpuTopLayout"> <layout class="QHBoxLayout" name="widgetGpuTopLayout">