mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-03 19:26:40 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
eef76468c4 | ||
![]() |
23d90b3de4 | ||
![]() |
ba2d5d2ab2 | ||
![]() |
3e99427d0b |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -288,3 +288,4 @@ __pycache__/
|
||||
*.xsd.cs
|
||||
|
||||
/QuickLook.Plugin.PDFViewer/MoonPdfLib
|
||||
/GitVersion.cs
|
||||
|
@@ -1,2 +0,0 @@
|
||||
bc a -r Debug_%date:~-4,4%%date:~-7,2%%date:~-10,2%.zip Build\Debug\*.exe Build\Debug\*.dll
|
||||
bc a -r Release_%date:~-4,4%%date:~-7,2%%date:~-10,2%.zip Build\Release\*.exe Build\Release\*.dll
|
@@ -30,6 +30,4 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
@@ -50,6 +50,9 @@
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\GitVersion.cs">
|
||||
<Link>Properties\GitVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="ArchiveInfoPanel.xaml.cs">
|
||||
<DependentUpon>ArchiveInfoPanel.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@@ -30,6 +30,4 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
@@ -49,6 +49,9 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\GitVersion.cs">
|
||||
<Link>Properties\GitVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="ImageFileHelper.cs" />
|
||||
<Compile Include="ImagePanel.xaml.cs">
|
||||
<DependentUpon>ImagePanel.xaml</DependentUpon>
|
||||
|
@@ -48,6 +48,4 @@ using System.Windows;
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
@@ -67,6 +67,9 @@
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\GitVersion.cs">
|
||||
<Link>Properties\GitVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="OfficeInteropWrapper.cs" />
|
||||
<Compile Include="PluginInterface.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
@@ -30,6 +30,4 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
@@ -49,6 +49,9 @@
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\GitVersion.cs">
|
||||
<Link>Properties\GitVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="PdfViewerControl.xaml.cs">
|
||||
<DependentUpon>PdfViewerControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@@ -30,6 +30,4 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
@@ -46,6 +46,9 @@
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\GitVersion.cs">
|
||||
<Link>Properties\GitVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TextViewerPanel.xaml.cs">
|
||||
|
@@ -48,6 +48,4 @@ using System.Windows;
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
@@ -60,6 +60,9 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="..\..\GitVersion.cs">
|
||||
<Link>Properties\GitVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="DoubleToHMSConverter.cs" />
|
||||
<Compile Include="PluginInterface.cs" />
|
||||
<Compile Include="ViewerPanel.xaml.cs">
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26403.7
|
||||
VisualStudioVersion = 15.0.26430.4
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook", "QuickLook\QuickLook.csproj", "{8B4A9CE5-67B5-4A94-81CB-3771F688FDEB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
@@ -24,6 +24,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook.Plugin.OfficeView
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook.Plugin.VideoViewer", "QuickLook.Plugin\QuickLook.Plugin.VideoViewer\QuickLook.Plugin.VideoViewer.csproj", "{1B746D92-49A5-4A37-9D75-DCC490393290}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BAE81497-98FA-4A7A-A0FB-2B86C9694B9C}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
GitVersion.cs = GitVersion.cs
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
|
@@ -4,4 +4,7 @@
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<legacyCorruptedStateExceptionsPolicy enabled="true" />
|
||||
</runtime>
|
||||
</configuration>
|
@@ -6,6 +6,16 @@ namespace QuickLook.Plugin.InfoPanel
|
||||
{
|
||||
public static class FileHelper
|
||||
{
|
||||
public static void GetDriveSpace(string path, out long totalSpace, out long totalFreeSpace)
|
||||
{
|
||||
totalSpace = totalFreeSpace = 0L;
|
||||
|
||||
var root = new DriveInfo(Path.GetPathRoot(path));
|
||||
|
||||
totalSpace = root.TotalSize;
|
||||
totalFreeSpace = root.AvailableFreeSpace;
|
||||
}
|
||||
|
||||
public static void CountFolder(string root, ref bool stop, out long totalDirs, out long totalFiles,
|
||||
out long totalSize)
|
||||
{
|
||||
|
@@ -51,6 +51,19 @@ namespace QuickLook.Plugin.InfoPanel
|
||||
|
||||
Dispatcher.Invoke(() => { totalSize.Text = size.ToPrettySize(2); });
|
||||
}
|
||||
else if (Path.GetPathRoot(path) == path) // is this a drive?
|
||||
{
|
||||
long totalSpace;
|
||||
long totalFreeSpace;
|
||||
|
||||
FileHelper.GetDriveSpace(path, out totalSpace, out totalFreeSpace);
|
||||
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
totalSize.Text =
|
||||
$"Capacity {totalSpace.ToPrettySize(2)}, {totalFreeSpace.ToPrettySize(2)} available";
|
||||
});
|
||||
}
|
||||
else if (Directory.Exists(path))
|
||||
{
|
||||
long totalDirsL;
|
||||
|
@@ -48,6 +48,4 @@ using System.Windows;
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
@@ -78,6 +78,9 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="..\GitVersion.cs">
|
||||
<Link>Properties\GitVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Helpers\AutoStartupHelper.cs" />
|
||||
<Compile Include="Controls\BackgroundVisualHost.cs" />
|
||||
<Compile Include="Controls\BusyDecorator.cs" />
|
||||
@@ -185,4 +188,7 @@
|
||||
<None Include="Resources\app_white.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>"$(SolutionDir)update-version.cmd" "$(SolutionDir)" "$(SolutionDir)GitVersion.cs"</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@@ -47,15 +47,37 @@ namespace QuickLook
|
||||
{
|
||||
_viewWindow.BeginShow(matchedPlugin, path);
|
||||
}
|
||||
catch (Exception e) // if current plugin failed, switch to default one
|
||||
catch (Exception e) // if current plugin failed, switch to default one.
|
||||
{
|
||||
_viewWindow.Close();
|
||||
|
||||
Debug.WriteLine(e.ToString());
|
||||
Debug.WriteLine(e.StackTrace);
|
||||
|
||||
if (matchedPlugin.GetType() != PluginManager.GetInstance().DefaultPlugin)
|
||||
{
|
||||
matchedPlugin.Dispose();
|
||||
_viewWindow.BeginShow(PluginManager.GetInstance().DefaultPlugin.CreateInstance<IViewer>(), path);
|
||||
matchedPlugin = PluginManager.GetInstance().DefaultPlugin.CreateInstance<IViewer>();
|
||||
BeginShowNewWindow(matchedPlugin, path);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
catch // Catch SEH exceptions here.
|
||||
{
|
||||
_viewWindow.Close();
|
||||
|
||||
if (matchedPlugin.GetType() != PluginManager.GetInstance().DefaultPlugin)
|
||||
{
|
||||
matchedPlugin.Dispose();
|
||||
matchedPlugin = PluginManager.GetInstance().DefaultPlugin.CreateInstance<IViewer>();
|
||||
BeginShowNewWindow(matchedPlugin, path);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||

|
||||
|
||||
# QuickLook
|
||||
|
||||
[](https://ci.appveyor.com/project/xupefei/quicklook)
|
||||
|
10
update-version.cmd
Normal file
10
update-version.cmd
Normal file
@@ -0,0 +1,10 @@
|
||||
rem @echo off
|
||||
cd %1
|
||||
for /F "delims=" %%i in ('git describe --always --tags "--abbrev=0"') do set git_tag=%%i
|
||||
for /F "delims=" %%i in ('git describe --always --tags') do set git_revision=%%i
|
||||
echo // This file is generated by update-version.cmd > %2
|
||||
echo. >> %2
|
||||
echo using System.Reflection;>> %2
|
||||
echo. >> %2
|
||||
echo [assembly: AssemblyVersion("%git_tag%")]>> %2
|
||||
echo [assembly: AssemblyInformationalVersion("%git_revision%")]>> %2
|
Reference in New Issue
Block a user