summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-10-10 03:53:26 +0200
committerZach Hilman <zachhilman@gmail.com>2018-10-24 01:31:28 +0200
commit466960c8ab3c10091058e4472d7d2b3aa3c808f0 (patch)
treef589638d79179e74d475ac0e6ad2e54895631682
parentqt: Add Profile Manager UI to system settings (diff)
downloadyuzu-466960c8ab3c10091058e4472d7d2b3aa3c808f0.tar
yuzu-466960c8ab3c10091058e4472d7d2b3aa3c808f0.tar.gz
yuzu-466960c8ab3c10091058e4472d7d2b3aa3c808f0.tar.bz2
yuzu-466960c8ab3c10091058e4472d7d2b3aa3c808f0.tar.lz
yuzu-466960c8ab3c10091058e4472d7d2b3aa3c808f0.tar.xz
yuzu-466960c8ab3c10091058e4472d7d2b3aa3c808f0.tar.zst
yuzu-466960c8ab3c10091058e4472d7d2b3aa3c808f0.zip
-rw-r--r--src/yuzu/main.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index be9896614..1de3b817f 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -757,12 +757,33 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
open_target = "Save Data";
const std::string nand_dir = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir);
ASSERT(program_id != 0);
- // TODO(tech4me): Update this to work with arbitrary user profile
- // Refer to core/hle/service/acc/profile_manager.cpp ProfileManager constructor
- constexpr u128 user_id = {1, 0};
+
+ QStringList list{};
+ std::transform(Settings::values.users.begin(), Settings::values.users.end(),
+ std::back_inserter(list),
+ [](const auto& user) { return QString::fromStdString(user.first); });
+
+ bool ok = false;
+ const auto index_string =
+ QInputDialog::getItem(this, tr("Select User"),
+ tr("Please select the user's save data you would like to open."),
+ list, Settings::values.current_user, false, &ok);
+ if (!ok)
+ return;
+
+ const auto index = list.indexOf(index_string);
+ ASSERT(index != -1);
+
+ const auto user_id = Settings::values.users[index].second.uuid;
path = nand_dir + FileSys::SaveDataFactory::GetFullPath(FileSys::SaveDataSpaceId::NandUser,
FileSys::SaveDataType::SaveData,
program_id, user_id, 0);
+
+ if (!FileUtil::Exists(path)) {
+ FileUtil::CreateFullPath(path);
+ FileUtil::CreateDir(path);
+ }
+
break;
}
case GameListOpenTarget::ModData: {