Skip to content

Commit a98b7b7

Browse files
authored
Merge branch 'dev' into 250223FluentTest2
2 parents c792544 + c34fd63 commit a98b7b7

File tree

158 files changed

+2394
-1763
lines changed

Some content is hidden

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

158 files changed

+2394
-1763
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</ItemGroup>
6767

6868
<ItemGroup>
69-
<PackageReference Include="Fody" Version="6.5.4">
69+
<PackageReference Include="Fody" Version="6.5.5">
7070
<PrivateAssets>all</PrivateAssets>
7171
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
7272
</PackageReference>

Flow.Launcher/App.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public App()
6464
.AddSingleton<IPublicAPI, PublicAPIInstance>()
6565
.AddSingleton<MainViewModel>()
6666
.AddSingleton<Theme>()
67+
.AddSingleton<WelcomeViewModel>()
6768
).Build();
6869
Ioc.Default.ConfigureServices(host.Services);
6970
}

Flow.Launcher/CustomQueryHotkeySetting.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
HorizontalAlignment="Left"
104104
VerticalAlignment="Center"
105105
HorizontalContentAlignment="Left"
106-
HotkeySettings="{Binding Settings}"
107106
DefaultHotkey="" />
108107
<TextBlock
109108
Grid.Row="1"

Flow.Launcher/Flow.Launcher.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<ItemGroup>
8686
<PackageReference Include="ChefKeys" Version="0.1.2" />
8787
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
88-
<PackageReference Include="Fody" Version="6.5.4">
88+
<PackageReference Include="Fody" Version="6.5.5">
8989
<PrivateAssets>all</PrivateAssets>
9090
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
9191
</PackageReference>

Flow.Launcher/HotkeyControl.xaml.cs

Lines changed: 118 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,16 @@
44
using System.Threading.Tasks;
55
using System.Windows;
66
using System.Windows.Input;
7+
using CommunityToolkit.Mvvm.DependencyInjection;
78
using Flow.Launcher.Core.Resource;
89
using Flow.Launcher.Helper;
910
using Flow.Launcher.Infrastructure.Hotkey;
11+
using Flow.Launcher.Infrastructure.UserSettings;
1012

1113
namespace Flow.Launcher
1214
{
1315
public partial class HotkeyControl
1416
{
15-
public IHotkeySettings HotkeySettings {
16-
get { return (IHotkeySettings)GetValue(HotkeySettingsProperty); }
17-
set { SetValue(HotkeySettingsProperty, value); }
18-
}
19-
20-
public static readonly DependencyProperty HotkeySettingsProperty = DependencyProperty.Register(
21-
nameof(HotkeySettings),
22-
typeof(IHotkeySettings),
23-
typeof(HotkeyControl),
24-
new PropertyMetadata()
25-
);
2617
public string WindowTitle {
2718
get { return (string)GetValue(WindowTitleProperty); }
2819
set { SetValue(WindowTitleProperty, value); }
@@ -71,8 +62,7 @@ private static void OnHotkeyChanged(DependencyObject d, DependencyPropertyChange
7162
return;
7263
}
7364

74-
hotkeyControl.SetKeysToDisplay(new HotkeyModel(hotkeyControl.Hotkey));
75-
hotkeyControl.CurrentHotkey = new HotkeyModel(hotkeyControl.Hotkey);
65+
hotkeyControl.RefreshHotkeyInterface(hotkeyControl.Hotkey);
7666
}
7767

7868

@@ -90,25 +80,132 @@ public ICommand? ChangeHotkey
9080
}
9181

9282

93-
public static readonly DependencyProperty HotkeyProperty = DependencyProperty.Register(
94-
nameof(Hotkey),
95-
typeof(string),
83+
public static readonly DependencyProperty TypeProperty = DependencyProperty.Register(
84+
nameof(Type),
85+
typeof(HotkeyType),
9686
typeof(HotkeyControl),
97-
new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnHotkeyChanged)
87+
new FrameworkPropertyMetadata(HotkeyType.Hotkey, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnHotkeyChanged)
9888
);
9989

90+
public HotkeyType Type
91+
{
92+
get { return (HotkeyType)GetValue(TypeProperty); }
93+
set { SetValue(TypeProperty, value); }
94+
}
95+
96+
public enum HotkeyType
97+
{
98+
Hotkey,
99+
PreviewHotkey,
100+
OpenContextMenuHotkey,
101+
SettingWindowHotkey,
102+
CycleHistoryUpHotkey,
103+
CycleHistoryDownHotkey,
104+
SelectPrevPageHotkey,
105+
SelectNextPageHotkey,
106+
AutoCompleteHotkey,
107+
AutoCompleteHotkey2,
108+
SelectPrevItemHotkey,
109+
SelectPrevItemHotkey2,
110+
SelectNextItemHotkey,
111+
SelectNextItemHotkey2
112+
}
113+
114+
// We can initialize settings in static field because it has been constructed in App constuctor
115+
// and it will not construct settings instances twice
116+
private static readonly Settings _settings = Ioc.Default.GetRequiredService<Settings>();
117+
100118
public string Hotkey
101119
{
102-
get { return (string)GetValue(HotkeyProperty); }
103-
set { SetValue(HotkeyProperty, value); }
120+
get
121+
{
122+
return Type switch
123+
{
124+
HotkeyType.Hotkey => _settings.Hotkey,
125+
HotkeyType.PreviewHotkey => _settings.PreviewHotkey,
126+
HotkeyType.OpenContextMenuHotkey => _settings.OpenContextMenuHotkey,
127+
HotkeyType.SettingWindowHotkey => _settings.SettingWindowHotkey,
128+
HotkeyType.CycleHistoryUpHotkey => _settings.CycleHistoryUpHotkey,
129+
HotkeyType.CycleHistoryDownHotkey => _settings.CycleHistoryDownHotkey,
130+
HotkeyType.SelectPrevPageHotkey => _settings.SelectPrevPageHotkey,
131+
HotkeyType.SelectNextPageHotkey => _settings.SelectNextPageHotkey,
132+
HotkeyType.AutoCompleteHotkey => _settings.AutoCompleteHotkey,
133+
HotkeyType.AutoCompleteHotkey2 => _settings.AutoCompleteHotkey2,
134+
HotkeyType.SelectPrevItemHotkey => _settings.SelectPrevItemHotkey,
135+
HotkeyType.SelectPrevItemHotkey2 => _settings.SelectPrevItemHotkey2,
136+
HotkeyType.SelectNextItemHotkey => _settings.SelectNextItemHotkey,
137+
HotkeyType.SelectNextItemHotkey2 => _settings.SelectNextItemHotkey2,
138+
_ => string.Empty
139+
};
140+
}
141+
set
142+
{
143+
switch (Type)
144+
{
145+
case HotkeyType.Hotkey:
146+
_settings.Hotkey = value;
147+
break;
148+
case HotkeyType.PreviewHotkey:
149+
_settings.PreviewHotkey = value;
150+
break;
151+
case HotkeyType.OpenContextMenuHotkey:
152+
_settings.OpenContextMenuHotkey = value;
153+
break;
154+
case HotkeyType.SettingWindowHotkey:
155+
_settings.SettingWindowHotkey = value;
156+
break;
157+
case HotkeyType.CycleHistoryUpHotkey:
158+
_settings.CycleHistoryUpHotkey = value;
159+
break;
160+
case HotkeyType.CycleHistoryDownHotkey:
161+
_settings.CycleHistoryDownHotkey = value;
162+
break;
163+
case HotkeyType.SelectPrevPageHotkey:
164+
_settings.SelectPrevPageHotkey = value;
165+
break;
166+
case HotkeyType.SelectNextPageHotkey:
167+
_settings.SelectNextPageHotkey = value;
168+
break;
169+
case HotkeyType.AutoCompleteHotkey:
170+
_settings.AutoCompleteHotkey = value;
171+
break;
172+
case HotkeyType.AutoCompleteHotkey2:
173+
_settings.AutoCompleteHotkey2 = value;
174+
break;
175+
case HotkeyType.SelectPrevItemHotkey:
176+
_settings.SelectPrevItemHotkey = value;
177+
break;
178+
case HotkeyType.SelectNextItemHotkey:
179+
_settings.SelectNextItemHotkey = value;
180+
break;
181+
case HotkeyType.SelectPrevItemHotkey2:
182+
_settings.SelectPrevItemHotkey2 = value;
183+
break;
184+
case HotkeyType.SelectNextItemHotkey2:
185+
_settings.SelectNextItemHotkey2 = value;
186+
break;
187+
default:
188+
return;
189+
}
190+
191+
// After setting the hotkey, we need to refresh the interface
192+
RefreshHotkeyInterface(Hotkey);
193+
}
104194
}
105195

106196
public HotkeyControl()
107197
{
108198
InitializeComponent();
109199

110200
HotkeyList.ItemsSource = KeysToDisplay;
111-
SetKeysToDisplay(CurrentHotkey);
201+
202+
RefreshHotkeyInterface(Hotkey);
203+
}
204+
205+
private void RefreshHotkeyInterface(string hotkey)
206+
{
207+
SetKeysToDisplay(new HotkeyModel(Hotkey));
208+
CurrentHotkey = new HotkeyModel(Hotkey);
112209
}
113210

114211
private static bool CheckHotkeyAvailability(HotkeyModel hotkey, bool validateKeyGesture) =>
@@ -133,7 +230,7 @@ private async Task OpenHotkeyDialog()
133230
HotKeyMapper.RemoveHotkey(Hotkey);
134231
}
135232

