Skip to content

Commit

Permalink
Open Folder - improvement (Save/Log) (shadps4-emu#1513)
Browse files Browse the repository at this point in the history
* Open Folder - improvement

* TR
  • Loading branch information
DanielSvoboda authored and fpiesche committed Nov 12, 2024
1 parent 539161e commit 1f4b7ac
Show file tree
Hide file tree
Showing 28 changed files with 626 additions and 193 deletions.
36 changes: 32 additions & 4 deletions src/qt_gui/gui_context_menus.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,31 @@ class GuiContextMenus : public QObject {

// Setup menu.
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 openFolder(tr("Open Game Folder"), widget);
QAction openCheats(tr("Cheats / Patches"), widget);
QAction openSfoViewer(tr("SFO Viewer"), widget);
QAction openTrophyViewer(tr("Trophy Viewer"), widget);

menu.addAction(&openFolder);
menu.addAction(&createShortcut);
menu.addAction(&openCheats);
menu.addAction(&openSfoViewer);
menu.addAction(&openTrophyViewer);

// "Copy" submenu.
QMenu* copyMenu = new QMenu(tr("Copy info"), widget);
QMenu* copyMenu = new QMenu(tr("Copy info..."), widget);
QAction* copyName = new QAction(tr("Copy Name"), widget);
QAction* copySerial = new QAction(tr("Copy Serial"), widget);
QAction* copyNameAll = new QAction(tr("Copy All"), widget);
Expand Down Expand Up @@ -86,12 +97,29 @@ class GuiContextMenus : public QObject {
return;
}

if (selected == &openFolder) {
if (selected == openGameFolder) {
QString folderPath;
Common::FS::PathToQString(folderPath, m_games[itemID].path);
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) {
PSF psf;
QString game_update_path;
Expand Down
29 changes: 22 additions & 7 deletions src/qt_gui/translations/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@
<source>Create Shortcut</source>
<translation>إنشاء اختصار</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="47"/>
<source>Open Game Folder</source>
<translation>فتح مجلد اللعبة</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="48"/>
<source>Cheats / Patches</source>
Expand All @@ -120,10 +115,30 @@
<source>Trophy Viewer</source>
<translation>عارض الجوائز</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="49"/>
<source>Open Folder...</source>
<translation>فتح المجلد...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="50"/>
<source>Open Game Folder</source>
<translation>فتح مجلد اللعبة</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="51"/>
<source>Open Save Data Folder</source>
<translation>فتح مجلد بيانات الحفظ</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="52"/>
<source>Open Log Folder</source>
<translation>فتح مجلد السجل</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="59"/>
<source>Copy info</source>
<translation>نسخ المعلومات</translation>
<source>Copy info...</source>
<translation>...نسخ المعلومات</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="60"/>
Expand Down
29 changes: 22 additions & 7 deletions src/qt_gui/translations/da_DK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@
<source>Create Shortcut</source>
<translation>Create Shortcut</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="47"/>
<source>Open Game Folder</source>
<translation>Open Game Folder</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="48"/>
<source>Cheats / Patches</source>
Expand All @@ -120,10 +115,30 @@
<source>Trophy Viewer</source>
<translation>Trophy Viewer</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="49"/>
<source>Open Folder...</source>
<translation>Åbn Mappe...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="50"/>
<source>Open Game Folder</source>
<translation>Åbn Spilmappe</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="51"/>
<source>Open Save Data Folder</source>
<translation>Åbn Gem Data Mappe</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="52"/>
<source>Open Log Folder</source>
<translation>Åbn Log Mappe</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="59"/>
<source>Copy info</source>
<translation>Copy info</translation>
<source>Copy info...</source>
<translation>Copy info...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="60"/>
Expand Down
29 changes: 22 additions & 7 deletions src/qt_gui/translations/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@
<source>Create Shortcut</source>
<translation>Verknüpfung erstellen</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="47"/>
<source>Open Game Folder</source>
<translation>Spieleordner öffnen</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="48"/>
<source>Cheats / Patches</source>
Expand All @@ -120,10 +115,30 @@
<source>Trophy Viewer</source>
<translation>Trophäen anzeigen</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="49"/>
<source>Open Folder...</source>
<translation>Ordner öffnen...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="50"/>
<source>Open Game Folder</source>
<translation>Spielordner öffnen</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="51"/>
<source>Open Save Data Folder</source>
<translation>Speicherordner öffnen</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="52"/>
<source>Open Log Folder</source>
<translation>Protokollordner öffnen</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="59"/>
<source>Copy info</source>
<translation>Infos kopieren</translation>
<source>Copy info...</source>
<translation>Infos kopieren...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="60"/>
Expand Down
29 changes: 22 additions & 7 deletions src/qt_gui/translations/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@
<source>Create Shortcut</source>
<translation>Create Shortcut</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="47"/>
<source>Open Game Folder</source>
<translation>Open Game Folder</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="48"/>
<source>Cheats / Patches</source>
Expand All @@ -120,10 +115,30 @@
<source>Trophy Viewer</source>
<translation>Trophy Viewer</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="49"/>
<source>Open Folder...</source>
<translation>Άνοιγμα Φακέλου...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="50"/>
<source>Open Game Folder</source>
<translation>Άνοιγμα Φακέλου Παιχνιδιού</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="51"/>
<source>Open Save Data Folder</source>
<translation>Άνοιγμα Φακέλου Αποθηκευμένων Δεδομένων</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="52"/>
<source>Open Log Folder</source>
<translation>Άνοιγμα Φακέλου Καταγραφής</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="59"/>
<source>Copy info</source>
<translation>Copy info</translation>
<source>Copy info...</source>
<translation>Copy info...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="60"/>
Expand Down
29 changes: 22 additions & 7 deletions src/qt_gui/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@
<source>Create Shortcut</source>
<translation>Create Shortcut</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="47"/>
<source>Open Game Folder</source>
<translation>Open Game Folder</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="48"/>
<source>Cheats / Patches</source>
Expand All @@ -120,10 +115,30 @@
<source>Trophy Viewer</source>
<translation>Trophy Viewer</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="49"/>
<source>Open Folder...</source>
<translation>Open Folder...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="50"/>
<source>Open Game Folder</source>
<translation>Open Game Folder</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="51"/>
<source>Open Save Data Folder</source>
<translation>Open Save Data Folder</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="52"/>
<source>Open Log Folder</source>
<translation>Open Log Folder</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="59"/>
<source>Copy info</source>
<translation>Copy info</translation>
<source>Copy info...</source>
<translation>Copy info...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="60"/>
Expand Down
29 changes: 22 additions & 7 deletions src/qt_gui/translations/es_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@
<source>Create Shortcut</source>
<translation>Crear acceso directo</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="47"/>
<source>Open Game Folder</source>
<translation>Abrir carpeta del juego</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="48"/>
<source>Cheats / Patches</source>
Expand All @@ -120,10 +115,30 @@
<source>Trophy Viewer</source>
<translation>Ver trofeos</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="49"/>
<source>Open Folder...</source>
<translation>Abrir Carpeta...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="50"/>
<source>Open Game Folder</source>
<translation>Abrir Carpeta del Juego</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="51"/>
<source>Open Save Data Folder</source>
<translation>Abrir Carpeta de Datos Guardados</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="52"/>
<source>Open Log Folder</source>
<translation>Abrir Carpeta de Registros</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="59"/>
<source>Copy info</source>
<translation>Copiar información</translation>
<source>Copy info...</source>
<translation>Copiar información...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="60"/>
Expand Down
29 changes: 22 additions & 7 deletions src/qt_gui/translations/fa_IR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@
<source>Create Shortcut</source>
<translation>ساخت شورتکات</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="40"/>
<source>Open Game Folder</source>
<translation>بازکردن محل نصب بازی</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="48"/>
<source>Cheats / Patches</source>
Expand All @@ -120,10 +115,30 @@
<source>Trophy Viewer</source>
<translation>مشاهده تروفی ها</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="49"/>
<source>Open Folder...</source>
<translation>باز کردن پوشه...</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="50"/>
<source>Open Game Folder</source>
<translation>باز کردن پوشه بازی</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="51"/>
<source>Open Save Data Folder</source>
<translation>پوشه ذخیره داده را باز کنید</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="52"/>
<source>Open Log Folder</source>
<translation>باز کردن پوشه لاگ</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="50"/>
<source>Copy info</source>
<translation>کپی کردن اطلاعات</translation>
<source>Copy info...</source>
<translation>...کپی کردن اطلاعات</translation>
</message>
<message>
<location filename="../gui_context_menus.h" line="51"/>
Expand Down
Loading

0 comments on commit 1f4b7ac

Please sign in to comment.