This commit is contained in:
Chris Need Space 2021-03-08 22:45:26 +01:00 committed by GitHub
commit ca916c16d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -64,6 +64,8 @@ namespace Greenshot.Destinations {
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) { public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(Designation, Description); ExportInformation exportInformation = new ExportInformation(Designation, Description);
// close the form after copying the image to clipboard
exportInformation.CloseForm = true;
try { try {
ClipboardHelper.SetClipboardData(surface); ClipboardHelper.SetClipboardData(surface);
exportInformation.ExportMade = true; exportInformation.ExportMade = true;

View file

@ -956,7 +956,11 @@ namespace Greenshot.Forms {
} }
if (destination.EditorShortcutKeys == keys) { if (destination.EditorShortcutKeys == keys) {
destination.ExportCapture(true, _surface, _surface.CaptureDetails); ExportInformation exportInformation = destination.ExportCapture(true, _surface, _surface.CaptureDetails);
if (exportInformation != null && exportInformation.ExportMade) {
if (exportInformation.CloseForm)
this.Close();
}
return true; return true;
} }
} }
@ -1297,6 +1301,8 @@ namespace Greenshot.Forms {
ExportInformation exportInformation = clickedDestination?.ExportCapture(true, _surface, _surface.CaptureDetails); ExportInformation exportInformation = clickedDestination?.ExportCapture(true, _surface, _surface.CaptureDetails);
if (exportInformation != null && exportInformation.ExportMade) { if (exportInformation != null && exportInformation.ExportMade) {
_surface.Modified = false; _surface.Modified = false;
if (exportInformation.CloseForm)
this.Close();
} }
} }

View file

@ -48,6 +48,11 @@ namespace GreenshotPlugin.Interfaces {
public string ErrorMessage { get; set; } public string ErrorMessage { get; set; }
public string Filepath { get; set; } public string Filepath { get; set; }
/// <summary>
/// Set to true to close the invoking form.
/// </summary>
public bool CloseForm { get; set; }
} }
/// <summary> /// <summary>