diff --git a/.github/workflows/purge-cloudflare-cache.yml b/.github/workflows/purge-cloudflare-cache.yml
new file mode 100644
index 000000000..a2d288faf
--- /dev/null
+++ b/.github/workflows/purge-cloudflare-cache.yml
@@ -0,0 +1,14 @@
+name: Purge CloudFlare Cache
+
+on:
+ page_build:
+
+jobs:
+ purge_cache:
+ runs-on: ubuntu-latest
+ steps:
+ - name: purge
+ uses: jakejarvis/cloudflare-purge-action@master
+ env:
+ CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
+ CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 000000000..06bc7342a
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,127 @@
+name: Build and Deploy
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - 'release/1.*'
+
+jobs:
+ build:
+ runs-on: windows-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Setup MSBuild
+ uses: microsoft/setup-msbuild@v2
+
+ - name: Set up .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: '7.x'
+
+ - name: Restore NuGet packages
+ run: msbuild src/Greenshot.sln /p:Configuration=Release /restore /t:PrepareForBuild
+ env:
+ Box13_ClientId: ${{ secrets.Box13_ClientId }}
+ Box13_ClientSecret: ${{ secrets.Box13_ClientSecret }}
+ DropBox13_ClientId: ${{ secrets.DropBox13_ClientId }}
+ DropBox13_ClientSecret: ${{ secrets.DropBox13_ClientSecret }}
+ Flickr_ClientId: ${{ secrets.Flickr_ClientId }}
+ Flickr_ClientSecret: ${{ secrets.Flickr_ClientSecret }}
+ Imgur13_ClientId: ${{ secrets.Imgur13_ClientId }}
+ Imgur13_ClientSecret: ${{ secrets.Imgur13_ClientSecret }}
+ Photobucket_ClientId: ${{ secrets.Photobucket_ClientId }}
+ Photobucket_ClientSecret: ${{ secrets.Photobucket_ClientSecret }}
+ Picasa_ClientId: ${{ secrets.Picasa_ClientId }}
+ Picasa_ClientSecret: ${{ secrets.Picasa_ClientSecret }}
+
+ - name: Build and package
+ run: msbuild src/Greenshot.sln /p:Configuration=Release /t:Rebuild /v:normal
+ env:
+ Box13_ClientId: ${{ secrets.Box13_ClientId }}
+ Box13_ClientSecret: ${{ secrets.Box13_ClientSecret }}
+ DropBox13_ClientId: ${{ secrets.DropBox13_ClientId }}
+ DropBox13_ClientSecret: ${{ secrets.DropBox13_ClientSecret }}
+ Flickr_ClientId: ${{ secrets.Flickr_ClientId }}
+ Flickr_ClientSecret: ${{ secrets.Flickr_ClientSecret }}
+ Imgur13_ClientId: ${{ secrets.Imgur13_ClientId }}
+ Imgur13_ClientSecret: ${{ secrets.Imgur13_ClientSecret }}
+ Photobucket_ClientId: ${{ secrets.Photobucket_ClientId }}
+ Photobucket_ClientSecret: ${{ secrets.Photobucket_ClientSecret }}
+ Picasa_ClientId: ${{ secrets.Picasa_ClientId }}
+ Picasa_ClientSecret: ${{ secrets.Picasa_ClientSecret }}
+
+ - name: Copy Files
+ run: |
+ mkdir -p ${{ github.workspace }}/artifacts
+ cp installer/Greenshot-INSTALLER-*.exe ${{ github.workspace }}/artifacts/
+
+ - name: Upload Artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: drop
+ path: ${{ github.workspace }}/artifacts
+
+ deploy:
+ runs-on: windows-latest
+ needs: build
+
+ steps:
+
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Download build artifacts
+ uses: actions/download-artifact@v4
+ with:
+ name: drop # Name of the artifact uploaded in previous steps
+ path: drop # Local folder where artifacts are downloaded
+
+ - name: Extract version from file name
+ id: extract_version
+ run: |
+ $file = Get-ChildItem drop -Filter "Greenshot-INSTALLER-*.exe" | Select-Object -First 1
+ if (-not $file) {
+ throw "No matching file found in 'drop' directory."
+ }
+ if ($file.Name -match "Greenshot-INSTALLER-([\d\.]+)(.*)\.exe") {
+ echo "version=$($matches[1])" >> $Env:GITHUB_OUTPUT
+ } else {
+ throw "Version number could not be extracted from file name: $($file.Name)"
+ }
+ shell: pwsh
+
+ - name: Create tag
+ run: |
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+ git tag -a "v${{ steps.extract_version.outputs.version }}" -m "v${{ steps.extract_version.outputs.version }}"
+ git push origin "v${{ steps.extract_version.outputs.version }}"
+
+ - name: Create GitHub Release
+ uses: softprops/action-gh-release@v2
+ with:
+ name: "Greenshot ${{ steps.extract_version.outputs.version }} (continuous build)"
+ tag_name: "v${{ steps.extract_version.outputs.version }}"
+ files: drop/*.exe
+ generate_release_notes: true
+ draft: false
+ prerelease: true
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Trigger GitHub Pages rebuild
+ shell: bash
+ run: |
+ curl -X POST \
+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github+json" \
+ https://api.github.com/repos/${{ github.repository }}/pages/builds
+
diff --git a/.github/workflows/update-gh-pages.yml b/.github/workflows/update-gh-pages.yml
new file mode 100644
index 000000000..5026ffb18
--- /dev/null
+++ b/.github/workflows/update-gh-pages.yml
@@ -0,0 +1,18 @@
+name: Update GitHub Pages
+
+on:
+ workflow_dispatch:
+ release:
+ types: [published]
+
+jobs:
+ update-gh-pages:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Trigger GitHub Pages rebuild
+ shell: bash
+ run: |
+ curl -X POST \
+ -H "Authorization: Bearer ${{ secrets.GH_PAGES_TOKEN }}" \
+ -H "Accept: application/vnd.github+json" \
+ https://api.github.com/repos/${{ github.repository }}/pages/builds
diff --git a/.gitignore b/.gitignore
index 3afd2d7ab..7e96d5501 100644
--- a/.gitignore
+++ b/.gitignore
@@ -214,4 +214,6 @@ ModelManifest.xml
*.credentials.cs
# Rider files
-.idea
\ No newline at end of file
+.idea
+
+/installer/Greenshot-INSTALLER-*.exe
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
deleted file mode 100644
index 558d40760..000000000
--- a/azure-pipelines.yml
+++ /dev/null
@@ -1,106 +0,0 @@
-# .NET Desktop
-# Build and run tests for .NET Desktop or Windows classic desktop solutions.
-# Add steps that publish symbols, save build artifacts, and more:
-# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
-
-trigger:
- batch: true
- branches:
- include:
- - 'release/1.*'
- exclude:
- - 'develop'
-
-stages:
-- stage: Build
- jobs:
- - job: Build
- variables:
- - group: 'Plug-in Credentials'
- - name: solution
- value: 'src/Greenshot.sln'
- - name: buildPlatform
- value: 'Any CPU'
- - name: buildConfiguration
- value: 'Release'
-
- pool:
- vmImage: 'Windows-latest'
-
- steps:
- - task: MSBuild@1
- displayName: Restore nuget packages and generate credential templates
- inputs:
- solution: '$(solution)'
- platform: $(buildPlatform)
- configuration: $(buildConfiguration)
- msbuildArguments: '/restore /t:PrepareForBuild'
-
- - task: MSBuild@1
- displayName: Build and package
- inputs:
- solution: '$(solution)'
- platform: $(buildPlatform)
- configuration: $(buildConfiguration)
- env:
- Box13_ClientId: $(Box13_ClientId)
- Box13_ClientSecret: $(Box13_ClientSecret)
- DropBox13_ClientId: $(DropBox13_ClientId)
- DropBox13_ClientSecret: $(DropBox13_ClientSecret)
- Flickr_ClientId: $(Flickr_ClientId)
- Flickr_ClientSecret: $(Flickr_ClientSecret)
- Imgur13_ClientId: $(Imgur13_ClientId)
- Imgur13_ClientSecret: $(Imgur13_ClientSecret)
- Photobucket_ClientId: $(Photobucket_ClientId)
- Photobucket_ClientSecret: $(Photobucket_ClientSecret)
- Picasa_ClientId: $(Picasa_ClientId)
- Picasa_ClientSecret: $(Picasa_ClientSecret)
-
- - task: CopyFiles@2
- displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)\installer'
- Contents: Greenshot-INSTALLER-*.exe
- TargetFolder: '$(build.artifactstagingdirectory)'
- flattenFolders: true
-
- - task: PublishBuildArtifacts@1
- displayName: 'Publish Artifact: drop'
- inputs:
- PathtoPublish: '$(build.artifactstagingdirectory)'
-
-- stage: Deploy
- jobs:
- - deployment: GitHub_Release
- pool:
- vmImage: 'Windows-latest'
-
- environment: 'GitHub Release'
- strategy:
- # default deployment strategy
- runOnce:
- deploy:
- steps:
- - download: current
- artifact: drop
-
- # Create a GitHub release
- - task: GitHubRelease@0
- inputs:
- gitHubConnection: GitHub Release
- repositoryName: '$(Build.Repository.Name)'
- action: 'create' # Options: create, edit, delete
- target: '$(Build.SourceVersion)' # Required when action == Create || Action == Edit
- tagSource: 'manual' # Required when action == Create# Options: auto, manual
- tag: 'v$(Build.BuildNumber)' # Required when action == Edit || Action == Delete || TagSource == Manual
- title: Greenshot $(Build.BuildNumber) unstable # Optional
- #releaseNotesSource: 'file' # Optional. Options: file, input
- #releaseNotesFile: # Optional
- #releaseNotes: # Optional
- assets: '$(Pipeline.Workspace)/drop/*.exe'
- #assetUploadMode: 'delete' # Optional. Options: delete, replace
- isDraft: true # Optional
- isPreRelease: true # Optional
- addChangeLog: true # Optional
- #compareWith: 'lastFullRelease' # Required when addChangeLog == True. Options: lastFullRelease, lastRelease, lastReleaseByTag
- #releaseTag: # Required when compareWith == LastReleaseByTag
diff --git a/build-and-deploy.ps1 b/build-and-deploy.ps1
new file mode 100644
index 000000000..7645259c5
--- /dev/null
+++ b/build-and-deploy.ps1
@@ -0,0 +1,149 @@
+# USAGE
+# * Enable script execution in Powershell: 'Set-ExecutionPolicy RemoteSigned'
+# * Create a GitHub personal access token (PAT) for greenshot repository
+# * user must be owner of the repository
+# * token needs read and write permissions ""for Contents"" and ""Pages""
+# * Execute the script and paste your token
+
+# Prompt the user to securely input the Github token
+$SecureToken = Read-Host "Please enter your GitHub personal access token" -AsSecureString
+$ReleaseToken = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureToken))
+
+# Variables
+$RepoPath = "." # Replace with your local repo path
+$ArtifactsPath = "$RepoPath\artifacts"
+$SolutionFile = "$RepoPath\src\Greenshot.sln"
+
+# Step 0: Update Local Repository
+git pull
+
+# Step 1: Restore NuGet Packages
+Write-Host "Restoring NuGet packages..."
+msbuild "$SolutionFile" /p:Configuration=Release /restore /t:PrepareForBuild
+if ($LASTEXITCODE -ne 0) {
+ Write-Error "Failed to restore NuGet packages."
+ exit $LASTEXITCODE
+}
+
+# Step 2: Build and Package
+Write-Host "Building and packaging the solution..."
+msbuild "$SolutionFile" /p:Configuration=Release /t:Rebuild /v:normal
+if ($LASTEXITCODE -ne 0) {
+ Write-Error "Build failed."
+ exit $LASTEXITCODE
+}
+
+# Step 3: Copy Installer Files
+Write-Host "Copying installer files..."
+if (-not (Test-Path $ArtifactsPath)) {
+ New-Item -ItemType Directory -Force -Path $ArtifactsPath
+}
+Copy-Item "$RepoPath\installer\Greenshot-INSTALLER-*.exe" -Destination $ArtifactsPath -Force
+if ($LASTEXITCODE -ne 0) {
+ Write-Error "Failed to copy installer files."
+ exit $LASTEXITCODE
+}
+
+# Step 4: Extract Version from File Name
+Write-Host "Extracting version from installer file name..."
+$InstallerFile = Get-ChildItem $ArtifactsPath -Filter "Greenshot-INSTALLER-*.exe" | Select-Object -Last 1
+if (-not $InstallerFile) {
+ Write-Error "No matching installer file found in '$ArtifactsPath'."
+ exit 1
+}
+
+if ($InstallerFile.Name -match "Greenshot-INSTALLER-([\d\.]+).*\.exe") {
+ $Version = $matches[1]
+ Write-Host "Extracted version: $Version"
+} else {
+ Write-Error "Version number could not be extracted from file name: $($InstallerFile.Name)"
+ exit 1
+}
+
+# Step 5: Create Git Tag
+Write-Host "Creating Git tag..."
+cd $RepoPath
+#git config user.name "local-script"
+#git config user.email "local-script@example.com"
+git tag -a "v$Version" -m "v$Version"
+git push origin "v$Version"
+if ($LASTEXITCODE -ne 0) {
+ Write-Error "Failed to create Git tag."
+ exit $LASTEXITCODE
+}
+
+# Step 6: Create GitHub Release
+Write-Host "Creating GitHub release..."
+$Headers = @{
+ Authorization = "Bearer $ReleaseToken"
+ Accept = "application/vnd.github+json"
+}
+$ReleaseData = @{
+ tag_name = "v$Version"
+ name = "Greenshot $Version unstable"
+ body = "Pre-release of Greenshot $Version."
+ draft = $true
+ prerelease = $true
+ generate_release_notes = $true
+}
+$ReleaseResponse = Invoke-RestMethod `
+ -Uri "https://api.github.com/repos/greenshot/greenshot/releases" `
+ -Method POST `
+ -Headers $Headers `
+ -Body (ConvertTo-Json $ReleaseData -Depth 10)
+
+if ($LASTEXITCODE -ne 0) {
+ Write-Error "Failed to create GitHub release."
+ exit $LASTEXITCODE
+}
+
+Write-Host "Release created successfully."
+
+# Get the release ID from the response
+$ReleaseId = $ReleaseResponse.id
+Write-Host "Release ID: $ReleaseId"
+
+# Step 7: Upload .exe File to Release
+Write-Host "Uploading .exe file to GitHub release..."
+$ExeFilePath = "$ArtifactsPath\$($InstallerFile.Name)"
+if (-Not (Test-Path $ExeFilePath)) {
+ Write-Error "Built .exe file not found: $ExeFilePath"
+ exit 1
+}
+
+# GitHub API for uploading release assets
+$UploadUrl = $ReleaseResponse.upload_url -replace "{.*}", ""
+
+# Upload the file
+$FileHeaders = @{
+ Authorization = "Bearer $ReleaseToken"
+ ContentType = "application/octet-stream"
+}
+$FileName = [System.IO.Path]::GetFileName($ExeFilePath)
+
+Invoke-RestMethod `
+ -Uri "$($UploadUrl)?name=$FileName" `
+ -Method POST `
+ -Headers $FileHeaders `
+ -InFile $ExeFilePath `
+ -ContentType "application/octet-stream"
+
+if ($LASTEXITCODE -ne 0) {
+ Write-Error "Failed to upload .exe file to release."
+ exit $LASTEXITCODE
+}
+
+Write-Host "File uploaded successfully: $FileName"
+
+# Step 7: Trigger GitHub Pages Rebuild
+#Write-Host "Triggering GitHub Pages rebuild..."
+#Invoke-RestMethod `
+# -Uri "https://api.github.com/repos/greenshot/greenshot/pages/builds" `
+# -Method POST `
+# -Headers $Headers
+#if ($LASTEXITCODE -ne 0) {
+# Write-Error "Failed to trigger GitHub Pages rebuild."
+# exit $LASTEXITCODE
+#}
+#
+#Write-Host "GitHub Pages rebuild triggered successfully."
\ No newline at end of file
diff --git a/installer/innosetup/setup.iss b/installer/innosetup/setup.iss
index 59363446f..6bb0d0fe5 100644
--- a/installer/innosetup/setup.iss
+++ b/installer/innosetup/setup.iss
@@ -7,6 +7,7 @@
#define BinDir "bin\Release\net472"
#define ReleaseDir "..\..\src\Greenshot\bin\Release\net472"
#define PluginDir "..\..\src\Greenshot\bin\Release\net472\Plugins"
+#define CertumThumbprint GetEnv('CertumThumbprint')
; Include the scripts to install .NET Framework
; See https://www.codeproject.com/KB/install/dotnetfx_innosetup_instal.aspx
@@ -132,15 +133,17 @@ InfoBeforeFile=..\additional_files\readme.txt
LicenseFile=..\additional_files\license.txt
LanguageDetectionMethod=uilanguage
MinVersion=6.1sp1
-OutputBaseFilename={#ExeName}-INSTALLER-{#Version}-UNSTABLE
OutputDir=..\
PrivilegesRequired=lowest
+PrivilegesRequiredOverridesAllowed=commandline
SetupIconFile=..\..\src\Greenshot\icons\applicationIcon\icon.ico
-; Create a SHA1 signature
-; SignTool=SignTool sign /debug /fd sha1 /tr https://time.certum.pl /td sha1 $f
-; Append a SHA256 to the previous SHA1 signature (this is what as does)
-; SignTool=SignTool sign /debug /as /fd sha256 /tr https://time.certum.pl /td sha256 $f
-; SignedUninstaller=yes
+#if CertumThumbprint != ""
+ OutputBaseFilename={#ExeName}-INSTALLER-{#Version}-UNSTABLE
+ SignTool=SignTool sign /sha1 "{#CertumThumbprint}" /tr http://time.certum.pl /td sha256 /fd sha256 /v $f
+ SignedUninstaller=yes
+#else
+ OutputBaseFilename={#ExeName}-INSTALLER-{#Version}-UNSTABLE-UNSIGNED
+#endif
UninstallDisplayIcon={app}\{#ExeName}.exe
Uninstallable=true
VersionInfoCompany={#ExeName}
diff --git a/nuget.config b/nuget.config
new file mode 100644
index 000000000..554c2f634
--- /dev/null
+++ b/nuget.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets
index f2ce406a1..caa6a3db3 100644
--- a/src/Directory.Build.targets
+++ b/src/Directory.Build.targets
@@ -1,13 +1,65 @@
+
+
+
+
+
+
+
+
+
+ ();
+ foreach (var line in InputLines)
+ {
+ string text = line.ItemSpec;
+ foreach (var token in Tokens)
+ {
+ string tokenName = token.ItemSpec;
+ // Skip if tokenName is null or empty
+ if (string.IsNullOrEmpty(tokenName))
+ continue;
+
+ string replacementValue = token.GetMetadata("ReplacementValue");
+ if (!string.IsNullOrEmpty(replacementValue))
+ {
+ string placeholder = "$"+ "{"+tokenName+"}"; // Token-Format wie $(Box13_ClientId)
+ text = text.Replace(placeholder, replacementValue);
+ }
+ }
+ output.Add(new Microsoft.Build.Utilities.TaskItem(text));
+ }
+ OutputLines = output.ToArray();
+ ]]>
+
+
+
- $(PkgMSBuildTasks)\tools\
+ $(NuGetPackageRoot)msbuildtasks/1.5.0.235/tools/
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
+
+
+
+
diff --git a/src/Greenshot.Editor/Drawing/StepLabelContainer.cs b/src/Greenshot.Editor/Drawing/StepLabelContainer.cs
index e5d93e514..7edecc4f8 100644
--- a/src/Greenshot.Editor/Drawing/StepLabelContainer.cs
+++ b/src/Greenshot.Editor/Drawing/StepLabelContainer.cs
@@ -24,6 +24,7 @@ using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Runtime.Serialization;
+using System.Windows.Forms;
using Dapplo.Windows.Common.Extensions;
using Dapplo.Windows.Common.Structs;
using Greenshot.Base.Interfaces;
@@ -187,6 +188,8 @@ namespace Greenshot.Editor.Drawing
///
public override void Draw(Graphics graphics, RenderMode rm)
{
+ if (Width == 0 || Height == 0) { return; }
+
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
graphics.CompositingQuality = CompositingQuality.HighQuality;
@@ -205,9 +208,17 @@ namespace Greenshot.Editor.Drawing
EllipseContainer.DrawEllipse(rect, graphics, rm, 0, Color.Transparent, fillColor, false);
}
- float fontSize = Math.Min(Math.Abs(Width), Math.Abs(Height)) / 1.4f;
- using FontFamily fam = new FontFamily(FontFamily.GenericSansSerif.Name);
- using Font font = new Font(fam, fontSize, FontStyle.Bold, GraphicsUnit.Pixel);
+ using FontFamily fam = new(FontFamily.GenericSansSerif.Name);
+
+ //calculate new font size based on ratio from text height and text width
+ float initialFontSize = Math.Min(Math.Abs(Width), Math.Abs(Height));
+ using Font Measurefont = new(fam, initialFontSize, FontStyle.Bold, GraphicsUnit.Pixel);
+ var fontSize = initialFontSize * TextRenderer.MeasureText(text, Measurefont).Height / TextRenderer.MeasureText(text, Measurefont).Width;
+
+ //static scale for optimal fit
+ fontSize *= 0.7f;
+
+ using Font font = new(fam, fontSize, FontStyle.Bold, GraphicsUnit.Pixel);
TextContainer.DrawText(graphics, rect, 0, lineColor, false, _stringFormat, text, font);
}
diff --git a/src/Greenshot.Editor/Forms/ImageEditorForm.cs b/src/Greenshot.Editor/Forms/ImageEditorForm.cs
index 87c3813c7..97263d8c2 100644
--- a/src/Greenshot.Editor/Forms/ImageEditorForm.cs
+++ b/src/Greenshot.Editor/Forms/ImageEditorForm.cs
@@ -1023,6 +1023,9 @@ namespace Greenshot.Editor.Forms
case Keys.C:
BtnCropClick(sender, e);
break;
+ case Keys.Z:
+ BtnResizeClick(sender, e);
+ break;
}
}
else if (e.Modifiers.Equals(Keys.Control))
diff --git a/src/Greenshot.Editor/Helpers/BinaryFormatterHelper.cs b/src/Greenshot.Editor/Helpers/BinaryFormatterHelper.cs
index 279e8b1a5..11c7dbae6 100644
--- a/src/Greenshot.Editor/Helpers/BinaryFormatterHelper.cs
+++ b/src/Greenshot.Editor/Helpers/BinaryFormatterHelper.cs
@@ -54,6 +54,7 @@ namespace Greenshot.Editor.Helpers
{"System.Collections.Generic.List`1[[Greenshot.Base.Interfaces.Drawing.IField", typeof(List)},
{"System.Collections.Generic.List`1[[System.Drawing.Point", typeof(List)},
{"Greenshot.Editor.Drawing.ArrowContainer", typeof(ArrowContainer) },
+ {"Greenshot.Editor.Drawing.ArrowContainer+ArrowHeadCombination", typeof(ArrowContainer.ArrowHeadCombination) },
{"Greenshot.Editor.Drawing.LineContainer", typeof(LineContainer) },
{"Greenshot.Editor.Drawing.TextContainer", typeof(TextContainer) },
{"Greenshot.Editor.Drawing.SpeechbubbleContainer", typeof(SpeechbubbleContainer) },
diff --git a/src/Greenshot.Editor/Helpers/ScaleHelper.cs b/src/Greenshot.Editor/Helpers/ScaleHelper.cs
index 8403bd939..8e4a76a13 100644
--- a/src/Greenshot.Editor/Helpers/ScaleHelper.cs
+++ b/src/Greenshot.Editor/Helpers/ScaleHelper.cs
@@ -202,7 +202,7 @@ namespace Greenshot.Editor.Helpers
{
// scaled rectangle (ratio) would be taller than original
// keep width and tweak height to maintain aspect ratio
- newSize = newSize.ChangeWidth(selectedSize.Width / originalRatio * flippedRatioSign);
+ newSize = newSize.ChangeHeight(selectedSize.Width / originalRatio * flippedRatioSign);
}
return newSize;
diff --git a/src/Greenshot.Plugin.Box/Greenshot.Plugin.Box.Credentials.template b/src/Greenshot.Plugin.Box/Greenshot.Plugin.Box.Credentials.template
index df6eaa0bd..da2dbc7ae 100644
--- a/src/Greenshot.Plugin.Box/Greenshot.Plugin.Box.Credentials.template
+++ b/src/Greenshot.Plugin.Box/Greenshot.Plugin.Box.Credentials.template
@@ -1,4 +1,4 @@
-/*
+/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
*
diff --git a/src/Greenshot.Plugin.Office/OfficeUtils.cs b/src/Greenshot.Plugin.Office/OfficeUtils.cs
index 52ca8d7cb..305611c5d 100644
--- a/src/Greenshot.Plugin.Office/OfficeUtils.cs
+++ b/src/Greenshot.Plugin.Office/OfficeUtils.cs
@@ -1,43 +1,45 @@
using System.Linq;
using Microsoft.Win32;
-namespace Greenshot.Plugin.Office;
-
-///
-/// A small utility class for helping with office
-///
-internal static class OfficeUtils
+namespace Greenshot.Plugin.Office
{
- private static readonly string[] OfficeRootKeys = { @"SOFTWARE\Microsoft\Office", @"SOFTWARE\WOW6432Node\Microsoft\Office" };
///
- /// Get the path to the office exe
+ /// A small utility class for helping with office
///
- /// Name of the office executable
- public static string GetOfficeExePath(string exeName)
+ internal static class OfficeUtils
{
- string strKeyName = exeName switch
- {
- "WINWORD.EXE" => "Word",
- "EXCEL.EXE" => "Excel",
- "POWERPNT.EXE" => "PowerPoint",
- "OUTLOOK.EXE" => "Outlook",
- "ONENOTE.EXE" => "OneNote",
- _ => ""
- };
+ private static readonly string[] OfficeRootKeys = { @"SOFTWARE\Microsoft\Office", @"SOFTWARE\WOW6432Node\Microsoft\Office" };
- foreach (string strRootKey in OfficeRootKeys)
+ ///
+ /// Get the path to the office exe
+ ///
+ /// Name of the office executable
+ public static string GetOfficeExePath(string exeName)
{
- using RegistryKey rootKey = Registry.LocalMachine.OpenSubKey(strRootKey);
- if (rootKey is null) continue;
-
- foreach (string officeVersion in rootKey.GetSubKeyNames().Where(r => r.Contains(".")).Reverse())
+ string strKeyName = exeName switch
{
- using RegistryKey installRootKey = Registry.LocalMachine.OpenSubKey($@"{strRootKey}\{officeVersion}\{strKeyName}\InstallRoot");
- if (installRootKey == null) continue;
- return $@"{installRootKey.GetValue("Path")}\{exeName}";
+ "WINWORD.EXE" => "Word",
+ "EXCEL.EXE" => "Excel",
+ "POWERPNT.EXE" => "PowerPoint",
+ "OUTLOOK.EXE" => "Outlook",
+ "ONENOTE.EXE" => "OneNote",
+ _ => ""
+ };
+
+ foreach (string strRootKey in OfficeRootKeys)
+ {
+ using RegistryKey rootKey = Registry.LocalMachine.OpenSubKey(strRootKey);
+ if (rootKey is null) continue;
+
+ foreach (string officeVersion in rootKey.GetSubKeyNames().Where(r => r.Contains(".")).Reverse())
+ {
+ using RegistryKey installRootKey = Registry.LocalMachine.OpenSubKey($@"{strRootKey}\{officeVersion}\{strKeyName}\InstallRoot");
+ if (installRootKey == null) continue;
+ return $@"{installRootKey.GetValue("Path")}\{exeName}";
+ }
}
+ return null;
}
- return null;
}
-}
+}
\ No newline at end of file
diff --git a/src/Greenshot.Plugin.Win10/ToastNotificationService.cs b/src/Greenshot.Plugin.Win10/ToastNotificationService.cs
index b9120fee7..52005356c 100644
--- a/src/Greenshot.Plugin.Win10/ToastNotificationService.cs
+++ b/src/Greenshot.Plugin.Win10/ToastNotificationService.cs
@@ -95,7 +95,17 @@ namespace Greenshot.Plugin.Win10
}
// Prepare the toast notifier. Be sure to specify the AppUserModelId on your application's shortcut!
- var toastNotifier = ToastNotificationManagerCompat.CreateToastNotifier();
+ Microsoft.Toolkit.Uwp.Notifications.ToastNotifierCompat toastNotifier = null;
+ try
+ {
+ toastNotifier = ToastNotificationManagerCompat.CreateToastNotifier();
+ }
+ catch (Exception ex)
+ {
+ Log.Warn("Could not create a toast notifier.", ex);
+
+ return;
+ }
// Here is an interesting article on reading the settings: https://www.rudyhuyn.com/blog/2018/02/10/toastnotifier-and-settings-careful-with-non-uwp-applications/
try
diff --git a/src/Greenshot.sln b/src/Greenshot.sln
index 91ddf4314..b71e79bd3 100644
--- a/src/Greenshot.sln
+++ b/src/Greenshot.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29728.190
+# Visual Studio Version 17
+VisualStudioVersion = 17.7.34009.444
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot", "Greenshot\Greenshot.csproj", "{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}"
ProjectSection(ProjectDependencies) = postProject
@@ -48,6 +48,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\azure-pipelines.yml = ..\azure-pipelines.yml
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
+ ..\.github\workflows\release.yml = ..\.github\workflows\release.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Editor", "Greenshot.Editor\Greenshot.Editor.csproj", "{148D3C8B-D6EC-4A7D-80E9-243A81F19DD2}"
diff --git a/src/Greenshot/Greenshot.csproj b/src/Greenshot/Greenshot.csproj
index fc4dd90d1..0bda5ae2c 100644
--- a/src/Greenshot/Greenshot.csproj
+++ b/src/Greenshot/Greenshot.csproj
@@ -17,6 +17,7 @@
+
@@ -75,6 +76,7 @@
+
diff --git a/src/Greenshot/Languages/language-ca-CA.xml b/src/Greenshot/Languages/language-ca-CA.xml
index 423c55006..323f7849f 100644
--- a/src/Greenshot/Languages/language-ca-CA.xml
+++ b/src/Greenshot/Languages/language-ca-CA.xml
@@ -305,7 +305,7 @@ Malgrat això, encara es poden utilitzar totes les característiques de Greensho
Afegeix un comptador (I)
Afegeix una bafarada (S)
- Canvia la mida
+ Canvia la mida (Z)
Configuració del canvi de mida
Manté la relació d'aspecte
Amplada
diff --git a/src/Greenshot/Languages/language-cs-CZ.xml b/src/Greenshot/Languages/language-cs-CZ.xml
index 86d7f2207..cc409c66f 100644
--- a/src/Greenshot/Languages/language-cs-CZ.xml
+++ b/src/Greenshot/Languages/language-cs-CZ.xml
@@ -308,7 +308,7 @@ Všechny funkce Greenshotu jsou stále dostupné přímo z místní nabídky bez
Přidat počítadlo (I)
Přidat textovou bublinu (S)
- Změnit velikost
+ Změnit velikost (Z)
Nastavení změny velikosti
Zachovat poměr stran
Šířka
diff --git a/src/Greenshot/Languages/language-de-DE.xml b/src/Greenshot/Languages/language-de-DE.xml
index a50ad0119..b636da112 100644
--- a/src/Greenshot/Languages/language-de-DE.xml
+++ b/src/Greenshot/Languages/language-de-DE.xml
@@ -312,7 +312,7 @@ Sie können aber auch alle Greenshot-Funktionen über das Kontextmenü des Green
Zähler hinzufügen (I)
Sprechblase hinzufügen (S)
- Skalieren
+ Skalieren (Z)
Einstellungen für Skalierung
Seitenverhältnis beibehalten
Breite
diff --git a/src/Greenshot/Languages/language-en-US.xml b/src/Greenshot/Languages/language-en-US.xml
index 5cac2280d..1403d3e9c 100644
--- a/src/Greenshot/Languages/language-en-US.xml
+++ b/src/Greenshot/Languages/language-en-US.xml
@@ -312,7 +312,7 @@ All Greenshot features still work directly from the tray icon context menu witho
Add counter (I)
Add speechbubble (S)
- Resize
+ Resize (Z)
Resize settings
Maintain aspect ratio
Width
diff --git a/src/Greenshot/Languages/language-fr-FR.xml b/src/Greenshot/Languages/language-fr-FR.xml
index 50cde5788..4ef502438 100644
--- a/src/Greenshot/Languages/language-fr-FR.xml
+++ b/src/Greenshot/Languages/language-fr-FR.xml
@@ -144,7 +144,7 @@ De plus, nous apprécierions beaucoup que vous preniez la peine de vérifier si
Imprimer
Rétablir {0}
Réinitialiser la taille
- Redimensionner
+ Redimensionner (Z)
Maintenir le rapport L / H
Hauteur
Pourcentage
diff --git a/src/Greenshot/Languages/language-id-ID.xml b/src/Greenshot/Languages/language-id-ID.xml
index df31cd624..fcb887082 100644
--- a/src/Greenshot/Languages/language-id-ID.xml
+++ b/src/Greenshot/Languages/language-id-ID.xml
@@ -144,7 +144,7 @@ Juga, kami sangat terbantu apabila anda mengecek laporan lain yang sama dengan k
Cetak
Ulang {0}
Reset ukuran
- Ubah ukuran
+ Ubah ukuran (Z)
Pertahankan aspek rasio
Tinggi
Persen
diff --git a/src/Greenshot/Languages/language-it-IT.xml b/src/Greenshot/Languages/language-it-IT.xml
index b0cb0e96f..89d68c988 100644
--- a/src/Greenshot/Languages/language-it-IT.xml
+++ b/src/Greenshot/Languages/language-it-IT.xml
@@ -322,7 +322,7 @@ In alternativa alle scorciatoie di tastiera, tutte le funzioni di Greenshot sono
Aggiungi conteggio
Aggiungi nuvoletta
- Ridimensiona
+ Ridimensiona (Z)
Impostazioni ridimensionamento
Mantieni rapporto dimensioni
Larghezza
diff --git a/src/Greenshot/Languages/language-ja-JP.xml b/src/Greenshot/Languages/language-ja-JP.xml
index 03638f0dc..36f5231f2 100644
--- a/src/Greenshot/Languages/language-ja-JP.xml
+++ b/src/Greenshot/Languages/language-ja-JP.xml
@@ -143,7 +143,7 @@ Greenshot には一切の保障がありません。GNU General Public License
印刷
やり直し{0}
サイズをリセット
- リサイズ
+ リサイズ (Z)
縦横比を維持する
高さ
パーセント
diff --git a/src/Greenshot/Languages/language-kab-DZ.xml b/src/Greenshot/Languages/language-kab-DZ.xml
index e3366a18a..8a690952c 100644
--- a/src/Greenshot/Languages/language-kab-DZ.xml
+++ b/src/Greenshot/Languages/language-kab-DZ.xml
@@ -144,7 +144,7 @@ Rnu ɣur-s, nḥemmel aṭas ma yella tesneqdeḍ aneqqis igebren ugur-agi. (Tze
Siggez
Err-d {0}
Wennez teɣzi
- Snifel tahri/teɣzi
+ Snifel tahri/teɣzi (Z)
Eǧǧ afmiḍi Teɣ / Teh
Awrir
Afmiḍi
diff --git a/src/Greenshot/Languages/language-ko-KR.xml b/src/Greenshot/Languages/language-ko-KR.xml
index 0bf90570e..144188ad8 100644
--- a/src/Greenshot/Languages/language-ko-KR.xml
+++ b/src/Greenshot/Languages/language-ko-KR.xml
@@ -304,7 +304,7 @@ ${hostname} PC명
카운터 더하기 (I)
설명선 더하기(S)
- 크기조정
+ 크기조정 (Z)
크기조정 설정
종횡비 유지
너비
diff --git a/src/Greenshot/Languages/language-lv-LV.xml b/src/Greenshot/Languages/language-lv-LV.xml
index acbe9eacb..dea057944 100644
--- a/src/Greenshot/Languages/language-lv-LV.xml
+++ b/src/Greenshot/Languages/language-lv-LV.xml
@@ -306,7 +306,7 @@ Arī bez karstiem taustiņiem visas darbības iespējams veikt izmantojot „Gre
Pievienot skaitli (I)
Pievienot teksta norādi (S)
- Mainīt izmēru
+ Mainīt izmēru (Z)
Izmēra maiņas iestatījumi
Saglabāt izmēru attiecības
Platums
diff --git a/src/Greenshot/Languages/language-nl-NL.xml b/src/Greenshot/Languages/language-nl-NL.xml
index 65c008c01..d640b0a42 100644
--- a/src/Greenshot/Languages/language-nl-NL.xml
+++ b/src/Greenshot/Languages/language-nl-NL.xml
@@ -307,7 +307,7 @@ Alle Greenshot functies werken ook zonder sneltoetsen via het context menu.Teller toevoegen (I)
Tekstballon toevoegen (S)
- Grootte
+ Grootte (Z)
Vergrotingsinstellingen
Verhouding behouden
Breedte
diff --git a/src/Greenshot/Languages/language-pt-PT.xml b/src/Greenshot/Languages/language-pt-PT.xml
index 53a3ea424..4da21743d 100644
--- a/src/Greenshot/Languages/language-pt-PT.xml
+++ b/src/Greenshot/Languages/language-pt-PT.xml
@@ -305,7 +305,7 @@ Todas as funcionalidades do Greenshot funcionam directamente através do menu de
Adicionar contador (I)
Adicionar balão de texto (S)
- Redimensionar
+ Redimensionar (Z)
Definições de Redimensionamento
Manter proporções
Largura
diff --git a/src/Greenshot/Languages/language-sv-SE.xml b/src/Greenshot/Languages/language-sv-SE.xml
index c67bfe8fe..c5b1517e2 100644
--- a/src/Greenshot/Languages/language-sv-SE.xml
+++ b/src/Greenshot/Languages/language-sv-SE.xml
@@ -305,7 +305,7 @@ Alla Greenshots funktioner fungerar fortfarande från snabbmenyn i aktivitetsfä
Lägg till räknare
Lägg till pratbubbla
- Anpassa storlek
+ Anpassa storlek (Z)
Storleksinställningar
Behåll bildförhållande
Bredd
diff --git a/src/Greenshot/Languages/language-uk-UA.xml b/src/Greenshot/Languages/language-uk-UA.xml
index 1eae26c97..057927676 100644
--- a/src/Greenshot/Languages/language-uk-UA.xml
+++ b/src/Greenshot/Languages/language-uk-UA.xml
@@ -306,7 +306,7 @@ ${hostname} назва комп’ютера
Додати лічильник (Ш)
Додати словесну бульбашку (І)
- Змінити розмір
+ Змінити розмір (Z)
Параметри зміни розміру
Зберігати пропорції
Ширина
diff --git a/src/Greenshot/Languages/language-zh-TW.xml b/src/Greenshot/Languages/language-zh-TW.xml
index 69f5e6696..63f8fce2f 100644
--- a/src/Greenshot/Languages/language-zh-TW.xml
+++ b/src/Greenshot/Languages/language-zh-TW.xml
@@ -307,7 +307,7 @@ Greenshot 所有功能仍然可以直接從通知區圖示的內容功能表動
加入計數器 (I)
加入對話框 (S)
- 縮放
+ 縮放 (Z)
縮放設定
維持長寬比
長度