Skip to content

Commit 4a4e24b

Browse files
committed
Added quick switch information
1 parent 6b7a70a commit 4a4e24b

File tree

8 files changed

+33
-0
lines changed

8 files changed

+33
-0
lines changed

Flow.Launcher.Infrastructure/QuickSwitch/Interface/IQuickSwitchDialog.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ namespace Flow.Launcher.Infrastructure.QuickSwitch.Interface
1313
/// </remarks>
1414
internal interface IQuickSwitchDialog : IDisposable
1515
{
16+
string Name { get; }
17+
1618
IQuickSwitchDialogWindow DialogWindow { get; }
1719

1820
bool CheckDialogWindow(HWND hwnd);

Flow.Launcher.Infrastructure/QuickSwitch/Interface/IQuickSwitchExplorer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ namespace Flow.Launcher.Infrastructure.QuickSwitch.Interface
1313
/// </remarks>
1414
internal interface IQuickSwitchExplorer : IDisposable
1515
{
16+
string Name { get; }
17+
1618
bool CheckExplorerWindow(HWND foreground);
1719

1820
void RemoveExplorerWindow();

Flow.Launcher.Infrastructure/QuickSwitch/Models/WindowsDialog.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ internal class WindowsDialog : IQuickSwitchDialog
1919

2020
private const string WindowsDialogClassName = "#32770";
2121

22+
public string Name => "Windows";
23+
2224
public bool CheckDialogWindow(HWND hwnd)
2325
{
2426
// Has it been checked?

Flow.Launcher.Infrastructure/QuickSwitch/Models/WindowsExplorer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ internal class WindowsExplorer : IQuickSwitchExplorer
1818
private static IWebBrowser2 _lastExplorerView = null;
1919
private static readonly object _lastExplorerViewLock = new();
2020

21+
public string Name => "Windows";
22+
2123
public bool CheckExplorerWindow(HWND foreground)
2224
{
2325
var isExplorer = false;

Flow.Launcher.Infrastructure/QuickSwitch/QuickSwitch.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ public static class QuickSwitch
8181

8282
#endregion
8383

84+
#region Supported Explorers & Dialogs Name
85+
86+
public static string[] SupportedExplorerNames => _quickSwitchExplorers.ConvertAll(explorer => explorer.Name).ToArray();
87+
88+
public static string[] SupportedDialogNames => _quickSwitchDialogs.ConvertAll(dialog => dialog.Name).ToArray();
89+
90+
#endregion
91+
8492
#region Initialize & Setup
8593

8694
public static void InitializeQuickSwitch()

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@
335335
<system:String x:Key="QuickSwitchFileResultBehaviourFullPath">Fill full path in file name box</system:String>
336336
<system:String x:Key="QuickSwitchFileResultBehaviourFullPathOpen">Fill full path in file name box and open</system:String>
337337
<system:String x:Key="QuickSwitchFileResultBehaviourDirectory">Fill directory in path box</system:String>
338+
<system:String x:Key="QuickSwitchSupportedExplorerDialogTitle">Information for Quick Switch user</system:String>
339+
<system:String x:Key="QuickSwitchSupportedExplorerDialogMessage">Currently Flow supports those file explorers ({0}) and those file dialogs ({1})</system:String>
338340

339341
<!-- Setting Proxy -->
340342
<system:String x:Key="proxy">HTTP Proxy</system:String>

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ public class QuickSwitchFileResultBehaviourData : DropdownDataGeneric<QuickSwitc
180180
public List<QuickSwitchFileResultBehaviourData> QuickSwitchFileResultBehaviours { get; } =
181181
DropdownDataGeneric<QuickSwitchFileResultBehaviours>.GetValues<QuickSwitchFileResultBehaviourData>("QuickSwitchFileResultBehaviour");
182182

183+
public string QuickSwitchSupportedExplorerDialogMessage =>
184+
string.Format(App.API.GetTranslation("QuickSwitchSupportedExplorerDialogMessage"),
185+
string.Join(", ", QuickSwitch.SupportedExplorerNames),
186+
string.Join(", ", QuickSwitch.SupportedDialogNames));
187+
183188
public int SearchDelayTimeValue
184189
{
185190
get => Settings.SearchDelayTime;
@@ -217,6 +222,7 @@ private void UpdateEnumDropdownLocalizations()
217222
DropdownDataGeneric<QuickSwitchFileResultBehaviours>.UpdateLabels(QuickSwitchFileResultBehaviours);
218223
// Since we are using Binding instead of DynamicResource, we need to manually trigger the update
219224
OnPropertyChanged(nameof(AlwaysPreviewToolTip));
225+
OnPropertyChanged(nameof(QuickSwitchSupportedExplorerDialogMessage));
220226
}
221227

222228
public string Language

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,15 @@
288288
</cc:CardGroup>
289289
</cc:ExCard>
290290

291+
<cc:InfoBar
292+
Title="{DynamicResource QuickSwitchSupportedExplorerDialogTitle}"
293+
Margin="0 14 0 0"
294+
Closable="False"
295+
IsIconVisible="True"
296+
Length="Long"
297+
Message="{Binding QuickSwitchSupportedExplorerDialogMessage, Mode=OneWay}"
298+
Type="Info" />
299+
291300
<cc:ExCard
292301
Title="{DynamicResource searchDelay}"
293302
Margin="0 14 0 0"

0 commit comments

Comments
 (0)