diff options
author | bunnei <bunneidev@gmail.com> | 2019-01-02 21:05:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-02 21:05:27 -0500 |
commit | a6aa710b841ba4b24620301e30b75e573f70f4a9 (patch) | |
tree | 74dbff5612e489c9a438fafe199d4c5b522687f5 /src/yuzu/main.cpp | |
parent | 11f990975c4e7fc8d34480703bdba28d650e56cb (diff) | |
parent | 4d61ac08aa0a5a65512f92a52b7a986080b20f74 (diff) |
Merge pull request #1942 from DarkLordZach/profile-select-game-boot
qt: Add setting to prompt for user on game boot
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index bd7b08007..1d5a2b51a 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -687,10 +687,26 @@ bool GMainWindow::LoadROM(const QString& filename) { return true; } +void GMainWindow::SelectAndSetCurrentUser() { + QtProfileSelectionDialog dialog(this); + dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | + Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); + dialog.setWindowModality(Qt::WindowModal); + dialog.exec(); + + if (dialog.GetStatus()) { + Settings::values.current_user = static_cast<s32>(dialog.GetIndex()); + } +} + void GMainWindow::BootGame(const QString& filename) { LOG_INFO(Frontend, "yuzu starting..."); StoreRecentFile(filename); // Put the filename on top of the list + if (UISettings::values.select_user_on_boot) { + SelectAndSetCurrentUser(); + } + if (!LoadROM(filename)) return; |