mirror of
https://github.com/greenshot/greenshot
synced 2025-08-22 06:23:24 -07:00
Fix wrong user intention (clipboard or save) detection on edit for.
This commit is contained in:
parent
c1da72cc37
commit
73f5bbb012
2 changed files with 11 additions and 4 deletions
|
@ -935,7 +935,8 @@ namespace Greenshot.Editor.Forms
|
||||||
// Make sure the editor is visible
|
// Make sure the editor is visible
|
||||||
WindowDetails.ToForeground(Handle);
|
WindowDetails.ToForeground(Handle);
|
||||||
|
|
||||||
bool saveToClipboard = _surface.CaptureDetails.CaptureMode == CaptureMode.Clipboard;
|
// If the user choose the clipboard as destination, just keep it also on close
|
||||||
|
bool saveToClipboard = _surface.CaptureDetails.CaptureDestinations.SingleOrDefault()?.Designation == nameof(WellKnownDestinations.Clipboard);
|
||||||
|
|
||||||
MessageBoxButtons buttons = MessageBoxButtons.YesNoCancel;
|
MessageBoxButtons buttons = MessageBoxButtons.YesNoCancel;
|
||||||
// Dissallow "CANCEL" if the application needs to shutdown
|
// Dissallow "CANCEL" if the application needs to shutdown
|
||||||
|
@ -958,7 +959,6 @@ namespace Greenshot.Editor.Forms
|
||||||
|
|
||||||
if (result.Equals(DialogResult.Yes))
|
if (result.Equals(DialogResult.Yes))
|
||||||
{
|
{
|
||||||
// If the user choose the clipboard as destination, just keep it also on close
|
|
||||||
if (saveToClipboard)
|
if (saveToClipboard)
|
||||||
{
|
{
|
||||||
BtnClipboardClick(sender, e);
|
BtnClipboardClick(sender, e);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Greenshot.Base;
|
using Greenshot.Base;
|
||||||
|
@ -83,10 +84,16 @@ namespace Greenshot.Destinations
|
||||||
{
|
{
|
||||||
Log.Info(Designation + " Notification Clicked!");
|
Log.Info(Designation + " Notification Clicked!");
|
||||||
|
|
||||||
var surface = new Surface((Image)e.Image.Clone()) { CaptureDetails = new CaptureDetails { CaptureMode = CaptureMode.Clipboard } };
|
var captureDetails = new CaptureDetails
|
||||||
|
{
|
||||||
|
CaptureMode = CaptureMode.Clipboard,
|
||||||
|
CaptureDestinations = new List<IDestination> { DestinationHelper.GetDestination(Designation) }
|
||||||
|
};
|
||||||
|
|
||||||
|
var surface = new Surface((Image)e.Image.Clone()) { CaptureDetails = captureDetails };
|
||||||
|
|
||||||
DestinationHelper.GetDestination(EditorDestination.DESIGNATION)
|
DestinationHelper.GetDestination(EditorDestination.DESIGNATION)
|
||||||
.ExportCapture(true, surface, new CaptureDetails { CaptureMode = CaptureMode.Clipboard });
|
.ExportCapture(true, surface, captureDetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue