Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Squeeze Upload #1

Merged
merged 9 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
6 changes: 3 additions & 3 deletions NAPS2.App.Gtk/NAPS2.App.Gtk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

<ItemGroup>
<PackageReference Include="NAPS2.Pdfium.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.2.0" />

<ProjectReference Include="..\NAPS2.Lib.Gtk\NAPS2.Lib.Gtk.csproj" />

<PackageReference Include="Eto.Platform.Gtk" Version="2.8.2" />
<PackageReference Include="Eto.Platform.Gtk" Version="2.8.3" />
<!-- This shouldn't need a reference normally, but otherwise "dotnet restore" doesn't pick
it up, which breaks the flatpak build. -->
<PackageReference Include="Microsoft.NETCore.App" Version="2.1.*" />
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.8" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions NAPS2.App.Mac/NAPS2.App.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<ItemGroup>
<PackageReference Include="NAPS2.Pdfium.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Sane.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.2.0" />

<ProjectReference Include="..\NAPS2.Lib.Mac\NAPS2.Lib.Mac.csproj" />

<PackageReference Include="Eto.Platform.macOS" Version="2.8.2" />
<PackageReference Include="Eto.Platform.macOS" Version="2.8.3" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions NAPS2.App.Tests/NAPS2.App.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

<ItemGroup>
<PackageReference Include="NAPS2.Pdfium.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.2.0" />

<ProjectReference Include="..\NAPS2.Lib.Tests\NAPS2.Lib.Tests.csproj" />

<PackageReference Include="Appium.WebDriver" Version="4.4.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" PrivateAssets="all" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion NAPS2.App.WinForms/NAPS2.App.WinForms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<ItemGroup>
<PackageReference Include="NAPS2.Pdfium.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.2.0" />

<ProjectReference Include="..\NAPS2.App.Worker\NAPS2.App.Worker.csproj" />
<ProjectReference Include="..\NAPS2.Lib.WinForms\NAPS2.Lib.WinForms.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions NAPS2.Escl.Tests/NAPS2.Escl.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion NAPS2.Escl/NAPS2.Escl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<ItemGroup>
<PackageReference Include="Makaretu.Dns" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion NAPS2.Images.Gdi/NAPS2.Images.Gdi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<ItemGroup>
<ProjectReference Include="..\NAPS2.Images\NAPS2.Images.csproj" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions NAPS2.Images.Gtk/NAPS2.Images.Gtk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<PackageTags>naps2</PackageTags>
</PropertyGroup>

<Import Project="..\NAPS2.Setup\targets\SdkPackageTargets.targets"/>
<Import Project="..\NAPS2.Setup\targets\SdkPackageTargets.targets" />

<ItemGroup>
<ProjectReference Include="..\NAPS2.Images\NAPS2.Images.csproj" />
<PackageReference Include="GtkSharp" Version="3.24.24.38" />
<PackageReference Include="GtkSharp" Version="3.24.24.95" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion NAPS2.Images.ImageSharp/NAPS2.Images.ImageSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
</ItemGroup>

<Import Project="..\NAPS2.Setup\targets\CommonTargets.targets" />
Expand Down
2 changes: 1 addition & 1 deletion NAPS2.Images.Mac/NAPS2.Images.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<ItemGroup>
<ProjectReference Include="..\NAPS2.Images\NAPS2.Images.csproj" />
<PackageReference Include="Eto.Platform.Mac64" Version="2.8.2" Condition="'$(TargetFramework)' == 'net6'" />
<PackageReference Include="Eto.Platform.Mac64" Version="2.8.3" Condition="'$(TargetFramework)' == 'net6'" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net6'">
Expand Down
4 changes: 2 additions & 2 deletions NAPS2.Lib.Gtk/NAPS2.Lib.Gtk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<ItemGroup>
<ProjectReference Include="..\NAPS2.Images.Gtk\NAPS2.Images.Gtk.csproj" />
<ProjectReference Include="..\NAPS2.Lib\NAPS2.Lib.csproj" />
<PackageReference Include="Eto.Forms" Version="2.8.2" />
<PackageReference Include="Eto.Platform.Gtk" Version="2.8.2" />
<PackageReference Include="Eto.Forms" Version="2.8.3" />
<PackageReference Include="Eto.Platform.Gtk" Version="2.8.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion NAPS2.Lib.Mac/NAPS2.Lib.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<ProjectReference Include="..\NAPS2.Images.Mac\NAPS2.Images.Mac.csproj" />
<ProjectReference Include="..\NAPS2.Lib\NAPS2.Lib.csproj" />
<PackageReference Include="Eto.Platform.macOS" Version="2.8.2" />
<PackageReference Include="Eto.Platform.macOS" Version="2.8.3" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions NAPS2.Lib.Tests/NAPS2.Lib.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<ProjectReference Include="..\NAPS2.Sdk.Tests\NAPS2.Sdk.Tests.csproj" />

<PackageReference Include="NAPS2.Pdfium.Binaries" Version="1.1.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="NAPS2.Tesseract.Binaries" Version="1.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions NAPS2.Lib.WinForms/NAPS2.Lib.WinForms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<ItemGroup>
<ProjectReference Include="..\NAPS2.Lib\NAPS2.Lib.csproj" />
<ProjectReference Include="..\NAPS2.Images.Gdi\NAPS2.Images.Gdi.csproj" />
<PackageReference Include="Eto.Forms" Version="2.8.2" />
<PackageReference Include="Eto.Platform.Windows" Version="2.8.2" />
<PackageReference Include="Eto.Forms" Version="2.8.3" />
<PackageReference Include="Eto.Platform.Windows" Version="2.8.3" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 13 additions & 0 deletions NAPS2.Lib/Config/CommonConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using NAPS2.Remoting.Server;
using NAPS2.Scan;
using NAPS2.Scan.Batch;
using NAPS2.ImportExport.Squeeze;

namespace NAPS2.Config;

Expand Down Expand Up @@ -189,4 +190,16 @@ public class CommonConfig
[Common]
public bool DisableScannerSharing { get; set; }

[User]
public bool KeepSettings { get; set; }


// Squeeze changes

[Config]
[Common]
public SqueezeSettings SqueezeSettings { get; set; } = new();

[User]
public bool RememberSqueezeSettings { get; set; }
}
11 changes: 11 additions & 0 deletions NAPS2.Lib/Config/ConfigSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ private ConfigStorage<CommonConfig> AppConfigV0ToCommonConfigDefault(AppConfigV0
storage.Set(x => x.OcrAfterScanning, c.OcrDefaultAfterScanning);
storage.Set(x => x.EventLogging, c.EventLogging);
storage.Set(x => x.KeyboardShortcuts, c.KeyboardShortcuts ?? new KeyboardShortcuts());
// Squeeze Storage
storage.Set(x => x.KeepSettings, c.KeepSettings);

return storage;
}

Expand Down Expand Up @@ -167,6 +170,9 @@ void SetIfLocked<T>(Expression<Func<CommonConfig, T>> accessor, T value, string
SetIfLocked(x => x.KeepSession, c.KeepSession, nameof(c.KeepSession));
SetIfLocked(x => x.SingleInstance, c.SingleInstance, nameof(c.SingleInstance));

//Squeeze change
SetIfLocked(x => x.KeepSettings, c.KeepSettings, nameof(c.KeepSettings));

return storage;
}

Expand Down Expand Up @@ -209,6 +215,11 @@ private static ConfigStorage<CommonConfig> UserConfigV0ToCommonConfig(UserConfig
storage.Set(x => x.EmailSettings, c.EmailSettings);
storage.Set(x => x.EmailSetup, c.EmailSetup);
storage.Set(x => x.ThumbnailSize, c.ThumbnailSize);

// Squeeze change
storage.Set(x => x.SqueezeSettings, c.SqueezeSettings);


if (c.LastBatchSettings != null)
{
storage.Set(x => x.BatchSettings, c.LastBatchSettings);
Expand Down
14 changes: 14 additions & 0 deletions NAPS2.Lib/Config/InternalDefaults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using NAPS2.Pdf;
using NAPS2.Scan;
using NAPS2.Scan.Batch;
using NAPS2.ImportExport.Squeeze;

namespace NAPS2.Config;

Expand Down Expand Up @@ -56,6 +57,7 @@ public static CommonConfig GetCommonConfig() =>
DesktopToolStripDock = DockStyle.Top,
EventLogging = EventType.None,
ShowPageNumbers = false,
KeepSettings = false,
PdfSettings = new PdfSettings
{
Metadata = new PdfMetadata
Expand Down Expand Up @@ -95,6 +97,18 @@ public static CommonConfig GetCommonConfig() =>
TiffCompression = TiffCompression.Auto
},
RememberImageSettings = false,

// Squeeze changes
SqueezeSettings = new SqueezeSettings
{
SQZURL = "URL",
SQZClient = "Mandant",
SQZUserName = "Benutzername",
SQZPassword = "",
SQZClassID = 1
},
RememberSqueezeSettings = false,

EmailSettings = new EmailSettings
{
AttachmentName = "Scan.pdf"
Expand Down
4 changes: 4 additions & 0 deletions NAPS2.Lib/Config/ObsoleteTypes/AppConfigV0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@ public class AppConfigV0
public EventType EventLogging { get; set; }

public KeyboardShortcuts? KeyboardShortcuts { get; set; }

// Squeeze changes

public bool KeepSettings { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In dieser File und CommonConfig.cs wurde KeepSettings hinzugefügt. In CommonConfig.cs allerdings auch RememberSqueezeSettings.

Ist das nicht 1 Property zu viel? Ich habe den Eindruck, dass nur RememberSqueezeSettings benötigt wird, welches für Squeeze-spezifische Einstellungen ist.

}
4 changes: 4 additions & 0 deletions NAPS2.Lib/Config/ObsoleteTypes/UserConfigV0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using NAPS2.Ocr;
using NAPS2.Scan;
using NAPS2.Scan.Batch;
using NAPS2.ImportExport.Squeeze;

namespace NAPS2.Config.ObsoleteTypes;

Expand Down Expand Up @@ -54,4 +55,7 @@ public class UserConfigV0
public KeyboardShortcuts? KeyboardShortcuts { get; set; }

public List<NamedPageSize>? CustomPageSizePresets { get; set; }

// Squeeze change
public SqueezeSettings SqueezeSettings { get; set; } = new();
}
29 changes: 15 additions & 14 deletions NAPS2.Lib/Config/ToolbarButtons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ public enum ToolbarButtons
Profiles = 1 << 2,
Ocr = 1 << 3,
Import = 1 << 4,
SavePdf = 1 << 5,
SaveImages = 1 << 6,
EmailPdf = 1 << 7,
Print = 1 << 8,
Image = 1 << 9,
Rotate = 1 << 10,
Move = 1 << 11,
Reorder = 1 << 12,
Delete = 1 << 13,
Clear = 1 << 14,
Language = 1 << 15,
Settings = 1 << 16,
About = 1 << 17,
Donate = 1 << 18
Squeeze = 1 << 5,
SavePdf = 1 << 6,
SaveImages = 1 << 7,
EmailPdf = 1 << 8,
Print = 1 << 9,
Image = 1 << 10,
Rotate = 1 << 11,
Move = 1 << 12,
Reorder = 1 << 13,
Delete = 1 << 14,
Clear = 1 << 15,
Language = 1 << 16,
Settings = 1 << 17,
About = 1 << 18,
Donate = 1 << 19
}
Loading
Loading