summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar boludoz2023-10-18 02:35:23 -0300
committerGravatar boludoz2023-10-18 02:35:23 -0300
commitac6290bea76e9719ef7806dab7f92ab53fdd27d0 (patch)
tree994bbf6b3b358bf75855cb66c42433a2bac2514a
parentUseless code removed related to admin privileges, if it is not an error we ca... (diff)
downloadyuzu-ac6290bea76e9719ef7806dab7f92ab53fdd27d0.tar.gz
yuzu-ac6290bea76e9719ef7806dab7f92ab53fdd27d0.tar.xz
yuzu-ac6290bea76e9719ef7806dab7f92ab53fdd27d0.zip
TODO: Implement shortcut creation for Apple.
-rw-r--r--src/yuzu/game_list.cpp6
-rw-r--r--src/yuzu/main.cpp8
-rw-r--r--src/yuzu/main.h3
3 files changed, 15 insertions, 2 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index fbe099661..90433e245 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -564,10 +564,13 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
564 QAction* verify_integrity = context_menu.addAction(tr("Verify Integrity")); 564 QAction* verify_integrity = context_menu.addAction(tr("Verify Integrity"));
565 QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard")); 565 QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard"));
566 QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry")); 566 QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry"));
567// TODO: Implement shortcut creation for macOS
568#if !defined(__APPLE__)
567 QMenu* shortcut_menu = context_menu.addMenu(tr("Create Shortcut")); 569 QMenu* shortcut_menu = context_menu.addMenu(tr("Create Shortcut"));
568 QAction* create_desktop_shortcut = shortcut_menu->addAction(tr("Add to Desktop")); 570 QAction* create_desktop_shortcut = shortcut_menu->addAction(tr("Add to Desktop"));
569 QAction* create_applications_menu_shortcut = 571 QAction* create_applications_menu_shortcut =
570 shortcut_menu->addAction(tr("Add to Applications Menu")); 572 shortcut_menu->addAction(tr("Add to Applications Menu"));
573#endif
571 context_menu.addSeparator(); 574 context_menu.addSeparator();
572 QAction* properties = context_menu.addAction(tr("Properties")); 575 QAction* properties = context_menu.addAction(tr("Properties"));
573 576
@@ -642,12 +645,15 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
642 connect(navigate_to_gamedb_entry, &QAction::triggered, [this, program_id]() { 645 connect(navigate_to_gamedb_entry, &QAction::triggered, [this, program_id]() {
643 emit NavigateToGamedbEntryRequested(program_id, compatibility_list); 646 emit NavigateToGamedbEntryRequested(program_id, compatibility_list);
644 }); 647 });
648// TODO: Implement shortcut creation for macOS
649#if !defined(__APPLE__)
645 connect(create_desktop_shortcut, &QAction::triggered, [this, program_id, path]() { 650 connect(create_desktop_shortcut, &QAction::triggered, [this, program_id, path]() {
646 emit CreateShortcut(program_id, path, GameListShortcutTarget::Desktop); 651 emit CreateShortcut(program_id, path, GameListShortcutTarget::Desktop);
647 }); 652 });
648 connect(create_applications_menu_shortcut, &QAction::triggered, [this, program_id, path]() { 653 connect(create_applications_menu_shortcut, &QAction::triggered, [this, program_id, path]() {
649 emit CreateShortcut(program_id, path, GameListShortcutTarget::Applications); 654 emit CreateShortcut(program_id, path, GameListShortcutTarget::Applications);
650 }); 655 });
656#endif
651 connect(properties, &QAction::triggered, 657 connect(properties, &QAction::triggered,
652 [this, path]() { emit OpenPerGameGeneralRequested(path); }); 658 [this, path]() { emit OpenPerGameGeneralRequested(path); });
653}; 659};
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 73cd06478..ec3eb7536 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2839,7 +2839,8 @@ void GMainWindow::OnGameListNavigateToGamedbEntry(u64 program_id,
2839 2839
2840 QDesktopServices::openUrl(QUrl(QStringLiteral("https://yuzu-emu.org/game/") + directory)); 2840 QDesktopServices::openUrl(QUrl(QStringLiteral("https://yuzu-emu.org/game/") + directory));
2841} 2841}
2842 2842// TODO: Implement shortcut creation for macOS
2843#if !defined(__APPLE__)
2843bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path, 2844bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
2844 const std::string& comment, 2845 const std::string& comment,
2845 const std::filesystem::path& icon_path, 2846 const std::filesystem::path& icon_path,
@@ -2997,9 +2998,11 @@ bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_vi
2997 : fmt::format("yuzu-{:016X}.{}", program_id, ico_extension)); 2998 : fmt::format("yuzu-{:016X}.{}", program_id, ico_extension));
2998 return true; 2999 return true;
2999} 3000}
3000 3001#endif // !defined(__APPLE__)
3001void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& game_path, 3002void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& game_path,
3002 GameListShortcutTarget target) { 3003 GameListShortcutTarget target) {
3004// TODO: Implement shortcut creation for macOS
3005#if !defined(__APPLE__)
3003 std::string game_title; 3006 std::string game_title;
3004 QString qt_game_title; 3007 QString qt_game_title;
3005 std::filesystem::path out_icon_path; 3008 std::filesystem::path out_icon_path;
@@ -3093,6 +3096,7 @@ void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& ga
3093 } 3096 }
3094 GMainWindow::CreateShortcutMessagesGUI(this, GMainWindow::CREATE_SHORTCUT_MSGBOX_ERROR, 3097 GMainWindow::CreateShortcutMessagesGUI(this, GMainWindow::CREATE_SHORTCUT_MSGBOX_ERROR,
3095 qt_game_title); 3098 qt_game_title);
3099#endif
3096} 3100}
3097 3101
3098void GMainWindow::OnGameListOpenDirectory(const QString& directory) { 3102void GMainWindow::OnGameListOpenDirectory(const QString& directory) {
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index d203e5301..7a1a97f33 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -441,6 +441,8 @@ private:
441 bool ConfirmShutdownGame(); 441 bool ConfirmShutdownGame();
442 442
443 QString GetTasStateDescription() const; 443 QString GetTasStateDescription() const;
444// TODO: Implement shortcut creation for macOS
445#if !defined(__APPLE__)
444 bool CreateShortcutMessagesGUI(QWidget* parent, int imsg, const QString& game_title); 446 bool CreateShortcutMessagesGUI(QWidget* parent, int imsg, const QString& game_title);
445 bool MakeShortcutIcoPath(const u64 program_id, const std::string_view game_file_name, 447 bool MakeShortcutIcoPath(const u64 program_id, const std::string_view game_file_name,
446 std::filesystem::path& out_icon_path); 448 std::filesystem::path& out_icon_path);
@@ -449,6 +451,7 @@ private:
449 const std::filesystem::path& command, const std::string& arguments, 451 const std::filesystem::path& command, const std::string& arguments,
450 const std::string& categories, const std::string& keywords, 452 const std::string& categories, const std::string& keywords,
451 const std::string& name); 453 const std::string& name);
454#endif
452 /** 455 /**
453 * Mimic the behavior of QMessageBox::question but link controller navigation to the dialog 456 * Mimic the behavior of QMessageBox::question but link controller navigation to the dialog
454 * The only difference is that it returns a boolean. 457 * The only difference is that it returns a boolean.