Shortcut to view settings dir

This commit is contained in:
2026-03-13 08:14:50 +09:00
parent cd71df8a8e
commit f4dd498d22
2 changed files with 18 additions and 0 deletions
+13
View File
@@ -18,6 +18,7 @@ using PdfSharp.Snippets.Font;
using MayShow.Interfaces; using MayShow.Interfaces;
using MayShow.Models; using MayShow.Models;
using MayShow.Helpers; using MayShow.Helpers;
using MayShows.Helpers;
namespace MayShow.ViewModels; namespace MayShow.ViewModels;
@@ -126,6 +127,18 @@ class SettingsViewModel: ChangeNotifier
} }
} }
public void OpenSettingsDir()
{
var topLevel = _topLevelGrabber?.GetTopLevel();
Console.WriteLine(Utilities.GetInternalDataPath());
var dirName = Utilities.GetInternalDataPath();
if (topLevel is not null && dirName != null)
{
var launcher = topLevel.Launcher;
launcher.LaunchUriAsync(new Uri(dirName));
}
}
public void Cancel() public void Cancel()
{ {
DialogHost.Close("DialogHost", null); DialogHost.Close("DialogHost", null);
+5
View File
@@ -47,6 +47,11 @@
VerticalAlignment="Top"/> VerticalAlignment="Top"/>
</Grid> </Grid>
<CheckBox IsChecked="{Binding SaveReportJsonDataInInternalDir}">Save report data (names, notes, etc.) in MayShow settings directory (saves in working directory by default)</CheckBox> <CheckBox IsChecked="{Binding SaveReportJsonDataInInternalDir}">Save report data (names, notes, etc.) in MayShow settings directory (saves in working directory by default)</CheckBox>
<Button Command="{Binding OpenSettingsDir}">
<TextBlock>
<Run Text="&#xf07c;"
FontFamily="{StaticResource FontAwesomeSolid}" /> Open MayShow Settings Directory</TextBlock>
</Button>
<TextBlock TextWrapping="Wrap" <TextBlock TextWrapping="Wrap"
Foreground="Red" Foreground="Red"
Text="{Binding ErrorMessage}" Text="{Binding ErrorMessage}"