Skip to content

Commit 3facf3f

Browse files
committed
Add Uninstall Button
1 parent 792b383 commit 3facf3f

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
<system:String x:Key="plugin_query_time">Query time:</system:String>
7878
<system:String x:Key="plugin_query_version">| Version</system:String>
7979
<system:String x:Key="plugin_query_web">Website</system:String>
80+
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
8081

8182

8283
<!-- Setting Plugin Store -->

Flow.Launcher/SettingWindow.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,17 @@
12031203
</Hyperlink>
12041204
</TextBlock>
12051205

1206+
<TextBlock
1207+
Margin="10,0,0,0"
1208+
HorizontalAlignment="Right"
1209+
VerticalAlignment="Center"
1210+
Cursor="Hand"
1211+
FontSize="11"
1212+
Foreground="{DynamicResource PluginInfoColor}"
1213+
MouseUp="OnExternalPluginUninstallClick"
1214+
Text="{DynamicResource plugin_uninstall}"
1215+
TextDecorations="Underline" />
1216+
12061217
<TextBlock
12071218
Margin="10,0,0,0"
12081219
HorizontalAlignment="Right"

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Flow.Launcher.Core.ExternalPlugins;
1+
using Droplex;
2+
using Flow.Launcher.Core.ExternalPlugins;
23
using Flow.Launcher.Core.Plugin;
34
using Flow.Launcher.Core.Resource;
45
using Flow.Launcher.Helper;
@@ -348,5 +349,17 @@ private void ItemSizeChanged(object sender, SizeChangedEventArgs e)
348349
{
349350
Plugins.ScrollIntoView(Plugins.SelectedItem);
350351
}
352+
353+
private void OnExternalPluginUninstallClick(object sender, MouseButtonEventArgs e)
354+
{
355+
if (e.ChangedButton == MouseButton.Left)
356+
{
357+
var id = viewModel.SelectedPlugin.PluginPair.Metadata.Name;
358+
var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7");
359+
var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0];
360+
API.ChangeQuery($"{actionKeyword} uninstall {id}");
361+
API.ShowMainWindow();
362+
}
363+
}
351364
}
352365
}

0 commit comments

Comments
 (0)