citra_qt: use Citra Web Service username as default multiplayer nickname

This commit is contained in:
zhupengfei 2018-07-17 15:25:00 +08:00
parent fd5f71bcff
commit 40aea8d6b8
No known key found for this signature in database
GPG key ID: 85B82A3E62174206
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);