diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2021-07-28 23:02:29 -0400 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-12-13 16:42:00 -0500 |
commit | 18bdf45868819d8ab1a743251ac21c87f583c9d4 (patch) | |
tree | 2438066371bb38e66f2320265d108a9b4d752ae8 /src/yuzu/game_list.cpp | |
parent | a4696285af946588dc33b19e49a3baa0f8b2b60d (diff) |
yuzu qt: Create shortcuts on Linux
This creates a Desktop Entry file and a PNG icon for the entry when the
user right-clicks a game and selects "Create Shortcut -> Create
{Application,Desktop} Shortcut". This uses the current executable's path
to create the shortcut.
yuzu qt: Add more error checking and OS gating for shortcuts
main: Remove FreeBSD gating for shortcuts
I'm not going to test FreeBSD, so I don't know if they follow
Freedesktop.org or not. I just have to let someone else verify that it
works there and let them enable it.
main: Move shortcut function to its own function
This function should really be in a common library, at least among
frontends.
main: Remove image manip references
main: Fix difference in MinGW and native GCC versions
main: Fix negation in creat shortcut
Addresses review comment
Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
main: Re-enable freedesktop shorcuts for FreeBSD
Diffstat (limited to 'src/yuzu/game_list.cpp')
-rw-r--r-- | src/yuzu/game_list.cpp | 14 |
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); }); }; |