TODO: Implement shortcut creation for Apple.
This commit is contained in:
parent
4051bbbed7
commit
ac6290bea7
|
@ -564,10 +564,13 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
|
||||||
QAction* verify_integrity = context_menu.addAction(tr("Verify Integrity"));
|
QAction* verify_integrity = context_menu.addAction(tr("Verify Integrity"));
|
||||||
QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard"));
|
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"));
|
QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry"));
|
||||||
|
// TODO: Implement shortcut creation for macOS
|
||||||
|
#if !defined(__APPLE__)
|
||||||
QMenu* shortcut_menu = context_menu.addMenu(tr("Create Shortcut"));
|
QMenu* shortcut_menu = context_menu.addMenu(tr("Create Shortcut"));
|
||||||
QAction* create_desktop_shortcut = shortcut_menu->addAction(tr("Add to Desktop"));
|
QAction* create_desktop_shortcut = shortcut_menu->addAction(tr("Add to Desktop"));
|
||||||
QAction* create_applications_menu_shortcut =
|
QAction* create_applications_menu_shortcut =
|
||||||
shortcut_menu->addAction(tr("Add to Applications Menu"));
|
shortcut_menu->addAction(tr("Add to Applications Menu"));
|
||||||
|
#endif
|
||||||
context_menu.addSeparator();
|
context_menu.addSeparator();
|
||||||
QAction* properties = context_menu.addAction(tr("Properties"));
|
QAction* properties = context_menu.addAction(tr("Properties"));
|
||||||
|
|
||||||
|
@ -642,12 +645,15 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
|
||||||
connect(navigate_to_gamedb_entry, &QAction::triggered, [this, program_id]() {
|
connect(navigate_to_gamedb_entry, &QAction::triggered, [this, program_id]() {
|
||||||
emit NavigateToGamedbEntryRequested(program_id, compatibility_list);
|
emit NavigateToGamedbEntryRequested(program_id, compatibility_list);
|
||||||
});
|
});
|
||||||
|
// TODO: Implement shortcut creation for macOS
|
||||||
|
#if !defined(__APPLE__)
|
||||||
connect(create_desktop_shortcut, &QAction::triggered, [this, program_id, path]() {
|
connect(create_desktop_shortcut, &QAction::triggered, [this, program_id, path]() {
|
||||||
emit CreateShortcut(program_id, path, GameListShortcutTarget::Desktop);
|
emit CreateShortcut(program_id, path, GameListShortcutTarget::Desktop);
|
||||||
});
|
});
|
||||||
connect(create_applications_menu_shortcut, &QAction::triggered, [this, program_id, path]() {
|
connect(create_applications_menu_shortcut, &QAction::triggered, [this, program_id, path]() {
|
||||||
emit CreateShortcut(program_id, path, GameListShortcutTarget::Applications);
|
emit CreateShortcut(program_id, path, GameListShortcutTarget::Applications);
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
connect(properties, &QAction::triggered,
|
connect(properties, &QAction::triggered,
|
||||||
[this, path]() { emit OpenPerGameGeneralRequested(path); });
|
[this, path]() { emit OpenPerGameGeneralRequested(path); });
|
||||||
};
|
};
|
||||||
|
|
|
@ -2839,7 +2839,8 @@ void GMainWindow::OnGameListNavigateToGamedbEntry(u64 program_id,
|
||||||
|
|
||||||
QDesktopServices::openUrl(QUrl(QStringLiteral("https://yuzu-emu.org/game/") + directory));
|
QDesktopServices::openUrl(QUrl(QStringLiteral("https://yuzu-emu.org/game/") + directory));
|
||||||
}
|
}
|
||||||
|
// TODO: Implement shortcut creation for macOS
|
||||||
|
#if !defined(__APPLE__)
|
||||||
bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
|
bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
|
||||||
const std::string& comment,
|
const std::string& comment,
|
||||||
const std::filesystem::path& icon_path,
|
const std::filesystem::path& icon_path,
|
||||||
|
@ -2997,9 +2998,11 @@ bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_vi
|
||||||
: fmt::format("yuzu-{:016X}.{}", program_id, ico_extension));
|
: fmt::format("yuzu-{:016X}.{}", program_id, ico_extension));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif // !defined(__APPLE__)
|
||||||
void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& game_path,
|
void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& game_path,
|
||||||
GameListShortcutTarget target) {
|
GameListShortcutTarget target) {
|
||||||
|
// TODO: Implement shortcut creation for macOS
|
||||||
|
#if !defined(__APPLE__)
|
||||||
std::string game_title;
|
std::string game_title;
|
||||||
QString qt_game_title;
|
QString qt_game_title;
|
||||||
std::filesystem::path out_icon_path;
|
std::filesystem::path out_icon_path;
|
||||||
|
@ -3093,6 +3096,7 @@ void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& ga
|
||||||
}
|
}
|
||||||
GMainWindow::CreateShortcutMessagesGUI(this, GMainWindow::CREATE_SHORTCUT_MSGBOX_ERROR,
|
GMainWindow::CreateShortcutMessagesGUI(this, GMainWindow::CREATE_SHORTCUT_MSGBOX_ERROR,
|
||||||
qt_game_title);
|
qt_game_title);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::OnGameListOpenDirectory(const QString& directory) {
|
void GMainWindow::OnGameListOpenDirectory(const QString& directory) {
|
||||||
|
|
|
@ -441,6 +441,8 @@ private:
|
||||||
bool ConfirmShutdownGame();
|
bool ConfirmShutdownGame();
|
||||||
|
|
||||||
QString GetTasStateDescription() const;
|
QString GetTasStateDescription() const;
|
||||||
|
// TODO: Implement shortcut creation for macOS
|
||||||
|
#if !defined(__APPLE__)
|
||||||
bool CreateShortcutMessagesGUI(QWidget* parent, int imsg, const QString& game_title);
|
bool CreateShortcutMessagesGUI(QWidget* parent, int imsg, const QString& game_title);
|
||||||
bool MakeShortcutIcoPath(const u64 program_id, const std::string_view game_file_name,
|
bool MakeShortcutIcoPath(const u64 program_id, const std::string_view game_file_name,
|
||||||
std::filesystem::path& out_icon_path);
|
std::filesystem::path& out_icon_path);
|
||||||
|
@ -449,6 +451,7 @@ private:
|
||||||
const std::filesystem::path& command, const std::string& arguments,
|
const std::filesystem::path& command, const std::string& arguments,
|
||||||
const std::string& categories, const std::string& keywords,
|
const std::string& categories, const std::string& keywords,
|
||||||
const std::string& name);
|
const std::string& name);
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* Mimic the behavior of QMessageBox::question but link controller navigation to the dialog
|
* Mimic the behavior of QMessageBox::question but link controller navigation to the dialog
|
||||||
* The only difference is that it returns a boolean.
|
* The only difference is that it returns a boolean.
|
||||||
|
|
Reference in New Issue