fixed #220: File upload test won't use after capture tasks

This commit is contained in:
Jaex 2014-08-04 02:28:07 +03:00
parent 4acbe38586
commit ddfa41391f
9 changed files with 35 additions and 83 deletions

View file

@ -46,7 +46,6 @@ protected override void Dispose(bool disposing)
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ImageEditorForm));
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
@ -167,9 +166,6 @@ private void InitializeComponent() {
this.btnCancel = new Greenshot.Controls.BindableToolStripButton();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.closeToolStripMenuItem = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.fileSavedStatusContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.copyPathMenuItem = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.openDirectoryMenuItem = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.LeftToolStripPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
@ -178,7 +174,6 @@ private void InitializeComponent() {
this.toolStrip2.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.propertiesToolStrip.SuspendLayout();
this.fileSavedStatusContextMenu.SuspendLayout();
this.SuspendLayout();
//
// toolStripContainer1
@ -1568,30 +1563,6 @@ private void InitializeComponent() {
this.closeToolStripMenuItem.Size = new System.Drawing.Size(307, 22);
this.closeToolStripMenuItem.Text = "Close";
//
// fileSavedStatusContextMenu
//
this.fileSavedStatusContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyPathMenuItem,
this.openDirectoryMenuItem});
this.fileSavedStatusContextMenu.Name = "contextMenuStrip1";
this.fileSavedStatusContextMenu.Size = new System.Drawing.Size(264, 48);
//
// copyPathMenuItem
//
this.copyPathMenuItem.LanguageKey = "editor_copypathtoclipboard";
this.copyPathMenuItem.Name = "copyPathMenuItem";
this.copyPathMenuItem.Size = new System.Drawing.Size(263, 22);
this.copyPathMenuItem.Text = "Copy path to clipboard";
this.copyPathMenuItem.Click += new System.EventHandler(this.CopyPathMenuItemClick);
//
// openDirectoryMenuItem
//
this.openDirectoryMenuItem.LanguageKey = "editor_opendirinexplorer";
this.openDirectoryMenuItem.Name = "openDirectoryMenuItem";
this.openDirectoryMenuItem.Size = new System.Drawing.Size(263, 22);
this.openDirectoryMenuItem.Text = "Open directory in Windows Explorer";
this.openDirectoryMenuItem.Click += new System.EventHandler(this.OpenDirectoryMenuItemClick);
//
// ImageEditorForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@ -1600,6 +1571,7 @@ private void InitializeComponent() {
this.Controls.Add(this.toolStripContainer1);
this.KeyPreview = true;
this.LanguageKey = "editor_title";
this.MinimumSize = new System.Drawing.Size(100, 100);
this.Name = "ImageEditorForm";
this.Text = "Greenshot image editor";
this.Activated += new System.EventHandler(this.ImageEditorFormActivated);
@ -1620,7 +1592,6 @@ private void InitializeComponent() {
this.menuStrip1.PerformLayout();
this.propertiesToolStrip.ResumeLayout(false);
this.propertiesToolStrip.PerformLayout();
this.fileSavedStatusContextMenu.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -1683,10 +1654,7 @@ private void InitializeComponent() {
private GreenshotPlugin.Controls.GreenshotToolStripButton btnFreehand;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnObfuscate;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnCrop;
private GreenshotPlugin.Controls.GreenshotToolStripMenuItem openDirectoryMenuItem;
private GreenshotPlugin.Controls.GreenshotToolStripMenuItem copyPathMenuItem;
private System.Windows.Forms.ContextMenuStrip fileSavedStatusContextMenu;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnCrop;
private GreenshotPlugin.Controls.GreenshotToolStripMenuItem downToBottomToolStripMenuItem;
private GreenshotPlugin.Controls.GreenshotToolStripMenuItem upToTopToolStripMenuItem;
private GreenshotPlugin.Controls.GreenshotToolStripMenuItem downOneLevelToolStripMenuItem;

View file

@ -918,21 +918,6 @@ private void StatusLabelClicked(object sender, MouseEventArgs e)
}
}*/
private void CopyPathMenuItemClick(object sender, EventArgs e)
{
ClipboardHelper.SetClipboardData(surface.LastSaveFullPath);
}
private void OpenDirectoryMenuItemClick(object sender, EventArgs e)
{
ProcessStartInfo psi = new ProcessStartInfo("explorer");
psi.Arguments = Path.GetDirectoryName(surface.LastSaveFullPath);
psi.UseShellExecute = false;
Process p = new Process();
p.StartInfo = psi;
p.Start();
}
#endregion status label handling
private void bindFieldControls()

View file

@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>612, 17</value>
<value>288, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnCursor.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -289,7 +289,7 @@
</value>
</data>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>497, 17</value>
<value>173, 17</value>
</metadata>
<data name="undoToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -467,7 +467,7 @@
</value>
</data>
<metadata name="propertiesToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>225, 17</value>
<value>17, 17</value>
</metadata>
<data name="btnSaveClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -501,7 +501,7 @@
<data name="btnCancelTasks.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADr4AAA6+AepCscAAAAHcSURBVDhPrZM7SMNQFIaPQn2ASipYRHStDk610L0g0qFY
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAHcSURBVDhPrZM7SMNQFIaPQn2ASipYRHStDk610L0g0qFY
F6mNIrjo4ODg6qwFBxcX8TlYa1HqUJcKRqWDaFMbHXxQihjB6lB0SOgSjufodahUXfzhJyf3/N/l3Dzg
3xUBaNsGmIxRSU4JR3iNeyJWWVEA/259vZLxePSXUMh4m5iwXsfHreehIUN1u3XucUbEy7VJjbgkqQVZ
Np9GR1GX5TLz2mMwaMYbG1XOCuxTyzRatK5OuR8cNG8HBvC6v7+ibwIBvPP7zU2bTWFG4ACrdL6Uy6Vr
@ -528,13 +528,13 @@
<data name="btnSaveAs.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFlSURBVDhPjZCxasJgFIUVn8BXSKZCBsFYHMySRehSl+5d
WgMJqGCEDCIFp76JWIWC1EItiEUL2UPnDjoWodg6WG/vCaEk5rfkwAfyn3tv5EuJkk6nb5i7i07n+hjo
MResRMPFsNvt0p6Ifvb7GHhHj7lgJRou7tvtNn3vdvS53cbAO3rMBSvRcDFyHIc+eHi1XsfAO3rMBSvR
cPFo2za5nkerzSYG3tFjTijspFR6u2q16LLR8JFlmVRVpWq1+ke9XseBSWJh2WyW8vm8f6hQKFCz2cSB
aWJhmqbRYvFKxWLR/12r1XBgnliYqp7SePzsL5fLZTJNEwfcxMJyOZUGgyfSdZ0qlQoZhkHs28OBCYSE
BR0SCHvPZDK3vLQM0ceBqWVZvhxIChMTJgoXc3wFciBpNnvxEQoThQsXBzAISZIk0XA4Egs7kjPGUxTl
C5Lw13u9B7Gwf3LOLCEpDN5C9JmDpFK/sHTQWPoWDp0AAAAASUVORK5CYII=
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFlSURBVDhPjZCxasJgFIUVn8BXSKZmEozFwSxZhC516d6l
NZCACkbIIFJw6puIVShILdSCWLSQPXTuoGMRiq2D9faeEEpifksOfCD/ufdGvpQo6XT6hrm76HSuj4Ee
c8FKNFwMu90u7YnoZ7+PgXf0mAtWouHivt1u0/duR5/bbQy8o8dcsBINFyPHceiDh1frdQy8o8dcsBIN
F4+2bZPrebTabGLgHT3mhMJOSqW3q1aLLhsNH1mWSVVVqlarf9TrdRyYJBaWzWYpn8/7hwqFAjWbTRyY
JhamaRotFq9ULBb937VaDQfmiYWp6imNx8/+crlcJtM0ccBNLCyXU2kweCJd16lSqZBhGMS+PRyYQEhY
0CGBsPdMJnPLS8sQfRyYWpbly4GkMDFhonAxx1cgB5JmsxcfoTBRuHBxAIOQJEkSDYcjsbAjOWM8RVG+
IAl/vdd7EAv7J+fMEpLC4C1EnzlIKvULraTQUmJxMIIAAAAASUVORK5CYII=
</value>
</data>
<data name="btnClipboardCopy.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -552,7 +552,7 @@
<data name="btnUploadImage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAK9SURBVDhPnZLfS1NhHMbPqqtuvLA/IRiRCeLIKMeMJYZ4
YQUAAAAJcEhZcwAADr4AAA6+AepCscAAAAK9SURBVDhPnZLfS1NhHMbPqqtuvLA/IRiRCeLIKMeMJYZ4
EU0ySSRCbeJNIbml6cItTa00wx/DSk2Q3FDbUiuOP1KXHjxuqFupa3MrneF0o4mo6OTpfdegC+3G5/CB
l/N+nvf9wjnMvgCCYxU/xEcrlqoFlZ73FLqm7+he2PpfIDhSPCU/WT3H15m9a822n7uWRd9uu31jLbrO
ztM96oTlA5JtlAhVo5amQc8OvwlUjSzjw+Im6LrHs7YTpRmzUCds74/g2quGq40T/uwuJ3INC8h7t4B8
@ -938,7 +938,4 @@
RU5ErkJggg==
</value>
</data>
<metadata name="fileSavedStatusContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -810,7 +810,7 @@ private void tsmiShowDebugLog_Click(object sender, EventArgs e)
private void tsmiTestImageUpload_Click(object sender, EventArgs e)
{
UploadManager.RunImageTask(Resources.Test);
UploadManager.UploadImage(Resources.Test);
}
private void tsmiTestTextUpload_Click(object sender, EventArgs e)

View file

@ -237,7 +237,7 @@ public void StartRecording(TaskSettings taskSettings)
if (screenRecorder != null)
{
TrayIcon.Text = "ShareX - Encoding...";
TrayIcon.Icon = Resources.camcorder__pencil.ToIcon();
TrayIcon.Icon = Resources.camcorder_pencil.ToIcon();
string sourceFilePath = path;

View file

@ -183,9 +183,9 @@ public static System.Drawing.Bitmap bin {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap camcorder__pencil {
public static System.Drawing.Bitmap camcorder_image {
get {
object obj = ResourceManager.GetObject("camcorder__pencil", resourceCulture);
object obj = ResourceManager.GetObject("camcorder_image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@ -193,9 +193,9 @@ public static System.Drawing.Bitmap camcorder__pencil {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap camcorder_image {
public static System.Drawing.Bitmap camcorder_pencil {
get {
object obj = ResourceManager.GetObject("camcorder_image", resourceCulture);
object obj = ResourceManager.GetObject("camcorder_pencil", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@ -394,7 +394,7 @@ public static System.Drawing.Bitmap eraser {
/// </summary>
public static System.Drawing.Bitmap exclamation_button {
get {
object obj = ResourceManager.GetObject("exclamation-button", resourceCulture);
object obj = ResourceManager.GetObject("exclamation_button", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@ -414,7 +414,7 @@ public static System.Drawing.Bitmap folder {
/// </summary>
public static System.Drawing.Bitmap folder_open_document {
get {
object obj = ResourceManager.GetObject("folder-open-document", resourceCulture);
object obj = ResourceManager.GetObject("folder_open_document", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@ -674,7 +674,7 @@ public static System.Drawing.Bitmap layers_ungroup {
/// </summary>
public static System.Drawing.Bitmap layout_select_content {
get {
object obj = ResourceManager.GetObject("layout-select-content", resourceCulture);
object obj = ResourceManager.GetObject("layout_select_content", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@ -684,7 +684,7 @@ public static System.Drawing.Bitmap layout_select_content {
/// </summary>
public static System.Drawing.Bitmap layout_select_sidebar {
get {
object obj = ResourceManager.GetObject("layout-select-sidebar", resourceCulture);
object obj = ResourceManager.GetObject("layout_select_sidebar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}

View file

@ -151,7 +151,7 @@
<data name="Ellipse" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Ellipse.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="exclamation-button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="exclamation_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\exclamation-button.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cross_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
@ -199,13 +199,13 @@
<data name="image_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\image-export.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layout-select-sidebar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="layout_select_sidebar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layout-select-sidebar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="au" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\au.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layout-select-content" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="layout_select_content" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layout-select-content.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="application_network" type="System.Resources.ResXFileRef, System.Windows.Forms">
@ -241,7 +241,7 @@
<data name="layer_shape_round" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer-shape-round.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="camcorder__pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="camcorder_pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\camcorder--pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="keyboard" type="System.Resources.ResXFileRef, System.Windows.Forms">
@ -355,7 +355,7 @@
<data name="layer_shape_polygon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer-shape-polygon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="folder-open-document" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="folder_open_document" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\folder-open-document.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="eraser" type="System.Resources.ResXFileRef, System.Windows.Forms">

View file

@ -261,7 +261,7 @@ public static Image AnnotateImage(Image img, string imgPath)
{
return ImageHelpers.AnnotateImage(img, imgPath, !Program.IsSandbox, Program.PersonalPath,
x => Program.MainForm.InvokeSafe(() => ClipboardHelpers.CopyImage(x)),
x => Program.MainForm.InvokeSafe(() => UploadManager.RunImageTask(x)),
x => Program.MainForm.InvokeSafe(() => UploadManager.UploadImage(x)),
(x, filePath) => Program.MainForm.InvokeSafe(() => ImageHelpers.SaveImage(x, filePath)),
(x, filePath) =>
{

View file

@ -296,13 +296,13 @@ public static void RunImageTask(Image img, TaskSettings taskSettings)
}
}
public static void RunImageTask(Image img, AfterCaptureTasks imageJob = AfterCaptureTasks.UploadImageToHost)
public static void UploadImage(Image img)
{
if (imageJob != AfterCaptureTasks.None)
if (img != null)
{
TaskSettings taskSettings = TaskSettings.GetDefaultTaskSettings();
taskSettings.UseDefaultAfterCaptureJob = false;
taskSettings.AfterCaptureJob = imageJob;
taskSettings.AfterCaptureJob = AfterCaptureTasks.UploadImageToHost;
RunImageTask(img, taskSettings);
}
@ -313,6 +313,8 @@ public static void UploadImage(Image img, ImageDestination imageDestination)
if (img != null)
{
TaskSettings taskSettings = TaskSettings.GetDefaultTaskSettings();
taskSettings.UseDefaultAfterCaptureJob = false;
taskSettings.AfterCaptureJob = AfterCaptureTasks.UploadImageToHost;
taskSettings.UseDefaultDestinations = false;
taskSettings.ImageDestination = imageDestination;