mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 10:47:02 -07:00
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:
parent
f3d376ee71
commit
be797ecf8a
27 changed files with 379 additions and 172 deletions
|
@ -62,17 +62,18 @@ namespace GreenshotPhotobucketPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
using (Image image = surface.GetImageForExport()) {
|
||||
string uploadURL = null;
|
||||
bool uploaded = plugin.Upload(captureDetails, image, out uploadURL);
|
||||
if (uploaded) {
|
||||
surface.UploadURL = uploadURL;
|
||||
surface.SendMessageEvent(this, SurfaceMessageTyp.UploadedUrl, Language.GetFormattedString("exported_to", Designation));
|
||||
surface.Modified = false;
|
||||
exportInformation.ExportMade = true;
|
||||
exportInformation.Uri = uploadURL;
|
||||
}
|
||||
return uploaded;
|
||||
}
|
||||
ProcessExport(exportInformation, surface);
|
||||
return exportInformation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,17 +68,14 @@ namespace GreenshotPhotobucketPlugin {
|
|||
config = IniConfig.GetIniSection<PhotobucketConfiguration>();
|
||||
resources = new ComponentResourceManager(typeof(PhotobucketPlugin));
|
||||
|
||||
ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem("Photobucket");
|
||||
itemPlugInRoot.Image = (Image)resources.GetObject("Photobucket");
|
||||
|
||||
ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(Language.GetString("photobucket", LangKey.configure));
|
||||
ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem("Photobucket " + Language.GetString("photobucket", LangKey.configure));
|
||||
itemPlugInConfig.Tag = host;
|
||||
itemPlugInConfig.Click += delegate {
|
||||
config.ShowConfigDialog();
|
||||
};
|
||||
itemPlugInRoot.DropDownItems.Add(itemPlugInConfig);
|
||||
itemPlugInConfig.Image = (Image)resources.GetObject("Photobucket");
|
||||
|
||||
PluginUtils.AddToContextMenu(host, itemPlugInRoot);
|
||||
PluginUtils.AddToContextMenu(host, itemPlugInConfig);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue