diff --git a/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/App.xaml.cs b/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/App.xaml.cs index 15312c5969..63d2c27c20 100644 --- a/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/App.xaml.cs +++ b/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/App.xaml.cs @@ -25,6 +25,8 @@ namespace FileLocksmithUI Logger.InitializeLogger("\\File Locksmith\\FileLocksmithUI\\Logs"); this.InitializeComponent(); + + UnhandledException += App_UnhandledException; } /// @@ -55,6 +57,11 @@ namespace FileLocksmithUI _window.Activate(); } + private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e) + { + Logger.LogError("Unhandled exception", e.Exception); + } + private Window _window; } } diff --git a/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/Views/MainPage.xaml b/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/Views/MainPage.xaml index 697858f8f9..472318a93a 100644 --- a/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/Views/MainPage.xaml +++ b/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/Views/MainPage.xaml @@ -141,27 +141,16 @@ IsTextSelectionEnabled="True" Text="{x:Bind user}" /> - + - - - - - - - + @@ -200,5 +189,13 @@ Text="{x:Bind ViewModel.PathsToString, Mode=OneWay}" TextWrapping="Wrap" /> + + + + + diff --git a/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/Views/MainPage.xaml.cs b/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/Views/MainPage.xaml.cs index 6a98692941..a1bab74f42 100644 --- a/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/Views/MainPage.xaml.cs +++ b/src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithXAML/Views/MainPage.xaml.cs @@ -3,6 +3,8 @@ // See the LICENSE file in the project root for more information. using System; +using FileLocksmith.Interop; +using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using PowerToys.FileLocksmithUI.ViewModels; @@ -19,9 +21,17 @@ namespace PowerToys.FileLocksmithUI.Views DataContext = ViewModel; } - private async void ShowSelectedPathsButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) + private async void ShowSelectedPathsButton_Click(object sender, RoutedEventArgs e) { await SelectedFilesListDialog.ShowAsync(); } + + private async void ShowProcessFiles_Click(object sender, RoutedEventArgs e) + { + var processResult = (ProcessResult)((FrameworkElement)sender).DataContext; + ProcessFilesListDialogTextBlock.Text = string.Join(Environment.NewLine, processResult.files); + + await ProcessFilesListDialog.ShowAsync(); + } } } diff --git a/src/modules/FileLocksmith/FileLocksmithUI/Strings/en-us/Resources.resw b/src/modules/FileLocksmith/FileLocksmithUI/Strings/en-us/Resources.resw index 2b56f59919..12f5278295 100644 --- a/src/modules/FileLocksmith/FileLocksmithUI/Strings/en-us/Resources.resw +++ b/src/modules/FileLocksmith/FileLocksmithUI/Strings/en-us/Resources.resw @@ -130,6 +130,13 @@ Files + + Files + + + Close + As in, close a dialog prompt. + Click to see the entire list of paths. Paths as in file paths that were selected for the utility to check. @@ -164,4 +171,8 @@ Administrator: File Locksmith Title of the window when running as administrator. + + Show files + Show files for the selected process + \ No newline at end of file