mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
Open Folder - improvement
This commit is contained in:
parent
75d2181489
commit
bdee9c291d
@ -44,13 +44,24 @@ public:
|
|||||||
|
|
||||||
// Setup menu.
|
// Setup menu.
|
||||||
QMenu menu(widget);
|
QMenu menu(widget);
|
||||||
|
|
||||||
|
// "Open Folder..." submenu
|
||||||
|
QMenu* openFolderMenu = new QMenu(tr("Open Folder..."), widget);
|
||||||
|
QAction* openGameFolder = new QAction(tr("Open Game Folder"), widget);
|
||||||
|
QAction* openSaveDataFolder = new QAction(tr("Open Save Data Folder"), widget);
|
||||||
|
QAction* openLogFolder = new QAction(tr("Open Log Folder"), widget);
|
||||||
|
|
||||||
|
openFolderMenu->addAction(openGameFolder);
|
||||||
|
openFolderMenu->addAction(openSaveDataFolder);
|
||||||
|
openFolderMenu->addAction(openLogFolder);
|
||||||
|
|
||||||
|
menu.addMenu(openFolderMenu);
|
||||||
|
|
||||||
QAction createShortcut(tr("Create Shortcut"), widget);
|
QAction createShortcut(tr("Create Shortcut"), widget);
|
||||||
QAction openFolder(tr("Open Game Folder"), widget);
|
|
||||||
QAction openCheats(tr("Cheats / Patches"), widget);
|
QAction openCheats(tr("Cheats / Patches"), widget);
|
||||||
QAction openSfoViewer(tr("SFO Viewer"), widget);
|
QAction openSfoViewer(tr("SFO Viewer"), widget);
|
||||||
QAction openTrophyViewer(tr("Trophy Viewer"), widget);
|
QAction openTrophyViewer(tr("Trophy Viewer"), widget);
|
||||||
|
|
||||||
menu.addAction(&openFolder);
|
|
||||||
menu.addAction(&createShortcut);
|
menu.addAction(&createShortcut);
|
||||||
menu.addAction(&openCheats);
|
menu.addAction(&openCheats);
|
||||||
menu.addAction(&openSfoViewer);
|
menu.addAction(&openSfoViewer);
|
||||||
@ -86,12 +97,29 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selected == &openFolder) {
|
if (selected == openGameFolder) {
|
||||||
QString folderPath;
|
QString folderPath;
|
||||||
Common::FS::PathToQString(folderPath, m_games[itemID].path);
|
Common::FS::PathToQString(folderPath, m_games[itemID].path);
|
||||||
QDesktopServices::openUrl(QUrl::fromLocalFile(folderPath));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(folderPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selected == openSaveDataFolder) {
|
||||||
|
QString userPath;
|
||||||
|
Common::FS::PathToQString(userPath,
|
||||||
|
Common::FS::GetUserPath(Common::FS::PathType::UserDir));
|
||||||
|
QString saveDataPath =
|
||||||
|
userPath + "/savedata/1/" + QString::fromStdString(m_games[itemID].serial);
|
||||||
|
QDir(saveDataPath).mkpath(saveDataPath);
|
||||||
|
QDesktopServices::openUrl(QUrl::fromLocalFile(saveDataPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selected == openLogFolder) {
|
||||||
|
QString userPath;
|
||||||
|
Common::FS::PathToQString(userPath,
|
||||||
|
Common::FS::GetUserPath(Common::FS::PathType::UserDir));
|
||||||
|
QDesktopServices::openUrl(QUrl::fromLocalFile(userPath + "/log"));
|
||||||
|
}
|
||||||
|
|
||||||
if (selected == &openSfoViewer) {
|
if (selected == &openSfoViewer) {
|
||||||
PSF psf;
|
PSF psf;
|
||||||
QString game_update_path;
|
QString game_update_path;
|
||||||
|
Loading…
Reference in New Issue
Block a user