136-
var dialog = new HotkeyControlDialog(Hotkey, DefaultHotkey, HotkeySettings, WindowTitle);
233+
var dialog = new HotkeyControlDialog(Hotkey, DefaultHotkey, WindowTitle);
137234
await dialog.ShowAsync();
138235
switch (dialog.ResultType)
139236
{

Flow.Launcher/HotkeyControlDialog.xaml.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
using System.Windows;
55
using System.Windows.Input;
66
using ChefKeys;
7+
using CommunityToolkit.Mvvm.DependencyInjection;
78
using Flow.Launcher.Core.Resource;
89
using Flow.Launcher.Helper;
910
using Flow.Launcher.Infrastructure.Hotkey;
11+
using Flow.Launcher.Infrastructure.UserSettings;
1012
using Flow.Launcher.Plugin;
1113
using ModernWpf.Controls;
1214

@@ -16,7 +18,7 @@ namespace Flow.Launcher;
1618

1719
public partial class HotkeyControlDialog : ContentDialog
1820
{
19-
private IHotkeySettings _hotkeySettings;
21+
private static readonly IHotkeySettings _hotkeySettings = Ioc.Default.GetRequiredService<Settings>();
2022
private Action? _overwriteOtherHotkey;
2123
private string DefaultHotkey { get; }
2224
public string WindowTitle { get; }
@@ -36,7 +38,7 @@ public enum EResultType
3638

3739
private static bool isOpenFlowHotkey;
3840

39-
public HotkeyControlDialog(string hotkey, string defaultHotkey, IHotkeySettings hotkeySettings, string windowTitle = "")
41+
public HotkeyControlDialog(string hotkey, string defaultHotkey, string windowTitle = "")
4042
{
4143
WindowTitle = windowTitle switch
4244
{
@@ -45,7 +47,6 @@ public HotkeyControlDialog(string hotkey, string defaultHotkey, IHotkeySettings
4547
};
4648
DefaultHotkey = defaultHotkey;
4749
CurrentHotkey = new HotkeyModel(hotkey);
48-
_hotkeySettings = hotkeySettings;
4950
SetKeysToDisplay(CurrentHotkey);
5051

5152
InitializeComponent();

Flow.Launcher/Languages/ar.xaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
<!-- MainWindow -->
1515
<system:String x:Key="registerHotkeyFailed">فشل في تسجيل مفتاح التشغيل السريع &quot;{0}&quot;. قد يكون المفتاح مستخدمًا من قبل برنامج آخر. قم بتغيير المفتاح، أو قم بإغلاق البرنامج الآخر.</system:String>
16+
<system:String x:Key="unregisterHotkeyFailed">Failed to unregister hotkey &quot;{0}&quot;. Please try again or see log for details</system:String>
1617
<system:String x:Key="MessageBoxTitle">Flow Launcher</system:String>
1718
<system:String x:Key="couldnotStartCmd">تعذر بدء {0}</system:String>
1819
<system:String x:Key="invalidFlowLauncherPluginFileFormat">تنسيق ملف إضافة Flow Launcher غير صالح</system:String>
@@ -44,6 +45,8 @@
4445
<system:String x:Key="portableMode">وضع المحمول</system:String>
4546
<system:String x:Key="portableModeToolTIp">تخزين جميع الإعدادات وبيانات المستخدم في مجلد واحد (مفيد عند استخدام الأقراص القابلة للإزالة أو الخدمات السحابية).</system:String>
4647
<system:String x:Key="startFlowLauncherOnSystemStartup">تشغيل Flow Launcher عند بدء تشغيل النظام</system:String>
48+
<system:String x:Key="useLogonTaskForStartup">Use logon task instead of startup entry for faster startup experience</system:String>
49+
<system:String x:Key="useLogonTaskForStartupTooltip">After uninstallation, you need to manually remove this task (Flow.Launcher Startup) via Task Scheduler</system:String>
4750
<system:String x:Key="setAutoStartFailed">خطأ في إعداد التشغيل عند بدء التشغيل</system:String>
4851
<system:String x:Key="hideFlowLauncherWhenLoseFocus">إخفاء Flow Launcher عند فقدان التركيز</system:String>
4952
<system:String x:Key="dontPromptUpdateMsg">عدم عرض إشعارات الإصدار الجديد</system:String>
@@ -126,7 +129,8 @@
126129
<system:String x:Key="plugin_query_version">الإصدار</system:String>
127130
<system:String x:Key="plugin_query_web">الموقع الإلكتروني</system:String>
128131
<system:String x:Key="plugin_uninstall">إلغاء التثبيت</system:String>
129-
132+
<system:String x:Key="failedToRemovePluginSettingsTitle">Fail to remove plugin settings</system:String>
133+
<system:String x:Key="failedToRemovePluginSettingsMessage">Plugins: {0} - Fail to remove plugin settings files, please remove them manually</system:String>
130134

131135
<!-- Setting Plugin Store -->
132136
<system:String x:Key="pluginStore">متجر الإضافات</system:String>
@@ -143,8 +147,6 @@
143147
<system:String x:Key="LabelNewToolTip">تم تحديث هذه الإضافة في آخر 7 أيام</system:String>
144148
<system:String x:Key="LabelUpdateToolTip">يتوفر تحديث جديد</system:String>
145149

146-
147-
148150
<!-- Setting Theme -->
149151
<system:String x:Key="theme">السمة</system:String>
150152
<system:String x:Key="appearance">المظهر</system:String>
@@ -194,7 +196,6 @@
194196
<system:String x:Key="TypeIsDarkToolTip">هذه السمة تدعم الوضعين (فاتح/داكن).</system:String>
195197
<system:String x:Key="TypeHasBlurToolTip">هذه السمة تدعم الخلفية الضبابية الشفافة.</system:String>
196198

197-
198199
<!-- Setting Hotkey -->
199200
<system:String x:Key="hotkey">مفتاح الاختصار</system:String>
200201
<system:String x:Key="hotkeys">مفاتيح الاختصار</system:String>
@@ -297,6 +298,9 @@
297298
<system:String x:Key="userdatapath">موقع بيانات المستخدم</system:String>
298299
<system:String x:Key="userdatapathToolTip">يتم حفظ إعدادات المستخدم والإضافات المثبتة في مجلد بيانات المستخدم. قد يختلف هذا الموقع اعتمادًا على ما إذا كان في وضع النقل أم لا.</system:String>
299300
<system:String x:Key="userdatapathButton">فتح المجلد</system:String>
301+
<system:String x:Key="logLevel">Log Level</system:String>
302+
<system:String x:Key="LogLevelDEBUG">Debug</system:String>
303+
<system:String x:Key="LogLevelINFO">Info</system:String>
300304

301305
<!-- FileManager Setting Dialog -->
302306
<system:String x:Key="fileManagerWindow">اختر مدير الملفات</system:String>
@@ -367,6 +371,7 @@
367371
<system:String x:Key="commonOK">حسناً</system:String>
368372
<system:String x:Key="commonYes">نعم</system:String>
369373
<system:String x:Key="commonNo">لا</system:String>
374+
<system:String x:Key="commonBackground">الخلفية</system:String>
370375

371376
<!-- Crash Reporter -->
372377
<system:String x:Key="reportWindow_version">الإصدار</system:String>
@@ -383,6 +388,9 @@
383388
<system:String x:Key="reportWindow_report_succeed">تم إرسال التقرير بنجاح</system:String>
384389
<system:String x:Key="reportWindow_report_failed">فشل في إرسال التقرير</system:String>
385390
<system:String x:Key="reportWindow_flowlauncher_got_an_error">حدث خطأ في Flow Launcher</system:String>
391+
<system:String x:Key="reportWindow_please_open_issue">Please open new issue in</system:String>
392+
<system:String x:Key="reportWindow_upload_log">1. Upload log file: {0}</system:String>
393+
<system:String x:Key="reportWindow_copy_below">2. Copy below exception message</system:String>
386394

387395
<!-- General Notice -->
388396
<system:String x:Key="pleaseWait">يرجى الانتظار...</system:String>

0 commit comments

Comments
 (0)