diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/frontend/applets/profile_select.cpp | 5 | ||||
| -rw-r--r-- | src/core/frontend/applets/profile_select.h | 8 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/profile_select.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/profile_select.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/mii/mii_manager.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/applets/profile_select.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu/applets/profile_select.h | 8 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_profile_manager.cpp | 11 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 |
9 files changed, 27 insertions, 29 deletions
diff --git a/src/core/frontend/applets/profile_select.cpp b/src/core/frontend/applets/profile_select.cpp index fbf5f2a9e..4df3574d2 100644 --- a/src/core/frontend/applets/profile_select.cpp +++ b/src/core/frontend/applets/profile_select.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/frontend/applets/profile_select.h" | 5 | #include "core/frontend/applets/profile_select.h" |
| 6 | #include "core/hle/service/acc/profile_manager.h" | ||
| 6 | #include "core/settings.h" | 7 | #include "core/settings.h" |
| 7 | 8 | ||
| 8 | namespace Core::Frontend { | 9 | namespace Core::Frontend { |
| @@ -10,9 +11,9 @@ namespace Core::Frontend { | |||
| 10 | ProfileSelectApplet::~ProfileSelectApplet() = default; | 11 | ProfileSelectApplet::~ProfileSelectApplet() = default; |
| 11 | 12 | ||
| 12 | void DefaultProfileSelectApplet::SelectProfile( | 13 | void DefaultProfileSelectApplet::SelectProfile( |
| 13 | std::function<void(std::optional<Service::Account::UUID>)> callback) const { | 14 | std::function<void(std::optional<Common::UUID>)> callback) const { |
| 14 | Service::Account::ProfileManager manager; | 15 | Service::Account::ProfileManager manager; |
| 15 | callback(manager.GetUser(Settings::values.current_user).value_or(Service::Account::UUID{})); | 16 | callback(manager.GetUser(Settings::values.current_user).value_or(Common::UUID{})); |
| 16 | LOG_INFO(Service_ACC, "called, selecting current user instead of prompting..."); | 17 | LOG_INFO(Service_ACC, "called, selecting current user instead of prompting..."); |
| 17 | } | 18 | } |
| 18 | 19 | ||
diff --git a/src/core/frontend/applets/profile_select.h b/src/core/frontend/applets/profile_select.h index fc8f7ae94..3506b9885 100644 --- a/src/core/frontend/applets/profile_select.h +++ b/src/core/frontend/applets/profile_select.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <functional> | 7 | #include <functional> |
| 8 | #include <optional> | 8 | #include <optional> |
| 9 | #include "core/hle/service/acc/profile_manager.h" | 9 | #include "common/uuid.h" |
| 10 | 10 | ||
| 11 | namespace Core::Frontend { | 11 | namespace Core::Frontend { |
| 12 | 12 | ||
| @@ -14,14 +14,12 @@ class ProfileSelectApplet { | |||
| 14 | public: | 14 | public: |
| 15 | virtual ~ProfileSelectApplet(); | 15 | virtual ~ProfileSelectApplet(); |
| 16 | 16 | ||
| 17 | virtual void SelectProfile( | 17 | virtual void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const = 0; |
| 18 | std::function<void(std::optional<Service::Account::UUID>)> callback) const = 0; | ||
| 19 | }; | 18 | }; |
| 20 | 19 | ||
| 21 | class DefaultProfileSelectApplet final : public ProfileSelectApplet { | 20 | class DefaultProfileSelectApplet final : public ProfileSelectApplet { |
| 22 | public: | 21 | public: |
| 23 | void SelectProfile( | 22 | void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const override; |
| 24 | std::function<void(std::optional<Service::Account::UUID>)> callback) const override; | ||
| 25 | }; | 23 | }; |
| 26 | 24 | ||
| 27 | } // namespace Core::Frontend | 25 | } // namespace Core::Frontend |
diff --git a/src/core/hle/service/am/applets/profile_select.cpp b/src/core/hle/service/am/applets/profile_select.cpp index d113bd2eb..3c184859d 100644 --- a/src/core/hle/service/am/applets/profile_select.cpp +++ b/src/core/hle/service/am/applets/profile_select.cpp | |||
| @@ -56,16 +56,16 @@ void ProfileSelect::Execute() { | |||
| 56 | frontend.SelectProfile([this](std::optional<Account::UUID> uuid) { SelectionComplete(uuid); }); | 56 | frontend.SelectProfile([this](std::optional<Account::UUID> uuid) { SelectionComplete(uuid); }); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | void ProfileSelect::SelectionComplete(std::optional<Account::UUID> uuid) { | 59 | void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) { |
| 60 | UserSelectionOutput output{}; | 60 | UserSelectionOutput output{}; |
| 61 | 61 | ||
| 62 | if (uuid.has_value() && uuid->uuid != Account::INVALID_UUID) { | 62 | if (uuid.has_value() && uuid->uuid != Common::INVALID_UUID) { |
| 63 | output.result = 0; | 63 | output.result = 0; |
| 64 | output.uuid_selected = uuid->uuid; | 64 | output.uuid_selected = uuid->uuid; |
| 65 | } else { | 65 | } else { |
| 66 | status = ERR_USER_CANCELLED_SELECTION; | 66 | status = ERR_USER_CANCELLED_SELECTION; |
| 67 | output.result = ERR_USER_CANCELLED_SELECTION.raw; | 67 | output.result = ERR_USER_CANCELLED_SELECTION.raw; |
| 68 | output.uuid_selected = Account::INVALID_UUID; | 68 | output.uuid_selected = Common::INVALID_UUID; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | final_data = std::vector<u8>(sizeof(UserSelectionOutput)); | 71 | final_data = std::vector<u8>(sizeof(UserSelectionOutput)); |
diff --git a/src/core/hle/service/am/applets/profile_select.h b/src/core/hle/service/am/applets/profile_select.h index a2ac6cf50..f99630158 100644 --- a/src/core/hle/service/am/applets/profile_select.h +++ b/src/core/hle/service/am/applets/profile_select.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include <vector> | 7 | #include <vector> |
| 8 | 8 | ||
| 9 | #include "common/common_funcs.h" | 9 | #include "common/common_funcs.h" |
| 10 | #include "core/hle/service/acc/profile_manager.h" | 10 | #include "common/uuid.h" |
| 11 | #include "core/hle/service/am/applets/applets.h" | 11 | #include "core/hle/service/am/applets/applets.h" |
| 12 | 12 | ||
| 13 | namespace Service::AM::Applets { | 13 | namespace Service::AM::Applets { |
| @@ -38,7 +38,7 @@ public: | |||
| 38 | void ExecuteInteractive() override; | 38 | void ExecuteInteractive() override; |
| 39 | void Execute() override; | 39 | void Execute() override; |
| 40 | 40 | ||
| 41 | void SelectionComplete(std::optional<Account::UUID> uuid); | 41 | void SelectionComplete(std::optional<Common::UUID> uuid); |
| 42 | 42 | ||
| 43 | private: | 43 | private: |
| 44 | const Core::Frontend::ProfileSelectApplet& frontend; | 44 | const Core::Frontend::ProfileSelectApplet& frontend; |
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp index 04fc2180b..a526e4440 100644 --- a/src/core/hle/service/mii/mii_manager.cpp +++ b/src/core/hle/service/mii/mii_manager.cpp | |||
| @@ -174,7 +174,7 @@ MiiStoreData ConvertInfoToStoreData(const MiiInfo& info) { | |||
| 174 | 174 | ||
| 175 | } // namespace | 175 | } // namespace |
| 176 | 176 | ||
| 177 | std::ostream& operator<<(std::ostream& os,Source source) { | 177 | std::ostream& operator<<(std::ostream& os, Source source) { |
| 178 | os << SOURCE_NAMES.at(static_cast<std::size_t>(source)); | 178 | os << SOURCE_NAMES.at(static_cast<std::size_t>(source)); |
| 179 | return os; | 179 | return os; |
| 180 | } | 180 | } |
diff --git a/src/yuzu/applets/profile_select.cpp b/src/yuzu/applets/profile_select.cpp index 743b24d76..812b0142f 100644 --- a/src/yuzu/applets/profile_select.cpp +++ b/src/yuzu/applets/profile_select.cpp | |||
| @@ -27,20 +27,20 @@ constexpr std::array<u8, 107> backup_jpeg{ | |||
| 27 | 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9, | 27 | 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9, |
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | QString FormatUserEntryText(const QString& username, Service::Account::UUID uuid) { | 30 | QString FormatUserEntryText(const QString& username, Common::UUID uuid) { |
| 31 | return QtProfileSelectionDialog::tr( | 31 | return QtProfileSelectionDialog::tr( |
| 32 | "%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. " | 32 | "%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. " |
| 33 | "00112233-4455-6677-8899-AABBCCDDEEFF))") | 33 | "00112233-4455-6677-8899-AABBCCDDEEFF))") |
| 34 | .arg(username, QString::fromStdString(uuid.FormatSwitch())); | 34 | .arg(username, QString::fromStdString(uuid.FormatSwitch())); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | QString GetImagePath(Service::Account::UUID uuid) { | 37 | QString GetImagePath(Common::UUID uuid) { |
| 38 | const auto path = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir) + | 38 | const auto path = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir) + |
| 39 | "/system/save/8000000000000010/su/avators/" + uuid.FormatSwitch() + ".jpg"; | 39 | "/system/save/8000000000000010/su/avators/" + uuid.FormatSwitch() + ".jpg"; |
| 40 | return QString::fromStdString(path); | 40 | return QString::fromStdString(path); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | QPixmap GetIcon(Service::Account::UUID uuid) { | 43 | QPixmap GetIcon(Common::UUID uuid) { |
| 44 | QPixmap icon{GetImagePath(uuid)}; | 44 | QPixmap icon{GetImagePath(uuid)}; |
| 45 | 45 | ||
| 46 | if (!icon) { | 46 | if (!icon) { |
| @@ -154,12 +154,12 @@ QtProfileSelector::QtProfileSelector(GMainWindow& parent) { | |||
| 154 | QtProfileSelector::~QtProfileSelector() = default; | 154 | QtProfileSelector::~QtProfileSelector() = default; |
| 155 | 155 | ||
| 156 | void QtProfileSelector::SelectProfile( | 156 | void QtProfileSelector::SelectProfile( |
| 157 | std::function<void(std::optional<Service::Account::UUID>)> callback) const { | 157 | std::function<void(std::optional<Common::UUID>)> callback) const { |
| 158 | this->callback = std::move(callback); | 158 | this->callback = std::move(callback); |
| 159 | emit MainWindowSelectProfile(); | 159 | emit MainWindowSelectProfile(); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | void QtProfileSelector::MainWindowFinishedSelection(std::optional<Service::Account::UUID> uuid) { | 162 | void QtProfileSelector::MainWindowFinishedSelection(std::optional<Common::UUID> uuid) { |
| 163 | // Acquire the HLE mutex | 163 | // Acquire the HLE mutex |
| 164 | std::lock_guard lock{HLE::g_hle_lock}; | 164 | std::lock_guard lock{HLE::g_hle_lock}; |
| 165 | callback(uuid); | 165 | callback(uuid); |
diff --git a/src/yuzu/applets/profile_select.h b/src/yuzu/applets/profile_select.h index 1c2922e54..c5b90a78e 100644 --- a/src/yuzu/applets/profile_select.h +++ b/src/yuzu/applets/profile_select.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <QList> | 9 | #include <QList> |
| 10 | #include <QTreeView> | 10 | #include <QTreeView> |
| 11 | #include "core/frontend/applets/profile_select.h" | 11 | #include "core/frontend/applets/profile_select.h" |
| 12 | #include "core/hle/service/acc/profile_manager.h" | ||
| 12 | 13 | ||
| 13 | class GMainWindow; | 14 | class GMainWindow; |
| 14 | class QDialogButtonBox; | 15 | class QDialogButtonBox; |
| @@ -60,14 +61,13 @@ public: | |||
| 60 | explicit QtProfileSelector(GMainWindow& parent); | 61 | explicit QtProfileSelector(GMainWindow& parent); |
| 61 | ~QtProfileSelector() override; | 62 | ~QtProfileSelector() override; |
| 62 | 63 | ||
| 63 | void SelectProfile( | 64 | void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const override; |
| 64 | std::function<void(std::optional<Service::Account::UUID>)> callback) const override; | ||
| 65 | 65 | ||
| 66 | signals: | 66 | signals: |
| 67 | void MainWindowSelectProfile() const; | 67 | void MainWindowSelectProfile() const; |
| 68 | 68 | ||
| 69 | private: | 69 | private: |
| 70 | void MainWindowFinishedSelection(std::optional<Service::Account::UUID> uuid); | 70 | void MainWindowFinishedSelection(std::optional<Common::UUID> uuid); |
| 71 | 71 | ||
| 72 | mutable std::function<void(std::optional<Service::Account::UUID>)> callback; | 72 | mutable std::function<void(std::optional<Common::UUID>)> callback; |
| 73 | }; | 73 | }; |
diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp index 41663e39a..10f8ba041 100644 --- a/src/yuzu/configuration/configure_profile_manager.cpp +++ b/src/yuzu/configuration/configure_profile_manager.cpp | |||
| @@ -33,14 +33,13 @@ constexpr std::array<u8, 107> backup_jpeg{ | |||
| 33 | 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9, | 33 | 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9, |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | QString GetImagePath(Service::Account::UUID uuid) { | 36 | QString GetImagePath(Common::UUID uuid) { |
| 37 | const auto path = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir) + | 37 | const auto path = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir) + |
| 38 | "/system/save/8000000000000010/su/avators/" + uuid.FormatSwitch() + ".jpg"; | 38 | "/system/save/8000000000000010/su/avators/" + uuid.FormatSwitch() + ".jpg"; |
| 39 | return QString::fromStdString(path); | 39 | return QString::fromStdString(path); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | QString GetAccountUsername(const Service::Account::ProfileManager& manager, | 42 | QString GetAccountUsername(const Service::Account::ProfileManager& manager, Common::UUID uuid) { |
| 43 | Service::Account::UUID uuid) { | ||
| 44 | Service::Account::ProfileBase profile; | 43 | Service::Account::ProfileBase profile; |
| 45 | if (!manager.GetProfileBase(uuid, profile)) { | 44 | if (!manager.GetProfileBase(uuid, profile)) { |
| 46 | return {}; | 45 | return {}; |
| @@ -51,14 +50,14 @@ QString GetAccountUsername(const Service::Account::ProfileManager& manager, | |||
| 51 | return QString::fromStdString(text); | 50 | return QString::fromStdString(text); |
| 52 | } | 51 | } |
| 53 | 52 | ||
| 54 | QString FormatUserEntryText(const QString& username, Service::Account::UUID uuid) { | 53 | QString FormatUserEntryText(const QString& username, Common::UUID uuid) { |
| 55 | return ConfigureProfileManager::tr("%1\n%2", | 54 | return ConfigureProfileManager::tr("%1\n%2", |
| 56 | "%1 is the profile username, %2 is the formatted UUID (e.g. " | 55 | "%1 is the profile username, %2 is the formatted UUID (e.g. " |
| 57 | "00112233-4455-6677-8899-AABBCCDDEEFF))") | 56 | "00112233-4455-6677-8899-AABBCCDDEEFF))") |
| 58 | .arg(username, QString::fromStdString(uuid.FormatSwitch())); | 57 | .arg(username, QString::fromStdString(uuid.FormatSwitch())); |
| 59 | } | 58 | } |
| 60 | 59 | ||
| 61 | QPixmap GetIcon(Service::Account::UUID uuid) { | 60 | QPixmap GetIcon(Common::UUID uuid) { |
| 62 | QPixmap icon{GetImagePath(uuid)}; | 61 | QPixmap icon{GetImagePath(uuid)}; |
| 63 | 62 | ||
| 64 | if (!icon) { | 63 | if (!icon) { |
| @@ -190,7 +189,7 @@ void ConfigureProfileManager::AddUser() { | |||
| 190 | return; | 189 | return; |
| 191 | } | 190 | } |
| 192 | 191 | ||
| 193 | const auto uuid = Service::Account::UUID::Generate(); | 192 | const auto uuid = Common::UUID::Generate(); |
| 194 | profile_manager->CreateNewUser(uuid, username.toStdString()); | 193 | profile_manager->CreateNewUser(uuid, username.toStdString()); |
| 195 | 194 | ||
| 196 | item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)}); | 195 | item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)}); |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index fb2a193cb..c4566ed2c 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -104,7 +104,7 @@ signals: | |||
| 104 | 104 | ||
| 105 | void ErrorDisplayFinished(); | 105 | void ErrorDisplayFinished(); |
| 106 | 106 | ||
| 107 | void ProfileSelectorFinishedSelection(std::optional<Service::Account::UUID> uuid); | 107 | void ProfileSelectorFinishedSelection(std::optional<Common::UUID> uuid); |
| 108 | void SoftwareKeyboardFinishedText(std::optional<std::u16string> text); | 108 | void SoftwareKeyboardFinishedText(std::optional<std::u16string> text); |
| 109 | void SoftwareKeyboardFinishedCheckDialog(); | 109 | void SoftwareKeyboardFinishedCheckDialog(); |
| 110 | 110 | ||