mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #1419 from onesounds/PluginUninstallButton
Add Uninstall Button
This commit is contained in:
commit
6a3707473a
3 changed files with 26 additions and 1 deletions
|
|
@ -79,6 +79,7 @@
|
|||
<system:String x:Key="plugin_query_time">Query time:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
|
|
|
|||
|
|
@ -1207,6 +1207,17 @@
|
|||
</Hyperlink>
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Cursor="Hand"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource PluginInfoColor}"
|
||||
MouseUp="OnExternalPluginUninstallClick"
|
||||
Text="{DynamicResource plugin_uninstall}"
|
||||
TextDecorations="Underline" />
|
||||
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Flow.Launcher.Core.ExternalPlugins;
|
||||
using Droplex;
|
||||
using Flow.Launcher.Core.ExternalPlugins;
|
||||
using Flow.Launcher.Core.Plugin;
|
||||
using Flow.Launcher.Core.Resource;
|
||||
using Flow.Launcher.Helper;
|
||||
|
|
@ -348,5 +349,17 @@ namespace Flow.Launcher
|
|||
{
|
||||
Plugins.ScrollIntoView(Plugins.SelectedItem);
|
||||
}
|
||||
|
||||
private void OnExternalPluginUninstallClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
var id = viewModel.SelectedPlugin.PluginPair.Metadata.Name;
|
||||
var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7");
|
||||
var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0];
|
||||
API.ChangeQuery($"{actionKeyword} uninstall {id}");
|
||||
API.ShowMainWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue