diff options
| author | 2020-07-17 05:20:27 -0400 | |
|---|---|---|
| committer | 2020-07-29 06:50:30 -0400 | |
| commit | de6b852dc21900372ae721d7e4899485dcccaf0b (patch) | |
| tree | 254cb4fc16cb78ab75652a2658be92d637fceda7 /src | |
| parent | Merge pull request #4442 from lioncash/devicemem (diff) | |
| download | yuzu-de6b852dc21900372ae721d7e4899485dcccaf0b.tar.gz yuzu-de6b852dc21900372ae721d7e4899485dcccaf0b.tar.xz yuzu-de6b852dc21900372ae721d7e4899485dcccaf0b.zip | |
game_list: Add "Remove" context menu
Adds the following actions:
- Remove Installed Update
- Remove All Installed DLC
- Remove Shader Cache
- Remove Custom Configuration
- Remove All Installed Contents
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/game_list.cpp | 26 | ||||
| -rw-r--r-- | src/yuzu/game_list.h | 15 |
2 files changed, 37 insertions, 4 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index ab7fc7a24..20073f3c8 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -474,10 +474,17 @@ void GameList::PopupContextMenu(const QPoint& menu_location) { | |||
| 474 | 474 | ||
| 475 | void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, std::string path) { | 475 | void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, std::string path) { |
| 476 | QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location")); | 476 | QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location")); |
| 477 | QAction* open_lfs_location = context_menu.addAction(tr("Open Mod Data Location")); | 477 | QAction* open_mod_location = context_menu.addAction(tr("Open Mod Data Location")); |
| 478 | QAction* open_transferable_shader_cache = | 478 | QAction* open_transferable_shader_cache = |
| 479 | context_menu.addAction(tr("Open Transferable Shader Cache")); | 479 | context_menu.addAction(tr("Open Transferable Shader Cache")); |
| 480 | context_menu.addSeparator(); | 480 | context_menu.addSeparator(); |
| 481 | QMenu* remove_menu = context_menu.addMenu(tr("Remove")); | ||
| 482 | QAction* remove_update = remove_menu->addAction(tr("Remove Installed Update")); | ||
| 483 | QAction* remove_dlc = remove_menu->addAction(tr("Remove All Installed DLC")); | ||
| 484 | QAction* remove_shader_cache = remove_menu->addAction(tr("Remove Shader Cache")); | ||
| 485 | QAction* remove_custom_config = remove_menu->addAction(tr("Remove Custom Configuration")); | ||
| 486 | remove_menu->addSeparator(); | ||
| 487 | QAction* remove_all_content = remove_menu->addAction(tr("Remove All Installed Contents")); | ||
| 481 | QAction* dump_romfs = context_menu.addAction(tr("Dump RomFS")); | 488 | QAction* dump_romfs = context_menu.addAction(tr("Dump RomFS")); |
| 482 | QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard")); | 489 | QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard")); |
| 483 | QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry")); | 490 | QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry")); |
| @@ -491,11 +498,26 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, std::string pat | |||
| 491 | connect(open_save_location, &QAction::triggered, [this, program_id, path]() { | 498 | connect(open_save_location, &QAction::triggered, [this, program_id, path]() { |
| 492 | emit OpenFolderRequested(GameListOpenTarget::SaveData, path); | 499 | emit OpenFolderRequested(GameListOpenTarget::SaveData, path); |
| 493 | }); | 500 | }); |
| 494 | connect(open_lfs_location, &QAction::triggered, [this, program_id, path]() { | 501 | connect(open_mod_location, &QAction::triggered, [this, program_id, path]() { |
| 495 | emit OpenFolderRequested(GameListOpenTarget::ModData, path); | 502 | emit OpenFolderRequested(GameListOpenTarget::ModData, path); |
| 496 | }); | 503 | }); |
| 497 | connect(open_transferable_shader_cache, &QAction::triggered, | 504 | connect(open_transferable_shader_cache, &QAction::triggered, |
| 498 | [this, program_id]() { emit OpenTransferableShaderCacheRequested(program_id); }); | 505 | [this, program_id]() { emit OpenTransferableShaderCacheRequested(program_id); }); |
| 506 | connect(remove_all_content, &QAction::triggered, [this, program_id]() { | ||
| 507 | emit RemoveInstalledEntryRequested(program_id, InstalledEntryType::Game); | ||
| 508 | }); | ||
| 509 | connect(remove_update, &QAction::triggered, [this, program_id]() { | ||
| 510 | emit RemoveInstalledEntryRequested(program_id, InstalledEntryType::Update); | ||
| 511 | }); | ||
| 512 | connect(remove_dlc, &QAction::triggered, [this, program_id]() { | ||
| 513 | emit RemoveInstalledEntryRequested(program_id, InstalledEntryType::AddOnContent); | ||
| 514 | }); | ||
| 515 | connect(remove_shader_cache, &QAction::triggered, [this, program_id]() { | ||
| 516 | emit RemoveFileRequested(program_id, GameListRemoveTarget::ShaderCache); | ||
| 517 | }); | ||
| 518 | connect(remove_custom_config, &QAction::triggered, [this, program_id]() { | ||
| 519 | emit RemoveFileRequested(program_id, GameListRemoveTarget::CustomConfiguration); | ||
| 520 | }); | ||
| 499 | connect(dump_romfs, &QAction::triggered, | 521 | connect(dump_romfs, &QAction::triggered, |
| 500 | [this, program_id, path]() { emit DumpRomFSRequested(program_id, path); }); | 522 | [this, program_id, path]() { emit DumpRomFSRequested(program_id, path); }); |
| 501 | connect(copy_tid, &QAction::triggered, | 523 | connect(copy_tid, &QAction::triggered, |
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index a38cb2fc3..483835cce 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h | |||
| @@ -39,6 +39,17 @@ enum class GameListOpenTarget { | |||
| 39 | ModData, | 39 | ModData, |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | enum class GameListRemoveTarget { | ||
| 43 | ShaderCache, | ||
| 44 | CustomConfiguration, | ||
| 45 | }; | ||
| 46 | |||
| 47 | enum class InstalledEntryType { | ||
| 48 | Game, | ||
| 49 | Update, | ||
| 50 | AddOnContent, | ||
| 51 | }; | ||
| 52 | |||
| 42 | class GameList : public QWidget { | 53 | class GameList : public QWidget { |
| 43 | Q_OBJECT | 54 | Q_OBJECT |
| 44 | 55 | ||
| @@ -75,6 +86,8 @@ signals: | |||
| 75 | void ShouldCancelWorker(); | 86 | void ShouldCancelWorker(); |
| 76 | void OpenFolderRequested(GameListOpenTarget target, const std::string& game_path); | 87 | void OpenFolderRequested(GameListOpenTarget target, const std::string& game_path); |
| 77 | void OpenTransferableShaderCacheRequested(u64 program_id); | 88 | void OpenTransferableShaderCacheRequested(u64 program_id); |
| 89 | void RemoveInstalledEntryRequested(u64 program_id, InstalledEntryType type); | ||
| 90 | void RemoveFileRequested(u64 program_id, GameListRemoveTarget target); | ||
| 78 | void DumpRomFSRequested(u64 program_id, const std::string& game_path); | 91 | void DumpRomFSRequested(u64 program_id, const std::string& game_path); |
| 79 | void CopyTIDRequested(u64 program_id); | 92 | void CopyTIDRequested(u64 program_id); |
| 80 | void NavigateToGamedbEntryRequested(u64 program_id, | 93 | void NavigateToGamedbEntryRequested(u64 program_id, |
| @@ -117,8 +130,6 @@ private: | |||
| 117 | friend class GameListSearchField; | 130 | friend class GameListSearchField; |
| 118 | }; | 131 | }; |
| 119 | 132 | ||
| 120 | Q_DECLARE_METATYPE(GameListOpenTarget); | ||
| 121 | |||
| 122 | class GameListPlaceholder : public QWidget { | 133 | class GameListPlaceholder : public QWidget { |
| 123 | Q_OBJECT | 134 | Q_OBJECT |
| 124 | public: | 135 | public: |