Extended the ExportCapture with ExportInformation as a result object, this allows us to better and more consistently return & handle information from the export. Also it should be easier to extend the functionality. TODO: Still need to cleanup some messages, some are no longer needed

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2034 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-09-14 15:04:37 +00:00
commit be797ecf8a
27 changed files with 379 additions and 172 deletions

View file

@ -69,7 +69,8 @@ namespace Greenshot.Destinations {
}
}
public override bool ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
bool outputMade;
bool overwrite;
string fullPath;
@ -114,14 +115,12 @@ namespace Greenshot.Destinations {
}
// Don't overwite filename if no output is made
if (outputMade) {
surface.LastSaveFullPath = fullPath;
surface.Modified = false;
exportInformation.ExportMade = outputMade;
exportInformation.Filepath = fullPath;
captureDetails.Filename = fullPath;
surface.SendMessageEvent(this, SurfaceMessageTyp.FileSaved, Language.GetFormattedString(LangKey.editor_imagesaved, surface.LastSaveFullPath));
} else {
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, "");
}
return outputMade;
ProcessExport(exportInformation, surface);
return exportInformation;
}
}
}