summaryrefslogtreecommitdiff
path: root/src/yuzu/main.h
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2021-07-28 23:02:29 -0400
committerLiam <byteslice@airmail.cc>2022-12-13 16:42:00 -0500
commit18bdf45868819d8ab1a743251ac21c87f583c9d4 (patch)
tree2438066371bb38e66f2320265d108a9b4d752ae8 /src/yuzu/main.h
parenta4696285af946588dc33b19e49a3baa0f8b2b60d (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/main.h')
-rw-r--r--src/yuzu/main.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 62d629973..a0f7aa77d 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -38,6 +38,7 @@ class QProgressDialog;
class WaitTreeWidget;
enum class GameListOpenTarget;
enum class GameListRemoveTarget;
+enum class GameListShortcutTarget;
enum class DumpRomFSTarget;
enum class InstalledEntryType;
class GameListPlaceholder;
@@ -293,6 +294,8 @@ private slots:
void OnGameListCopyTID(u64 program_id);
void OnGameListNavigateToGamedbEntry(u64 program_id,
const CompatibilityList& compatibility_list);
+ void OnGameListCreateShortcut(u64 program_id, const std::string& game_path,
+ GameListShortcutTarget target);
void OnGameListOpenDirectory(const QString& directory);
void OnGameListAddDirectory();
void OnGameListShowList(bool show);
@@ -365,6 +368,10 @@ private:
bool CheckDarkMode();
QString GetTasStateDescription() const;
+ bool CreateShortcut(const std::string& shortcut_path, const std::string& title,
+ const std::string& comment, const std::string& icon_path,
+ const std::string& command, const std::string& arguments,
+ const std::string& categories, const std::string& keywords);
std::unique_ptr<Ui::MainWindow> ui;