diff --git a/Flow.Launcher/PriorityChangeWindow.xaml.cs b/Flow.Launcher/PriorityChangeWindow.xaml.cs index fe846e78b..e2fe46adc 100644 --- a/Flow.Launcher/PriorityChangeWindow.xaml.cs +++ b/Flow.Launcher/PriorityChangeWindow.xaml.cs @@ -1,6 +1,5 @@ using Flow.Launcher.Core.Plugin; using Flow.Launcher.Core.Resource; -using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.ViewModel; using System; @@ -23,14 +22,12 @@ namespace Flow.Launcher public partial class PriorityChangeWindow : Window { private readonly PluginPair plugin; - private Settings settings; private readonly Internationalization translater = InternationalizationManager.Instance; private readonly PluginViewModel pluginViewModel; - public PriorityChangeWindow(string pluginId, Settings settings, PluginViewModel pluginViewModel) + public PriorityChangeWindow(string pluginId, PluginViewModel pluginViewModel) { InitializeComponent(); plugin = PluginManager.GetPluginForId(pluginId); - this.settings = settings; this.pluginViewModel = pluginViewModel; if (plugin == null) { @@ -74,4 +71,4 @@ namespace Flow.Launcher } } } -} \ No newline at end of file +} diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 46b198a4e..94b542e2f 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1355,9 +1355,14 @@ Cursor="Hand" FontSize="11" Foreground="{DynamicResource PluginInfoColor}" - MouseUp="OnPluginDirecotyClick" Text="{DynamicResource pluginDirectory}" - TextDecorations="Underline" /> + TextDecorations="Underline" > + + + + diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 5edaeb7e3..5c06e02e2 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -189,7 +189,7 @@ namespace Flow.Launcher { if (sender is Control { DataContext: PluginViewModel pluginViewModel }) { - PriorityChangeWindow priorityChangeWindow = new PriorityChangeWindow(pluginViewModel.PluginPair.Metadata.ID, settings, pluginViewModel); + PriorityChangeWindow priorityChangeWindow = new PriorityChangeWindow(pluginViewModel.PluginPair.Metadata.ID, pluginViewModel); priorityChangeWindow.ShowDialog(); } } @@ -328,8 +328,6 @@ namespace Flow.Launcher var name = viewModel.SelectedPlugin.PluginPair.Metadata.Name; viewModel.DisplayPluginQuery($"uninstall {name}", PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7")); } - - } private void OnExternalPluginUninstallClick(object sender, RoutedEventArgs e) diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index f8143b61e..9871ceb93 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -54,7 +54,7 @@ namespace Flow.Launcher.ViewModel set { _isExpanded = value; - + OnPropertyChanged(); OnPropertyChanged(nameof(SettingControl)); } @@ -62,12 +62,12 @@ namespace Flow.Launcher.ViewModel private Control _settingControl; private bool _isExpanded; - public Control SettingControl + public Control SettingControl => IsExpanded ? _settingControl ??= PluginPair.Plugin is not ISettingProvider settingProvider - ? new Control() - : settingProvider.CreateSettingPanel() + ? new Control() + : settingProvider.CreateSettingPanel() : null; private ImageSource _image = ImageLoader.DefaultImage; @@ -89,6 +89,21 @@ namespace Flow.Launcher.ViewModel OnPropertyChanged(nameof(Priority)); } + [RelayCommand] + private void EditPluginPriority() + { + PriorityChangeWindow priorityChangeWindow = new PriorityChangeWindow(PluginPair.Metadata.ID, this); + priorityChangeWindow.ShowDialog(); + } + + [RelayCommand] + private void OpenPluginDirectory() + { + var directory = PluginPair.Metadata.PluginDirectory; + if (!string.IsNullOrEmpty(directory)) + PluginManager.API.OpenDirectory(directory); + } + public static bool IsActionKeywordRegistered(string newActionKeyword) => PluginManager.ActionKeywordRegistered(newActionKeyword); [RelayCommand] diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index f63a5e5bf..a97a328e6 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -356,6 +356,8 @@ namespace Flow.Launcher.ViewModel await PluginsManifest.UpdateManifestAsync(); OnPropertyChanged(nameof(ExternalPlugins)); } + + internal void DisplayPluginQuery(string queryToDisplay, PluginPair plugin, int actionKeywordPosition = 0) {