Skip to content

Commit

Permalink
Added squirrel
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Oct 6, 2020
1 parent 31dd7e6 commit 28b75e4
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
12 changes: 12 additions & 0 deletions QuickDictionary/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.IO;
using System.Drawing;
using System.Windows.Media.Animation;
using Squirrel;

namespace QuickDictionary
{
Expand All @@ -37,10 +38,13 @@ public partial class MainWindow : Window, INotifyPropertyChanged
TesseractEngine engine = new TesseractEngine("data/tessdata", "eng", EngineMode.LstmOnly);
bool engineBusy = true;

string title;

public MainWindow()
{
InitializeComponent();
Helper.HideBoundingBox(root);

dictionaries.Add(Dictionary.CambridgeCE);
dictionaries.Add(Dictionary.MedicalDictionary);
dictionaries.Add(Dictionary.GoogleDefinitions);
Expand All @@ -55,6 +59,9 @@ public MainWindow()
engine.SetVariable("tessedit_char_blacklist", "¢§+~»~`!@#$%^&*()_+={}[]|\\:\";<>?,./");

engineBusy = false;

Title = "Quick Dictionary v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
title = Title;
}

List<OCRWord> OCRWords = new List<OCRWord>();
Expand Down Expand Up @@ -185,6 +192,11 @@ private async void Window_SourceInitialized(object sender, EventArgs e)
// Initialize the clipboard now that we have a window source to use
var windowClipboardManager = new ClipboardManager(this);
windowClipboardManager.ClipboardChanged += ClipboardChanged;

using (var mgr = await UpdateManager.GitHubUpdateManager("https://github.com/Henry-YSLin/QuickDictionary"))
{
await mgr.UpdateApp((progress) => Dispatcher.Invoke(() => Title = title + $" - Updating {progress}%"));
}
}

private void ClipboardChanged(object sender, EventArgs e)
Expand Down
40 changes: 40 additions & 0 deletions QuickDictionary/QuickDictionary.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props" Condition="Exists('..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props')" />
<Import Project="..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props" Condition="Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props')" />
<Import Project="..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props')" />
<Import Project="..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props')" />
Expand Down Expand Up @@ -88,6 +89,15 @@
<ApplicationIcon>ic_launcher.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="DeltaCompressionDotNet, Version=1.1.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll</HintPath>
</Reference>
<Reference Include="DeltaCompressionDotNet.MsDelta, Version=1.1.0.0, Culture=neutral, PublicKeyToken=46b2138a390abf55, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll</HintPath>
</Reference>
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.11.24.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.11.24\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
Expand All @@ -97,9 +107,30 @@
<Reference Include="MaterialDesignThemes.Wpf, Version=3.2.0.1979, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignThemes.3.2.0\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.11.2\lib\net40\Mono.Cecil.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Mdb, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.11.2\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Pdb, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.11.2\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Rocks, Version=0.11.2.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.11.2\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
</Reference>
<Reference Include="MoreLinq, Version=3.3.2.0, Culture=neutral, PublicKeyToken=384d532d7e88985d, processorArchitecture=MSIL">
<HintPath>..\packages\morelinq.3.3.2\lib\net451\MoreLinq.dll</HintPath>
</Reference>
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.2.0.1\lib\Net45\NuGet.Squirrel.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.17.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll</HintPath>
</Reference>
<Reference Include="Squirrel, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.2.0.1\lib\Net45\Squirrel.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
Expand Down Expand Up @@ -168,6 +199,7 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="QuickDictionary.nuspec" />
<Resource Include="ic_launcher.ico" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down Expand Up @@ -198,6 +230,14 @@
<Error Condition="!Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets'))" />
<Error Condition="!Exists('..\packages\MaterialDesignThemes.3.2.0\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.3.2.0\build\MaterialDesignThemes.targets'))" />
<Error Condition="!Exists('..\packages\Tesseract.4.1.0-beta1\build\Tesseract.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Tesseract.4.1.0-beta1\build\Tesseract.targets'))" />
<Error Condition="!Exists('..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\squirrel.windows.2.0.1\build\squirrel.windows.props'))" />
</Target>
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release'">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="myAssemblyInfo" />
</GetAssemblyIdentity>
<Exec Command="nuget pack QuickDictionary.nuspec -Version %(myAssemblyInfo.Version) -Properties Configuration=Release -OutputDirectory $(OutDir) -BasePath $(OutDir)" />
<Exec Command="squirrel --releasify $(OutDir)QuickDictionary.$([System.Version]::Parse(%(myAssemblyInfo.Version)).ToString(3)).nupkg" />
</Target>
<Import Project="..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets')" />
<Import Project="..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets" Condition="Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets')" />
Expand Down
17 changes: 17 additions & 0 deletions QuickDictionary/QuickDictionary.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>QuickDictionary</id>
<!-- version will be replaced by MSBuild -->
<version>0.0.0.0</version>
<title>QuickDictionary</title>
<authors>Henry Lin</authors>
<description>Speed up the process of looking up a word in dictionaries</description>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright 2020</copyright>
<dependencies />
</metadata>
<files>
<file src="*.*" target="lib\net45\" exclude="*.pdb;*.nupkg;*.vshost.*"/>
</files>
</package>
5 changes: 5 additions & 0 deletions QuickDictionary/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
<package id="cef.redist.x86" version="84.4.1" targetFramework="net472" />
<package id="CefSharp.Common" version="84.4.10" targetFramework="net472" />
<package id="CefSharp.Wpf" version="84.4.10" targetFramework="net472" />
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net472" />
<package id="HtmlAgilityPack" version="1.11.24" targetFramework="net472" />
<package id="MaterialDesignColors" version="1.2.7" targetFramework="net472" />
<package id="MaterialDesignThemes" version="3.2.0" targetFramework="net472" />
<package id="Mono.Cecil" version="0.11.2" targetFramework="net472" />
<package id="morelinq" version="3.3.2" targetFramework="net472" />
<package id="NuGet.CommandLine" version="5.7.0" targetFramework="net472" developmentDependency="true" />
<package id="SharpCompress" version="0.17.1" targetFramework="net472" />
<package id="squirrel.windows" version="2.0.1" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
<package id="Tesseract" version="4.1.0-beta1" targetFramework="net472" />
</packages>

0 comments on commit 28b75e4

Please sign in to comment.