Skip to content

Commit 84e0193

Browse files
authored
Merge branch 'dev' into improve_update
2 parents 3786130 + 8e6eaf7 commit 84e0193

File tree

69 files changed

+538
-409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+538
-409
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,14 @@ public static ICollection<PluginPair> ValidPluginsForQuery(Query query)
290290
return Array.Empty<PluginPair>();
291291

292292
if (!NonGlobalPlugins.TryGetValue(query.ActionKeyword, out var plugin))
293-
return GlobalPlugins;
293+
{
294+
return GlobalPlugins.Where(p => !PluginModified(p.Metadata.ID)).ToList();
295+
}
296+
297+
if (API.PluginModified(plugin.Metadata.ID))
298+
{
299+
return Array.Empty<PluginPair>();
300+
}
294301

295302
return new List<PluginPair>
296303
{
@@ -300,7 +307,7 @@ public static ICollection<PluginPair> ValidPluginsForQuery(Query query)
300307

301308
public static ICollection<PluginPair> ValidPluginsForHomeQuery()
302309
{
303-
return _homePlugins.ToList();
310+
return _homePlugins.Where(p => !PluginModified(p.Metadata.ID)).ToList();
304311
}
305312

306313
public static async Task<List<Result>> QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token)
@@ -552,9 +559,9 @@ public static void InstallPlugin(UserPlugin plugin, string zipFilePath)
552559
InstallPlugin(plugin, zipFilePath, checkModified: true);
553560
}
554561

555-
public static async Task UninstallPluginAsync(PluginMetadata plugin, bool removePluginFromSettings = true, bool removePluginSettings = false)
562+
public static async Task UninstallPluginAsync(PluginMetadata plugin, bool removePluginSettings = false)
556563
{
557-
await UninstallPluginAsync(plugin, removePluginFromSettings, removePluginSettings, true);
564+
await UninstallPluginAsync(plugin, removePluginFromSettings: true, removePluginSettings: removePluginSettings, checkModified: true);
558565
}
559566

560567
#endregion

Flow.Launcher.Plugin/EventHandler.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ namespace Flow.Launcher.Plugin
3939
/// <param name="sender"></param>
4040
/// <param name="args"></param>
4141
public delegate void VisibilityChangedEventHandler(object sender, VisibilityChangedEventArgs args);
42-
42+
43+
/// <summary>
44+
/// A delegate for when the actual application theme is changed
45+
/// </summary>
46+
/// <param name="sender"></param>
47+
/// <param name="args"></param>
48+
public delegate void ActualApplicationThemeChangedEventHandler(object sender, ActualApplicationThemeChangedEventArgs args);
49+
4350
/// <summary>
4451
/// The event args for <see cref="VisibilityChangedEventHandler"/>
4552
/// </summary>
@@ -77,4 +84,15 @@ public class FlowLauncherQueryEventArgs
7784
/// </summary>
7885
public Query Query { get; set; }
7986
}
87+
88+
/// <summary>
89+
/// The event args for <see cref="ActualApplicationThemeChangedEventHandler"/>
90+
/// </summary>
91+
public class ActualApplicationThemeChangedEventArgs : EventArgs
92+
{
93+
/// <summary>
94+
/// <see langword="true"/> if the application has changed actual theme
95+
/// </summary>
96+
public bool IsDark { get; init; }
97+
}
8098
}

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,5 +595,16 @@ public interface IPublicAPI
595595
/// </summary>
596596
/// <returns>The time taken to execute the method in milliseconds</returns>
597597
public Task<long> StopwatchLogInfoAsync(string className, string message, Func<Task> action, [CallerMemberName] string methodName = "");
598+
599+
/// <summary>
600+
/// Representing whether the application is using a dark theme
601+
/// </summary>
602+
/// <returns></returns>
603+
bool IsApplicationDarkTheme();
604+
605+
/// <summary>
606+
/// Invoked when the actual theme of the application has changed. Currently, the plugin will continue to be subscribed even if it is turned off.
607+
/// </summary>
608+
event ActualApplicationThemeChangedEventHandler ActualApplicationThemeChanged;
598609
}
599610
}

Flow.Launcher/Languages/ar.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@
136136
<system:String x:Key="historyResultsForHomePage">Show History Results in Home Page</system:String>
137137
<system:String x:Key="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
138138
<system:String x:Key="homeToggleBoxToolTip">This can only be edited if plugin supports Home feature and Home Page is enabled.</system:String>
139-
<system:String x:Key="showAtTopmost">Show Search Window at Topmost</system:String>
140-
<system:String x:Key="showAtTopmostToolTip">Show search window above other windows</system:String>
139+
<system:String x:Key="showAtTopmost">Show Search Window at Foremost</system:String>
140+
<system:String x:Key="showAtTopmostToolTip">Overrides other programs' 'Always on Top' setting and displays Flow in the foremost position.</system:String>
141141

142142
<!-- Setting Plugin -->
143143
<system:String x:Key="searchplugin">البحث عن إضافة</system:String>

Flow.Launcher/Languages/cs.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@
136136
<system:String x:Key="historyResultsForHomePage">Show History Results in Home Page</system:String>
137137
<system:String x:Key="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
138138
<system:String x:Key="homeToggleBoxToolTip">This can only be edited if plugin supports Home feature and Home Page is enabled.</system:String>
139-
<system:String x:Key="showAtTopmost">Show Search Window at Topmost</system:String>
140-
<system:String x:Key="showAtTopmostToolTip">Show search window above other windows</system:String>
139+
<system:String x:Key="showAtTopmost">Show Search Window at Foremost</system:String>
140+
<system:String x:Key="showAtTopmostToolTip">Overrides other programs' 'Always on Top' setting and displays Flow in the foremost position.</system:String>
141141

142142
<!-- Setting Plugin -->
143143
<system:String x:Key="searchplugin">Vyhledat plugin</system:String>

Flow.Launcher/Languages/da.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@
136136
<system:String x:Key="historyResultsForHomePage">Show History Results in Home Page</system:String>
137137
<system:String x:Key="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
138138
<system:String x:Key="homeToggleBoxToolTip">This can only be edited if plugin supports Home feature and Home Page is enabled.</system:String>
139-
<system:String x:Key="showAtTopmost">Show Search Window at Topmost</system:String>
140-
<system:String x:Key="showAtTopmostToolTip">Show search window above other windows</system:String>
139+
<system:String x:Key="showAtTopmost">Show Search Window at Foremost</system:String>
140+
<system:String x:Key="showAtTopmostToolTip">Overrides other programs' 'Always on Top' setting and displays Flow in the foremost position.</system:String>
141141

142142
<!-- Setting Plugin -->
143143
<system:String x:Key="searchplugin">Search Plugin</system:String>

0 commit comments

Comments
 (0)