Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bin/resources/icons/AppIconLarge.ico
Binary file not shown.
17 changes: 16 additions & 1 deletion common/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static inline bool FileSystemCharacterIsSane(char32_t c, bool strip_slashes)
if (c == '*')
return false;

// macos doesn't allow colons, apparently
// macos doesn't allow colons, apparently
#ifdef __APPLE__
if (c == U':')
return false;
Expand Down Expand Up @@ -2490,6 +2490,21 @@ bool FileSystem::DeleteDirectory(const char* path)
return (rmdir(path) == 0);
}

std::string FileSystem::GetPackagePath()
{
// NOTE: The reason this function is separated from FileSystem::GetProgramPath() is because
// This path check breaks other usages of FileSystem::GetProgramPath for the AppImage.
// Notably the CI-generated AppImage fails to start because PCSX2 can't find its resources
// since it tries to look for them relative to the .AppImage file instead of relative to the actual executable.

// Check if we are running inside appimage. If so, return the path to the appimage instead.
if (const char* appimage_path = getenv("APPIMAGE"))
return std::string(appimage_path);

// Otherwise, find the executable file directly
return GetProgramPath();
}

std::string FileSystem::GetProgramPath()
{
#if defined(__linux__)
Expand Down
3 changes: 3 additions & 0 deletions common/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ namespace FileSystem
/// Copies one file to another, optionally replacing it if it already exists.
bool CopyFilePath(const char* source, const char* destination, bool replace);

/// Returns the path to the current package (AppImage).
std::string GetPackagePath();

/// Returns the path to the current executable.
std::string GetProgramPath();

Expand Down
8 changes: 8 additions & 0 deletions pcsx2-qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ target_sources(pcsx2-qt PRIVATE
resources/resources.qrc
)

if (NOT APPLE)
target_sources(pcsx2-qt PRIVATE
ShortcutCreationDialog.cpp
ShortcutCreationDialog.h
ShortcutCreationDialog.ui
)
endif()

file(GLOB TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Translations/*.ts)

target_precompile_headers(pcsx2-qt PRIVATE PrecompiledHeader.h)
Expand Down
19 changes: 19 additions & 0 deletions pcsx2-qt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include "Tools/InputRecording/InputRecordingViewer.h"
#include "Tools/InputRecording/NewInputRecordingDlg.h"

#if !defined(__APPLE__)
#include "ShortcutCreationDialog.h"
#endif

#include "pcsx2/Achievements.h"
#include "pcsx2/CDVD/CDVDcommon.h"
#include "pcsx2/CDVD/CDVDdiscReader.h"
Expand Down Expand Up @@ -1452,6 +1456,10 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point)
action = menu.addAction(tr("Set Cover Image..."));
connect(action, &QAction::triggered, [this, entry]() { setGameListEntryCoverImage(entry); });

#if !defined(__APPLE__)
connect(menu.addAction(tr("Create Game Shortcut...")), &QAction::triggered, [this]() { MainWindow::onCreateGameShortcutTriggered(); });
#endif

connect(menu.addAction(tr("Exclude From List")), &QAction::triggered,
[this, entry]() { getSettingsWindow()->getGameListSettingsWidget()->addExcludedPath(entry->path); });

Expand Down Expand Up @@ -1758,6 +1766,17 @@ void MainWindow::onToolsCoverDownloaderTriggered()
dlg.exec();
}

#if !defined(__APPLE__)
void MainWindow::onCreateGameShortcutTriggered()
{
const GameList::Entry* entry = m_game_list_widget->getSelectedEntry();
const QString title = QString::fromStdString(entry->GetTitle());
const QString path = QString::fromStdString(entry->path);
VMLock lock(pauseAndLockVM());
ShortcutCreationDialog dlg(lock.getDialogParent(), title, path);
dlg.exec();
}
#endif
void MainWindow::onToolsEditCheatsPatchesTriggered(bool cheats)
{
if (s_current_disc_serial.isEmpty() || s_current_running_crc == 0)
Expand Down
3 changes: 3 additions & 0 deletions pcsx2-qt/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ private Q_SLOTS:
void onAboutActionTriggered();
void onToolsOpenDataDirectoryTriggered();
void onToolsCoverDownloaderTriggered();
#if !defined(__APPLE__)
void onCreateGameShortcutTriggered();
#endif
void onToolsEditCheatsPatchesTriggered(bool cheats);
void onCreateMemoryCardOpenRequested();
void updateTheme();
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Settings/InterfaceSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "SettingsWindow.h"
#include "QtHost.h"

static const char* IMAGE_FILE_FILTER = QT_TRANSLATE_NOOP(GameListWidget,
static const char* IMAGE_FILE_FILTER = QT_TRANSLATE_NOOP(InterfaceSettingsWidget,
"Supported Image Types (*.bmp *.gif *.jpg *.jpeg *.png *.webp)");

const char* InterfaceSettingsWidget::THEME_NAMES[] = {
Expand Down
Loading