From 9e39e48bf80d4c32745e0a498142e10a55418193 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 30 May 2024 21:49:44 +1000 Subject: [PATCH] minor clean up and update --- .../UserSettings/Settings.cs | 2 -- .../Interfaces/IAsyncExternalPreview.cs | 22 ++++++++++++++++--- Flow.Launcher.Plugin/Result.cs | 4 ++-- Flow.Launcher/ViewModel/MainViewModel.cs | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 892cb3876..67b2ae406 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -186,8 +186,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings /// public bool ShouldUsePinyin { get; set; } = false; - public bool UseExternalPreview { get; set; } = false; - public bool AlwaysPreview { get; set; } = false; public bool AlwaysStartEn { get; set; } = false; diff --git a/Flow.Launcher.Plugin/Interfaces/IAsyncExternalPreview.cs b/Flow.Launcher.Plugin/Interfaces/IAsyncExternalPreview.cs index 9ee05b46c..575a422d9 100644 --- a/Flow.Launcher.Plugin/Interfaces/IAsyncExternalPreview.cs +++ b/Flow.Launcher.Plugin/Interfaces/IAsyncExternalPreview.cs @@ -2,14 +2,30 @@ namespace Flow.Launcher.Plugin { - public interface IAsyncExternalPreview: IFeatures + /// + /// This interface is for plugins that wish to provide file preview (external preview) + /// via a third party app instead of the default preview. + /// + public interface IAsyncExternalPreview : IFeatures { - public Task TogglePreviewAsync(string path); - + /// + /// Method for opening/showing the preview. + /// + /// The file path to open the preview for + /// Whether to send a toast message notification on failure for the user public Task OpenPreviewAsync(string path, bool sendFailToast = true); + /// + /// Method for closing/hiding the preview. + /// public Task ClosePreviewAsync(); + /// + /// Method for switching the preview to the next file result. + /// This requires the external preview be already open/showing + /// + /// The file path to switch the preview for + /// Whether to send a toast message notification on failure for the user public Task SwitchPreviewAsync(string path, bool sendFailToast = true); } } diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 179fc5ef8..9b42b1021 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -261,7 +261,7 @@ namespace Flow.Launcher.Plugin /// Contains data used to populate the preview section of this result. /// public PreviewInfo Preview { get; set; } = PreviewInfo.Default; - + /// /// Info of the preview section of a /// @@ -291,7 +291,7 @@ namespace Flow.Launcher.Plugin public IconDelegate PreviewDelegate { get; set; } = null; /// - /// File path of the result. For third-party preview programs such as QuickLook. + /// File path of the result. For third-party programs providing external preview. /// public string FilePath { get; set; } = null; diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 7f3ec1ff3..94a3a9695 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -768,7 +768,7 @@ namespace Flow.Launcher.ViewModel public int ResultAreaColumn { get; set; } = ResultAreaColumnPreviewShown; // This is not a reliable indicator of whether external preview is visible due to the - // ability of manually closing/exiting the external preview program, and this does not inform flow that + // ability of manually closing/exiting the external preview program which, does not inform flow that // preview is no longer available. public bool ExternalPreviewVisible { get; set; } = false;