diff --git a/QuickLook.Common/Plugin/ContextObject.cs b/QuickLook.Common/Plugin/ContextObject.cs index f1e5645..0d8933e 100644 --- a/QuickLook.Common/Plugin/ContextObject.cs +++ b/QuickLook.Common/Plugin/ContextObject.cs @@ -199,7 +199,8 @@ public class ContextObject : INotifyPropertyChanged } /// - /// Get or set whether to block showing the preview window. + /// Get or set whether to block showing the preview window + /// Display "blocked" in the preview window if true /// public bool IsBlocked { diff --git a/QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/Plugin.cs b/QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/Plugin.cs deleted file mode 100644 index ddfe213..0000000 --- a/QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/Plugin.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright © 2017-2025 QL-Win Contributors -// -// This file is part of QuickLook program. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -using QuickLook.Common.Plugin; -using System; -using System.IO; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Threading; - -namespace QuickLook.Plugin.InsvBlocker; - -public class Plugin : IViewer -{ - // Very high priority to ensure this plugin is checked before any other plugins - // This prevents QuickLook from handling .insv files, allowing Insta360Studio's QuickLook to handle them instead - public int Priority => int.MaxValue; - - public void Init() - { - } - - public bool CanHandle(string path) - { - // Match .insv files (Insta360 panoramic video files) - if (Directory.Exists(path)) - return false; - - return path.EndsWith(".insv", StringComparison.OrdinalIgnoreCase); - } - - public void Prepare(string path, ContextObject context) - { - // Set Ignore to true to display "blocked" in the preview window - context.IsBlocked = true; - context.Title = $"[BLOCKED] {Path.GetFileName(path)}"; - context.PreferredSize = new Size(400, 200); - } - - public void View(string path, ContextObject context) - { - // This should not be called since Ignore is set to true in Prepare - // But if called, do nothing - } - - public void Cleanup() - { - } -} diff --git a/QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/QuickLook.Plugin.InsvBlocker.csproj b/QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/QuickLook.Plugin.InsvBlocker.csproj deleted file mode 100644 index b970ad2..0000000 --- a/QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/QuickLook.Plugin.InsvBlocker.csproj +++ /dev/null @@ -1,80 +0,0 @@ - - - - Library - net462 - QuickLook.Plugin.InsvBlocker - QuickLook.Plugin.InsvBlocker - 512 - false - true - latest - false - false - false - MinimumRecommendedRules.ruleset - {A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D} - - - - true - full - false - ..\..\Build\Debug\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\ - DEBUG;TRACE - x86 - prompt - MinimumRecommendedRules.ruleset - - - - pdbonly - true - ..\..\Build\Release\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\ - TRACE - x86 - prompt - MinimumRecommendedRules.ruleset - - - - true - full - false - ..\..\Build\Debug\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\ - DEBUG;TRACE - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - - pdbonly - true - ..\..\Build\Release\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\ - TRACE - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - - - - - - - - {85FDD6BA-871D-46C8-BD64-F6BB0CB5EA95} - QuickLook.Common - False - - - - - - Properties\GitVersion.cs - - - - diff --git a/QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/README.md b/QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/README.md deleted file mode 100644 index b9f9673..0000000 --- a/QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# QuickLook.Plugin.InsvBlocker - -This plugin prevents QuickLook from handling `.insv` files (Insta360 panoramic video files). - -## Purpose - -Insta360Studio has its own QuickLook application with the same name and activation method (pressing spacebar). When both applications are installed, pressing space on `.insv` files would cause both QuickLook windows to appear, creating a conflict. - -This plugin solves that issue by having QuickLook claim the file (via high priority) but immediately close without displaying anything, allowing Insta360Studio's QuickLook to handle the file instead. - -## Implementation - -- **Priority**: `int.MaxValue` (highest priority, checked before all other plugins) -- **Behavior**: - - Returns `true` for `CanHandle()` on files with `.insv` extension - - Sets minimal window size (1x1 pixels) in `Prepare()` - - Closes the window immediately in `View()` using `DispatcherPriority.Send` - -## Technical Details - -The plugin prevents the QuickLook window from becoming visible by: -1. Matching `.insv` files with highest priority -2. Setting a minimal window size to reduce visual impact if window briefly appears -3. Closing the window immediately after content is set, before it becomes visible to the user - -This approach ensures that Insta360Studio's QuickLook can handle the file without interference.