Skip to content

Commit

Permalink
Add button to About view to open logs folder for when users are repor…
Browse files Browse the repository at this point in the history
…ting bugs.
  • Loading branch information
Soapwood committed Jul 27, 2024
1 parent 2cfbe9a commit a7e1373
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
17 changes: 17 additions & 0 deletions VXMusicDesktop/MVVM/View/AboutView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,23 @@
VXMusic Open Source Library available on GitHub
<LineBreak />
BRUSHSTRIKE is a brush typeface designed by Francesco Canovaro
<LineBreak />
</TextBlock>

<TextBlock Text="Reporting a Bug?"
Foreground="{StaticResource SecondaryColor}"
HorizontalAlignment="Center"
VerticalAlignment="Center">
</TextBlock>
<TextBlock Text="Open Logs Directory"
Foreground="{StaticResource SecondaryColor}"
TextDecorations="Underline"
Cursor="Hand"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock.InputBindings>
<MouseBinding Gesture="LeftClick" Command="{Binding OpenFolderCommand}"/>
</TextBlock.InputBindings>
</TextBlock>
</StackPanel>
</UserControl>
25 changes: 24 additions & 1 deletion VXMusicDesktop/MVVM/ViewModel/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,44 @@
using VXMusicDesktop.Core;
using System.Windows.Input;
using System.ComponentModel;
using System.IO;

namespace VXMusicDesktop.MVVM.ViewModel
{
public class AboutViewModel : INotifyPropertyChanged
{
private RelayCommand openFolderClick;
public ICommand OpenFolderCommand => openFolderClick ??= new RelayCommand(OpenFolder);

public event PropertyChangedEventHandler? PropertyChanged;

private static readonly string LogsOutputPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"VirtualXtensions", "VXMusic", "Logs");

public AboutViewModel()
{

}

protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

private void OpenFolder(object commandParameter)
{
try
{
Process.Start(new ProcessStartInfo
{
FileName = LogsOutputPath,
UseShellExecute = true,
Verb = "open"
});
}
catch (Exception ex)
{
MessageBox.Show($"Failed to open Log folder: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}
}
2 changes: 1 addition & 1 deletion VXMusicDesktop/VXMusicDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageIcon>VXLogo.png</PackageIcon>
<ApplicationIcon>Images\VXLogoIcon.ico</ApplicationIcon>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<Version>0.6.4.14</Version>
<Version>0.6.4.15</Version>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<Title>VXMusicDesktop</Title>
<Authors>VirtualXtensions</Authors>
Expand Down

0 comments on commit a7e1373

Please sign in to comment.