mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-12 01:08:02 +08:00
Compare commits
18 Commits
copilot/cr
...
copilot/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6de335da5 | ||
|
|
eade320211 | ||
|
|
f54f037b01 | ||
|
|
15ec6b4749 | ||
|
|
0d9e80eb36 | ||
|
|
b0dae69889 | ||
|
|
76dfa34928 | ||
|
|
bf7de3bd8e | ||
|
|
1adb7ce980 | ||
|
|
d7edd92204 | ||
|
|
cbf3e566d9 | ||
|
|
f41fb0a68e | ||
|
|
1f96cf5745 | ||
|
|
2e742461f2 | ||
|
|
dc3da38c34 | ||
|
|
f24cbab72a | ||
|
|
17b374b2e9 | ||
|
|
9ebc030f8b |
Submodule QuickLook.Common updated: ffda8978fa...709f26fa38
@@ -30,7 +30,7 @@
|
|||||||
HWND hMsgWnd;
|
HWND hMsgWnd;
|
||||||
HANDLE hGetResultEvent;
|
HANDLE hGetResultEvent;
|
||||||
|
|
||||||
PCHAR pXmlBuffer;
|
PCHAR pXmlBuffer = nullptr;
|
||||||
|
|
||||||
void DOpus::GetSelected(PWCHAR buffer)
|
void DOpus::GetSelected(PWCHAR buffer)
|
||||||
{
|
{
|
||||||
@@ -72,9 +72,12 @@ void DOpus::GetSelected(PWCHAR buffer)
|
|||||||
|
|
||||||
WaitForSingleObject(hGetResultEvent, 2000);
|
WaitForSingleObject(hGetResultEvent, 2000);
|
||||||
|
|
||||||
ParseXmlBuffer(buffer);
|
if (pXmlBuffer != nullptr)
|
||||||
|
{
|
||||||
delete[] pXmlBuffer;
|
ParseXmlBuffer(buffer);
|
||||||
|
delete[] pXmlBuffer;
|
||||||
|
pXmlBuffer = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
||||||
@@ -88,6 +91,9 @@ void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
|||||||
* ...
|
* ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (pXmlBuffer == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
using namespace rapidxml;
|
using namespace rapidxml;
|
||||||
|
|
||||||
xml_document<> doc;
|
xml_document<> doc;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FreeTypeSharp" Version="3.0.1" />
|
<PackageReference Include="FreeTypeSharp" Version="3.0.1" />
|
||||||
<PackageReference Include="QuickLook.Typography.OpenFont" Version="1.0.1" />
|
<PackageReference Include="QuickLook.Typography.OpenFont" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ internal class ImageMagickProvider : AnimationProvider
|
|||||||
{
|
{
|
||||||
if (mi.ColorSpace == ColorSpace.RGB || mi.ColorSpace == ColorSpace.sRGB || mi.ColorSpace == ColorSpace.scRGB)
|
if (mi.ColorSpace == ColorSpace.RGB || mi.ColorSpace == ColorSpace.sRGB || mi.ColorSpace == ColorSpace.scRGB)
|
||||||
{
|
{
|
||||||
mi.SetProfile(ColorProfile.SRGB);
|
mi.SetProfile(ColorProfiles.SRGB);
|
||||||
if (ContextObject.ColorProfileName != null)
|
if (ContextObject.ColorProfileName != null)
|
||||||
mi.SetProfile(new ColorProfile(ContextObject.ColorProfileName)); // map to monitor color
|
mi.SetProfile(new ColorProfile(ContextObject.ColorProfileName)); // map to monitor color
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,10 +62,10 @@
|
|||||||
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.9.1">
|
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.9.1">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Google.Protobuf" Version="3.33.0">
|
<PackageReference Include="Google.Protobuf" Version="3.33.1">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="System.Memory" Version="4.6.3">
|
<PackageReference Include="System.Memory" Version="4.6.3">
|
||||||
|
|||||||
63
QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/Plugin.cs
Normal file
63
QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/Plugin.cs
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<TargetFramework>net462</TargetFramework>
|
||||||
|
<RootNamespace>QuickLook.Plugin.InsvBlocker</RootNamespace>
|
||||||
|
<AssemblyName>QuickLook.Plugin.InsvBlocker</AssemblyName>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<SignAssembly>false</SignAssembly>
|
||||||
|
<UseWPF>true</UseWPF>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
|
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<ProjectGuid>{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}</ProjectGuid>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>..\..\Build\Debug\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>..\..\Build\Release\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>..\..\Build\Debug\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>..\..\Build\Release\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
<Reference Include="System.ComponentModel.Composition" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\QuickLook.Common\QuickLook.Common.csproj">
|
||||||
|
<Project>{85FDD6BA-871D-46C8-BD64-F6BB0CB5EA95}</Project>
|
||||||
|
<Name>QuickLook.Common</Name>
|
||||||
|
<Private>False</Private>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\..\GitVersion.cs">
|
||||||
|
<Link>Properties\GitVersion.cs</Link>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
26
QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/README.md
Normal file
26
QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/README.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# 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.
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MsgReader" Version="6.0.5" />
|
<PackageReference Include="MsgReader" Version="6.0.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="UTF.Unknown" Version="2.6.0" />
|
<PackageReference Include="UTF.Unknown" Version="2.6.0" />
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="PdfiumViewer.Updated" Version="2.14.5" />
|
<PackageReference Include="PdfiumViewer.Updated" Version="2.14.5" />
|
||||||
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="143.0.7497" />
|
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="144.0.7543" />
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<SignAssembly>false</SignAssembly>
|
<SignAssembly>false</SignAssembly>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>preview</LangVersion>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<SyntaxDefinition name="Svelte" extensions=".svelte" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
|
||||||
|
<Color name="Comment" foreground="#6A9955" />
|
||||||
|
<Color name="Tag" foreground="#569CD6" exampleText="div" />
|
||||||
|
<Color name="Attribute" foreground="#9CDCFE" exampleText="on:click" />
|
||||||
|
<Color name="String" foreground="#CE9178" exampleText=""text"" />
|
||||||
|
<Color name="Directive" foreground="#DCDCAA" exampleText="bind:" />
|
||||||
|
<Color name="Keyword" foreground="#C586C0" exampleText="import" />
|
||||||
|
<Color name="Script" foreground="#D4D4D4" />
|
||||||
|
<Color name="Style" foreground="#4EC9B0" />
|
||||||
|
|
||||||
|
<RuleSet name="Html">
|
||||||
|
<Span color="Comment" begin="<!--" end="-->" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
|
||||||
|
<!-- Tags -->
|
||||||
|
<Span color="Tag" begin="<" end=">">
|
||||||
|
<RuleSet>
|
||||||
|
<Keywords color="Tag">
|
||||||
|
<Word>script</Word>
|
||||||
|
<Word>style</Word>
|
||||||
|
<Word>div</Word>
|
||||||
|
<Word>span</Word>
|
||||||
|
<Word>input</Word>
|
||||||
|
<Word>button</Word>
|
||||||
|
<Word>section</Word>
|
||||||
|
<Word>article</Word>
|
||||||
|
<Word>header</Word>
|
||||||
|
<Word>footer</Word>
|
||||||
|
<Word>main</Word>
|
||||||
|
<Word>nav</Word>
|
||||||
|
<Word>aside</Word>
|
||||||
|
<Word>p</Word>
|
||||||
|
<Word>h1</Word>
|
||||||
|
<Word>h2</Word>
|
||||||
|
<Word>h3</Word>
|
||||||
|
<Word>ul</Word>
|
||||||
|
<Word>li</Word>
|
||||||
|
<Word>a</Word>
|
||||||
|
<Word>img</Word>
|
||||||
|
</Keywords>
|
||||||
|
<Keywords color="Directive">
|
||||||
|
<Word>bind:</Word>
|
||||||
|
<Word>on:</Word>
|
||||||
|
<Word>use:</Word>
|
||||||
|
<Word>transition:</Word>
|
||||||
|
<Word>in:</Word>
|
||||||
|
<Word>out:</Word>
|
||||||
|
<Word>animate:</Word>
|
||||||
|
<Word>class:</Word>
|
||||||
|
<Word>style:</Word>
|
||||||
|
</Keywords>
|
||||||
|
<Keywords color="Attribute">
|
||||||
|
<Word>export</Word>
|
||||||
|
<Word>let</Word>
|
||||||
|
<Word>const</Word>
|
||||||
|
</Keywords>
|
||||||
|
</RuleSet>
|
||||||
|
</Span>
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="JavaScript">
|
||||||
|
<Span color="Comment" begin="//" end="\n" />
|
||||||
|
<Span color="Comment" begin="/\*" end="\*/" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
<Keywords color="Keyword">
|
||||||
|
<Word>import</Word>
|
||||||
|
<Word>export</Word>
|
||||||
|
<Word>default</Word>
|
||||||
|
<Word>return</Word>
|
||||||
|
<Word>const</Word>
|
||||||
|
<Word>let</Word>
|
||||||
|
<Word>var</Word>
|
||||||
|
<Word>if</Word>
|
||||||
|
<Word>else</Word>
|
||||||
|
<Word>for</Word>
|
||||||
|
<Word>while</Word>
|
||||||
|
<Word>function</Word>
|
||||||
|
<Word>async</Word>
|
||||||
|
<Word>await</Word>
|
||||||
|
<Word>new</Word>
|
||||||
|
<Word>this</Word>
|
||||||
|
<Word>true</Word>
|
||||||
|
<Word>false</Word>
|
||||||
|
<Word>null</Word>
|
||||||
|
<Word>undefined</Word>
|
||||||
|
<Word>each</Word>
|
||||||
|
<Word>if</Word>
|
||||||
|
<Word>else</Word>
|
||||||
|
<Word>await</Word>
|
||||||
|
<Word>then</Word>
|
||||||
|
<Word>catch</Word>
|
||||||
|
</Keywords>
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="CSS">
|
||||||
|
<Span color="Comment" begin="/\*" end="\*/" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="MainRuleSet">
|
||||||
|
<Import ruleSet="Html" />
|
||||||
|
<Import ruleSet="JavaScript" />
|
||||||
|
<Import ruleSet="CSS" />
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet>
|
||||||
|
<Import ruleSet="MainRuleSet" />
|
||||||
|
</RuleSet>
|
||||||
|
</SyntaxDefinition>
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<SyntaxDefinition name="Svelte" extensions=".svelte" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
|
||||||
|
<Color name="Comment" foreground="#008000" />
|
||||||
|
<Color name="Tag" foreground="#800000" exampleText="div" />
|
||||||
|
<Color name="Attribute" foreground="#0000FF" exampleText="on:click" />
|
||||||
|
<Color name="String" foreground="#A31515" exampleText=""text"" />
|
||||||
|
<Color name="Directive" foreground="#B000B0" exampleText="bind:" />
|
||||||
|
<Color name="Keyword" foreground="#000080" exampleText="import" />
|
||||||
|
<Color name="Script" foreground="#333333" />
|
||||||
|
<Color name="Style" foreground="#0055A5" />
|
||||||
|
|
||||||
|
<RuleSet name="Html">
|
||||||
|
<Span color="Comment" begin="<!--" end="-->" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
|
||||||
|
<!-- Tags -->
|
||||||
|
<Span color="Tag" begin="<" end=">">
|
||||||
|
<RuleSet>
|
||||||
|
<Keywords color="Tag">
|
||||||
|
<Word>script</Word>
|
||||||
|
<Word>style</Word>
|
||||||
|
<Word>div</Word>
|
||||||
|
<Word>span</Word>
|
||||||
|
<Word>input</Word>
|
||||||
|
<Word>button</Word>
|
||||||
|
<Word>section</Word>
|
||||||
|
<Word>article</Word>
|
||||||
|
<Word>header</Word>
|
||||||
|
<Word>footer</Word>
|
||||||
|
<Word>main</Word>
|
||||||
|
<Word>nav</Word>
|
||||||
|
<Word>aside</Word>
|
||||||
|
<Word>p</Word>
|
||||||
|
<Word>h1</Word>
|
||||||
|
<Word>h2</Word>
|
||||||
|
<Word>h3</Word>
|
||||||
|
<Word>ul</Word>
|
||||||
|
<Word>li</Word>
|
||||||
|
<Word>a</Word>
|
||||||
|
<Word>img</Word>
|
||||||
|
</Keywords>
|
||||||
|
<Keywords color="Directive">
|
||||||
|
<Word>bind:</Word>
|
||||||
|
<Word>on:</Word>
|
||||||
|
<Word>use:</Word>
|
||||||
|
<Word>transition:</Word>
|
||||||
|
<Word>in:</Word>
|
||||||
|
<Word>out:</Word>
|
||||||
|
<Word>animate:</Word>
|
||||||
|
<Word>class:</Word>
|
||||||
|
<Word>style:</Word>
|
||||||
|
</Keywords>
|
||||||
|
<Keywords color="Attribute">
|
||||||
|
<Word>export</Word>
|
||||||
|
<Word>let</Word>
|
||||||
|
<Word>const</Word>
|
||||||
|
</Keywords>
|
||||||
|
</RuleSet>
|
||||||
|
</Span>
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="JavaScript">
|
||||||
|
<Span color="Comment" begin="//" end="\n" />
|
||||||
|
<Span color="Comment" begin="/\*" end="\*/" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
<Keywords color="Keyword">
|
||||||
|
<Word>import</Word>
|
||||||
|
<Word>export</Word>
|
||||||
|
<Word>default</Word>
|
||||||
|
<Word>return</Word>
|
||||||
|
<Word>const</Word>
|
||||||
|
<Word>let</Word>
|
||||||
|
<Word>var</Word>
|
||||||
|
<Word>if</Word>
|
||||||
|
<Word>else</Word>
|
||||||
|
<Word>for</Word>
|
||||||
|
<Word>while</Word>
|
||||||
|
<Word>function</Word>
|
||||||
|
<Word>async</Word>
|
||||||
|
<Word>await</Word>
|
||||||
|
<Word>new</Word>
|
||||||
|
<Word>this</Word>
|
||||||
|
<Word>true</Word>
|
||||||
|
<Word>false</Word>
|
||||||
|
<Word>null</Word>
|
||||||
|
<Word>undefined</Word>
|
||||||
|
<Word>each</Word>
|
||||||
|
<Word>if</Word>
|
||||||
|
<Word>else</Word>
|
||||||
|
<Word>await</Word>
|
||||||
|
<Word>then</Word>
|
||||||
|
<Word>catch</Word>
|
||||||
|
</Keywords>
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="CSS">
|
||||||
|
<Span color="Comment" begin="/\*" end="\*/" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="MainRuleSet">
|
||||||
|
<Import ruleSet="Html" />
|
||||||
|
<Import ruleSet="JavaScript" />
|
||||||
|
<Import ruleSet="CSS" />
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet>
|
||||||
|
<Import ruleSet="MainRuleSet" />
|
||||||
|
</RuleSet>
|
||||||
|
</SyntaxDefinition>
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
using ICSharpCode.AvalonEdit;
|
using ICSharpCode.AvalonEdit;
|
||||||
using ICSharpCode.AvalonEdit.Document;
|
using ICSharpCode.AvalonEdit.Document;
|
||||||
|
using ICSharpCode.AvalonEdit.Editing;
|
||||||
using ICSharpCode.AvalonEdit.Rendering;
|
using ICSharpCode.AvalonEdit.Rendering;
|
||||||
using ICSharpCode.AvalonEdit.Search;
|
using ICSharpCode.AvalonEdit.Search;
|
||||||
using QuickLook.Common.Helpers;
|
using QuickLook.Common.Helpers;
|
||||||
@@ -27,6 +28,7 @@ using QuickLook.Plugin.TextViewer.Themes.HighlightingDefinitions;
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@@ -68,16 +70,33 @@ public partial class TextViewerPanel : TextEditor, IDisposable
|
|||||||
ShowLineNumbers = true;
|
ShowLineNumbers = true;
|
||||||
WordWrap = true;
|
WordWrap = true;
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
|
|
||||||
|
// Enable manipulation events (touch gestures like pan/scroll).
|
||||||
IsManipulationEnabled = true;
|
IsManipulationEnabled = true;
|
||||||
|
|
||||||
|
// Disable automatic hyperlink detection for email addresses.
|
||||||
Options.EnableEmailHyperlinks = false;
|
Options.EnableEmailHyperlinks = false;
|
||||||
|
|
||||||
|
// Disable automatic hyperlink detection for general URLs.
|
||||||
Options.EnableHyperlinks = false;
|
Options.EnableHyperlinks = false;
|
||||||
|
|
||||||
|
// Search for the separator line inside the left margins of the TextArea.
|
||||||
|
// The default LineNumberMargin in AvalonEdit often contains a thin Line element
|
||||||
|
// used as a visual separator between line numbers and the text.
|
||||||
|
// If found, set its Stroke to Transparent to hide the separator visually.
|
||||||
|
TextArea.LeftMargins
|
||||||
|
.OfType<System.Windows.Shapes.Line>()
|
||||||
|
.FirstOrDefault()
|
||||||
|
?.Stroke = Brushes.Transparent;
|
||||||
|
|
||||||
ContextMenu = new ContextMenu();
|
ContextMenu = new ContextMenu();
|
||||||
|
// Add "Copy" menu item.
|
||||||
ContextMenu.Items.Add(new MenuItem
|
ContextMenu.Items.Add(new MenuItem
|
||||||
{
|
{
|
||||||
Header = TranslationHelper.Get("Editor_Copy", domain: Assembly.GetExecutingAssembly().GetName().Name),
|
Header = TranslationHelper.Get("Editor_Copy", domain: Assembly.GetExecutingAssembly().GetName().Name),
|
||||||
Command = ApplicationCommands.Copy
|
Command = ApplicationCommands.Copy
|
||||||
});
|
});
|
||||||
|
// Add "Select All" menu item.
|
||||||
ContextMenu.Items.Add(new MenuItem
|
ContextMenu.Items.Add(new MenuItem
|
||||||
{
|
{
|
||||||
Header = TranslationHelper.Get("Editor_SelectAll",
|
Header = TranslationHelper.Get("Editor_SelectAll",
|
||||||
@@ -95,8 +114,10 @@ public partial class TextViewerPanel : TextEditor, IDisposable
|
|||||||
FontFamily = new FontFamily(TranslationHelper.Get("Editor_FontFamily",
|
FontFamily = new FontFamily(TranslationHelper.Get("Editor_FontFamily",
|
||||||
domain: Assembly.GetExecutingAssembly().GetName().Name));
|
domain: Assembly.GetExecutingAssembly().GetName().Name));
|
||||||
|
|
||||||
|
// Add a custom element generator (e.g., to truncate extremely long lines).
|
||||||
TextArea.TextView.ElementGenerators.Add(new TruncateLongLines());
|
TextArea.TextView.ElementGenerators.Add(new TruncateLongLines());
|
||||||
|
|
||||||
|
// Install the search panel (Ctrl+F style search UI).
|
||||||
SearchPanel.Install(this);
|
SearchPanel.Install(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
|
|||||||
|
|
||||||
private void ChangeVolume(double delta)
|
private void ChangeVolume(double delta)
|
||||||
{
|
{
|
||||||
LinearVolume += delta;
|
LinearVolume = Math.Max(0d, Math.Min(1d, LinearVolume + delta));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TogglePlayPause(object sender, EventArgs e)
|
private void TogglePlayPause(object sender, EventArgs e)
|
||||||
@@ -385,16 +385,16 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
|
|||||||
UpdateMeta(path, info);
|
UpdateMeta(path, info);
|
||||||
|
|
||||||
// detect rotation
|
// detect rotation
|
||||||
double.TryParse(info?.Get(StreamKind.Video, 0, "Rotation"), out var rotation);
|
_ = double.TryParse(info?.Get(StreamKind.Video, 0, "Rotation"), out var rotation);
|
||||||
// Correct rotation: on some machine the value "90" becomes "90000" by some reason
|
// Correct rotation: on some machine the value "90" becomes "90000" by some reason
|
||||||
if (rotation > 360)
|
if (rotation > 360d)
|
||||||
rotation /= 1e3;
|
rotation /= 1e3;
|
||||||
if (Math.Abs(rotation) > 0.1)
|
if (Math.Abs(rotation) > 0.1d)
|
||||||
mediaElement.LayoutTransform = new RotateTransform(rotation, 0.5, 0.5);
|
mediaElement.LayoutTransform = new RotateTransform(rotation, 0.5d, 0.5d);
|
||||||
|
|
||||||
mediaElement.Source = new Uri(path);
|
mediaElement.Source = new Uri(path);
|
||||||
// old plugin use an int-typed "Volume" config key ranged from 0 to 100. Let's use a new one here.
|
// old plugin use an int-typed "Volume" config key ranged from 0 to 100. Let's use a new one here.
|
||||||
LinearVolume = SettingHelper.Get("VolumeDouble", 1d, "QuickLook.Plugin.VideoViewer");
|
LinearVolume = Math.Max(0d, Math.Min(1d, SettingHelper.Get("VolumeDouble", 1d, "QuickLook.Plugin.VideoViewer")));
|
||||||
|
|
||||||
mediaElement.Play();
|
mediaElement.Play();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook.Plugin.HelixViewe
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook.Plugin.MediaInfoViewer", "QuickLook.Plugin\QuickLook.Plugin.MediaInfoViewer\QuickLook.Plugin.MediaInfoViewer.csproj", "{B0054A16-472E-44AC-BA40-349303E524FF}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook.Plugin.MediaInfoViewer", "QuickLook.Plugin\QuickLook.Plugin.MediaInfoViewer\QuickLook.Plugin.MediaInfoViewer.csproj", "{B0054A16-472E-44AC-BA40-349303E524FF}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook.Plugin.InsvBlocker", "QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\QuickLook.Plugin.InsvBlocker.csproj", "{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -289,6 +291,14 @@ Global
|
|||||||
{B0054A16-472E-44AC-BA40-349303E524FF}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B0054A16-472E-44AC-BA40-349303E524FF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{B0054A16-472E-44AC-BA40-349303E524FF}.Release|x64.ActiveCfg = Release|Any CPU
|
{B0054A16-472E-44AC-BA40-349303E524FF}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
{B0054A16-472E-44AC-BA40-349303E524FF}.Release|x64.Build.0 = Release|Any CPU
|
{B0054A16-472E-44AC-BA40-349303E524FF}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Release|x64.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -315,6 +325,7 @@ Global
|
|||||||
{B4F7C88D-C79D-49E7-A1FB-FB69CF72585F} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
{B4F7C88D-C79D-49E7-A1FB-FB69CF72585F} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
||||||
{311E6E78-3A5B-4E51-802A-5755BD5F9F97} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
{311E6E78-3A5B-4E51-802A-5755BD5F9F97} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
||||||
{B0054A16-472E-44AC-BA40-349303E524FF} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
{B0054A16-472E-44AC-BA40-349303E524FF} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
||||||
|
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {D3761C32-8C5F-498A-892B-3B0882994B62}
|
SolutionGuid = {D3761C32-8C5F-498A-892B-3B0882994B62}
|
||||||
|
|||||||
@@ -259,6 +259,9 @@ public partial class App : Application
|
|||||||
|
|
||||||
private void CheckUpdate()
|
private void CheckUpdate()
|
||||||
{
|
{
|
||||||
|
if (SettingHelper.Get("DisableAutoUpdateCheck", false))
|
||||||
|
return;
|
||||||
|
|
||||||
if (DateTime.Now.Ticks - SettingHelper.Get<long>("LastUpdateTicks") < TimeSpan.FromDays(30).Ticks)
|
if (DateTime.Now.Ticks - SettingHelper.Get<long>("LastUpdateTicks") < TimeSpan.FromDays(30).Ticks)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
198
QuickLook/Helpers/ExtensionFilterHelper.cs
Normal file
198
QuickLook/Helpers/ExtensionFilterHelper.cs
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
using QuickLook.Common.Helpers;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace QuickLook.Helpers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper class for managing file extension allowlist/blocklist filtering.
|
||||||
|
/// <para>
|
||||||
|
/// <b>Blocklist mode (default):</b> All extensions are allowed except those in the blocklist.
|
||||||
|
/// If the blocklist is empty, all files are allowed.
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// <b>Allowlist mode:</b> Only extensions in the allowlist can be previewed.
|
||||||
|
/// If the allowlist is empty in allowlist mode, all files are allowed (no filtering).
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// Directories and files without extensions are always allowed regardless of the mode.
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
public static class ExtensionFilterHelper
|
||||||
|
{
|
||||||
|
private const string AllowlistKey = "ExtensionAllowlist";
|
||||||
|
private const string BlocklistKey = "ExtensionBlocklist";
|
||||||
|
private const string UseAllowlistModeKey = "UseExtensionAllowlistMode";
|
||||||
|
private static readonly char[] ExtensionSeparators = [';', ','];
|
||||||
|
|
||||||
|
private static HashSet<string> _allowlistCache;
|
||||||
|
private static HashSet<string> _blocklistCache;
|
||||||
|
private static bool? _useAllowlistModeCache;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets whether to use allowlist mode.
|
||||||
|
/// When true, only extensions in the allowlist can be previewed.
|
||||||
|
/// When false (default), extensions in the blocklist are blocked from preview.
|
||||||
|
/// </summary>
|
||||||
|
public static bool UseAllowlistMode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
_useAllowlistModeCache ??= SettingHelper.Get(UseAllowlistModeKey, false);
|
||||||
|
return _useAllowlistModeCache.Value;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_useAllowlistModeCache = value;
|
||||||
|
SettingHelper.Set(UseAllowlistModeKey, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current allowlist of file extensions.
|
||||||
|
/// Extensions should be in the format ".ext" (with leading dot).
|
||||||
|
/// </summary>
|
||||||
|
public static HashSet<string> Allowlist
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_allowlistCache == null)
|
||||||
|
{
|
||||||
|
var list = SettingHelper.Get(AllowlistKey, string.Empty);
|
||||||
|
_allowlistCache = ParseExtensionList(list);
|
||||||
|
}
|
||||||
|
return _allowlistCache;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current blocklist of file extensions.
|
||||||
|
/// Extensions should be in the format ".ext" (with leading dot).
|
||||||
|
/// </summary>
|
||||||
|
public static HashSet<string> Blocklist
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_blocklistCache == null)
|
||||||
|
{
|
||||||
|
var list = SettingHelper.Get(BlocklistKey, string.Empty);
|
||||||
|
_blocklistCache = ParseExtensionList(list);
|
||||||
|
}
|
||||||
|
return _blocklistCache;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the allowlist of file extensions.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="extensions">Collection of extensions in the format ".ext" (with leading dot).</param>
|
||||||
|
public static void SetAllowlist(IEnumerable<string> extensions)
|
||||||
|
{
|
||||||
|
var normalized = NormalizeExtensions(extensions);
|
||||||
|
_allowlistCache = normalized;
|
||||||
|
SettingHelper.Set(AllowlistKey, string.Join(";", normalized));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the blocklist of file extensions.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="extensions">Collection of extensions in the format ".ext" (with leading dot).</param>
|
||||||
|
public static void SetBlocklist(IEnumerable<string> extensions)
|
||||||
|
{
|
||||||
|
var normalized = NormalizeExtensions(extensions);
|
||||||
|
_blocklistCache = normalized;
|
||||||
|
SettingHelper.Set(BlocklistKey, string.Join(";", normalized));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if a file path is allowed for preview based on the current filter settings.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The file path to check.</param>
|
||||||
|
/// <returns>True if the file is allowed for preview, false if it should be blocked.</returns>
|
||||||
|
public static bool IsExtensionAllowed(string path)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(path))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
var extension = Path.GetExtension(path);
|
||||||
|
|
||||||
|
// Files without extensions are always allowed (includes directories)
|
||||||
|
if (string.IsNullOrEmpty(extension))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
extension = extension.ToLowerInvariant();
|
||||||
|
|
||||||
|
if (UseAllowlistMode)
|
||||||
|
{
|
||||||
|
// In allowlist mode: only allow if extension is in the allowlist
|
||||||
|
// If allowlist is empty, allow all (no filtering)
|
||||||
|
return Allowlist.Count == 0 || Allowlist.Contains(extension);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// In blocklist mode: block if extension is in the blocklist
|
||||||
|
return !Blocklist.Contains(extension);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears the cached settings, forcing a reload from the config file.
|
||||||
|
/// </summary>
|
||||||
|
public static void ClearCache()
|
||||||
|
{
|
||||||
|
_allowlistCache = null;
|
||||||
|
_blocklistCache = null;
|
||||||
|
_useAllowlistModeCache = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static HashSet<string> ParseExtensionList(string list)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(list))
|
||||||
|
return new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
return new HashSet<string>(
|
||||||
|
list.Split(ExtensionSeparators, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
.Select(NormalizeExtension)
|
||||||
|
.Where(e => !string.IsNullOrEmpty(e)),
|
||||||
|
StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static HashSet<string> NormalizeExtensions(IEnumerable<string> extensions)
|
||||||
|
{
|
||||||
|
return new HashSet<string>(
|
||||||
|
extensions.Select(NormalizeExtension).Where(e => !string.IsNullOrEmpty(e)),
|
||||||
|
StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string NormalizeExtension(string ext)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(ext))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
ext = ext.Trim().ToLowerInvariant();
|
||||||
|
if (!ext.StartsWith("."))
|
||||||
|
ext = "." + ext;
|
||||||
|
|
||||||
|
return ext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
<PackageReference Include="WPF-UI.Violeta" Version="4.0.3.6">
|
<PackageReference Include="WPF-UI.Violeta" Version="4.0.3.6">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Lib.Harmony" Version="2.4.1">
|
<PackageReference Include="Lib.Harmony" Version="2.4.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="UnblockZoneIdentifier" Version="1.0.0">
|
<PackageReference Include="UnblockZoneIdentifier" Version="1.0.0">
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<MW_Open>افتح الملف {0} باستخدام البرنامج الافتراضي</MW_Open>
|
<MW_Open>افتح الملف {0} باستخدام البرنامج الافتراضي</MW_Open>
|
||||||
<MW_OpenWith>افتح الملف {0} باستخدام برنامج محدد</MW_OpenWith>
|
<MW_OpenWith>افتح الملف {0} باستخدام برنامج محدد</MW_OpenWith>
|
||||||
<MW_Run>شغل الملف {0} المحدد</MW_Run>
|
<MW_Run>شغل الملف {0} المحدد</MW_Run>
|
||||||
|
<MW_FileBlocked>هذا النوع من الملفات محظور.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>شغل البرنامج أوتوماتيكيًا عند تشغيل النظام</Icon_RunAtStartup>
|
<Icon_RunAtStartup>شغل البرنامج أوتوماتيكيًا عند تشغيل النظام</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>النسخة {0} من كويك لووك</Icon_ToolTip>
|
<Icon_ToolTip>النسخة {0} من كويك لووك</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>تأكد من وجود أي تحديث للبرنامج</Icon_CheckUpdate>
|
<Icon_CheckUpdate>تأكد من وجود أي تحديث للبرنامج</Icon_CheckUpdate>
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
<MW_Open>Megnyitás {0}</MW_Open>
|
<MW_Open>Megnyitás {0}</MW_Open>
|
||||||
<MW_OpenWith>Megnyitás ezzel {0}</MW_OpenWith>
|
<MW_OpenWith>Megnyitás ezzel {0}</MW_OpenWith>
|
||||||
<MW_Run>Futtatás {0}</MW_Run>
|
<MW_Run>Futtatás {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Ez a fájltípus blokkolva van.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>Futattás &Indításkor</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Futattás &Indításkor</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>Keressen új &Frissítést...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>Keressen új &Frissítést...</Icon_CheckUpdate>
|
||||||
@@ -69,6 +71,7 @@
|
|||||||
<MW_Open>Otvoriť {0}</MW_Open>
|
<MW_Open>Otvoriť {0}</MW_Open>
|
||||||
<MW_OpenWith>Otvoriť v programe {0}</MW_OpenWith>
|
<MW_OpenWith>Otvoriť v programe {0}</MW_OpenWith>
|
||||||
<MW_Run>Spustiť {0}</MW_Run>
|
<MW_Run>Spustiť {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Tento typ súboru je blokovaný.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>Spustiť pri &štarte</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Spustiť pri &štarte</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>Skontrolovať &aktualizácie...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>Skontrolovať &aktualizácie...</Icon_CheckUpdate>
|
||||||
@@ -97,6 +100,7 @@
|
|||||||
<MW_Open>Buka {0}</MW_Open>
|
<MW_Open>Buka {0}</MW_Open>
|
||||||
<MW_OpenWith>Buka dengan {0}</MW_OpenWith>
|
<MW_OpenWith>Buka dengan {0}</MW_OpenWith>
|
||||||
<MW_Run>Jalankan {0}</MW_Run>
|
<MW_Run>Jalankan {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Jenis file ini diblokir.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>Jalankan saat &Memulai</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Jalankan saat &Memulai</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v. {0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v. {0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>Memeriksa &Pembaharuan...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>Memeriksa &Pembaharuan...</Icon_CheckUpdate>
|
||||||
@@ -130,6 +134,7 @@
|
|||||||
<MW_Open>{0} 열기</MW_Open>
|
<MW_Open>{0} 열기</MW_Open>
|
||||||
<MW_OpenWith>{0}(으)로 열기</MW_OpenWith>
|
<MW_OpenWith>{0}(으)로 열기</MW_OpenWith>
|
||||||
<MW_Run>{0} 실행</MW_Run>
|
<MW_Run>{0} 실행</MW_Run>
|
||||||
|
<MW_FileBlocked>이 파일 유형은 차단되었습니다.</MW_FileBlocked>
|
||||||
<MW_Share>공유</MW_Share>
|
<MW_Share>공유</MW_Share>
|
||||||
<Icon_RunAtStartup>시작 시 실행(&S)</Icon_RunAtStartup>
|
<Icon_RunAtStartup>시작 시 실행(&S)</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
@@ -160,6 +165,7 @@
|
|||||||
<MW_Open>Obre {0}</MW_Open>
|
<MW_Open>Obre {0}</MW_Open>
|
||||||
<MW_OpenWith>Obre'l amb {0}</MW_OpenWith>
|
<MW_OpenWith>Obre'l amb {0}</MW_OpenWith>
|
||||||
<MW_Run>Executa'l {0}</MW_Run>
|
<MW_Run>Executa'l {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Aquest tipus de fitxer està bloquejat.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>Executa'l a l'&inici</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Executa'l a l'&inici</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>Cerca &actualitzacions...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>Cerca &actualitzacions...</Icon_CheckUpdate>
|
||||||
@@ -192,6 +198,7 @@
|
|||||||
<MW_OpenWith>Öffnen mit {0}</MW_OpenWith>
|
<MW_OpenWith>Öffnen mit {0}</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>Öffnen mit ...</MW_OpenWithMenu>
|
<MW_OpenWithMenu>Öffnen mit ...</MW_OpenWithMenu>
|
||||||
<MW_Run>{0} ausführen</MW_Run>
|
<MW_Run>{0} ausführen</MW_Run>
|
||||||
|
<MW_FileBlocked>Dieser Dateityp ist blockiert.</MW_FileBlocked>
|
||||||
<MW_Share>Freigeben</MW_Share>
|
<MW_Share>Freigeben</MW_Share>
|
||||||
<MW_Reload>Neu laden</MW_Reload>
|
<MW_Reload>Neu laden</MW_Reload>
|
||||||
<MW_More>Mehr</MW_More>
|
<MW_More>Mehr</MW_More>
|
||||||
@@ -229,6 +236,7 @@
|
|||||||
<MW_OpenWith>Open with {0}</MW_OpenWith>
|
<MW_OpenWith>Open with {0}</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>Open With Menu</MW_OpenWithMenu>
|
<MW_OpenWithMenu>Open With Menu</MW_OpenWithMenu>
|
||||||
<MW_Run>Run {0}</MW_Run>
|
<MW_Run>Run {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>This file type is blocked.</MW_FileBlocked>
|
||||||
<MW_Share>Share</MW_Share>
|
<MW_Share>Share</MW_Share>
|
||||||
<MW_Reload>Reload</MW_Reload>
|
<MW_Reload>Reload</MW_Reload>
|
||||||
<MW_More>More</MW_More>
|
<MW_More>More</MW_More>
|
||||||
@@ -266,6 +274,7 @@
|
|||||||
<MW_OpenWith>Abrir con {0}</MW_OpenWith>
|
<MW_OpenWith>Abrir con {0}</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>Abrir Con Menu</MW_OpenWithMenu>
|
<MW_OpenWithMenu>Abrir Con Menu</MW_OpenWithMenu>
|
||||||
<MW_Run>Iniciar {0}</MW_Run>
|
<MW_Run>Iniciar {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Este tipo de archivo está bloqueado.</MW_FileBlocked>
|
||||||
<MW_Share>Compartir</MW_Share>
|
<MW_Share>Compartir</MW_Share>
|
||||||
<MW_Reload>Recargar</MW_Reload>
|
<MW_Reload>Recargar</MW_Reload>
|
||||||
<MW_More>Más</MW_More>
|
<MW_More>Más</MW_More>
|
||||||
@@ -299,6 +308,7 @@
|
|||||||
<MW_Open>Ouvrir {0}</MW_Open>
|
<MW_Open>Ouvrir {0}</MW_Open>
|
||||||
<MW_OpenWith>Ouvrir avec {0}</MW_OpenWith>
|
<MW_OpenWith>Ouvrir avec {0}</MW_OpenWith>
|
||||||
<MW_Run>Exécuter {0}</MW_Run>
|
<MW_Run>Exécuter {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Ce type de fichier est bloqué.</MW_FileBlocked>
|
||||||
<MW_Reload>Recharger</MW_Reload>
|
<MW_Reload>Recharger</MW_Reload>
|
||||||
<MW_More>Plus</MW_More>
|
<MW_More>Plus</MW_More>
|
||||||
<Icon_RunAtStartup>Exécuter au &démarrage</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Exécuter au &démarrage</Icon_RunAtStartup>
|
||||||
@@ -331,6 +341,7 @@
|
|||||||
<MW_Open>Apri {0}</MW_Open>
|
<MW_Open>Apri {0}</MW_Open>
|
||||||
<MW_OpenWith>Apri con {0}</MW_OpenWith>
|
<MW_OpenWith>Apri con {0}</MW_OpenWith>
|
||||||
<MW_Run>Esegui {0}</MW_Run>
|
<MW_Run>Esegui {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Questo tipo di file è bloccato.</MW_FileBlocked>
|
||||||
<MW_Reload>Ricarica</MW_Reload>
|
<MW_Reload>Ricarica</MW_Reload>
|
||||||
<MW_More>Altro</MW_More>
|
<MW_More>Altro</MW_More>
|
||||||
<Icon_RunAtStartup>Esegui all'&Avvio</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Esegui all'&Avvio</Icon_RunAtStartup>
|
||||||
@@ -365,6 +376,7 @@
|
|||||||
<MW_OpenWith>{0} で開く</MW_OpenWith>
|
<MW_OpenWith>{0} で開く</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>メニューから選択して開く</MW_OpenWithMenu>
|
<MW_OpenWithMenu>メニューから選択して開く</MW_OpenWithMenu>
|
||||||
<MW_Run>{0} を起動</MW_Run>
|
<MW_Run>{0} を起動</MW_Run>
|
||||||
|
<MW_FileBlocked>このファイルタイプはブロックされています.</MW_FileBlocked>
|
||||||
<MW_Share>シェア</MW_Share>
|
<MW_Share>シェア</MW_Share>
|
||||||
<MW_Reload>再読み込み</MW_Reload>
|
<MW_Reload>再読み込み</MW_Reload>
|
||||||
<MW_More>その他</MW_More>
|
<MW_More>その他</MW_More>
|
||||||
@@ -397,6 +409,7 @@
|
|||||||
<MW_Open>Åpne {0}</MW_Open>
|
<MW_Open>Åpne {0}</MW_Open>
|
||||||
<MW_OpenWith>Åpne med {0}</MW_OpenWith>
|
<MW_OpenWith>Åpne med {0}</MW_OpenWith>
|
||||||
<MW_Run>Kjør {0}</MW_Run>
|
<MW_Run>Kjør {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Denne filtypen er blokkert.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>Kjør ved &oppstart</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Kjør ved &oppstart</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>Se etter &oppdateringer...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>Se etter &oppdateringer...</Icon_CheckUpdate>
|
||||||
@@ -424,6 +437,7 @@
|
|||||||
<MW_Open>Open {0}</MW_Open>
|
<MW_Open>Open {0}</MW_Open>
|
||||||
<MW_OpenWith>Openen met {0}</MW_OpenWith>
|
<MW_OpenWith>Openen met {0}</MW_OpenWith>
|
||||||
<MW_Run>Uitvoeren {0}</MW_Run>
|
<MW_Run>Uitvoeren {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Dit bestandstype is geblokkeerd.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>Uitvoeren bij &Opstarten</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Uitvoeren bij &Opstarten</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>Controleren op &Updates...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>Controleren op &Updates...</Icon_CheckUpdate>
|
||||||
@@ -456,6 +470,7 @@
|
|||||||
<MW_OpenWith>Otwórz w {0}</MW_OpenWith>
|
<MW_OpenWith>Otwórz w {0}</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>Otwórz za pomocą...</MW_OpenWithMenu>
|
<MW_OpenWithMenu>Otwórz za pomocą...</MW_OpenWithMenu>
|
||||||
<MW_Run>Uruchom {0}</MW_Run>
|
<MW_Run>Uruchom {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Ten typ pliku jest zablokowany.</MW_FileBlocked>
|
||||||
<MW_Share>Udostępnij</MW_Share>
|
<MW_Share>Udostępnij</MW_Share>
|
||||||
<MW_Reload>Przeładuj</MW_Reload>
|
<MW_Reload>Przeładuj</MW_Reload>
|
||||||
<MW_More>Więcej</MW_More>
|
<MW_More>Więcej</MW_More>
|
||||||
@@ -493,6 +508,7 @@
|
|||||||
<MW_OpenWith>Abrir com {0}</MW_OpenWith>
|
<MW_OpenWith>Abrir com {0}</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>Menu abrir com</MW_OpenWithMenu>
|
<MW_OpenWithMenu>Menu abrir com</MW_OpenWithMenu>
|
||||||
<MW_Run>Executar {0}</MW_Run>
|
<MW_Run>Executar {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Este tipo de arquivo está bloqueado.</MW_FileBlocked>
|
||||||
<MW_Share>Compartilhar</MW_Share>
|
<MW_Share>Compartilhar</MW_Share>
|
||||||
<MW_Reload>Recarregar</MW_Reload>
|
<MW_Reload>Recarregar</MW_Reload>
|
||||||
<MW_More>Mais</MW_More>
|
<MW_More>Mais</MW_More>
|
||||||
@@ -525,6 +541,7 @@
|
|||||||
<MW_Open>Abrir {0}</MW_Open>
|
<MW_Open>Abrir {0}</MW_Open>
|
||||||
<MW_OpenWith>Abrir com {0}</MW_OpenWith>
|
<MW_OpenWith>Abrir com {0}</MW_OpenWith>
|
||||||
<MW_Run>Executar {0}</MW_Run>
|
<MW_Run>Executar {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Este tipo de ficheiro está bloqueado.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>Executar no &Arranque</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Executar no &Arranque</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>Procurar por &Atualizações...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>Procurar por &Atualizações...</Icon_CheckUpdate>
|
||||||
@@ -553,6 +570,7 @@
|
|||||||
<MW_Open>Открыть {0}</MW_Open>
|
<MW_Open>Открыть {0}</MW_Open>
|
||||||
<MW_OpenWith>Открыть с помощью {0}</MW_OpenWith>
|
<MW_OpenWith>Открыть с помощью {0}</MW_OpenWith>
|
||||||
<MW_Run>Запустить {0}</MW_Run>
|
<MW_Run>Запустить {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Этот тип файла заблокирован.</MW_FileBlocked>
|
||||||
<MW_StayTop>Поверх всех окон</MW_StayTop>
|
<MW_StayTop>Поверх всех окон</MW_StayTop>
|
||||||
<MW_PreventClosing>Закрепить</MW_PreventClosing>
|
<MW_PreventClosing>Закрепить</MW_PreventClosing>
|
||||||
<MW_Share>Поделиться</MW_Share>
|
<MW_Share>Поделиться</MW_Share>
|
||||||
@@ -587,6 +605,7 @@
|
|||||||
<MW_Open>Aç: {0}</MW_Open>
|
<MW_Open>Aç: {0}</MW_Open>
|
||||||
<MW_OpenWith>Birlikte aç: {0}</MW_OpenWith>
|
<MW_OpenWith>Birlikte aç: {0}</MW_OpenWith>
|
||||||
<MW_Run>Çalıştır: {0}</MW_Run>
|
<MW_Run>Çalıştır: {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Bu dosya türü engellenmiştir.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>B&aşlangıçta çalıştır</Icon_RunAtStartup>
|
<Icon_RunAtStartup>B&aşlangıçta çalıştır</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>&Güncellemeleri denetle...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>&Güncellemeleri denetle...</Icon_CheckUpdate>
|
||||||
@@ -620,6 +639,7 @@
|
|||||||
<MW_OpenWith>Відкрити за допомогою {0}</MW_OpenWith>
|
<MW_OpenWith>Відкрити за допомогою {0}</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>Відкрити за допомогою меню</MW_OpenWithMenu>
|
<MW_OpenWithMenu>Відкрити за допомогою меню</MW_OpenWithMenu>
|
||||||
<MW_Run>Запустити {0}</MW_Run>
|
<MW_Run>Запустити {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Цей тип файлу заблоковано.</MW_FileBlocked>
|
||||||
<MW_Share>Поширити</MW_Share>
|
<MW_Share>Поширити</MW_Share>
|
||||||
<MW_Reload>Перезавантажити</MW_Reload>
|
<MW_Reload>Перезавантажити</MW_Reload>
|
||||||
<MW_More>Більше</MW_More>
|
<MW_More>Більше</MW_More>
|
||||||
@@ -652,6 +672,7 @@
|
|||||||
<MW_Open>Mở {0}</MW_Open>
|
<MW_Open>Mở {0}</MW_Open>
|
||||||
<MW_OpenWith>Mở bằng {0}</MW_OpenWith>
|
<MW_OpenWith>Mở bằng {0}</MW_OpenWith>
|
||||||
<MW_Run>Chạy {0}</MW_Run>
|
<MW_Run>Chạy {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Loại tệp này bị chặn.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>&Khởi động cùng hệ thống</Icon_RunAtStartup>
|
<Icon_RunAtStartup>&Khởi động cùng hệ thống</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>&Kiểm tra cập nhật...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>&Kiểm tra cập nhật...</Icon_CheckUpdate>
|
||||||
@@ -684,6 +705,7 @@
|
|||||||
<MW_OpenWith>用 {0} 打开</MW_OpenWith>
|
<MW_OpenWith>用 {0} 打开</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>从菜单选择打开</MW_OpenWithMenu>
|
<MW_OpenWithMenu>从菜单选择打开</MW_OpenWithMenu>
|
||||||
<MW_Run>运行 {0}</MW_Run>
|
<MW_Run>运行 {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>此文件类型已被阻止。</MW_FileBlocked>
|
||||||
<MW_Share>分享</MW_Share>
|
<MW_Share>分享</MW_Share>
|
||||||
<MW_Reload>重新加载</MW_Reload>
|
<MW_Reload>重新加载</MW_Reload>
|
||||||
<MW_More>更多</MW_More>
|
<MW_More>更多</MW_More>
|
||||||
@@ -721,6 +743,7 @@
|
|||||||
<MW_OpenWith>使用 {0} 開啟</MW_OpenWith>
|
<MW_OpenWith>使用 {0} 開啟</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>從選單選擇開啟</MW_OpenWithMenu>
|
<MW_OpenWithMenu>從選單選擇開啟</MW_OpenWithMenu>
|
||||||
<MW_Run>執行 {0}</MW_Run>
|
<MW_Run>執行 {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>此檔案類型已被阻止。</MW_FileBlocked>
|
||||||
<MW_Share>分享</MW_Share>
|
<MW_Share>分享</MW_Share>
|
||||||
<MW_Reload>重新載入</MW_Reload>
|
<MW_Reload>重新載入</MW_Reload>
|
||||||
<MW_More>更多</MW_More>
|
<MW_More>更多</MW_More>
|
||||||
@@ -754,6 +777,7 @@
|
|||||||
<MW_Open>{0} उघडा</MW_Open>
|
<MW_Open>{0} उघडा</MW_Open>
|
||||||
<MW_OpenWith>{0} च्या सह उघडा</MW_OpenWith>
|
<MW_OpenWith>{0} च्या सह उघडा</MW_OpenWith>
|
||||||
<MW_Run>{0} चालवा</MW_Run>
|
<MW_Run>{0} चालवा</MW_Run>
|
||||||
|
<MW_FileBlocked>हा फाइल प्रकार ब्लॉक केला आहे.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>&सुरूवातीस चालवा</Icon_RunAtStartup>
|
<Icon_RunAtStartup>&सुरूवातीस चालवा</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook आवृत्ती v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook आवृत्ती v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>&अद्यतनांसाठी तपासा...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>&अद्यतनांसाठी तपासा...</Icon_CheckUpdate>
|
||||||
@@ -781,6 +805,7 @@
|
|||||||
<MW_Open>{0} खोलें</MW_Open>
|
<MW_Open>{0} खोलें</MW_Open>
|
||||||
<MW_OpenWith>{0} के साथ खोलें</MW_OpenWith>
|
<MW_OpenWith>{0} के साथ खोलें</MW_OpenWith>
|
||||||
<MW_Run>{0} चलाएं</MW_Run>
|
<MW_Run>{0} चलाएं</MW_Run>
|
||||||
|
<MW_FileBlocked>यह फ़ाइल प्रकार अवरुद्ध है.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>&शुरु होते समय चलाएं</Icon_RunAtStartup>
|
<Icon_RunAtStartup>&शुरु होते समय चलाएं</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook आवृत्ती v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook आवृत्ती v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>&अद्यतन के लिए जाँच करें...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>&अद्यतन के लिए जाँच करें...</Icon_CheckUpdate>
|
||||||
@@ -808,6 +833,8 @@
|
|||||||
<MW_BrowseFolder>סייר ב{0}</MW_BrowseFolder>
|
<MW_BrowseFolder>סייר ב{0}</MW_BrowseFolder>
|
||||||
<MW_Open>פתח את {0}</MW_Open>
|
<MW_Open>פתח את {0}</MW_Open>
|
||||||
<MW_OpenWith>פתח בעזרת {0}</MW_OpenWith>
|
<MW_OpenWith>פתח בעזרת {0}</MW_OpenWith>
|
||||||
|
<MW_Run>הפעל {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>סוג קובץ זה חסום.</MW_FileBlocked>
|
||||||
<MW_Run>הרץ {0}</MW_Run>
|
<MW_Run>הרץ {0}</MW_Run>
|
||||||
<Icon_RunAtStartup>הרץ ב&אתחול</Icon_RunAtStartup>
|
<Icon_RunAtStartup>הרץ ב&אתחול</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>'תצוגה מהירה' v{0}</Icon_ToolTip>
|
<Icon_ToolTip>'תצוגה מהירה' v{0}</Icon_ToolTip>
|
||||||
@@ -837,6 +864,7 @@
|
|||||||
<MW_Open>Άνοιγμα {0}</MW_Open>
|
<MW_Open>Άνοιγμα {0}</MW_Open>
|
||||||
<MW_OpenWith>Άνοιγμα με {0}</MW_OpenWith>
|
<MW_OpenWith>Άνοιγμα με {0}</MW_OpenWith>
|
||||||
<MW_Run>Εκτέλεση {0}</MW_Run>
|
<MW_Run>Εκτέλεση {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Αυτός ο τύπος αρχείου είναι αποκλεισμένος.</MW_FileBlocked>
|
||||||
<Icon_RunAtStartup>Εκτέλεση κατά &την εκκίνηση</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Εκτέλεση κατά &την εκκίνηση</Icon_RunAtStartup>
|
||||||
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
<Icon_ToolTip>QuickLook v{0}</Icon_ToolTip>
|
||||||
<Icon_CheckUpdate>Ελεγχος για &ενημερώσεις...</Icon_CheckUpdate>
|
<Icon_CheckUpdate>Ελεγχος για &ενημερώσεις...</Icon_CheckUpdate>
|
||||||
@@ -868,6 +896,7 @@
|
|||||||
<MW_OpenWith>Öppna med {0}</MW_OpenWith>
|
<MW_OpenWith>Öppna med {0}</MW_OpenWith>
|
||||||
<MW_OpenWithMenu>Öppna med…</MW_OpenWithMenu>
|
<MW_OpenWithMenu>Öppna med…</MW_OpenWithMenu>
|
||||||
<MW_Run>Kör {0}</MW_Run>
|
<MW_Run>Kör {0}</MW_Run>
|
||||||
|
<MW_FileBlocked>Den här filtypen är blockerad.</MW_FileBlocked>
|
||||||
<MW_Share>Dela</MW_Share>
|
<MW_Share>Dela</MW_Share>
|
||||||
<MW_Reload>Ladda om</MW_Reload>
|
<MW_Reload>Ladda om</MW_Reload>
|
||||||
<Icon_RunAtStartup>Kör vid &start</Icon_RunAtStartup>
|
<Icon_RunAtStartup>Kör vid &start</Icon_RunAtStartup>
|
||||||
|
|||||||
@@ -151,10 +151,15 @@ public class ViewWindowManager : IDisposable
|
|||||||
if (_viewerWindow.IsVisible && path == _invokedPath)
|
if (_viewerWindow.IsVisible && path == _invokedPath)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!Directory.Exists(path) && !File.Exists(path))
|
var isDirectory = Directory.Exists(path);
|
||||||
|
if (!isDirectory && !File.Exists(path))
|
||||||
if (!path.StartsWith("::")) // CLSID
|
if (!path.StartsWith("::")) // CLSID
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Check extension filtering before proceeding (skip for directories)
|
||||||
|
if (!isDirectory && !ExtensionFilterHelper.IsExtensionAllowed(path))
|
||||||
|
return;
|
||||||
|
|
||||||
_invokedPath = path;
|
_invokedPath = path;
|
||||||
|
|
||||||
RunFocusMonitor();
|
RunFocusMonitor();
|
||||||
@@ -172,7 +177,12 @@ public class ViewWindowManager : IDisposable
|
|||||||
if (string.IsNullOrEmpty(path))
|
if (string.IsNullOrEmpty(path))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!Directory.Exists(path) && !File.Exists(path))
|
var isDirectory = Directory.Exists(path);
|
||||||
|
if (!isDirectory && !File.Exists(path))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Check extension filtering before proceeding (skip for directories)
|
||||||
|
if (!isDirectory && !ExtensionFilterHelper.IsExtensionAllowed(path))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RunFocusMonitor();
|
RunFocusMonitor();
|
||||||
|
|||||||
@@ -201,6 +201,19 @@ public partial class ViewerWindow
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ContextObject.IsBlocked)
|
||||||
|
{
|
||||||
|
ContextObject.ViewerContent = new System.Windows.Controls.TextBlock
|
||||||
|
{
|
||||||
|
Text = TranslationHelper.Get("MW_FileBlocked", failsafe: "This file type is blocked."),
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
FontSize = 14,
|
||||||
|
};
|
||||||
|
ContextObject.IsBusy = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SetOpenWithButtonAndPath();
|
SetOpenWithButtonAndPath();
|
||||||
|
|
||||||
// Revert UI changes
|
// Revert UI changes
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public partial class ViewerWindow : Window
|
|||||||
Topmost = SettingHelper.Get("Topmost", false);
|
Topmost = SettingHelper.Get("Topmost", false);
|
||||||
buttonTop.Tag = Topmost ? "Top" : "Auto";
|
buttonTop.Tag = Topmost ? "Top" : "Auto";
|
||||||
|
|
||||||
|
ShowInTaskbar = SettingHelper.Get("ShowInTaskbar", false);
|
||||||
|
|
||||||
buttonTop.Click += (_, _) =>
|
buttonTop.Click += (_, _) =>
|
||||||
{
|
{
|
||||||
Topmost = !Topmost;
|
Topmost = !Topmost;
|
||||||
|
|||||||
Reference in New Issue
Block a user