From 2acfbf19f27f86163f59fe5ecf10148dd8f50569 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 23 Apr 2020 19:39:23 +1000 Subject: [PATCH 1/7] Change to shared command WebSearch --- Flow.Launcher/SettingWindow.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 36e77e25c..ddb05efb0 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -17,6 +17,7 @@ using Flow.Launcher.Core.Resource; using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; +using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.ViewModel; namespace Flow.Launcher @@ -269,7 +270,7 @@ namespace Flow.Launcher private void OnRequestNavigate(object sender, RequestNavigateEventArgs e) { - Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); + SearchWeb.NewBrowserWindow(e.Uri.AbsoluteUri); e.Handled = true; } From 41140002935f2ac86d3a0fce537f62044d653ef7 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 23 Apr 2020 19:39:39 +1000 Subject: [PATCH 2/7] Remove unused references --- Flow.Launcher/SettingWindow.xaml.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index ddb05efb0..2792c424d 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -1,17 +1,12 @@ using System; -using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Linq; -using System.Net; using System.Windows; -using System.Windows.Controls; using System.Windows.Input; using System.Windows.Navigation; using Microsoft.Win32; using NHotkey; using NHotkey.Wpf; -using Flow.Launcher.Core; using Flow.Launcher.Core.Plugin; using Flow.Launcher.Core.Resource; using Flow.Launcher.Infrastructure.Hotkey; From 13217d1e723e406453b0cbb6c1fd44a299281f49 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 23 Apr 2020 20:10:20 +1000 Subject: [PATCH 3/7] Fix Process.Start on URL --- Flow.Launcher/ReportWindow.xaml.cs | 5 +++-- Flow.Launcher/SettingWindow.xaml.cs | 4 ++-- Flow.Launcher/ViewModel/MainViewModel.cs | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/ReportWindow.xaml.cs b/Flow.Launcher/ReportWindow.xaml.cs index 2f90ec47a..b4e0414ab 100644 --- a/Flow.Launcher/ReportWindow.xaml.cs +++ b/Flow.Launcher/ReportWindow.xaml.cs @@ -9,6 +9,7 @@ using System.Windows.Documents; using Flow.Launcher.Helper; using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.Logger; +using Flow.Launcher.Plugin.SharedCommands; namespace Flow.Launcher { @@ -51,8 +52,8 @@ namespace Flow.Launcher var link = new Hyperlink { IsEnabled = true }; link.Inlines.Add(url); link.NavigateUri = new Uri(url); - link.RequestNavigate += (s, e) => Process.Start(e.Uri.ToString()); - link.Click += (s, e) => Process.Start(url); + link.RequestNavigate += (s, e) => SearchWeb.NewBrowserWindow(e.Uri.ToString()); + link.Click += (s, e) => SearchWeb.NewBrowserWindow(url); paragraph.Inlines.Add(textBeforeUrl); paragraph.Inlines.Add(link); diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 2792c424d..296812792 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.IO; using System.Windows; @@ -229,7 +229,7 @@ namespace Flow.Launcher var uri = new Uri(website); if (Uri.CheckSchemeName(uri.Scheme)) { - Process.Start(website); + SearchWeb.NewBrowserWindow(website); } } } diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 85eb638d4..8bc61e98d 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -17,6 +17,7 @@ using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; +using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Storage; namespace Flow.Launcher.ViewModel @@ -130,7 +131,7 @@ namespace Flow.Launcher.ViewModel StartHelpCommand = new RelayCommand(_ => { - Process.Start("http://doc.wox.one/"); + SearchWeb.NewBrowserWindow("http://doc.wox.one/"); }); OpenResultCommand = new RelayCommand(index => From ef0cd2bf7c8205f9b3ac72e0a6a78d74808edc5e Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 23 Apr 2020 20:11:39 +1000 Subject: [PATCH 4/7] Update opening directory location to use shared plugin command --- Flow.Launcher/SettingWindow.xaml.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 296812792..af8a148da 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.IO; using System.Windows; @@ -240,10 +240,8 @@ namespace Flow.Launcher if (e.ChangedButton == MouseButton.Left) { var directory = _viewModel.SelectedPlugin.PluginPair.Metadata.PluginDirectory; - if (!string.IsNullOrEmpty(directory) && Directory.Exists(directory)) - { - Process.Start(directory); - } + if (!string.IsNullOrEmpty(directory)) + FilesFolders.OpenLocationInExporer(directory); } } #endregion From a1353d5249c2fd62b981ea2acb872251cde863e3 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 23 Apr 2020 21:56:11 +1000 Subject: [PATCH 5/7] Update start process for opening directory --- Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs | 3 ++- Plugins/Flow.Launcher.Plugin.Folder/Main.cs | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs index 98e465b50..f3f0ee32c 100644 --- a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs +++ b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs @@ -7,6 +7,7 @@ namespace Flow.Launcher.Plugin.SharedCommands { public static class FilesFolders { + private const string FileExplorerProgramName = "explorer"; public static void Copy(this string sourcePath, string targetPath) { // Get the subdirectories for the specified directory. @@ -114,7 +115,7 @@ namespace Flow.Launcher.Plugin.SharedCommands try { if (LocationExists(location)) - Process.Start(location); + Process.Start(FileExplorerProgramName, location); } catch (Exception e) { diff --git a/Plugins/Flow.Launcher.Plugin.Folder/Main.cs b/Plugins/Flow.Launcher.Plugin.Folder/Main.cs index 84a83b666..4283fe7f7 100644 --- a/Plugins/Flow.Launcher.Plugin.Folder/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Folder/Main.cs @@ -7,6 +7,7 @@ using System.Windows; using System.Windows.Controls; using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.Storage; +using Flow.Launcher.Plugin.SharedCommands; namespace Flow.Launcher.Plugin.Folder { @@ -18,8 +19,7 @@ namespace Flow.Launcher.Plugin.Folder public const string CopyImagePath = "Images\\copy.png"; private string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory"; - - private const string _fileExplorerProgramName = "explorer"; + private static List _driverNames; private PluginInitContext _context; @@ -103,7 +103,7 @@ namespace Flow.Launcher.Plugin.Folder { try { - Process.Start(_fileExplorerProgramName, path); + FilesFolders.OpenLocationInExporer(path); return true; } catch (Exception ex) @@ -255,7 +255,7 @@ namespace Flow.Launcher.Plugin.Folder { try { - Process.Start(_fileExplorerProgramName, filePath); + FilesFolders.OpenLocationInExporer(filePath); } catch (Exception ex) { @@ -286,7 +286,7 @@ namespace Flow.Launcher.Plugin.Folder Score = 500, Action = c => { - Process.Start(_fileExplorerProgramName, search); + FilesFolders.OpenLocationInExporer(search); return true; } }; From 7277373d84ed1da517fabd81bd2704e1c8421ac6 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Fri, 24 Apr 2020 07:59:24 +1000 Subject: [PATCH 6/7] use shell when opening directories --- Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs index f3f0ee32c..7165804a4 100644 --- a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs +++ b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs @@ -112,10 +112,11 @@ namespace Flow.Launcher.Plugin.SharedCommands public static void OpenLocationInExporer(string location) { + var psi = new ProcessStartInfo { FileName = FileExplorerProgramName, UseShellExecute = true, Arguments = location }; try { if (LocationExists(location)) - Process.Start(FileExplorerProgramName, location); + Process.Start(psi); } catch (Exception e) { From e3fca3a082e69d23c62daa98a9e86792a30d9c5b Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Sat, 25 Apr 2020 13:36:41 +1000 Subject: [PATCH 7/7] Update url of documentation --- Flow.Launcher/ViewModel/MainViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 8bc61e98d..c677d7c71 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -131,7 +131,7 @@ namespace Flow.Launcher.ViewModel StartHelpCommand = new RelayCommand(_ => { - SearchWeb.NewBrowserWindow("http://doc.wox.one/"); + SearchWeb.NewBrowserWindow("https://github.com/Flow-Launcher/Flow.Launcher/wiki/Flow-Launcher/"); }); OpenResultCommand = new RelayCommand(index =>