From 6a2d7fc146a248ebc0c6cd895457648c3f78f59f Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 31 Oct 2021 03:49:23 +0900 Subject: [PATCH 01/53] Add File Manager Item and popup window --- Flow.Launcher/SelectFileManagerWindow.xaml | 58 +++++++++++++++++++ Flow.Launcher/SelectFileManagerWindow.xaml.cs | 27 +++++++++ Flow.Launcher/SettingWindow.xaml | 20 +++++++ Flow.Launcher/SettingWindow.xaml.cs | 6 ++ 4 files changed, 111 insertions(+) create mode 100644 Flow.Launcher/SelectFileManagerWindow.xaml create mode 100644 Flow.Launcher/SelectFileManagerWindow.xaml.cs diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml new file mode 100644 index 00000000000..1a846710f03 --- /dev/null +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml.cs b/Flow.Launcher/SelectFileManagerWindow.xaml.cs new file mode 100644 index 00000000000..6fcf6feefd2 --- /dev/null +++ b/Flow.Launcher/SelectFileManagerWindow.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Flow.Launcher +{ + /// + /// SelectFileManagerWindow.xaml에 대한 상호 작용 논리 + /// + public partial class SelectFileManagerWindow : Window + { + public SelectFileManagerWindow() + { + InitializeComponent(); + } + } +} diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index ac613864444..1d270e42fba 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -587,6 +587,26 @@ + + + + + + + + diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 1d270e42fba..120fd328c74 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -596,8 +596,17 @@ Style="{DynamicResource SettingSubTitleLabel}" /> - Date: Tue, 2 Nov 2021 15:07:11 -0500 Subject: [PATCH 03/53] Custom Explorer Binding (Part 1) --- .../UserSettings/CustomExplorerViewModel.cs | 17 ++ .../UserSettings/Settings.cs | 25 +++ Flow.Launcher/App.xaml.cs | 2 +- Flow.Launcher/Languages/en.xaml | 3 +- Flow.Launcher/SelectFileManagerWindow.xaml | 208 +++++++++++------- Flow.Launcher/SelectFileManagerWindow.xaml.cs | 9 +- Flow.Launcher/SettingWindow.xaml.cs | 2 +- 7 files changed, 181 insertions(+), 85 deletions(-) create mode 100644 Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs new file mode 100644 index 00000000000..4fd5e317a1e --- /dev/null +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Flow.Launcher.ViewModel +{ + public class CustomExplorerViewModel + { + public string Name { get; set; } + public string Path { get; set; } + public string FileArgument { get; set; } = "\"%d\""; + public string DirectoryArgument { get; set; } = "\"%d\""; + public bool Editable { get; init; } = true; + } +} diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 10244615863..f1c5fd442a1 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -1,9 +1,11 @@ using System; +using System.Collections.Generic; using System.Collections.ObjectModel; using System.Drawing; using System.Text.Json.Serialization; using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.SharedModels; +using Flow.Launcher.ViewModel; namespace Flow.Launcher.Infrastructure.UserSettings { @@ -34,6 +36,29 @@ public string Language public string ResultFontStretch { get; set; } public bool UseGlyphIcons { get; set; } = true; + public CustomExplorerViewModel CustomExplorer { get; set; } + public List CustomExplorerList { get; set; } = new() + { + new() + { + Name = "Explorer", + Path = "explorer", + FileArgument = "/select, \"%f\"", + DirectoryArgument = "\"%d\"", + Editable = false + }, + new() + { + Name = "Total Commander", + Path = @"C:\Program Files\TOTALCMD\totalcommander.exe" + }, + new() + { + Name = "Dopus", + Path = @"c:\programe files\dopus\dopus.exe" + } + }; + /// /// when false Alphabet static service will always return empty results diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 8c869e9418a..75925b1e064 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -101,7 +101,7 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () => API.SaveAppAllSettings(); - _mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Hidden : Visibility.Visible; + _mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Collapsed : Visibility.Visible; Log.Info("|App.OnStartup|End Flow Launcher startup ---------------------------------------------------- "); }); } diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 15954c8967b..84f7c06b1d1 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -135,7 +135,8 @@ Please specify the file location of the file manager you using and add arguments (optional) if necessary. File Manager Path - Argument + Argument For Directory + Argument For File Parent Directory Change Priority diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml index 9fb9ee1cdac..55eceae273c 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -2,112 +2,154 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Flow.Launcher" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.modernwpf.com/2019" - xmlns:local="clr-namespace:Flow.Launcher" - mc:Ignorable="d" + Title="{DynamicResource fileManagerWindow}" + Width="500" + Height="420" + Background="#f3f3f3" + DataContext="{Binding RelativeSource={RelativeSource Self}}" + ResizeMode="NoResize" WindowStartupLocation="CenterScreen" - Title="{DynamicResource fileManagerWindow}" Height="420" Width="500" ResizeMode="NoResize" Background="#f3f3f3"> + mc:Ignorable="d"> - + - + - - + + - + - - - - - - - - + + + + + + + + - - + + - + - + - - + + - - - - - - + + + + + + + + @@ -116,10 +158,16 @@ - - diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml.cs b/Flow.Launcher/SelectFileManagerWindow.xaml.cs index 6fcf6feefd2..429ccec49e9 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml.cs +++ b/Flow.Launcher/SelectFileManagerWindow.xaml.cs @@ -1,4 +1,6 @@ -using System; +using Flow.Launcher.Infrastructure.UserSettings; +using Flow.Launcher.ViewModel; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -19,8 +21,11 @@ namespace Flow.Launcher /// public partial class SelectFileManagerWindow : Window { - public SelectFileManagerWindow() + public Settings Settings { get; } + + public SelectFileManagerWindow(Settings settings) { + Settings = settings; InitializeComponent(); } } diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 80f82e8ed72..3066778c1be 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -117,7 +117,7 @@ private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e) private void OnSelectFileManagerClick(object sender, RoutedEventArgs e) { - SelectFileManagerWindow fileManagerChangeWindow = new SelectFileManagerWindow(); + SelectFileManagerWindow fileManagerChangeWindow = new SelectFileManagerWindow(settings); fileManagerChangeWindow.ShowDialog(); } From 5ebe5d4b0c3f490a3768194b55a60b7827d2d23a Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Fri, 5 Nov 2021 12:53:53 -0500 Subject: [PATCH 04/53] Revert a test change --- Flow.Launcher/App.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 75925b1e064..8c869e9418a 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -101,7 +101,7 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () => API.SaveAppAllSettings(); - _mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Collapsed : Visibility.Visible; + _mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Hidden : Visibility.Visible; Log.Info("|App.OnStartup|End Flow Launcher startup ---------------------------------------------------- "); }); } From 99d8575b4fd31a7243333331405b50035c0e2665 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Fri, 5 Nov 2021 14:16:20 -0500 Subject: [PATCH 05/53] File Explore Binding (Part 2) --- .../UserSettings/CustomExplorerViewModel.cs | 17 ++++++++-- .../UserSettings/Settings.cs | 8 ++++- Flow.Launcher/SelectFileManagerWindow.xaml | 17 +++++----- Flow.Launcher/SelectFileManagerWindow.xaml.cs | 32 ++++++++++++++++++- Flow.Launcher/SettingWindow.xaml | 2 +- 5 files changed, 63 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs index 4fd5e317a1e..7806debe125 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs @@ -1,4 +1,5 @@ -using System; +using Flow.Launcher.Plugin; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,12 +7,24 @@ namespace Flow.Launcher.ViewModel { - public class CustomExplorerViewModel + public class CustomExplorerViewModel : BaseModel { public string Name { get; set; } public string Path { get; set; } public string FileArgument { get; set; } = "\"%d\""; public string DirectoryArgument { get; set; } = "\"%d\""; public bool Editable { get; init; } = true; + + public CustomExplorerViewModel Copy() + { + return new CustomExplorerViewModel + { + Name = Name, + Path = Path, + FileArgument = FileArgument, + DirectoryArgument = DirectoryArgument, + Editable = Editable + }; + } } } diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 2ba209d5dda..48a764027c6 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -38,7 +38,13 @@ public string Language public string ResultFontStretch { get; set; } public bool UseGlyphIcons { get; set; } = true; - public CustomExplorerViewModel CustomExplorer { get; set; } + public int CustomExplorerIndex { get; set; } = 0; + public CustomExplorerViewModel CustomExplorer + { + get => CustomExplorerList[CustomExplorerIndex]; + set => CustomExplorerList[CustomExplorerIndex] = value; + } + public List CustomExplorerList { get; set; } = new() { new() diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml index 55eceae273c..ff472f0078e 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -53,9 +53,8 @@ Margin="14,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" - ItemsSource="{Binding Settings.CustomExplorerList}" - SelectedIndex="0" - SelectedItem="{Binding Settings.CustomExplorer}"> + ItemsSource="{Binding CustomExplorers}" + SelectedIndex="{Binding SelectedCustomExplorerIndex}"> @@ -66,7 +65,7 @@ @@ -163,13 +162,15 @@ Width="100" Height="30" Margin="0,0,5,0" - Content="{DynamicResource cancel}" /> + Content="{DynamicResource cancel}" + Click="btnCancel_Click"/> + Margin="5,0,0,0" + Content="{DynamicResource done}" + Click="btnDone_Click" + /> diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml.cs b/Flow.Launcher/SelectFileManagerWindow.xaml.cs index 429ccec49e9..7ac8dc1cf7a 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml.cs +++ b/Flow.Launcher/SelectFileManagerWindow.xaml.cs @@ -2,6 +2,7 @@ using Flow.Launcher.ViewModel; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -19,14 +20,43 @@ namespace Flow.Launcher /// /// SelectFileManagerWindow.xaml에 대한 상호 작용 논리 /// - public partial class SelectFileManagerWindow : Window + public partial class SelectFileManagerWindow : Window, INotifyPropertyChanged { + private int selectedCustomExplorerIndex; + + public event PropertyChangedEventHandler PropertyChanged; + public Settings Settings { get; } + public int SelectedCustomExplorerIndex + { + get => selectedCustomExplorerIndex; set + { + selectedCustomExplorerIndex = value; + PropertyChanged?.Invoke(this, new(nameof(CustomExplorer))); + } + } + public List CustomExplorers { get; set; } + + public CustomExplorerViewModel CustomExplorer => CustomExplorers[SelectedCustomExplorerIndex]; public SelectFileManagerWindow(Settings settings) { Settings = settings; + CustomExplorers = Settings.CustomExplorerList.Select(x => x.Copy()).ToList(); + SelectedCustomExplorerIndex = Settings.CustomExplorerIndex; InitializeComponent(); } + + private void btnCancel_Click(object sender, RoutedEventArgs e) + { + Close(); + } + + private void btnDone_Click(object sender, RoutedEventArgs e) + { + Settings.CustomExplorerIndex = SelectedCustomExplorerIndex; + Settings.CustomExplorerList = CustomExplorers; + Close(); + } } } diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 8e9bc8042d4..e8064a421b5 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -618,7 +618,7 @@ diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml index 9db840ad451..d4cf96e8616 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml @@ -1,79 +1,164 @@ - - + + - - - + + + - - - - - + + + + + - - - -  + +  - + - - + Content="{Binding Settings.CustomExplorer.Name}" /> Date: Wed, 10 Nov 2021 08:30:10 +0900 Subject: [PATCH 23/53] Add File Select Dialogue --- Flow.Launcher/SelectFileManagerWindow.xaml | 41 ++++++++++++++----- Flow.Launcher/SelectFileManagerWindow.xaml.cs | 14 +++++++ 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml index 85d0d14cedc..68e7b93b299 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -88,7 +88,7 @@ Orientation="Horizontal"> - + @@ -123,16 +123,35 @@ VerticalAlignment="Center" FontSize="14" Text="{DynamicResource fileManager_path}" /> - + + + + result = dlg.ShowDialog(); + + if (result == true) + { + TextBox path = (TextBox)(((FrameworkElement)sender).Parent as FrameworkElement).FindName("PathTextBox"); + path.Text = dlg.FileName; + path.Focus(); + ((Button)sender).Focus(); + } + } } } From c6054d4c56bdfa6a56193bb920a5a333915eb171 Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 31 Oct 2021 03:49:23 +0900 Subject: [PATCH 24/53] Add File Manager Item and popup window --- Flow.Launcher/SelectFileManagerWindow.xaml | 58 +++++++++++++++++++ Flow.Launcher/SelectFileManagerWindow.xaml.cs | 27 +++++++++ Flow.Launcher/SettingWindow.xaml | 22 ++++++- Flow.Launcher/SettingWindow.xaml.cs | 6 ++ 4 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 Flow.Launcher/SelectFileManagerWindow.xaml create mode 100644 Flow.Launcher/SelectFileManagerWindow.xaml.cs diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml new file mode 100644 index 00000000000..1a846710f03 --- /dev/null +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml.cs b/Flow.Launcher/SelectFileManagerWindow.xaml.cs new file mode 100644 index 00000000000..6fcf6feefd2 --- /dev/null +++ b/Flow.Launcher/SelectFileManagerWindow.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Flow.Launcher +{ + /// + /// SelectFileManagerWindow.xaml에 대한 상호 작용 논리 + /// + public partial class SelectFileManagerWindow : Window + { + public SelectFileManagerWindow() + { + InitializeComponent(); + } + } +} diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 433feeb9fb2..55c65037811 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -608,7 +608,27 @@ - + + + + + + + + diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 55c65037811..8e9bc8042d4 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -617,8 +617,17 @@ Style="{DynamicResource SettingSubTitleLabel}" /> - Date: Tue, 2 Nov 2021 15:07:11 -0500 Subject: [PATCH 26/53] Custom Explorer Binding (Part 1) --- .../UserSettings/CustomExplorerViewModel.cs | 17 ++ .../UserSettings/Settings.cs | 25 +++ Flow.Launcher/App.xaml.cs | 2 +- Flow.Launcher/Languages/en.xaml | 3 +- Flow.Launcher/SelectFileManagerWindow.xaml | 208 +++++++++++------- Flow.Launcher/SelectFileManagerWindow.xaml.cs | 9 +- Flow.Launcher/SettingWindow.xaml.cs | 2 +- 7 files changed, 181 insertions(+), 85 deletions(-) create mode 100644 Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs new file mode 100644 index 00000000000..4fd5e317a1e --- /dev/null +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Flow.Launcher.ViewModel +{ + public class CustomExplorerViewModel + { + public string Name { get; set; } + public string Path { get; set; } + public string FileArgument { get; set; } = "\"%d\""; + public string DirectoryArgument { get; set; } = "\"%d\""; + public bool Editable { get; init; } = true; + } +} diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 5f9082fe935..53ced152474 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -1,10 +1,12 @@ using System; +using System.Collections.Generic; using System.Collections.ObjectModel; using System.Drawing; using System.Text.Json.Serialization; using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.SharedModels; using Flow.Launcher; +using Flow.Launcher.ViewModel; namespace Flow.Launcher.Infrastructure.UserSettings { @@ -37,6 +39,29 @@ public string Language public string ResultFontStretch { get; set; } public bool UseGlyphIcons { get; set; } = true; + public CustomExplorerViewModel CustomExplorer { get; set; } + public List CustomExplorerList { get; set; } = new() + { + new() + { + Name = "Explorer", + Path = "explorer", + FileArgument = "/select, \"%f\"", + DirectoryArgument = "\"%d\"", + Editable = false + }, + new() + { + Name = "Total Commander", + Path = @"C:\Program Files\TOTALCMD\totalcommander.exe" + }, + new() + { + Name = "Dopus", + Path = @"c:\programe files\dopus\dopus.exe" + } + }; + /// /// when false Alphabet static service will always return empty results diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 8c869e9418a..75925b1e064 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -101,7 +101,7 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () => API.SaveAppAllSettings(); - _mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Hidden : Visibility.Visible; + _mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Collapsed : Visibility.Visible; Log.Info("|App.OnStartup|End Flow Launcher startup ---------------------------------------------------- "); }); } diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 9d8e0caa0e9..e8469763f73 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -138,7 +138,8 @@ Please specify the file location of the file manager you using and add arguments (optional) if necessary. File Manager Path - Argument + Argument For Directory + Argument For File Parent Directory Change Priority diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml index 9fb9ee1cdac..55eceae273c 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -2,112 +2,154 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Flow.Launcher" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.modernwpf.com/2019" - xmlns:local="clr-namespace:Flow.Launcher" - mc:Ignorable="d" + Title="{DynamicResource fileManagerWindow}" + Width="500" + Height="420" + Background="#f3f3f3" + DataContext="{Binding RelativeSource={RelativeSource Self}}" + ResizeMode="NoResize" WindowStartupLocation="CenterScreen" - Title="{DynamicResource fileManagerWindow}" Height="420" Width="500" ResizeMode="NoResize" Background="#f3f3f3"> + mc:Ignorable="d"> - + - + - - + + - + - - - - - - - - + + + + + + + + - - + + - + - + - - + + - - - - - - + + + + + + + + @@ -116,10 +158,16 @@ - - diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml.cs b/Flow.Launcher/SelectFileManagerWindow.xaml.cs index 6fcf6feefd2..429ccec49e9 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml.cs +++ b/Flow.Launcher/SelectFileManagerWindow.xaml.cs @@ -1,4 +1,6 @@ -using System; +using Flow.Launcher.Infrastructure.UserSettings; +using Flow.Launcher.ViewModel; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -19,8 +21,11 @@ namespace Flow.Launcher /// public partial class SelectFileManagerWindow : Window { - public SelectFileManagerWindow() + public Settings Settings { get; } + + public SelectFileManagerWindow(Settings settings) { + Settings = settings; InitializeComponent(); } } diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 62ef96b3822..38ede80764b 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -117,7 +117,7 @@ private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e) private void OnSelectFileManagerClick(object sender, RoutedEventArgs e) { - SelectFileManagerWindow fileManagerChangeWindow = new SelectFileManagerWindow(); + SelectFileManagerWindow fileManagerChangeWindow = new SelectFileManagerWindow(settings); fileManagerChangeWindow.ShowDialog(); } From 6bfebe9fbd77acdfe2075ee644ecfc7addae0b3f Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Fri, 5 Nov 2021 12:53:53 -0500 Subject: [PATCH 27/53] Revert a test change --- Flow.Launcher/App.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 75925b1e064..8c869e9418a 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -101,7 +101,7 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () => API.SaveAppAllSettings(); - _mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Collapsed : Visibility.Visible; + _mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Hidden : Visibility.Visible; Log.Info("|App.OnStartup|End Flow Launcher startup ---------------------------------------------------- "); }); } From a69f4a7ea636fd8acc4f2117886bb574f20586d3 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Fri, 5 Nov 2021 14:16:20 -0500 Subject: [PATCH 28/53] File Explore Binding (Part 2) --- .../UserSettings/CustomExplorerViewModel.cs | 17 ++++++++-- .../UserSettings/Settings.cs | 8 ++++- Flow.Launcher/SelectFileManagerWindow.xaml | 17 +++++----- Flow.Launcher/SelectFileManagerWindow.xaml.cs | 32 ++++++++++++++++++- Flow.Launcher/SettingWindow.xaml | 2 +- 5 files changed, 63 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs index 4fd5e317a1e..7806debe125 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs @@ -1,4 +1,5 @@ -using System; +using Flow.Launcher.Plugin; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,12 +7,24 @@ namespace Flow.Launcher.ViewModel { - public class CustomExplorerViewModel + public class CustomExplorerViewModel : BaseModel { public string Name { get; set; } public string Path { get; set; } public string FileArgument { get; set; } = "\"%d\""; public string DirectoryArgument { get; set; } = "\"%d\""; public bool Editable { get; init; } = true; + + public CustomExplorerViewModel Copy() + { + return new CustomExplorerViewModel + { + Name = Name, + Path = Path, + FileArgument = FileArgument, + DirectoryArgument = DirectoryArgument, + Editable = Editable + }; + } } } diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 53ced152474..f753a4a1aa8 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -39,7 +39,13 @@ public string Language public string ResultFontStretch { get; set; } public bool UseGlyphIcons { get; set; } = true; - public CustomExplorerViewModel CustomExplorer { get; set; } + public int CustomExplorerIndex { get; set; } = 0; + public CustomExplorerViewModel CustomExplorer + { + get => CustomExplorerList[CustomExplorerIndex]; + set => CustomExplorerList[CustomExplorerIndex] = value; + } + public List CustomExplorerList { get; set; } = new() { new() diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml index 55eceae273c..ff472f0078e 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -53,9 +53,8 @@ Margin="14,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" - ItemsSource="{Binding Settings.CustomExplorerList}" - SelectedIndex="0" - SelectedItem="{Binding Settings.CustomExplorer}"> + ItemsSource="{Binding CustomExplorers}" + SelectedIndex="{Binding SelectedCustomExplorerIndex}"> @@ -66,7 +65,7 @@ @@ -163,13 +162,15 @@ Width="100" Height="30" Margin="0,0,5,0" - Content="{DynamicResource cancel}" /> + Content="{DynamicResource cancel}" + Click="btnCancel_Click"/> + Margin="5,0,0,0" + Content="{DynamicResource done}" + Click="btnDone_Click" + /> diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml.cs b/Flow.Launcher/SelectFileManagerWindow.xaml.cs index 429ccec49e9..7ac8dc1cf7a 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml.cs +++ b/Flow.Launcher/SelectFileManagerWindow.xaml.cs @@ -2,6 +2,7 @@ using Flow.Launcher.ViewModel; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -19,14 +20,43 @@ namespace Flow.Launcher /// /// SelectFileManagerWindow.xaml에 대한 상호 작용 논리 /// - public partial class SelectFileManagerWindow : Window + public partial class SelectFileManagerWindow : Window, INotifyPropertyChanged { + private int selectedCustomExplorerIndex; + + public event PropertyChangedEventHandler PropertyChanged; + public Settings Settings { get; } + public int SelectedCustomExplorerIndex + { + get => selectedCustomExplorerIndex; set + { + selectedCustomExplorerIndex = value; + PropertyChanged?.Invoke(this, new(nameof(CustomExplorer))); + } + } + public List CustomExplorers { get; set; } + + public CustomExplorerViewModel CustomExplorer => CustomExplorers[SelectedCustomExplorerIndex]; public SelectFileManagerWindow(Settings settings) { Settings = settings; + CustomExplorers = Settings.CustomExplorerList.Select(x => x.Copy()).ToList(); + SelectedCustomExplorerIndex = Settings.CustomExplorerIndex; InitializeComponent(); } + + private void btnCancel_Click(object sender, RoutedEventArgs e) + { + Close(); + } + + private void btnDone_Click(object sender, RoutedEventArgs e) + { + Settings.CustomExplorerIndex = SelectedCustomExplorerIndex; + Settings.CustomExplorerList = CustomExplorers; + Close(); + } } } diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 8e9bc8042d4..e8064a421b5 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -618,7 +618,7 @@ diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml index 9db840ad451..d4cf96e8616 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml @@ -1,79 +1,164 @@ - - + + - - - + + + - - - - - + + + + + - - - -  + +  - + - - + Content="{Binding Settings.CustomExplorer.Name}" /> Date: Wed, 10 Nov 2021 08:30:10 +0900 Subject: [PATCH 47/53] Add File Select Dialogue --- Flow.Launcher/SelectFileManagerWindow.xaml | 41 ++++++++++++++----- Flow.Launcher/SelectFileManagerWindow.xaml.cs | 14 +++++++ 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml index 85d0d14cedc..68e7b93b299 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -88,7 +88,7 @@ Orientation="Horizontal"> - + @@ -123,16 +123,35 @@ VerticalAlignment="Center" FontSize="14" Text="{DynamicResource fileManager_path}" /> - + + + + result = dlg.ShowDialog(); + + if (result == true) + { + TextBox path = (TextBox)(((FrameworkElement)sender).Parent as FrameworkElement).FindName("PathTextBox"); + path.Text = dlg.FileName; + path.Focus(); + ((Button)sender).Focus(); + } + } } } From b15ec0f83b01c21cc58d61e038c29ed5a81fde17 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Wed, 10 Nov 2021 13:39:15 -0600 Subject: [PATCH 48/53] Json Ignore CustomExplorer Property because we don't use that to store value --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index ce07dc0ea21..34e86a3edf5 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -40,6 +40,8 @@ public string Language public bool UseGlyphIcons { get; set; } = true; public int CustomExplorerIndex { get; set; } = 0; + + [JsonIgnore] public CustomExplorerViewModel CustomExplorer { get => CustomExplorerList[CustomExplorerIndex < CustomExplorerList.Count ? CustomExplorerIndex : 0]; From 07905e8d9ce6c9976cbbd8b3a804a7fb0f9ba31f Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 11 Nov 2021 08:40:15 +1100 Subject: [PATCH 49/53] update api description comment --- Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index 066188882ad..3abdaf01f4e 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -192,7 +192,7 @@ public interface IPublicAPI void SaveSettingJsonStorage() where T : new(); /// - /// Open Directory in explorer configured by user + /// Open directory in an explorer configured by user via Flow's Settings. The default is Windows Explorer /// /// Directory Path to open /// Extra FileName Info From d8b4050dd6a6350758fb889168dee30b66602a29 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 11 Nov 2021 08:42:16 +1100 Subject: [PATCH 50/53] remove summary --- Flow.Launcher/SelectFileManagerWindow.xaml.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml.cs b/Flow.Launcher/SelectFileManagerWindow.xaml.cs index c648f86ac50..4f6fb343911 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml.cs +++ b/Flow.Launcher/SelectFileManagerWindow.xaml.cs @@ -18,9 +18,6 @@ namespace Flow.Launcher { - /// - /// SelectFileManagerWindow.xaml에 대한 상호 작용 논리 - /// public partial class SelectFileManagerWindow : Window, INotifyPropertyChanged { private int selectedCustomExplorerIndex; From e09248fe0a11e498d841f1d472a7583c1d67f2ee Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 11 Nov 2021 08:50:02 +1100 Subject: [PATCH 51/53] bump version for plugins --- Plugins/Flow.Launcher.Plugin.Explorer/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.Program/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.Sys/plugin.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json index c525c001bee..8d5d97af172 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json @@ -10,7 +10,7 @@ "Name": "Explorer", "Description": "Search and manage files and folders. Explorer utilises Windows Index Search", "Author": "Jeremy Wu", - "Version": "1.9.1", + "Version": "1.10.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll", diff --git a/Plugins/Flow.Launcher.Plugin.Program/plugin.json b/Plugins/Flow.Launcher.Plugin.Program/plugin.json index 5f762f7b6ea..cbcc00f2b36 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Program/plugin.json @@ -4,7 +4,7 @@ "Name": "Program", "Description": "Search programs in Flow.Launcher", "Author": "qianlifeng", - "Version": "1.6.1", + "Version": "1.7.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Program.dll", diff --git a/Plugins/Flow.Launcher.Plugin.Sys/plugin.json b/Plugins/Flow.Launcher.Plugin.Sys/plugin.json index 826a1b7563b..42e8058e511 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Sys/plugin.json @@ -4,7 +4,7 @@ "Name": "System Commands", "Description": "Provide System related commands. e.g. shutdown,lock, setting etc.", "Author": "qianlifeng", - "Version": "1.4.1", + "Version": "1.5.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Sys.dll", From 994d7eba47500f840b48ecdd5bc139f7b885e3c7 Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 11 Nov 2021 23:53:54 +0900 Subject: [PATCH 52/53] - Add "%f" tip text and adjust string - Adjust Window Size --- Flow.Launcher/Languages/en.xaml | 5 +++-- Flow.Launcher/SelectFileManagerWindow.xaml | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 289aec337c4..64f87759df5 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -139,11 +139,12 @@ Select File Manager Please specify the file location of the file manager you using and add arguments if necessary. The default arguments is "%d", and a path is entered at that location. For example, If a command is required such as "totalcmd.exe /A c:\windows", Argument is /A "%d". + "%f" is an argument that represent the file path. It is used to emphasize the file/folder name when opening a specific file location in 3rd party file manager. This Argument is only available in the "Arg for File" item. If the file manager does not have that function, you can use "%d". File Manager Profile Name File Manager Path - Arguments For Folder - Arguments For File + Arg For Folder + Arg For File Change Priority diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml index 68e7b93b299..eba794c96ca 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -42,6 +42,12 @@ Text="{DynamicResource fileManager_tips}" TextAlignment="Left" TextWrapping="WrapWithOverflow" /> + + + @@ -88,7 +94,7 @@ Orientation="Horizontal"> - + @@ -126,7 +132,7 @@ + Text="{DynamicResource fileManager_directory_arg}" + TextWrapping="WrapWithOverflow" /> + Text="{DynamicResource fileManager_file_arg}" + TextWrapping="WrapWithOverflow" /> Date: Fri, 12 Nov 2021 07:30:47 +1100 Subject: [PATCH 53/53] update wording --- Flow.Launcher/Languages/en.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 64f87759df5..5ca6bdbfd7a 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -138,8 +138,8 @@ Select File Manager - Please specify the file location of the file manager you using and add arguments if necessary. The default arguments is "%d", and a path is entered at that location. For example, If a command is required such as "totalcmd.exe /A c:\windows", Argument is /A "%d". - "%f" is an argument that represent the file path. It is used to emphasize the file/folder name when opening a specific file location in 3rd party file manager. This Argument is only available in the "Arg for File" item. If the file manager does not have that function, you can use "%d". + Please specify the file location of the file manager you using and add arguments if necessary. The default arguments is "%d", and a path is entered at that location. For example, If a command is required such as "totalcmd.exe /A c:\windows", argument is /A "%d". + "%f" is an argument that represent the file path. It is used to emphasize the file/folder name when opening a specific file location in 3rd party file manager. This argument is only available in the "Arg for File" item. If the file manager does not have that function, you can use "%d". File Manager Profile Name File Manager Path