From a53317ad925becf7f419b22d2ba7a1dc8f629caf Mon Sep 17 00:00:00 2001 From: deadlydog Date: Sun, 25 Oct 2020 17:29:10 -0600 Subject: [PATCH 1/4] feat: Add more info to tooltips and make it look better. feat: Add button to UI for resetting search options (implementation is WIP still) --- src/PathLengthCheckerGUI/MainWindow.xaml | 61 ++++++++++++++++++--- src/PathLengthCheckerGUI/MainWindow.xaml.cs | 5 ++ 2 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/PathLengthCheckerGUI/MainWindow.xaml b/src/PathLengthCheckerGUI/MainWindow.xaml index 38c8515..cf4a017 100644 --- a/src/PathLengthCheckerGUI/MainWindow.xaml +++ b/src/PathLengthCheckerGUI/MainWindow.xaml @@ -75,11 +75,47 @@ - - - - - + + + + Only paths with this many or more characters will be returned in the search results. + + Use 260 to identify long paths that Windows may have trouble handling. + + Use 0 to not filter any paths by minimum length. + + + + + + + Only paths with this many or more characters will be returned in the search results. + + Use 260 to identify long paths that Windows may have trouble handling. + + Use 0 to not filter any paths by minimum length. + + + + + + + + Only paths with this many or less characters will be returned in the search results. + + Use a large value like 999999 to not filter any paths by maximum length. + + + + + + + Only paths with this many or less characters will be returned in the search results. + + Use a large value like 999999 to not filter any paths by maximum length. + + + @@ -104,8 +140,19 @@ + diff --git a/src/PathLengthCheckerGUI/MainWindow.xaml.cs b/src/PathLengthCheckerGUI/MainWindow.xaml.cs index 7a94c61..43efbdd 100644 --- a/src/PathLengthCheckerGUI/MainWindow.xaml.cs +++ b/src/PathLengthCheckerGUI/MainWindow.xaml.cs @@ -360,5 +360,10 @@ protected internal void SetUIControlsFromSearchOptions(PathLengthSearchOptions a numMinPathLength.Value = argSearchOptions.MinimumPathLength; numMaxPathLength.Value = argSearchOptions.MaximumPathLength; } + + private void btnResetSearchOptions_Click(object sender, RoutedEventArgs e) + { + + } } } From 02f9b60aa46f87bfb90931b98538de6a38386b21 Mon Sep 17 00:00:00 2001 From: deadlydog Date: Sun, 25 Oct 2020 17:38:59 -0600 Subject: [PATCH 2/4] Implement button to reset search options UI controls --- src/PathLengthCheckerGUI/MainWindow.xaml.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/PathLengthCheckerGUI/MainWindow.xaml.cs b/src/PathLengthCheckerGUI/MainWindow.xaml.cs index 43efbdd..e55b4e6 100644 --- a/src/PathLengthCheckerGUI/MainWindow.xaml.cs +++ b/src/PathLengthCheckerGUI/MainWindow.xaml.cs @@ -47,8 +47,7 @@ public MainWindow() InitializeComponent(); this.DataContext = this; - // Set the default type for the combo boxes. - cmbTypesToInclude.SelectedValue = FileSystemTypes.All; + ResetAllUiSearchOptionsToDefaultValues(); SetWindowTitle(); } @@ -363,7 +362,22 @@ protected internal void SetUIControlsFromSearchOptions(PathLengthSearchOptions a private void btnResetSearchOptions_Click(object sender, RoutedEventArgs e) { + ResetAllUiSearchOptionsToDefaultValues(); + } + + private void ResetAllUiSearchOptionsToDefaultValues() + { + txtRootDirectory.Text = string.Empty; + txtSearchPattern.Text = string.Empty; + + numMinPathLength.Value = 0; + numMaxPathLength.Value = PathLengthSearchOptions.MaximumPathLengthMaxValue; + + chkIncludeSubdirectories.IsChecked = true; + cmbTypesToInclude.SelectedValue = FileSystemTypes.All; + txtReplaceRootDirectory.Text = string.Empty; + chkReplaceRootDirectory.IsChecked = false; } } } From 6561de5c50ac1fc51f3f4095d4dabfde9b5603dc Mon Sep 17 00:00:00 2001 From: deadlydog Date: Sun, 25 Oct 2020 17:47:30 -0600 Subject: [PATCH 3/4] Use explicit binding properties for application settings --- src/PathLengthCheckerGUI/MainWindow.xaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PathLengthCheckerGUI/MainWindow.xaml b/src/PathLengthCheckerGUI/MainWindow.xaml index cf4a017..219d9a7 100644 --- a/src/PathLengthCheckerGUI/MainWindow.xaml +++ b/src/PathLengthCheckerGUI/MainWindow.xaml @@ -5,13 +5,13 @@ xmlns:extToolkit="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:PathLengthChecker="clr-namespace:PathLengthChecker;assembly=PathLengthChecker" - Style="{StaticResource DefaultWindowStyle}" + Style="{StaticResource ResourceKey=DefaultWindowStyle}" MinWidth="770" MinHeight="400" - Width="{local:ApplicationSettingsBinding WindowWidth}" - Height="{local:ApplicationSettingsBinding WindowHeight}" - Left="{local:ApplicationSettingsBinding WindowLeftPosition}" - Top="{local:ApplicationSettingsBinding WindowTopPosition}" - WindowState="{local:ApplicationSettingsBinding WindowState}" + Width="{local:ApplicationSettingsBinding Path=WindowWidth}" + Height="{local:ApplicationSettingsBinding Path=WindowHeight}" + Left="{local:ApplicationSettingsBinding Path=WindowLeftPosition}" + Top="{local:ApplicationSettingsBinding Path=WindowTopPosition}" + WindowState="{local:ApplicationSettingsBinding Path=WindowState}" FocusManager.FocusedElement="{Binding ElementName=txtRootDirectory}"> From e4e6177385f00bb4ac434becbefe9104389a2744 Mon Sep 17 00:00:00 2001 From: deadlydog Date: Sun, 25 Oct 2020 18:32:02 -0600 Subject: [PATCH 4/4] feat: Hooked up all of the search option UI controls to be saved as user settings --- src/PathLengthCheckerGUI/MainWindow.xaml | 16 ++-- src/PathLengthCheckerGUI/MainWindow.xaml.cs | 4 +- .../Properties/Settings.Designer.cs | 96 +++++++++++++++++++ .../Properties/Settings.settings | 24 +++++ src/PathLengthCheckerGUI/app.config | 24 +++++ 5 files changed, 154 insertions(+), 10 deletions(-) diff --git a/src/PathLengthCheckerGUI/MainWindow.xaml b/src/PathLengthCheckerGUI/MainWindow.xaml index 219d9a7..b68bd9e 100644 --- a/src/PathLengthCheckerGUI/MainWindow.xaml +++ b/src/PathLengthCheckerGUI/MainWindow.xaml @@ -51,7 +51,7 @@ - +