mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 13:10:00 -07:00
Added tool-tip click support for imgur
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1801 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
ca14e8365c
commit
3bbbc49c5e
2 changed files with 7 additions and 3 deletions
|
@ -64,9 +64,11 @@ namespace GreenshotImgurPlugin {
|
||||||
|
|
||||||
public override bool ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
public override bool ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||||
using (Image image = surface.GetImageForExport()) {
|
using (Image image = surface.GetImageForExport()) {
|
||||||
bool uploaded = plugin.Upload(captureDetails, image);
|
string uploadURL = null;
|
||||||
|
bool uploaded = plugin.Upload(captureDetails, image, out uploadURL);
|
||||||
if (uploaded) {
|
if (uploaded) {
|
||||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, Language.GetFormattedString("imgur", "exported_to", Description));
|
surface.UploadURL = uploadURL;
|
||||||
|
surface.SendMessageEvent(this, SurfaceMessageTyp.UploadedUrl, Language.GetFormattedString("exported_to", Designation));
|
||||||
surface.Modified = false;
|
surface.Modified = false;
|
||||||
}
|
}
|
||||||
return uploaded;
|
return uploaded;
|
||||||
|
|
|
@ -129,7 +129,7 @@ namespace GreenshotImgurPlugin {
|
||||||
Shutdown();
|
Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Upload(ICaptureDetails captureDetails, Image image) {
|
public bool Upload(ICaptureDetails captureDetails, Image image, out string uploadURL) {
|
||||||
using (MemoryStream stream = new MemoryStream()) {
|
using (MemoryStream stream = new MemoryStream()) {
|
||||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(Attributes.Name, Language.GetString("imgur", LangKey.communication_wait));
|
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(Attributes.Name, Language.GetString("imgur", LangKey.communication_wait));
|
||||||
|
|
||||||
|
@ -143,6 +143,7 @@ namespace GreenshotImgurPlugin {
|
||||||
CheckHistory();
|
CheckHistory();
|
||||||
imgurInfo.Image = ImageHelper.CreateThumbnail(image, 90, 90);
|
imgurInfo.Image = ImageHelper.CreateThumbnail(image, 90, 90);
|
||||||
IniConfig.Save();
|
IniConfig.Save();
|
||||||
|
uploadURL = imgurInfo.Page;
|
||||||
try {
|
try {
|
||||||
if (config.UsePageLink) {
|
if (config.UsePageLink) {
|
||||||
Clipboard.SetText(imgurInfo.Page);
|
Clipboard.SetText(imgurInfo.Page);
|
||||||
|
@ -159,6 +160,7 @@ namespace GreenshotImgurPlugin {
|
||||||
backgroundForm.CloseDialog();
|
backgroundForm.CloseDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
uploadURL = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue