Skip to content

Commit 6a37074

Browse files
authored
Merge pull request #1419 from onesounds/PluginUninstallButton
Add Uninstall Button
2 parents 1546f63 + bb941e6 commit 6a37074

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
@@ -79,6 +79,7 @@
7979
<system:String x:Key="plugin_query_time">Query time:</system:String>
8080
<system:String x:Key="plugin_query_version">| Version</system:String>
8181
<system:String x:Key="plugin_query_web">Website</system:String>
82+
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
8283

8384

8485
<!-- Setting Plugin Store -->

Flow.Launcher/SettingWindow.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,17 @@
12071207
</Hyperlink>
12081208
</TextBlock>
12091209

1210+
<TextBlock
1211+
Margin="10,0,0,0"
1212+
HorizontalAlignment="Right"
1213+
VerticalAlignment="Center"
1214+
Cursor="Hand"
1215+
FontSize="11"
1216+
Foreground="{DynamicResource PluginInfoColor}"
1217+
MouseUp="OnExternalPluginUninstallClick"
1218+
Text="{DynamicResource plugin_uninstall}"
1219+
TextDecorations="Underline" />
1220+
12101221
<TextBlock
12111222
Margin="10,0,0,0"
12121223
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)