Merge pull request #3947 from zhaowenlan1779/autofill-multiplayer

citra_qt: use Citra Web Service username as default multiplayer nickname
This commit is contained in:
James Rowe 2018-07-18 10:02:14 -06:00 committed by GitHub
commit bc30b314d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -33,6 +33,10 @@ DirectConnectWindow::DirectConnectWindow(QWidget* parent)
ui->nickname->setValidator(validation.GetNickname());
ui->nickname->setText(UISettings::values.nickname);
if (ui->nickname->text().isEmpty() && !Settings::values.citra_username.empty()) {
// Use Citra Web Service user name as nickname by default
ui->nickname->setText(QString::fromStdString(Settings::values.citra_username));
}
ui->ip->setValidator(validation.GetIP());
ui->ip->setText(UISettings::values.ip);
ui->port->setValidator(validation.GetPort());

View file

@ -54,6 +54,10 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
// Restore the settings:
ui->username->setText(UISettings::values.room_nickname);
if (ui->username->text().isEmpty() && !Settings::values.citra_username.empty()) {
// Use Citra Web Service user name as nickname by default
ui->username->setText(QString::fromStdString(Settings::values.citra_username));
}
ui->room_name->setText(UISettings::values.room_name);
ui->port->setText(UISettings::values.room_port);
ui->max_player->setValue(UISettings::values.max_player);

View file

@ -48,6 +48,10 @@ Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
ui->nickname->setValidator(validation.GetNickname());
ui->nickname->setText(UISettings::values.nickname);
if (ui->nickname->text().isEmpty() && !Settings::values.citra_username.empty()) {
// Use Citra Web Service user name as nickname by default
ui->nickname->setText(QString::fromStdString(Settings::values.citra_username));
}
// UI Buttons
connect(ui->refresh_list, &QPushButton::pressed, this, &Lobby::RefreshLobby);