Skip to content

Commit 09992fa

Browse files
committed
merge dev for fix conflict
2 parents 0a74766 + 74aa9e4 commit 09992fa

Some content is hidden

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

50 files changed

+1829
-684
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
using Flow.Launcher.Infrastructure.Http;
2+
using Flow.Launcher.Infrastructure.Logger;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Text.Json;
6+
using System.Threading;
7+
using System.Threading.Tasks;
8+
9+
namespace Flow.Launcher.Core.ExternalPlugins
10+
{
11+
public static class PluginsManifest
12+
{
13+
static PluginsManifest()
14+
{
15+
UpdateTask = UpdateManifestAsync();
16+
}
17+
18+
public static List<UserPlugin> UserPlugins { get; private set; } = new List<UserPlugin>();
19+
20+
public static Task UpdateTask { get; private set; }
21+
22+
private static readonly SemaphoreSlim manifestUpdateLock = new(1);
23+
24+
public static Task UpdateManifestAsync()
25+
{
26+
if (manifestUpdateLock.CurrentCount == 0)
27+
{
28+
return UpdateTask;
29+
}
30+
31+
return UpdateTask = DownloadManifestAsync();
32+
}
33+
34+
private async static Task DownloadManifestAsync()
35+
{
36+
try
37+
{
38+
await manifestUpdateLock.WaitAsync().ConfigureAwait(false);
39+
40+
await using var jsonStream = await Http.GetStreamAsync("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/plugin_api_v2/plugins.json")
41+
.ConfigureAwait(false);
42+
43+
UserPlugins = await JsonSerializer.DeserializeAsync<List<UserPlugin>>(jsonStream).ConfigureAwait(false);
44+
}
45+
catch (Exception e)
46+
{
47+
Log.Exception("|PluginManagement.GetManifest|Encountered error trying to download plugins manifest", e);
48+
49+
UserPlugins = new List<UserPlugin>();
50+
}
51+
finally
52+
{
53+
manifestUpdateLock.Release();
54+
}
55+
}
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-

2-
namespace Flow.Launcher.Plugin.PluginsManager.Models
1+
namespace Flow.Launcher.Core.ExternalPlugins
32
{
4-
public class UserPlugin
3+
public record UserPlugin
54
{
65
public string ID { get; set; }
76
public string Name { get; set; }
@@ -12,5 +11,6 @@ public class UserPlugin
1211
public string Website { get; set; }
1312
public string UrlDownload { get; set; }
1413
public string UrlSourceCode { get; set; }
14+
public string IcoPath { get; set; }
1515
}
1616
}

Flow.Launcher.Core/Resource/Internationalization.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Flow.Launcher.Infrastructure.Logger;
1010
using Flow.Launcher.Infrastructure.UserSettings;
1111
using Flow.Launcher.Plugin;
12+
using System.Globalization;
1213

1314
namespace Flow.Launcher.Core.Resource
1415
{
@@ -96,7 +97,8 @@ public void ChangeLanguage(Language language)
9697
}
9798
UpdatePluginMetadataTranslations();
9899
Settings.Language = language.LanguageCode;
99-
100+
CultureInfo.CurrentCulture = new CultureInfo(language.LanguageCode);
101+
CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture;
100102
}
101103

102104
public bool PromptShouldUsePinyin(string languageCodeToSet)

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ public bool HideNotifyIcon
102102
public bool RememberLastLaunchLocation { get; set; }
103103
public bool IgnoreHotkeysOnFullscreen { get; set; }
104104

105-
public bool AutoHideScrollBar { get; set; }
106-
107105
public HttpProxy Proxy { get; set; } = new HttpProxy();
108106

109107
[JsonConverter(typeof(JsonStringEnumConverter))]

Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@
6060
</ItemGroup>
6161

6262
<ItemGroup>
63+
<PackageReference Include="Fody" Version="6.5.4">
64+
<PrivateAssets>all</PrivateAssets>
65+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
66+
</PackageReference>
6367
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
6468
<PackageReference Include="JetBrains.Annotations" Version="2021.2.0" />
69+
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
6570
</ItemGroup>
6671

6772
</Project>

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ public interface IPublicAPI
5959
/// <param name="subTitle">Optional message subtitle</param>
6060
void ShowMsgError(string title, string subTitle = "");
6161

62+
/// <summary>
63+
/// Show the MainWindow when hiding
64+
/// </summary>
65+
void ShowMainWindow();
66+
6267
/// <summary>
6368
/// Show message box
6469
/// </summary>

Flow.Launcher/ActionKeywords.xaml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,54 @@
11
<Window x:Class="Flow.Launcher.ActionKeywords"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
Title="ActionKeywords"
4+
Title="{DynamicResource actionKeywordsTitle}"
55
Icon="Images\app.png"
66
ResizeMode="NoResize"
77
Loaded="ActionKeyword_OnLoaded"
88
WindowStartupLocation="CenterScreen"
9-
Height="250" Width="500">
9+
Height="365" Width="450" Background="#F3F3F3" BorderBrush="#cecece">
1010
<Grid>
11+
<Grid.RowDefinitions>
12+
<RowDefinition />
13+
<RowDefinition Height="80"/>
14+
</Grid.RowDefinitions>
15+
<Border BorderThickness="0 0 0 1" BorderBrush="#e5e5e5" Background="#ffffff" Padding="26 26 26 0">
16+
<Grid>
17+
<StackPanel>
18+
<StackPanel Grid.Row="0" Margin="0 0 0 12">
19+
<TextBlock Grid.Column="0" Text="{DynamicResource actionKeywordsTitle}" FontSize="20" FontWeight="SemiBold" FontFamily="Segoe UI" TextAlignment="Left"
20+
Margin="0 0 0 0" />
21+
</StackPanel>
22+
<StackPanel>
23+
<TextBlock
24+
Text="{DynamicResource actionkeyword_tips}" Foreground="#1b1b1b" FontSize="14" TextWrapping="WrapWithOverflow" TextAlignment="Left"/>
25+
</StackPanel>
26+
27+
<StackPanel Orientation="Horizontal" Margin="0 18 0 0">
28+
<TextBlock FontSize="14" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"
29+
HorizontalAlignment="Left" Text="{DynamicResource currentActionKeywords}" />
30+
<TextBlock x:Name="tbOldActionKeyword" Grid.Row="0" Grid.Column="1" Margin="14 10 10 10" FontSize="14"
31+
VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="SemiBold"/>
32+
</StackPanel>
33+
<StackPanel Orientation="Horizontal">
34+
<TextBlock FontSize="14" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"
35+
HorizontalAlignment="Left" Text="{DynamicResource newActionKeyword}" />
36+
37+
<TextBox x:Name="tbAction" Margin="10 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
38+
39+
</StackPanel>
40+
</StackPanel>
41+
</Grid>
42+
</Border>
43+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
44+
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 5 0" Width="100" Height="30"
45+
Content="{DynamicResource cancel}" />
46+
<Button x:Name="btnDone" Margin="5 0 10 0" Width="100" Height="30" Click="btnDone_OnClick">
47+
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
48+
</Button>
49+
</StackPanel>
50+
</Grid>
51+
<!--
1152
<Grid.RowDefinitions>
1253
<RowDefinition />
1354
<RowDefinition Height="60"/>
@@ -40,4 +81,5 @@
4081
</Button>
4182
</StackPanel>
4283
</Grid>
84+
-->
4385
</Window>

Flow.Launcher/ActionKeywords.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private void btnDone_OnClick(object sender, RoutedEventArgs _)
4444
var oldActionKeyword = plugin.Metadata.ActionKeywords[0];
4545
var newActionKeyword = tbAction.Text.Trim();
4646
newActionKeyword = newActionKeyword.Length > 0 ? newActionKeyword : "*";
47-
if (!pluginViewModel.IsActionKeywordRegistered(newActionKeyword))
47+
if (!PluginViewModel.IsActionKeywordRegistered(newActionKeyword))
4848
{
4949
pluginViewModel.ChangeActionKeyword(newActionKeyword, oldActionKeyword);
5050
Close();

0 commit comments

Comments
 (0)