Skip to content

Commit 8ebdff0

Browse files
authored
Merge branch 'dev' into Shortcut
2 parents d60ba01 + c3d7691 commit 8ebdff0

File tree

21 files changed

+262
-202
lines changed

21 files changed

+262
-202
lines changed

.github/workflows/stale.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# For more information, see:
2+
# https://github.com/actions/stale
3+
name: Mark stale issues and pull requests
4+
5+
on:
6+
schedule:
7+
- cron: '30 1 * * *'
8+
9+
jobs:
10+
stale:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/stale@v4
17+
with:
18+
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
19+
days-before-stale: 30
20+
days-before-close: 5
21+
days-before-pr-close: -1
22+
exempt-all-milestones: true
23+
close-issue-message: 'This issue was closed because it has been stale for 5 days with no activity. If you feel this issue still needs attention please feel free to reopen.'

Flow.Launcher.Core/Flow.Launcher.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
</ItemGroup>
5454

5555
<ItemGroup>
56-
<PackageReference Include="Droplex" Version="1.4.0" />
56+
<PackageReference Include="Droplex" Version="1.4.1" />
5757
<PackageReference Include="FSharp.Core" Version="5.0.2" />
5858
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.1.3" />
5959
<PackageReference Include="squirrel.windows" Version="1.5.2" />

Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,6 @@ internal class PluginAssemblyLoader : AssemblyLoadContext
1515

1616
private readonly AssemblyName assemblyName;
1717

18-
private static readonly ConcurrentDictionary<string, byte> loadedAssembly;
19-
20-
static PluginAssemblyLoader()
21-
{
22-
var currentAssemblies = AppDomain.CurrentDomain.GetAssemblies();
23-
loadedAssembly = new ConcurrentDictionary<string, byte>(
24-
currentAssemblies.Select(x => new KeyValuePair<string, byte>(x.FullName, default)));
25-
26-
AppDomain.CurrentDomain.AssemblyLoad += (sender, args) =>
27-
{
28-
loadedAssembly[args.LoadedAssembly.FullName] = default;
29-
};
30-
}
31-
3218
internal PluginAssemblyLoader(string assemblyFilePath)
3319
{
3420
dependencyResolver = new AssemblyDependencyResolver(assemblyFilePath);
@@ -47,21 +33,15 @@ protected override Assembly Load(AssemblyName assemblyName)
4733
// When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher
4834
// Otherwise duplicate assembly will be loaded and some weird behavior will occur, such as WinRT.Runtime.dll
4935
// will fail due to loading multiple versions in process, each with their own static instance of registration state
50-
if (assemblyPath == null || ExistsInReferencedPackage(assemblyName))
51-
return null;
36+
var existAssembly = Default.Assemblies.FirstOrDefault(x => x.FullName == assemblyName.FullName);
5237

53-
return LoadFromAssemblyPath(assemblyPath);
38+
return existAssembly ?? (assemblyPath == null ? null : LoadFromAssemblyPath(assemblyPath));
5439
}
5540

5641
internal Type FromAssemblyGetTypeOfInterface(Assembly assembly, Type type)
5742
{
5843
var allTypes = assembly.ExportedTypes;
5944
return allTypes.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Any(t => t == type));
6045
}
61-
62-
internal bool ExistsInReferencedPackage(AssemblyName assemblyName)
63-
{
64-
return loadedAssembly.ContainsKey(assemblyName.FullName);
65-
}
6646
}
6747
}

Flow.Launcher.Core/Resource/AvailableLanguages.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ internal static class AvailableLanguages
1919
public static Language Serbian = new Language("sr", "Srpski");
2020
public static Language Portuguese_Portugal = new Language("pt-pt", "Português");
2121
public static Language Portuguese_Brazil = new Language("pt-br", "Português (Brasil)");
22+
public static Language Spanish = new Language("es", "Spanish");
23+
public static Language Spanish_LatinAmerica = new Language("es-419", "Spanish (Latin America)");
2224
public static Language Italian = new Language("it", "Italiano");
2325
public static Language Norwegian_Bokmal = new Language("nb-NO", "Norsk Bokmål");
2426
public static Language Slovak = new Language("sk", "Slovenský");
@@ -43,6 +45,8 @@ public static List<Language> GetAvailableLanguages()
4345
Serbian,
4446
Portuguese_Portugal,
4547
Portuguese_Brazil,
48+
Spanish,
49+
Spanish_LatinAmerica,
4650
Italian,
4751
Norwegian_Bokmal,
4852
Slovak,

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,26 @@ public interface IPublicAPI
228228
public void OpenDirectory(string DirectoryPath, string FileName = null);
229229

