Skip to content

Commit

Permalink
UI: Button to open screenshots folder in File menu
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Feb 16, 2025
1 parent f92d097 commit aa2178d
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
50 changes: 50 additions & 0 deletions src/Ryujinx/Assets/locales.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,31 @@
"zh_TW": "開啟 Ryujinx 資料夾"
}
},
{
"ID": "MenuBarFileOpenScreenshotsFolder",
"Translations": {
"ar_SA": "",
"de_DE": "",
"el_GR": "",
"en_US": "Open Screenshots Folder",
"es_ES": "",
"fr_FR": "",
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "",
"no_NO": "",
"pl_PL": "",
"pt_BR": "",
"ru_RU": "",
"sv_SE": "",
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "",
"zh_TW": ""
}
},
{
"ID": "MenuBarFileOpenLogsFolder",
"Translations": {
Expand Down Expand Up @@ -17197,6 +17222,31 @@
"zh_TW": "開啟 Ryujinx 檔案系統資料夾"
}
},
{
"ID": "OpenScreenshotFolderTooltip",
"Translations": {
"ar_SA": "",
"de_DE": "",
"el_GR": "",
"en_US": "Open Ryujinx screenshots folder",
"es_ES": "",
"fr_FR": "",
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "",
"no_NO": "",
"pl_PL": "",
"pt_BR": "",
"ru_RU": "",
"sv_SE": "",
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "",
"zh_TW": ""
}
},
{
"ID": "OpenRyujinxLogsTooltip",
"Translations": {
Expand Down
19 changes: 19 additions & 0 deletions src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,25 @@ public void OpenRyujinxFolder()
OpenHelper.OpenFolder(AppDataManager.BaseDirPath);
}

public void OpenScreenshotsFolder()
{
string screenshotsDir = Path.Combine(AppDataManager.BaseDirPath, "screenshots");

try
{
if (!Directory.Exists(screenshotsDir))
Directory.CreateDirectory(screenshotsDir);
}
catch (Exception ex)
{
Logger.Error?.Print(LogClass.Application, $"Failed to create directory at path {screenshotsDir}. Error : {ex.GetType().Name}", "Screenshot");

return;
}

OpenHelper.OpenFolder(screenshotsDir);
}

public void OpenLogsFolder()
{
string logPath = AppDataManager.GetOrCreateLogsDir();
Expand Down
4 changes: 4 additions & 0 deletions src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
Command="{Binding OpenRyujinxFolder}"
Header="{ext:Locale MenuBarFileOpenEmuFolder}"
ToolTip.Tip="{ext:Locale OpenRyujinxFolderTooltip}" />
<MenuItem
Command="{Binding OpenScreenshotsFolder}"
Header="{ext:Locale MenuBarFileOpenScreenshotsFolder}"
ToolTip.Tip="{ext:Locale OpenScreenshotFolderTooltip}"/>
<MenuItem
Command="{Binding OpenLogsFolder}"
Header="{ext:Locale MenuBarFileOpenLogsFolder}"
Expand Down

0 comments on commit aa2178d

Please sign in to comment.