mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 00:47:57 -05:00
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
This commit is contained in:
@ -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); });
|
||||
};
|
||||
|
Reference in New Issue
Block a user