mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-02-27 01:00:11 +08:00
Add support for extracting .pak files in MoreMenu
Extended the Plugin.MoreMenu functionality to handle .pak (Chromium resource package) files by integrating PakExtractor for extraction. This allows users to extract .pak files in addition to existing .cfb and .eif formats.
This commit is contained in:
@@ -117,7 +117,7 @@ public partial class PakInfoPanel : UserControl, IDisposable, INotifyPropertyCha
|
||||
|
||||
private void LoadItemsFromPak(string path)
|
||||
{
|
||||
var dict = PakExtractor.ExtractToDictionary(path, true);
|
||||
var dict = PakExtractor.ExtractToDictionary(path, appendExtension: true);
|
||||
var modifiedDate = File.GetLastWriteTime(path);
|
||||
|
||||
foreach (var kv in dict)
|
||||
|
||||
@@ -19,6 +19,7 @@ using QuickLook.Common.Commands;
|
||||
using QuickLook.Common.Controls;
|
||||
using QuickLook.Common.Helpers;
|
||||
using QuickLook.Common.Plugin.MoreMenu;
|
||||
using QuickLook.Plugin.ArchiveViewer.ChromiumResourcePackage;
|
||||
using QuickLook.Plugin.ArchiveViewer.CompoundFileBinary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -54,7 +55,8 @@ public sealed partial class Plugin
|
||||
{
|
||||
// Currently only supports for CFB and EIF files
|
||||
if (_path.EndsWith(".cfb", StringComparison.OrdinalIgnoreCase)
|
||||
|| _path.EndsWith(".eif", StringComparison.OrdinalIgnoreCase))
|
||||
|| _path.EndsWith(".eif", StringComparison.OrdinalIgnoreCase)
|
||||
|| _path.EndsWith(".pak", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Use external Translations.config shipped next to the executing assembly
|
||||
string translationFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Translations.config");
|
||||
@@ -115,6 +117,14 @@ public sealed partial class Plugin
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (_path.EndsWith(".pak", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Chromium resource package file v5 extraction
|
||||
await Task.Run(() =>
|
||||
{
|
||||
PakExtractor.ExtractToDirectory(_path, dialog.FileName);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user