aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/game_list.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-12-16 11:57:16 -0500
committerGitHub <noreply@github.com>2022-12-16 11:57:16 -0500
commit9bfd4d880ecc332b230c9977654849d7521c93fb (patch)
treed12654b62b1da9a29cc878f0aa3c7f26e275ed70 /src/yuzu/game_list.cpp
parent9ff891ce71bfe89f46a1b6f018e421db5dec5762 (diff)
parent5a5bb91f4048f210c56ef6f233879d3b845927f0 (diff)
Merge pull request #6769 from lat9nq/create-shortcut-2
yuzu qt, common: Add option to create game shortcuts on Linux
Diffstat (limited to 'src/yuzu/game_list.cpp')
-rw-r--r--src/yuzu/game_list.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 5c33c1b0f..22aa19c56 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -554,6 +554,12 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
QAction* dump_romfs_sdmc = dump_romfs_menu->addAction(tr("Dump RomFS to SDMC"));
QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard"));
QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry"));
+#ifndef WIN32
+ QMenu* shortcut_menu = context_menu.addMenu(tr("Create Shortcut"));
+ QAction* create_desktop_shortcut = shortcut_menu->addAction(tr("Add to Desktop"));
+ QAction* create_applications_menu_shortcut =
+ shortcut_menu->addAction(tr("Add to Applications Menu"));
+#endif
context_menu.addSeparator();
QAction* properties = context_menu.addAction(tr("Properties"));
@@ -619,6 +625,14 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
connect(navigate_to_gamedb_entry, &QAction::triggered, [this, program_id]() {
emit NavigateToGamedbEntryRequested(program_id, compatibility_list);
});
+#ifndef WIN32
+ connect(create_desktop_shortcut, &QAction::triggered, [this, program_id, path]() {
+ emit CreateShortcut(program_id, path, GameListShortcutTarget::Desktop);
+ });
+ connect(create_applications_menu_shortcut, &QAction::triggered, [this, program_id, path]() {
+ emit CreateShortcut(program_id, path, GameListShortcutTarget::Applications);
+ });
+#endif
connect(properties, &QAction::triggered,
[this, path]() { emit OpenPerGameGeneralRequested(path); });
};