diff --git a/Flow.Launcher.Core/Flow.Launcher.Core.csproj b/Flow.Launcher.Core/Flow.Launcher.Core.csproj index 4077320bc..8d06e71c5 100644 --- a/Flow.Launcher.Core/Flow.Launcher.Core.csproj +++ b/Flow.Launcher.Core/Flow.Launcher.Core.csproj @@ -1,4 +1,4 @@ - + net7.0-windows @@ -54,8 +54,8 @@ - - + + diff --git a/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs b/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs index 6b55bb3e3..a7bbccfec 100644 --- a/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs +++ b/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs @@ -2,7 +2,6 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -using Flow.Launcher.Plugin; namespace Flow.Launcher.Core.Plugin { diff --git a/Flow.Launcher.Core/Plugin/JsonPRCModel.cs b/Flow.Launcher.Core/Plugin/JsonPRCModel.cs index e937779a1..eaaae25b0 100644 --- a/Flow.Launcher.Core/Plugin/JsonPRCModel.cs +++ b/Flow.Launcher.Core/Plugin/JsonPRCModel.cs @@ -12,9 +12,7 @@ * */ -using Flow.Launcher.Core.Resource; using System.Collections.Generic; -using System.Linq; using System.Text.Json.Serialization; using Flow.Launcher.Plugin; using System.Text.Json; diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs index f3b2eed87..438c1dd8a 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs @@ -23,9 +23,6 @@ using Orientation = System.Windows.Controls.Orientation; using TextBox = System.Windows.Controls.TextBox; using UserControl = System.Windows.Controls.UserControl; using System.Windows.Documents; -using static System.Windows.Forms.LinkLabel; -using Droplex; -using System.Windows.Forms; namespace Flow.Launcher.Core.Plugin { diff --git a/Flow.Launcher.Core/Plugin/NodePlugin.cs b/Flow.Launcher.Core/Plugin/NodePlugin.cs index 1247143fa..8ea5c4b78 100644 --- a/Flow.Launcher.Core/Plugin/NodePlugin.cs +++ b/Flow.Launcher.Core/Plugin/NodePlugin.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.IO; -using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; using Flow.Launcher.Plugin; diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 9d76b6be0..1dd0683f0 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -1,7 +1,4 @@ -using Flow.Launcher.Infrastructure; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; +using System; using System.IO; using System.Linq; using System.Reflection; diff --git a/Flow.Launcher.Core/Plugin/PluginsLoader.cs b/Flow.Launcher.Core/Plugin/PluginsLoader.cs index e6329aba1..fea7f55b9 100644 --- a/Flow.Launcher.Core/Plugin/PluginsLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginsLoader.cs @@ -5,7 +5,9 @@ using System.Reflection; using System.Threading.Tasks; using System.Windows.Forms; using Flow.Launcher.Core.ExternalPlugins.Environments; +#pragma warning disable IDE0005 using Flow.Launcher.Infrastructure.Logger; +#pragma warning restore IDE0005 using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch; diff --git a/Flow.Launcher.Core/Plugin/PythonPlugin.cs b/Flow.Launcher.Core/Plugin/PythonPlugin.cs index 2bbf6d110..d8df21226 100644 --- a/Flow.Launcher.Core/Plugin/PythonPlugin.cs +++ b/Flow.Launcher.Core/Plugin/PythonPlugin.cs @@ -1,5 +1,4 @@ -using System; -using System.Diagnostics; +using System.Diagnostics; using System.IO; using System.Threading; using System.Threading.Tasks; diff --git a/Flow.Launcher.Core/Plugin/QueryBuilder.cs b/Flow.Launcher.Core/Plugin/QueryBuilder.cs index a819f94b7..84f36e91a 100644 --- a/Flow.Launcher.Core/Plugin/QueryBuilder.cs +++ b/Flow.Launcher.Core/Plugin/QueryBuilder.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using Flow.Launcher.Plugin; namespace Flow.Launcher.Core.Plugin diff --git a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj index 1d4db757b..cd78034f7 100644 --- a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj +++ b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj @@ -53,7 +53,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Flow.Launcher.Infrastructure/Helper.cs b/Flow.Launcher.Infrastructure/Helper.cs index db575de90..864d796c7 100644 --- a/Flow.Launcher.Infrastructure/Helper.cs +++ b/Flow.Launcher.Infrastructure/Helper.cs @@ -2,7 +2,6 @@ using System; using System.IO; -using System.Runtime.CompilerServices; using System.Text.Json; using System.Text.Json.Serialization; diff --git a/Flow.Launcher.Infrastructure/Hotkey/GlobalHotkey.cs b/Flow.Launcher.Infrastructure/Hotkey/GlobalHotkey.cs index a09185696..f847ab189 100644 --- a/Flow.Launcher.Infrastructure/Hotkey/GlobalHotkey.cs +++ b/Flow.Launcher.Infrastructure/Hotkey/GlobalHotkey.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Flow.Launcher.Plugin; diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs index e5be0701f..14b8eef4e 100644 --- a/Flow.Launcher.Infrastructure/Http/Http.cs +++ b/Flow.Launcher.Infrastructure/Http/Http.cs @@ -1,15 +1,12 @@ using System.IO; using System.Net; using System.Net.Http; -using System.Text; using System.Threading.Tasks; using JetBrains.Annotations; using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.UserSettings; using System; -using System.ComponentModel; using System.Threading; -using System.Windows.Interop; using Flow.Launcher.Plugin; namespace Flow.Launcher.Infrastructure.Http diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index fee2c60bd..203c5646a 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -1,11 +1,8 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; -using System.Net; -using System.Net.Http; using System.Threading.Tasks; using System.Windows.Media; using System.Windows.Media.Imaging; diff --git a/Flow.Launcher.Infrastructure/Logger/Log.cs b/Flow.Launcher.Infrastructure/Logger/Log.cs index 53726ea64..d4bd473ac 100644 --- a/Flow.Launcher.Infrastructure/Logger/Log.cs +++ b/Flow.Launcher.Infrastructure/Logger/Log.cs @@ -5,7 +5,6 @@ using NLog; using NLog.Config; using NLog.Targets; using Flow.Launcher.Infrastructure.UserSettings; -using NLog.Fluent; using NLog.Targets.Wrappers; using System.Runtime.ExceptionServices; diff --git a/Flow.Launcher.Infrastructure/Storage/FlowLauncherJsonStorage.cs b/Flow.Launcher.Infrastructure/Storage/FlowLauncherJsonStorage.cs index ec7a38804..865041fb3 100644 --- a/Flow.Launcher.Infrastructure/Storage/FlowLauncherJsonStorage.cs +++ b/Flow.Launcher.Infrastructure/Storage/FlowLauncherJsonStorage.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.IO; using Flow.Launcher.Infrastructure.UserSettings; namespace Flow.Launcher.Infrastructure.Storage diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs index 7806debe1..c54c30478 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs @@ -1,9 +1,4 @@ using Flow.Launcher.Plugin; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Flow.Launcher.ViewModel { diff --git a/Flow.Launcher.Infrastructure/UserSettings/HttpProxy.cs b/Flow.Launcher.Infrastructure/UserSettings/HttpProxy.cs index 213193526..c8d76d2ba 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/HttpProxy.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/HttpProxy.cs @@ -1,6 +1,4 @@ -using System.ComponentModel; - -namespace Flow.Launcher.Infrastructure.UserSettings +namespace Flow.Launcher.Infrastructure.UserSettings { public enum ProxyProperty { diff --git a/Flow.Launcher.Plugin/Features.cs b/Flow.Launcher.Plugin/Features.cs index 5b9c6a7b9..b4a1eccc1 100644 --- a/Flow.Launcher.Plugin/Features.cs +++ b/Flow.Launcher.Plugin/Features.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Threading; - -namespace Flow.Launcher.Plugin +namespace Flow.Launcher.Plugin { /// /// Base Interface for Flow's special plugin feature interface diff --git a/Flow.Launcher.Plugin/GlyphInfo.cs b/Flow.Launcher.Plugin/GlyphInfo.cs index 730046e1d..45b90b09e 100644 --- a/Flow.Launcher.Plugin/GlyphInfo.cs +++ b/Flow.Launcher.Plugin/GlyphInfo.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; - -namespace Flow.Launcher.Plugin +namespace Flow.Launcher.Plugin { /// /// Text with FontFamily specified diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index d0fdf136b..a07975f3c 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -38,12 +38,18 @@ namespace Flow.Launcher.Plugin /// Thrown when unable to find the file specified in the command /// Thrown when error occurs during the execution of the command void ShellRun(string cmd, string filename = "cmd.exe"); - + /// - /// Copy Text to clipboard + /// Copies the passed in text and shows a message indicating whether the operation was completed successfully. + /// When directCopy is set to true and passed in text is the path to a file or directory, + /// the actual file/directory will be copied to clipboard. Otherwise the text itself will still be copied to clipboard. /// /// Text to save on clipboard - public void CopyToClipboard(string text); + /// When true it will directly copy the file/folder from the path specified in text + /// Whether to show the default notification from this method after copy is done. + /// It will show file/folder/text is copied successfully. + /// Turn this off to show your own notification after copy is done.> + public void CopyToClipboard(string text, bool directCopy = false, bool showDefaultNotification = true); /// /// Save everything, all of Flow Launcher and plugins' data and settings diff --git a/Flow.Launcher.Plugin/PluginInitContext.cs b/Flow.Launcher.Plugin/PluginInitContext.cs index 04f20e984..233ead8f9 100644 --- a/Flow.Launcher.Plugin/PluginInitContext.cs +++ b/Flow.Launcher.Plugin/PluginInitContext.cs @@ -1,6 +1,4 @@ -using System; - -namespace Flow.Launcher.Plugin +namespace Flow.Launcher.Plugin { public class PluginInitContext { diff --git a/Flow.Launcher.Plugin/PluginMetadata.cs b/Flow.Launcher.Plugin/PluginMetadata.cs index e8f5cf744..b4e06913e 100644 --- a/Flow.Launcher.Plugin/PluginMetadata.cs +++ b/Flow.Launcher.Plugin/PluginMetadata.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Text.Json.Serialization; diff --git a/Flow.Launcher.Plugin/Query.cs b/Flow.Launcher.Plugin/Query.cs index 95547d273..c3bd82c74 100644 --- a/Flow.Launcher.Plugin/Query.cs +++ b/Flow.Launcher.Plugin/Query.cs @@ -1,7 +1,4 @@ -using JetBrains.Annotations; -using System; -using System.Collections.Generic; -using System.Linq; +using System; namespace Flow.Launcher.Plugin { @@ -29,6 +26,13 @@ namespace Flow.Launcher.Plugin /// public string RawQuery { get; internal init; } + /// + /// Determines whether the query was forced to execute again. + /// For example, the value will be true when the user presses Ctrl + R. + /// When this property is true, plugins handling this query should avoid serving cached results. + /// + public bool IsReQuery { get; internal set; } = false; + /// /// Search part of a query. /// This will not include action keyword if exclusive plugin gets it, otherwise it should be same as RawQuery. diff --git a/Flow.Launcher.Plugin/SharedCommands/ShellCommand.cs b/Flow.Launcher.Plugin/SharedCommands/ShellCommand.cs index c18f8b90c..49f78b458 100644 --- a/Flow.Launcher.Plugin/SharedCommands/ShellCommand.cs +++ b/Flow.Launcher.Plugin/SharedCommands/ShellCommand.cs @@ -1,13 +1,10 @@ using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; -using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading; -using System.Threading.Tasks; namespace Flow.Launcher.Plugin.SharedCommands { diff --git a/Flow.Launcher.Test/Flow.Launcher.Test.csproj b/Flow.Launcher.Test/Flow.Launcher.Test.csproj index f5d9dea28..d88becad0 100644 --- a/Flow.Launcher.Test/Flow.Launcher.Test.csproj +++ b/Flow.Launcher.Test/Flow.Launcher.Test.csproj @@ -54,7 +54,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + \ No newline at end of file diff --git a/Flow.Launcher.Test/HttpTest.cs b/Flow.Launcher.Test/HttpTest.cs index 637747a07..e72ad7a67 100644 --- a/Flow.Launcher.Test/HttpTest.cs +++ b/Flow.Launcher.Test/HttpTest.cs @@ -1,7 +1,5 @@ using NUnit.Framework; using System; -using System.Collections.Generic; -using System.Text; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.Http; diff --git a/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs b/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs index 765280e08..d071545ba 100644 --- a/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs +++ b/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs @@ -1,4 +1,3 @@ -using NUnit; using NUnit.Framework; using Flow.Launcher.Core.Plugin; using Flow.Launcher.Plugin; diff --git a/Flow.Launcher/ActionKeywords.xaml.cs b/Flow.Launcher/ActionKeywords.xaml.cs index c89f82a3b..371b2dd07 100644 --- a/Flow.Launcher/ActionKeywords.xaml.cs +++ b/Flow.Launcher/ActionKeywords.xaml.cs @@ -1,8 +1,5 @@ using System.Windows; -using Flow.Launcher.Core.Plugin; using Flow.Launcher.Core.Resource; -using Flow.Launcher.Infrastructure.Exception; -using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.ViewModel; diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 1d398276d..295dd3e7a 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -3,7 +3,6 @@ using System.Diagnostics; using System.Text; using System.Threading; using System.Threading.Tasks; -using System.Timers; using System.Windows; using Flow.Launcher.Core; using Flow.Launcher.Core.Configuration; diff --git a/Flow.Launcher/Converters/BoolToVisibilityConverter.cs b/Flow.Launcher/Converters/BoolToVisibilityConverter.cs index ad474d693..e60e26be4 100644 --- a/Flow.Launcher/Converters/BoolToVisibilityConverter.cs +++ b/Flow.Launcher/Converters/BoolToVisibilityConverter.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Globalization; using System.Windows; -using System.Windows.Controls; using System.Windows.Data; namespace Flow.Launcher.Converters diff --git a/Flow.Launcher/Converters/BorderClipConverter.cs b/Flow.Launcher/Converters/BorderClipConverter.cs index 83e83f1de..c0bce2cd9 100644 --- a/Flow.Launcher/Converters/BorderClipConverter.cs +++ b/Flow.Launcher/Converters/BorderClipConverter.cs @@ -1,13 +1,8 @@ using System; -using System.Collections.Generic; using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Data; using System.Windows.Media; -using System.Windows.Documents; using System.Windows.Shapes; // For Clipping inside listbox item diff --git a/Flow.Launcher/Converters/HighlightTextConverter.cs b/Flow.Launcher/Converters/HighlightTextConverter.cs index 972dd1bc8..cb62c0d3d 100644 --- a/Flow.Launcher/Converters/HighlightTextConverter.cs +++ b/Flow.Launcher/Converters/HighlightTextConverter.cs @@ -2,11 +2,8 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -using System.Windows.Media; using System.Windows.Documents; namespace Flow.Launcher.Converters diff --git a/Flow.Launcher/Converters/IconRadiusConverter.cs b/Flow.Launcher/Converters/IconRadiusConverter.cs index 51129cfb8..c73bef8b2 100644 --- a/Flow.Launcher/Converters/IconRadiusConverter.cs +++ b/Flow.Launcher/Converters/IconRadiusConverter.cs @@ -1,7 +1,6 @@ using System; using System.Globalization; using System.Windows.Data; -using Windows.Devices.PointOfService; namespace Flow.Launcher.Converters { diff --git a/Flow.Launcher/Converters/OpenResultHotkeyVisibilityConverter.cs b/Flow.Launcher/Converters/OpenResultHotkeyVisibilityConverter.cs index 7586d1fcf..a44b07cab 100644 --- a/Flow.Launcher/Converters/OpenResultHotkeyVisibilityConverter.cs +++ b/Flow.Launcher/Converters/OpenResultHotkeyVisibilityConverter.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Globalization; -using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 02930fc25..384df2e62 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -94,10 +94,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Flow.Launcher/Helper/AutoStartup.cs b/Flow.Launcher/Helper/AutoStartup.cs index 956324020..bf36b7f6f 100644 --- a/Flow.Launcher/Helper/AutoStartup.cs +++ b/Flow.Launcher/Helper/AutoStartup.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.Logger; using Microsoft.Win32; @@ -51,7 +47,7 @@ namespace Flow.Launcher.Helper try { using var key = Registry.CurrentUser.OpenSubKey(StartupPath, true); - key?.SetValue(Constant.FlowLauncher, Constant.ExecutablePath); + key?.SetValue(Constant.FlowLauncher, $"\"{Constant.ExecutablePath}\""); } catch (Exception e) { diff --git a/Flow.Launcher/Helper/SingleInstance.cs b/Flow.Launcher/Helper/SingleInstance.cs index d684596be..739fed378 100644 --- a/Flow.Launcher/Helper/SingleInstance.cs +++ b/Flow.Launcher/Helper/SingleInstance.cs @@ -1,21 +1,18 @@ using System; -using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Runtime.InteropServices; using System.IO.Pipes; -using System.Runtime.Serialization.Formatters; using System.Security; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows; -using System.Windows.Threading; // http://blogs.microsoft.co.il/arik/2010/05/28/wpf-single-instance-application/ // modified to allow single instace restart -namespace Flow.Launcher.Helper +namespace Flow.Launcher.Helper { internal enum WM { diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 4a95834b5..f864815e4 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -86,6 +86,10 @@ Key="O" Command="{Binding LoadContextMenuCommand}" Modifiers="Ctrl" /> + _mainVM.ProgressBarVisibility = Visibility.Visible; diff --git a/Flow.Launcher/ReportWindow.xaml.cs b/Flow.Launcher/ReportWindow.xaml.cs index a2e7a8562..a535dfb3e 100644 --- a/Flow.Launcher/ReportWindow.xaml.cs +++ b/Flow.Launcher/ReportWindow.xaml.cs @@ -1,6 +1,5 @@ using Flow.Launcher.Core.ExternalPlugins; using System; -using System.Diagnostics; using System.Globalization; using System.IO; using System.Text; diff --git a/Flow.Launcher/SelectBrowserWindow.xaml.cs b/Flow.Launcher/SelectBrowserWindow.xaml.cs index 37f0c47ae..4244d5827 100644 --- a/Flow.Launcher/SelectBrowserWindow.xaml.cs +++ b/Flow.Launcher/SelectBrowserWindow.xaml.cs @@ -1,20 +1,10 @@ using Flow.Launcher.Infrastructure.UserSettings; -using Flow.Launcher.ViewModel; using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; 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 { diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml.cs b/Flow.Launcher/SelectFileManagerWindow.xaml.cs index 4f6fb3439..b7bda4565 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml.cs +++ b/Flow.Launcher/SelectFileManagerWindow.xaml.cs @@ -1,20 +1,11 @@ using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.ViewModel; using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; 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 { diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 7ac9c8cb6..7301be130 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -10,9 +10,7 @@ using ModernWpf; using ModernWpf.Controls; using System; using System.ComponentModel; -using System.Diagnostics; using System.IO; -using System.Security.Policy; using System.Windows; using System.Windows.Data; using System.Windows.Forms; diff --git a/Flow.Launcher/Settings.cs b/Flow.Launcher/Settings.cs index c5294b372..8f53c061f 100644 --- a/Flow.Launcher/Settings.cs +++ b/Flow.Launcher/Settings.cs @@ -1,6 +1,7 @@ -namespace Flow.Launcher.Properties { - - +namespace Flow.Launcher.Properties +{ + + // This class allows you to handle specific events on the settings class: // The SettingChanging event is raised before a setting's value is changed. // The PropertyChanged event is raised after a setting's value is changed. diff --git a/Flow.Launcher/Storage/UserSelectedRecord.cs b/Flow.Launcher/Storage/UserSelectedRecord.cs index 23d8c4faf..6afe1e91f 100644 --- a/Flow.Launcher/Storage/UserSelectedRecord.cs +++ b/Flow.Launcher/Storage/UserSelectedRecord.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Flow.Launcher.Infrastructure; -using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Plugin; -using Flow.Launcher.ViewModel; namespace Flow.Launcher.Storage { diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 27809f67b..0110a11d7 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -205,6 +205,15 @@ namespace Flow.Launcher.ViewModel } } + [RelayCommand] + private void ReQuery() + { + if (SelectedIsFromQueryResults()) + { + QueryResults(isReQuery: true); + } + } + [RelayCommand] private void LoadContextMenu() { @@ -495,8 +504,8 @@ namespace Flow.Launcher.ViewModel /// but we don't want to move cursor to end when query is updated from TextBox /// /// - /// Force query even when Query Text doesn't change - public void ChangeQueryText(string queryText, bool reQuery = false) + /// Force query even when Query Text doesn't change + public void ChangeQueryText(string queryText, bool isReQuery = false) { Application.Current.Dispatcher.Invoke(() => { @@ -510,9 +519,9 @@ namespace Flow.Launcher.ViewModel QueryTextCursorMovedToEnd = false; } - else if (reQuery) + else if (isReQuery) { - Query(); + Query(isReQuery: true); } QueryTextCursorMovedToEnd = true; }); @@ -612,11 +621,11 @@ namespace Flow.Launcher.ViewModel #region Query - public void Query() + public void Query(bool isReQuery = false) { if (SelectedIsFromQueryResults()) { - QueryResults(); + QueryResults(isReQuery); } else if (ContextMenuSelected()) { @@ -716,7 +725,7 @@ namespace Flow.Launcher.ViewModel private readonly IReadOnlyList _emptyResult = new List(); - private async void QueryResults() + private async void QueryResults(bool isReQuery = false) { _updateSource?.Cancel(); @@ -747,6 +756,8 @@ namespace Flow.Launcher.ViewModel if (currentCancellationToken.IsCancellationRequested) return; + // Update the query's IsReQuery property to true if this is a re-query + query.IsReQuery = isReQuery; // handle the exclusiveness of plugin using action keyword RemoveOldQueryResults(query); @@ -1103,50 +1114,6 @@ namespace Flow.Launcher.ViewModel Results.AddResults(resultsForUpdates, token); } - /// - /// This is the global copy method for an individual result. If no text is passed, - /// the method will work out what is to be copied based on the result, so plugin can offer the text - /// to be copied via the result model. If the text is a directory/file path, - /// then actual file/folder will be copied instead. - /// The result's subtitle text is the default text to be copied - /// - public void ResultCopy(string stringToCopy) - { - if (string.IsNullOrEmpty(stringToCopy)) - { - var result = Results.SelectedItem?.Result; - if (result != null) - { - string copyText = result.CopyText; - var isFile = File.Exists(copyText); - var isFolder = Directory.Exists(copyText); - if (isFile || isFolder) - { - var paths = new StringCollection - { - copyText - }; - - Clipboard.SetFileDropList(paths); - App.API.ShowMsg( - $"{App.API.GetTranslation("copy")} {(isFile ? App.API.GetTranslation("fileTitle") : App.API.GetTranslation("folderTitle"))}", - App.API.GetTranslation("completedSuccessfully")); - } - else - { - Clipboard.SetDataObject(copyText); - App.API.ShowMsg( - $"{App.API.GetTranslation("copy")} {App.API.GetTranslation("textTitle")}", - App.API.GetTranslation("completedSuccessfully")); - } - } - - return; - } - - Clipboard.SetDataObject(stringToCopy); - } - #endregion } } diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index 65ba657ba..d2919507d 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -1,5 +1,4 @@ -using System.Threading.Tasks; -using System.Windows; +using System.Windows; using System.Windows.Media; using Flow.Launcher.Plugin; using Flow.Launcher.Infrastructure.Image; diff --git a/Flow.Launcher/ViewModel/ResultsForUpdate.cs b/Flow.Launcher/ViewModel/ResultsForUpdate.cs index 94c6a923a..4cb5b1a95 100644 --- a/Flow.Launcher/ViewModel/ResultsForUpdate.cs +++ b/Flow.Launcher/ViewModel/ResultsForUpdate.cs @@ -1,7 +1,5 @@ using Flow.Launcher.Plugin; -using System; using System.Collections.Generic; -using System.Text; using System.Threading; namespace Flow.Launcher.ViewModel diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromeBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromeBookmarkLoader.cs index ec6f8423d..09755fe0c 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromeBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromeBookmarkLoader.cs @@ -2,8 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text.RegularExpressions; namespace Flow.Launcher.Plugin.BrowserBookmark { diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs index e20a476c5..c1efb5b5f 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs @@ -1,5 +1,4 @@ using Flow.Launcher.Plugin.BrowserBookmark.Models; -using Microsoft.AspNetCore.Authentication; using System.Collections.Generic; using System.IO; using System.Text.Json; diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/EdgeBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/EdgeBookmarkLoader.cs index 276f6368e..79190f0ef 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/EdgeBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/EdgeBookmarkLoader.cs @@ -2,9 +2,6 @@ using Flow.Launcher.Plugin.BrowserBookmark.Models; using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text.Json; -using System.Text.RegularExpressions; namespace Flow.Launcher.Plugin.BrowserBookmark { diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 25577d96b..5af3457c5 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -57,8 +57,6 @@ - - diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs index 2a94714fa..53dc6b528 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs @@ -4,11 +4,9 @@ using System.Linq; using System.Windows; using System.Windows.Controls; using Flow.Launcher.Infrastructure.Logger; -using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Plugin.BrowserBookmark.Commands; using Flow.Launcher.Plugin.BrowserBookmark.Models; using Flow.Launcher.Plugin.BrowserBookmark.Views; -using Flow.Launcher.Plugin.SharedCommands; using System.IO; using System.Threading.Channels; using System.Threading.Tasks; @@ -203,7 +201,7 @@ namespace Flow.Launcher.Plugin.BrowserBookmark { try { - Clipboard.SetDataObject(((BookmarkAttributes)selectedResult.ContextData).Url); + context.API.CopyToClipboard(((BookmarkAttributes)selectedResult.ContextData).Url); return true; } diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs index 17b794e03..dc1016b4e 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Text.Json.Serialization; +using System.Collections.ObjectModel; namespace Flow.Launcher.Plugin.BrowserBookmark.Models { diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs b/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs index ac0da1c6f..27bdf94ee 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs @@ -2,7 +2,7 @@ using Flow.Launcher.Core.Resource; namespace Flow.Launcher.Plugin.Caculator -{ +{ [TypeConverter(typeof(LocalizationConverter))] public enum DecimalSeparator { diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index d5dcdacea..e2aa5860c 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -95,7 +95,7 @@ namespace Flow.Launcher.Plugin.Caculator { try { - Clipboard.SetDataObject(newResult); + Context.API.CopyToClipboard(newResult); return true; } catch (ExternalException) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs b/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs index 528b21e4d..ed4aed75b 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; +using System.Globalization; using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; namespace Flow.Launcher.Plugin.Caculator { diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs index 9ee95e840..afe4d1c0c 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Flow.Launcher.Infrastructure.Storage; -using Flow.Launcher.Infrastructure.UserSettings; namespace Flow.Launcher.Plugin.Caculator.ViewModels { diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs index 807bdca00..1f15aceaa 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml.cs @@ -1,17 +1,5 @@ -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.Navigation; -using System.Windows.Shapes; using Flow.Launcher.Plugin.Caculator.ViewModels; namespace Flow.Launcher.Plugin.Caculator.Views diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index f5733bbb5..b4924a0fc 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -9,8 +9,6 @@ using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.Explorer.Search; using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; using System.Linq; -using System.Windows.Controls; -using System.Windows.Input; using MessageBox = System.Windows.Forms.MessageBox; using MessageBoxIcon = System.Windows.Forms.MessageBoxIcon; using MessageBoxButton = System.Windows.Forms.MessageBoxButtons; @@ -124,7 +122,7 @@ namespace Flow.Launcher.Plugin.Explorer { try { - Clipboard.SetText(record.FullPath); + Context.API.CopyToClipboard(record.FullPath); return true; } catch (Exception e) @@ -147,10 +145,7 @@ namespace Flow.Launcher.Plugin.Explorer { try { - Clipboard.SetFileDropList(new System.Collections.Specialized.StringCollection - { - record.FullPath - }); + Context.API.CopyToClipboard(record.FullPath, directCopy: true); return true; } catch (Exception e) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs index 3870c4876..abb76580d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs @@ -1,11 +1,9 @@ using System; -using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Drawing; using System.Windows.Forms; using System.IO; -using System.Security.Permissions; namespace Peter { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs index 82a5d5441..e4056131d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs @@ -79,7 +79,7 @@ namespace Flow.Launcher.Plugin.Explorer ? action : _ => { - Clipboard.SetDataObject(e.ToString()); + Context.API.CopyToClipboard(e.ToString()); return new ValueTask(true); } } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs index 2174aeee6..e7b43c555 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using System.Reflection; namespace Flow.Launcher.Plugin.Explorer.Search diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs index e618b5c36..6159c9355 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs @@ -2,14 +2,10 @@ using Flow.Launcher.Plugin.Explorer.Search.Everything.Exceptions; using System; using System.Collections.Generic; -using System.Linq; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; -using System.Windows.Forms.Design; -using Flow.Launcher.Plugin.Explorer.Exceptions; namespace Flow.Launcher.Plugin.Explorer.Search.Everything { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs index ce774281c..ef923632d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs @@ -4,7 +4,6 @@ using Microsoft.Win32; using System; using System.IO; using System.Linq; -using System.Threading; using System.Threading.Tasks; namespace Flow.Launcher.Plugin.Explorer.Search.Everything; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchOption.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchOption.cs index 0b1bbd0ec..3d930becf 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchOption.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchOption.cs @@ -1,5 +1,4 @@ -using System; -using Flow.Launcher.Plugin.Everything.Everything; +using Flow.Launcher.Plugin.Everything.Everything; namespace Flow.Launcher.Plugin.Explorer.Search.Everything { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/SortOption.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/SortOption.cs index c57e3fe4a..3c2fc3660 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/SortOption.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/SortOption.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Flow.Launcher.Plugin.Everything.Everything +namespace Flow.Launcher.Plugin.Everything.Everything { public enum SortOption : uint { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IContentIndexProvider.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IContentIndexProvider.cs index 6e036e058..7b8960b37 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IContentIndexProvider.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IContentIndexProvider.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; namespace Flow.Launcher.Plugin.Explorer.Search.IProvider diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IIndexProvider.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IIndexProvider.cs index d43dd7df3..9909b18d8 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IIndexProvider.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IIndexProvider.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; namespace Flow.Launcher.Plugin.Explorer.Search.IProvider diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IPathIndexProvider.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IPathIndexProvider.cs index 4622df5f9..56d735687 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IPathIndexProvider.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/IProvider/IPathIndexProvider.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; namespace Flow.Launcher.Plugin.Explorer.Search.IProvider diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 83c173ac6..a87f766a1 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -2,7 +2,6 @@ using Flow.Launcher.Infrastructure; using Flow.Launcher.Plugin.SharedCommands; using System; -using System.Diagnostics; using System.IO; using System.Linq; using System.Threading.Tasks; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchResult.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchResult.cs index 92c24559d..3cd97df82 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchResult.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchResult.cs @@ -1,5 +1,3 @@ -using System; - namespace Flow.Launcher.Plugin.Explorer.Search { public record struct SearchResult diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs index 87eca91da..a35bad274 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs @@ -1,5 +1,4 @@ using System; -using System.Buffers; using Microsoft.Search.Interop; namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs index 2093508a0..8aca5929d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndex.cs @@ -8,7 +8,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Threading; -using System.Threading.Tasks; using Flow.Launcher.Plugin.Explorer.Exceptions; namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 4077e2fcc..137ba2f19 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -4,10 +4,8 @@ using Flow.Launcher.Plugin.Explorer.Search.Everything; using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; using Flow.Launcher.Plugin.Explorer.Search.WindowsIndex; using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; -using System.Linq; using System.Text.Json.Serialization; using Flow.Launcher.Plugin.Explorer.Search.IProvider; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/EnumBindingModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/EnumBindingModel.cs index 29c81a465..13971914b 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/EnumBindingModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/EnumBindingModel.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; namespace Flow.Launcher.Plugin.Explorer.ViewModels; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index 189434eea..02199fb5a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -6,7 +6,6 @@ using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; using Flow.Launcher.Plugin.Explorer.Views; using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs index 6ee4faad8..9e86ce4b4 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs @@ -1,9 +1,5 @@ -using Flow.Launcher.Plugin.Explorer.ViewModels; -using ICSharpCode.SharpZipLib.Zip; -using System; using System.Collections.Generic; using System.ComponentModel; -using System.Linq; using System.Runtime.CompilerServices; using System.Windows; using System.Windows.Input; diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs index 73627592a..580954f3c 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs @@ -1,6 +1,4 @@ using Flow.Launcher.Core.ExternalPlugins; -using Flow.Launcher.Infrastructure.UserSettings; -using System; using System.Collections.Generic; using System.Text.RegularExpressions; diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs index bf62caee8..cd554e4d0 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Main.cs @@ -1,14 +1,11 @@ -using Flow.Launcher.Infrastructure.Storage; -using Flow.Launcher.Plugin.PluginsManager.ViewModels; +using Flow.Launcher.Plugin.PluginsManager.ViewModels; using Flow.Launcher.Plugin.PluginsManager.Views; using System.Collections.Generic; using System.Linq; using System.Windows.Controls; using Flow.Launcher.Infrastructure; -using System; using System.Threading.Tasks; using System.Threading; -using System.Windows; namespace Flow.Launcher.Plugin.PluginsManager { diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs index 6fd4e51ac..aa35f02b5 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Settings.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Flow.Launcher.Plugin.PluginsManager +namespace Flow.Launcher.Plugin.PluginsManager { internal class Settings { diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs index 2853ffc9e..792891ad1 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs @@ -1,7 +1,5 @@ -using Flow.Launcher.Infrastructure.Http; -using ICSharpCode.SharpZipLib.Zip; +using ICSharpCode.SharpZipLib.Zip; using System.IO; -using System.Net; namespace Flow.Launcher.Plugin.PluginsManager { diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/ViewModels/SettingsViewModel.cs index 11303f472..672884f80 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/ViewModels/SettingsViewModel.cs @@ -1,7 +1,4 @@ -using Flow.Launcher.Infrastructure.Storage; -using Flow.Launcher.Infrastructure.UserSettings; - -namespace Flow.Launcher.Plugin.PluginsManager.ViewModels +namespace Flow.Launcher.Plugin.PluginsManager.ViewModels { internal class SettingsViewModel { diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs index 3eff7e398..be2a2dd66 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs @@ -1,7 +1,6 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Flow.Launcher.Infrastructure; -using System.Threading.Tasks; namespace Flow.Launcher.Plugin.ProcessKiller { @@ -89,7 +88,8 @@ namespace Flow.Launcher.Plugin.ProcessKiller Action = (c) => { processHelper.TryKill(p); - _ = DelayAndReQueryAsync(query.RawQuery); // Re-query after killing process to refresh process list + // Re-query to refresh process list + _context.API.ChangeQuery(query.RawQuery, true); return true; } }); @@ -114,7 +114,8 @@ namespace Flow.Launcher.Plugin.ProcessKiller { processHelper.TryKill(p.Process); } - _ = DelayAndReQueryAsync(query.RawQuery); // Re-query after killing process to refresh process list + // Re-query to refresh process list + _context.API.ChangeQuery(query.RawQuery, true); return true; } }); @@ -122,11 +123,5 @@ namespace Flow.Launcher.Plugin.ProcessKiller return sortedResults; } - - private static async Task DelayAndReQueryAsync(string query) - { - await Task.Delay(500); - _context.API.ChangeQuery(query, true); - } } } diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessHelper.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessHelper.cs index 0932955d6..0acc39fbb 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/ProcessHelper.cs @@ -1,4 +1,4 @@ -using Flow.Launcher.Infrastructure; +using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.Logger; using System; using System.Collections.Generic; @@ -75,6 +75,7 @@ namespace Flow.Launcher.Plugin.ProcessKiller if (!p.HasExited) { p.Kill(); + p.WaitForExit(50); } } catch (Exception e) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj b/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj index 02555cf1f..e9c680824 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj +++ b/Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj @@ -59,7 +59,6 @@ - \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index 340d882da..ac23534b1 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -88,21 +88,24 @@ namespace Flow.Launcher.Plugin.Program bool cacheEmpty = !_win32s.Any() && !_uwps.Any(); - var a = Task.Run(() => + if (cacheEmpty || _settings.LastIndexTime.AddHours(30) < DateTime.Now) { - Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Win32Program index cost", IndexWin32Programs); - }); - - var b = Task.Run(() => + _ = Task.Run(async () => + { + await IndexProgramsAsync().ConfigureAwait(false); + WatchProgramUpdate(); + }); + } + else { - Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|UWPPRogram index cost", IndexUwpPrograms); - }); + WatchProgramUpdate(); + } - if (cacheEmpty) - await Task.WhenAll(a, b); - - Win32.WatchProgramUpdate(_settings); - _ = UWP.WatchPackageChange(); + static void WatchProgramUpdate() + { + Win32.WatchProgramUpdate(_settings); + _ = UWP.WatchPackageChange(); + } } public static void IndexWin32Programs() @@ -110,6 +113,8 @@ namespace Flow.Launcher.Plugin.Program var win32S = Win32.All(_settings); _win32s = win32S; ResetCache(); + _win32Storage.Save(_win32s); + _settings.LastIndexTime = DateTime.Now; } public static void IndexUwpPrograms() @@ -117,6 +122,8 @@ namespace Flow.Launcher.Plugin.Program var applications = UWP.All(_settings); _uwps = applications; ResetCache(); + _uwpStorage.Save(_uwps); + _settings.LastIndexTime = DateTime.Now; } public static async Task IndexProgramsAsync() @@ -131,7 +138,6 @@ namespace Flow.Launcher.Plugin.Program Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|UWPProgram index cost", IndexUwpPrograms); }); await Task.WhenAll(a, b).ConfigureAwait(false); - _settings.LastIndexTime = DateTime.Today; } internal static void ResetCache() @@ -199,7 +205,6 @@ namespace Flow.Launcher.Plugin.Program _ = Task.Run(() => { IndexUwpPrograms(); - _settings.LastIndexTime = DateTime.Today; }); } else if (_win32s.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)) @@ -210,7 +215,6 @@ namespace Flow.Launcher.Plugin.Program _ = Task.Run(() => { IndexWin32Programs(); - _settings.LastIndexTime = DateTime.Today; }); } } diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index afde1ba1e..f3a26dca6 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Threading.Tasks; diff --git a/Plugins/Flow.Launcher.Plugin.Program/Settings.cs b/Plugins/Flow.Launcher.Plugin.Program/Settings.cs index f59facaa4..ca203f803 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Settings.cs @@ -121,13 +121,6 @@ namespace Flow.Launcher.Plugin.Program public bool EnablePathSource { get; set; } = false; public bool EnableUWP { get; set; } = true; - public string CustomizedExplorer { get; set; } = Explorer; - public string CustomizedArgs { get; set; } = ExplorerArgs; - internal const char SuffixSeparator = ';'; - - internal const string Explorer = "explorer"; - - internal const string ExplorerArgs = "%s"; } } diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/Models/ProgramSource.cs b/Plugins/Flow.Launcher.Plugin.Program/Views/Models/ProgramSource.cs index 93c33e9ad..0dc080c8d 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/Models/ProgramSource.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/Models/ProgramSource.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using System.Text.Json.Serialization; using Flow.Launcher.Plugin.Program.Programs; diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs index 4b63d38a5..156f33ebc 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs @@ -87,18 +87,6 @@ namespace Flow.Launcher.Plugin.Program.Views } } - public string CustomizedExplorerPath - { - get => _settings.CustomizedExplorer; - set => _settings.CustomizedExplorer = value; - } - - public string CustomizedExplorerArg - { - get => _settings.CustomizedArgs; - set => _settings.CustomizedArgs = value; - } - public bool ShowUWPCheckbox => UWP.SupportUWP(); public ProgramSetting(PluginInitContext context, Settings settings, Win32[] win32s, UWP.Application[] uwps) diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs index f64f5d376..24d263578 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs @@ -10,9 +10,7 @@ using WindowsInput; using WindowsInput.Native; using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Infrastructure.Logger; -using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Plugin.SharedCommands; -using Application = System.Windows.Application; using Control = System.Windows.Controls.Control; using Keys = System.Windows.Forms.Keys; @@ -84,7 +82,8 @@ namespace Flow.Launcher.Plugin.Shell Execute(Process.Start, PrepareProcessStartInfo(m, runAsAdministrator)); return true; - } + }, + CopyText = m })); } } @@ -123,7 +122,8 @@ namespace Flow.Launcher.Plugin.Shell Execute(Process.Start, PrepareProcessStartInfo(m.Key, runAsAdministrator)); return true; - } + }, + CopyText = m.Key }; return ret; }).Where(o => o != null); @@ -152,7 +152,8 @@ namespace Flow.Launcher.Plugin.Shell Execute(Process.Start, PrepareProcessStartInfo(cmd, runAsAdministrator)); return true; - } + }, + CopyText = cmd }; return result; @@ -176,7 +177,8 @@ namespace Flow.Launcher.Plugin.Shell Execute(Process.Start, PrepareProcessStartInfo(m.Key, runAsAdministrator)); return true; - } + }, + CopyText = m.Key }); if (_settings.ShowOnlyMostUsedCMDs) @@ -406,7 +408,7 @@ namespace Flow.Launcher.Plugin.Shell Title = context.API.GetTranslation("flowlauncher_plugin_cmd_copy"), Action = c => { - Clipboard.SetDataObject(selectedResult.Title); + context.API.CopyToClipboard(selectedResult.Title); return true; }, IcoPath = "Images/copy.png", diff --git a/Plugins/Flow.Launcher.Plugin.Url/Main.cs b/Plugins/Flow.Launcher.Plugin.Url/Main.cs index 4831bac1d..80425a8ff 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Url/Main.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.Text.RegularExpressions; using System.Windows.Controls; -using Flow.Launcher.Infrastructure.Storage; -using Flow.Launcher.Plugin.SharedCommands; namespace Flow.Launcher.Plugin.Url { diff --git a/Plugins/Flow.Launcher.Plugin.Url/Settings.cs b/Plugins/Flow.Launcher.Plugin.Url/Settings.cs index 7ac4c371d..a8d89e27f 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Url/Settings.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Flow.Launcher.Plugin.Url +namespace Flow.Launcher.Plugin.Url { public class Settings { diff --git a/Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml.cs b/Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml.cs index dce13c522..f68d1bb2d 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Controls; +using System.Windows.Controls; namespace Flow.Launcher.Plugin.Url { diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs index 179745e2d..39aa1738f 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs @@ -1,14 +1,11 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; -using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; using System.Windows.Controls; using Flow.Launcher.Infrastructure; -using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin.SharedCommands; diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs index e489cb19f..9eedd29a3 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs @@ -1,9 +1,5 @@ using System.IO; -using System.Windows.Media; using JetBrains.Annotations; -using Flow.Launcher.Infrastructure.Image; -using Flow.Launcher.Infrastructure; -using System.Reflection; using System.Text.Json.Serialization; namespace Flow.Launcher.Plugin.WebSearch diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceViewModel.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceViewModel.cs index 1b42bf788..105e7dd68 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceViewModel.cs @@ -1,9 +1,10 @@ using Flow.Launcher.Infrastructure.Image; using System; -using System.Drawing; using System.IO; using System.Threading.Tasks; +#pragma warning disable IDE0005 using System.Windows; +#pragma warning restore IDE0005 using System.Windows.Media; namespace Flow.Launcher.Plugin.WebSearch diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs index 44f717c4b..7caa5beb3 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs @@ -1,4 +1,3 @@ -using Microsoft.Win32; using System.Windows; using System.Windows.Controls; using Flow.Launcher.Core.Plugin; diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs index 40379b1ed..51f81b718 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Net; using System.Text.Json; using System.Text.RegularExpressions; using System.Threading.Tasks; diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs index b8ad9a586..640674243 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs @@ -2,10 +2,7 @@ using Flow.Launcher.Infrastructure.Logger; using System; using System.Collections.Generic; -using System.IO; using System.Net.Http; -using System.Text; -using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Text.Json; using System.Linq; diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs index 567e896b5..265de4a98 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs @@ -1,14 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Net; using System.Threading.Tasks; using Flow.Launcher.Infrastructure.Http; using Flow.Launcher.Infrastructure.Logger; using System.Net.Http; using System.Threading; using System.Text.Json; -using System.IO; namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources { diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ContextMenuHelper.cs b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ContextMenuHelper.cs index e123e2d2f..32e5256e3 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ContextMenuHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ContextMenuHelper.cs @@ -1,9 +1,6 @@ using System; using System.Collections.Generic; using System.Windows; -using Flow.Launcher.Plugin; -using Flow.Launcher.Plugin.WindowsSettings.Classes; -using Flow.Launcher.Plugin.WindowsSettings.Properties; namespace Flow.Launcher.Plugin.WindowsSettings.Helper { @@ -22,26 +19,6 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper internal static List GetContextMenu(in Result result, in string assemblyName) { return new List(0); - } - - /// - /// Copy the given text to the clipboard - /// - /// The text to copy to the clipboard - /// The text successful copy to the clipboard, otherwise - private static bool TryToCopyToClipBoard(in string text) - { - try - { - Clipboard.Clear(); - Clipboard.SetText(text); - return true; - } - catch (Exception exception) - { - Log.Exception("Can't copy to clipboard", exception, typeof(Main)); - return false; - } - } + } } } diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ResultHelper.cs b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ResultHelper.cs index 0bfb00b34..9e85a8580 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ResultHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ResultHelper.cs @@ -1,9 +1,9 @@ using System; +using System.ComponentModel; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; -using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.WindowsSettings.Classes; using Flow.Launcher.Plugin.WindowsSettings.Properties; @@ -201,6 +201,21 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper Process.Start(processStartInfo); return true; } + catch (Win32Exception) + { + try + { + processStartInfo.UseShellExecute = true; + processStartInfo.Verb = "runas"; + Process.Start(processStartInfo); + return true; + } + catch (Exception exception) + { + Log.Exception("can't open settings on elevated permission", exception, typeof(ResultHelper)); + return false; + } + } catch (Exception exception) { Log.Exception("can't open settings", exception, typeof(ResultHelper)); diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/TranslationHelper.cs b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/TranslationHelper.cs index 327d70296..52b07e8d9 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/TranslationHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/TranslationHelper.cs @@ -1,6 +1,4 @@ using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Globalization; using System.Linq; using Flow.Launcher.Plugin.WindowsSettings.Classes; using Flow.Launcher.Plugin.WindowsSettings.Properties; diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Log.cs b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Log.cs index 2f6324767..257b0fa8b 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Log.cs +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Log.cs @@ -1,6 +1,5 @@ using System; using System.Runtime.CompilerServices; -using Flow.Launcher.Plugin; namespace Flow.Launcher.Plugin.WindowsSettings { diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Main.cs b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Main.cs index cbcca03ae..ce8709171 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Main.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Globalization; using System.Reflection; -using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.WindowsSettings.Classes; using Flow.Launcher.Plugin.WindowsSettings.Helper; using Flow.Launcher.Plugin.WindowsSettings.Properties; diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 23eabedfd..1757ed99e 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -71,7 +71,6 @@ function Pack-Squirrel-Installer ($path, $version, $output) { Write-Host "Packing: $spec" Write-Host "Input path: $input" - New-Alias Nuget $env:USERPROFILE\.nuget\packages\NuGet.CommandLine\6.3.1\tools\NuGet.exe -Force # dotnet pack is not used because ran into issues, need to test installation and starting up if to use it. nuget pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release diff --git a/appveyor.yml b/appveyor.yml index a3cc8ecfb..2068cd67b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -51,7 +51,7 @@ deploy: - provider: NuGet artifact: Plugin nupkg api_key: - secure: EwKxUgjI8VGouFq9fdhI68+uj42amAhwE65JixIbqx8VlqLbyEuW97CLjBBOIL0r + secure: Uho7u3gk4RHzyWGgqgXZuOeI55NbqHLQ9tXahL7xmE4av2oiSldrNiyGgy/0AQYw on: APPVEYOR_REPO_TAG: true