Shortcut to view settings dir
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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=""
|
||||||
|
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}"
|
||||||
|
|||||||
Reference in New Issue
Block a user