diff options
| author | bunnei <bunneidev@gmail.com> | 2018-12-23 14:35:13 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-23 14:35:13 -0500 |
| commit | f95f6c7d86af9857cb737a741fc847bf2c5d8413 (patch) | |
| tree | b5c02a35cdb18b78c648bc3a6f98b87e68d2e651 /src/yuzu/main.cpp | |
| parent | d08bdc861f056cd217fb58b3cbe9beb2357d9d22 (diff) | |
| parent | e11e65b3d63fabd7c953cca07971364984021c3e (diff) | |
Merge pull request #1781 from DarkLordZach/applet-profile-select
am: Implement HLE profile selector applet
Diffstat (limited to 'src/yuzu/main.cpp')
| -rw-r--r-- | src/yuzu/main.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 90b212ba5..feb5572c6 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -8,6 +8,7 @@ #include <thread> // VFS includes must be before glad as they will conflict with Windows file api, which uses defines. +#include "applets/profile_select.h" #include "applets/software_keyboard.h" #include "configuration/configure_per_general.h" #include "core/file_sys/vfs.h" @@ -208,6 +209,28 @@ GMainWindow::~GMainWindow() { delete render_window; } +void GMainWindow::ProfileSelectorSelectProfile() { + QtProfileSelectionDialog dialog(this); + dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | + Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); + dialog.setWindowModality(Qt::WindowModal); + dialog.exec(); + + if (!dialog.GetStatus()) { + emit ProfileSelectorFinishedSelection(std::nullopt); + return; + } + + Service::Account::ProfileManager manager; + const auto uuid = manager.GetUser(dialog.GetIndex()); + if (!uuid.has_value()) { + emit ProfileSelectorFinishedSelection(std::nullopt); + return; + } + + emit ProfileSelectorFinishedSelection(uuid); +} + void GMainWindow::SoftwareKeyboardGetText( const Core::Frontend::SoftwareKeyboardParameters& parameters) { QtSoftwareKeyboardDialog dialog(this, parameters); @@ -574,6 +597,7 @@ bool GMainWindow::LoadROM(const QString& filename) { system.SetGPUDebugContext(debug_context); + system.SetProfileSelector(std::make_unique<QtProfileSelector>(*this)); system.SetSoftwareKeyboard(std::make_unique<QtSoftwareKeyboard>(*this)); const Core::System::ResultStatus result{system.Load(*render_window, filename.toStdString())}; |
