Compare commits

..

3 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
d91ef677f2 Address code review feedback: improve logic and remove redundant code
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
2025-12-08 02:21:31 +00:00
copilot-swe-agent[bot]
9a768b2401 Add remember choice option for protected view notice
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
2025-12-08 02:17:10 +00:00
copilot-swe-agent[bot]
ef17dc5dcc Initial plan 2025-12-08 02:08:39 +00:00
11 changed files with 138 additions and 33 deletions

View File

@@ -1,6 +1,6 @@
# run a build for the latest version and upload the artifacts to a "latest" pre-release
name: build
name: MSBuild
on:
push:
@@ -26,7 +26,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

View File

@@ -1,14 +1,3 @@
## 4.3.0
- Add Svelte syntax highlighting support
- Add ShowInTaskbar setting to display window in taskbar [#1789](https://github.com/QL-Win/QuickLook/issues/1789)
- Add option to disable automatic update check at startup [#1801](https://github.com/QL-Win/QuickLook/issues/1801)
- Update PowerShell syntax colors in dark theme
- Improve TextViewerPanel UI and usability
- Fix DOpus crash when QuickLook runs with different privilege level [#1781](https://github.com/QL-Win/QuickLook/issues/1781)
- Fix volume control exceeding limits during mouse wheel scroll [#1813](https://github.com/QL-Win/QuickLook/issues/1813)
- Fix error in RTF file originating from version 4.2.1 [#1826](https://github.com/QL-Win/QuickLook/issues/1826)
## 4.2.2
- Fix version display issue [#1776](https://github.com/QL-Win/QuickLook/issues/1776)

View File

@@ -73,7 +73,7 @@
<ItemGroup>
<PackageReference Include="FreeTypeSharp" Version="3.0.1" />
<PackageReference Include="QuickLook.Typography.OpenFont" Version="1.0.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3650.58">
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

View File

@@ -61,7 +61,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3650.58">
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

View File

@@ -62,10 +62,10 @@
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.9.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3650.58">
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Google.Protobuf" Version="3.33.2">
<PackageReference Include="Google.Protobuf" Version="3.33.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Memory" Version="4.6.3">

View File

@@ -61,7 +61,7 @@
<ItemGroup>
<PackageReference Include="UTF.Unknown" Version="2.6.0" />
<Reference Include="WindowsBase" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3650.58">
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

View File

@@ -108,19 +108,32 @@ public class Plugin : IViewer
{
context.Title = $"[PROTECTED VIEW] {Path.GetFileName(path)}";
MessageBoxResult result = MessageBox.Show(
"""
Be careful - files from the Internet can contain viruses.
The Office interface prevents loading in Protected View.
// Check if user has a saved preference
var savedPreference = SettingHelper.Get<bool?>("AlwaysUnblockProtectedView", null, "QuickLook.Plugin.OfficeViewer");
Would you like OfficeViewer-Native to unblock the ZoneIdentifier of Internet?
""",
"PROTECTED VIEW",
MessageBoxButton.YesNo,
MessageBoxImage.Question
);
bool shouldUnblock;
if (result == MessageBoxResult.Yes)
if (savedPreference.HasValue)
{
// Use saved preference
shouldUnblock = savedPreference.Value;
}
else
{
// Show dialog to ask user
var dialog = new ProtectedViewDialog();
var dialogResult = dialog.ShowDialog();
shouldUnblock = dialogResult == true;
// Save preference if user checked "Remember my choice"
if (dialog.RememberChoice)
{
SettingHelper.Set("AlwaysUnblockProtectedView", shouldUnblock, "QuickLook.Plugin.OfficeViewer");
}
}
if (shouldUnblock)
{
_ = ZoneIdentifierManager.UnblockZone(path);
}

View File

@@ -0,0 +1,60 @@
<Window x:Class="QuickLook.Plugin.OfficeViewer.ProtectedViewDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="PROTECTED VIEW"
Width="500"
Height="250"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize"
ShowInTaskbar="False">
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
TextWrapping="Wrap"
FontSize="14"
Margin="0,0,0,10">
<Run FontWeight="Bold">Be careful - files from the Internet can contain viruses.</Run>
</TextBlock>
<TextBlock Grid.Row="1"
TextWrapping="Wrap"
Margin="0,0,0,10">
The Office interface prevents loading in Protected View.
</TextBlock>
<TextBlock Grid.Row="2"
TextWrapping="Wrap"
Margin="0,0,0,20">
Would you like OfficeViewer-Native to unblock the ZoneIdentifier of Internet?
</TextBlock>
<StackPanel Grid.Row="3">
<CheckBox x:Name="RememberCheckBox"
Content="Remember my choice"
Margin="0,0,0,15" />
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right">
<Button x:Name="YesButton"
Content="Yes"
Width="80"
Height="30"
Margin="0,0,10,0"
IsDefault="True"
Click="YesButton_Click" />
<Button x:Name="NoButton"
Content="No"
Width="80"
Height="30"
IsCancel="True"
Click="NoButton_Click" />
</StackPanel>
</StackPanel>
</Grid>
</Window>

View File

@@ -0,0 +1,44 @@
// 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 System.Windows;
namespace QuickLook.Plugin.OfficeViewer;
public partial class ProtectedViewDialog : Window
{
public bool RememberChoice => RememberCheckBox.IsChecked ?? false;
public bool UserSelectedYes { get; private set; }
public ProtectedViewDialog()
{
InitializeComponent();
}
private void YesButton_Click(object sender, RoutedEventArgs e)
{
UserSelectedYes = true;
DialogResult = true;
Close();
}
private void NoButton_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
Close();
}
}

View File

@@ -64,7 +64,7 @@
<ItemGroup>
<PackageReference Include="PdfiumViewer.Updated" Version="2.14.5" />
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="145.0.7568" />
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="144.0.7543" />
<Reference Include="WindowsBase" />
</ItemGroup>

View File

@@ -5,8 +5,7 @@
<a href="https://trendshift.io/repositories/3258" target="_blank"><img src="https://trendshift.io/api/badge/repositories/3258" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[![license](https://img.shields.io/github/license/QL-Win/QuickLook.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![Actions](https://github.com/QL-Win/QuickLook/actions/workflows/msbuild.yml/badge.svg)](https://github.com/QL-Win/QuickLook/actions/workflows/msbuild.yml)
[![Platform](https://img.shields.io/badge/platform-Windows-blue?logo=windowsxp&color=1E9BFA)](https://dotnet.microsoft.com/en-us/download/dotnet/latest/runtime)
[![AppVeyor](https://img.shields.io/appveyor/ci/xupefei/QuickLook.svg)](https://ci.appveyor.com/project/xupefei/QuickLook)
[![Github All Releases](https://img.shields.io/github/downloads/QL-Win/QuickLook/total.svg)](https://github.com/QL-Win/QuickLook/releases)
[![GitHub release](https://img.shields.io/github/release/QL-Win/QuickLook.svg)](https://github.com/QL-Win/QuickLook/releases/latest)
@@ -37,7 +36,7 @@ Get it from one of the following sources:
* Microsoft Store (Windows 10 and later only). Not supported on Windows 10 S. Not support file preview in Open-File or Save-File dialogs. <a href="https://www.microsoft.com/store/apps/9nv4bs3l1h4s?ocid=badge" target="_blank"><img src="https://developer.microsoft.com/store/badges/images/English_get_L.png" height="22px" alt="Store Link" /></a>
* Installer or portable archive of the stable version from [GitHub Release](https://github.com/QL-Win/QuickLook/releases)
* Using [Scoop](https://scoop.sh/): `scoop bucket add extras && scoop install extras/quicklook`
* Nightly builds from [GitHub Action](https://github.com/QL-Win/QuickLook/releases/)
* Nightly builds from [AppVeyor](https://ci.appveyor.com/project/xupefei/quicklook/build/artifacts) and [GitHub Action](https://github.com/QL-Win/QuickLook/releases/)
[What are the differences between `.msi`, `.zip`, Nightly and Store versions?](https://github.com/QL-Win/QuickLook/wiki/Differences-Between-Distributions)