230230
/// <summary>
231-
/// Opens the url. The browser and mode used is based on what's configured in Flow's default browser settings.
231+
/// Opens the URL with the given Uri object.
232+
/// The browser and mode used is based on what's configured in Flow's default browser settings.
233+
/// </summary>
234+
public void OpenUrl(Uri url, bool? inPrivate = null);
235+
236+
/// <summary>
237+
/// Opens the URL with the given string.
238+
/// The browser and mode used is based on what's configured in Flow's default browser settings.
239+
/// Non-C# plugins should use this method.
232240
/// </summary>
233241
public void OpenUrl(string url, bool? inPrivate = null);
234242

235243
/// <summary>
236-
/// Opens the application URI.
244+
/// Opens the application URI with the given Uri object, e.g. obsidian://search-query-example
245+
/// </summary>
246+
public void OpenAppUri(Uri appUri);
247+
248+
/// <summary>
249+
/// Opens the application URI with the given string, e.g. obsidian://search-query-example
250+
/// Non-C# plugins should use this method
237251
/// </summary>
238252
public void OpenAppUri(string appUri);
239253
}

Flow.Launcher/Helper/HotKeyMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal static void Initialize(MainViewModel mainVM)
2525

2626
internal static void OnToggleHotkey(object sender, HotkeyEventArgs args)
2727
{
28-
if (!mainViewModel.GameModeStatus)
28+
if (!mainViewModel.ShouldIgnoreHotkeys() && !mainViewModel.GameModeStatus)
2929
mainViewModel.ToggleFlowLauncher();
3030
}
3131

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>
5959

6060
<!-- Setting Plugin -->
61-
<system:String x:Key="plugin">Plugins</system:String>
61+
<system:String x:Key="plugin">Plugin</system:String>
6262
<system:String x:Key="browserMorePlugins">Find more plugins</system:String>
6363
<system:String x:Key="enable">On</system:String>
6464
<system:String x:Key="disable">Off</system:String>

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,8 @@ public void OpenDirectory(string DirectoryPath, string FileName = null)
209209
explorer.Start();
210210
}
211211

212-
public void OpenUri(string url, bool? inPrivate = null, bool isAppUri = false)
212+
private void OpenUri(Uri uri, bool? inPrivate = null)
213213
{
214-
var uri = new Uri(url);
215214
if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
216215
{
217216
var browserInfo = _settingsVM.Settings.CustomBrowser;
@@ -220,38 +219,43 @@ public void OpenUri(string url, bool? inPrivate = null, bool isAppUri = false)
220219

221220
if (browserInfo.OpenInTab)
222221
{
223-
url.OpenInBrowserTab(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
222+
uri.AbsoluteUri.OpenInBrowserTab(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
224223
}
225224
else
226225
{
227-
url.OpenInBrowserWindow(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
226+
uri.AbsoluteUri.OpenInBrowserWindow(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
228227
}
229-
230-
return;
231228
}
232-
233-
if (isAppUri)
229+
else
234230
{
235231
Process.Start(new ProcessStartInfo()
236232
{
237-
FileName = url,
233+
FileName = uri.AbsoluteUri,
238234
UseShellExecute = true
239235
})?.Dispose();
240236

241237
return;
242238
}
243-
244-
throw new InvalidOperationException("URI scheme not specified or supported ");
245239
}
246240

247241
public void OpenUrl(string url, bool? inPrivate = null)
242+
{
243+
OpenUri(new Uri(url), inPrivate);
244+
}
245+
246+
public void OpenUrl(Uri url, bool? inPrivate = null)
248247
{
249248
OpenUri(url, inPrivate);
250249
}
251250

252251
public void OpenAppUri(string appUri)
253252
{
254-
OpenUri(appUri, isAppUri: true);
253+
OpenUri(new Uri(appUri));
254+
}
255+
256+
public void OpenAppUri(Uri appUri)
257+
{
258+
OpenUri(appUri);
255259
}
256260

257261
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;

0 commit comments

Comments
 (0)