mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Changed the picker behavior to show again if the export failed or was "canceled"
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1913 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
292160b793
commit
6f3c928792
2 changed files with 28 additions and 12 deletions
|
@ -110,10 +110,15 @@ namespace Greenshot.Destinations {
|
||||||
LOG.Error(e);
|
LOG.Error(e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
using (Bitmap image = (Bitmap)surface.GetImageForExport()) {
|
try {
|
||||||
editor.Surface.AddBitmapContainer(image, 10, 10);
|
using (Bitmap image = (Bitmap)surface.GetImageForExport()) {
|
||||||
}
|
editor.Surface.AddBitmapContainer(image, 10, 10);
|
||||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, Language.GetFormattedString(LangKey.exported_to, Description));
|
}
|
||||||
|
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, Language.GetFormattedString(LangKey.exported_to, Description));
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.Error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,15 +78,26 @@ namespace Greenshot.Destinations {
|
||||||
if (clickedDestination == null) {
|
if (clickedDestination == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Make sure the menu is closed
|
bool isEditor = EditorDestination.DESIGNATION.Equals(clickedDestination.Designation);
|
||||||
menu.Close();
|
// Make sure the menu is invisible, don't close it
|
||||||
|
menu.Hide();
|
||||||
|
|
||||||
|
// Export
|
||||||
bool result = clickedDestination.ExportCapture(true, surface, captureDetails);
|
bool result = clickedDestination.ExportCapture(true, surface, captureDetails);
|
||||||
// TODO: Find some better way to detect that we exported to the editor
|
LOG.InfoFormat("Destination was {0} and result {1}", clickedDestination.Designation, result);
|
||||||
if (!EditorDestination.DESIGNATION.Equals(clickedDestination.Designation) || result == false) {
|
if (result == true) {
|
||||||
LOG.DebugFormat("Disposing as Destination was {0} and result {1}", clickedDestination.Description, result);
|
LOG.Info("Export success, closing menu");
|
||||||
// Cleanup surface
|
// close menu if the destination wasn't the editor
|
||||||
surface.Dispose();
|
menu.Close();
|
||||||
}
|
|
||||||
|
// Cleanup surface, only if the destination wasn't the editor
|
||||||
|
if (!isEditor) {
|
||||||
|
surface.Dispose();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LOG.Info("Export failed, showing menu again");
|
||||||
|
menu.Show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue