diff options
| author | Zach Hilman <zachhilman@gmail.com> | 2018-12-25 10:42:02 -0500 |
|---|---|---|
| committer | Zach Hilman <zachhilman@gmail.com> | 2018-12-25 10:42:14 -0500 |
| commit | 4d61ac08aa0a5a65512f92a52b7a986080b20f74 (patch) | |
| tree | fa9f7af5b309cb4c1839eaa6648450cf782d6e60 /src/yuzu/main.cpp | |
| parent | 9a22a94a510e6f537b5156a960f0d49307089668 (diff) | |
qt: Add setting to prompt for user on game boot
Using the QtProfileSelectorDialog, this implementation is trivial. This mimics the real switch behavior of asking which user on every game boot, but it is default disabled as that might get inconvenient.
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 01a0f94ab..8c1d132f5 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; |
