diff options
| author | 2020-07-16 09:45:09 -0400 | |
|---|---|---|
| committer | 2020-07-16 09:45:09 -0400 | |
| commit | 9121d35e70ccfadd4bbd60d7b0ec27fa81a24352 (patch) | |
| tree | d7c8923fca23cd0d282d6bf52c49e11c36863c50 /src | |
| parent | Merge pull request #4346 from lioncash/thread (diff) | |
| parent | main/profile_select: Don't prompt for profile selection when only one is avai... (diff) | |
| download | yuzu-9121d35e70ccfadd4bbd60d7b0ec27fa81a24352.tar.gz yuzu-9121d35e70ccfadd4bbd60d7b0ec27fa81a24352.tar.xz yuzu-9121d35e70ccfadd4bbd60d7b0ec27fa81a24352.zip | |
Merge pull request #4297 from FearlessTobi/skip-profile-select
main/profile_select: Don't prompt for profile selection when only one is available
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index d51cb2bcb..9f758605a 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -279,17 +279,21 @@ GMainWindow::~GMainWindow() { | |||
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | void GMainWindow::ProfileSelectorSelectProfile() { | 281 | void GMainWindow::ProfileSelectorSelectProfile() { |
| 282 | QtProfileSelectionDialog dialog(this); | 282 | const Service::Account::ProfileManager manager; |
| 283 | dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | | 283 | int index = 0; |
| 284 | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); | 284 | if (manager.GetUserCount() != 1) { |
| 285 | dialog.setWindowModality(Qt::WindowModal); | 285 | QtProfileSelectionDialog dialog(this); |
| 286 | if (dialog.exec() == QDialog::Rejected) { | 286 | dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | |
| 287 | emit ProfileSelectorFinishedSelection(std::nullopt); | 287 | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); |
| 288 | return; | 288 | dialog.setWindowModality(Qt::WindowModal); |
| 289 | if (dialog.exec() == QDialog::Rejected) { | ||
| 290 | emit ProfileSelectorFinishedSelection(std::nullopt); | ||
| 291 | return; | ||
| 292 | } | ||
| 293 | index = dialog.GetIndex(); | ||
| 289 | } | 294 | } |
| 290 | 295 | ||
| 291 | Service::Account::ProfileManager manager; | 296 | const auto uuid = manager.GetUser(static_cast<std::size_t>(index)); |
| 292 | const auto uuid = manager.GetUser(static_cast<std::size_t>(dialog.GetIndex())); | ||
| 293 | if (!uuid.has_value()) { | 297 | if (!uuid.has_value()) { |
| 294 | emit ProfileSelectorFinishedSelection(std::nullopt); | 298 | emit ProfileSelectorFinishedSelection(std::nullopt); |
| 295 | return; | 299 | return; |