From 46ff96e9d201c31d04e0942b13a4751558b69b55 Mon Sep 17 00:00:00 2001 From: Jaex Date: Sun, 1 Jun 2014 11:59:37 +0300 Subject: [PATCH] Few Gfycat changes, About window updated --- ShareX/Forms/AboutForm.Designer.cs | 181 +++++++++--------- ShareX/Forms/AboutForm.cs | 4 +- ShareX/Forms/AboutForm.resx | 10 +- ShareX/Properties/Resources.Designer.cs | 10 + ShareX/Properties/Resources.resx | 9 +- ShareX/Resources/GitHub.png | Bin 0 -> 434 bytes ShareX/ShareX.csproj | 1 + .../Favicons/{Gist.ico => GitHub.ico} | Bin UploadersLib/FileUploaders/GfycatUploader.cs | 40 +++- .../FileUploaders/MediaCrushUploader.cs | 2 +- UploadersLib/GUI/UploadersConfigForm.cs | 2 +- UploadersLib/Properties/Resources.Designer.cs | 4 +- UploadersLib/Properties/Resources.resx | 12 +- UploadersLib/UploadersLib.csproj | 2 +- 14 files changed, 157 insertions(+), 120 deletions(-) create mode 100644 ShareX/Resources/GitHub.png rename UploadersLib/Favicons/{Gist.ico => GitHub.ico} (100%) diff --git a/ShareX/Forms/AboutForm.Designer.cs b/ShareX/Forms/AboutForm.Designer.cs index c742dfb80..03df5b5b7 100644 --- a/ShareX/Forms/AboutForm.Designer.cs +++ b/ShareX/Forms/AboutForm.Designer.cs @@ -31,24 +31,24 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm)); this.lblProductName = new System.Windows.Forms.Label(); this.lblBerk = new System.Windows.Forms.Label(); - this.pbTR = new System.Windows.Forms.PictureBox(); - this.pbBerkURL = new System.Windows.Forms.PictureBox(); - this.pbMikeURL = new System.Windows.Forms.PictureBox(); - this.pbAU = new System.Windows.Forms.PictureBox(); this.lblMike = new System.Windows.Forms.Label(); - this.pbBerkSteamURL = new System.Windows.Forms.PictureBox(); this.rtbCredits = new System.Windows.Forms.RichTextBox(); this.rtbShareXInfo = new System.Windows.Forms.RichTextBox(); this.lblOwners = new System.Windows.Forms.Label(); - this.pbMikeSteamURL = new System.Windows.Forms.PictureBox(); this.cLogo = new HelpersLib.Canvas(); this.uclUpdate = new HelpersLib.UpdateCheckerLabel(); - ((System.ComponentModel.ISupportInitialize)(this.pbTR)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbBerkURL)).BeginInit(); + this.pbMikeSteamURL = new System.Windows.Forms.PictureBox(); + this.pbBerkSteamURL = new System.Windows.Forms.PictureBox(); + this.pbMikeURL = new System.Windows.Forms.PictureBox(); + this.pbAU = new System.Windows.Forms.PictureBox(); + this.pbBerkURL = new System.Windows.Forms.PictureBox(); + this.pbTR = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pbMikeSteamURL)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbBerkSteamURL)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbMikeURL)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbAU)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbBerkSteamURL)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbMikeSteamURL)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbBerkURL)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbTR)).BeginInit(); this.SuspendLayout(); // // lblProductName @@ -77,54 +77,6 @@ private void InitializeComponent() this.lblBerk.TabIndex = 4; this.lblBerk.Text = "Jaex (Berk)"; // - // pbTR - // - this.pbTR.BackColor = System.Drawing.Color.Transparent; - this.pbTR.Image = global::ShareX.Properties.Resources.tr; - this.pbTR.Location = new System.Drawing.Point(17, 142); - this.pbTR.Name = "pbTR"; - this.pbTR.Size = new System.Drawing.Size(16, 16); - this.pbTR.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pbTR.TabIndex = 8; - this.pbTR.TabStop = false; - // - // pbBerkURL - // - this.pbBerkURL.BackColor = System.Drawing.Color.Transparent; - this.pbBerkURL.Cursor = System.Windows.Forms.Cursors.Hand; - this.pbBerkURL.Image = global::ShareX.Properties.Resources.application_browser; - this.pbBerkURL.Location = new System.Drawing.Point(41, 142); - this.pbBerkURL.Name = "pbBerkURL"; - this.pbBerkURL.Size = new System.Drawing.Size(16, 16); - this.pbBerkURL.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pbBerkURL.TabIndex = 10; - this.pbBerkURL.TabStop = false; - this.pbBerkURL.Click += new System.EventHandler(this.pbBerkURL_Click); - // - // pbMikeURL - // - this.pbMikeURL.BackColor = System.Drawing.Color.Transparent; - this.pbMikeURL.Cursor = System.Windows.Forms.Cursors.Hand; - this.pbMikeURL.Image = global::ShareX.Properties.Resources.application_browser; - this.pbMikeURL.Location = new System.Drawing.Point(41, 166); - this.pbMikeURL.Name = "pbMikeURL"; - this.pbMikeURL.Size = new System.Drawing.Size(16, 16); - this.pbMikeURL.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pbMikeURL.TabIndex = 14; - this.pbMikeURL.TabStop = false; - this.pbMikeURL.Click += new System.EventHandler(this.pbMikeURL_Click); - // - // pbAU - // - this.pbAU.BackColor = System.Drawing.Color.Transparent; - this.pbAU.Image = global::ShareX.Properties.Resources.au; - this.pbAU.Location = new System.Drawing.Point(17, 166); - this.pbAU.Name = "pbAU"; - this.pbAU.Size = new System.Drawing.Size(16, 16); - this.pbAU.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pbAU.TabIndex = 12; - this.pbAU.TabStop = false; - // // lblMike // this.lblMike.AutoSize = true; @@ -136,19 +88,6 @@ private void InitializeComponent() this.lblMike.TabIndex = 6; this.lblMike.Text = "mcored (Michael Delpach)"; // - // pbBerkSteamURL - // - this.pbBerkSteamURL.BackColor = System.Drawing.Color.Transparent; - this.pbBerkSteamURL.Cursor = System.Windows.Forms.Cursors.Hand; - this.pbBerkSteamURL.Image = global::ShareX.Properties.Resources.steam; - this.pbBerkSteamURL.Location = new System.Drawing.Point(65, 142); - this.pbBerkSteamURL.Name = "pbBerkSteamURL"; - this.pbBerkSteamURL.Size = new System.Drawing.Size(16, 16); - this.pbBerkSteamURL.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pbBerkSteamURL.TabIndex = 21; - this.pbBerkSteamURL.TabStop = false; - this.pbBerkSteamURL.Click += new System.EventHandler(this.pbBerkSteamURL_Click); - // // rtbCredits // this.rtbCredits.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -159,9 +98,10 @@ private void InitializeComponent() this.rtbCredits.Location = new System.Drawing.Point(15, 200); this.rtbCredits.Name = "rtbCredits"; this.rtbCredits.ReadOnly = true; - this.rtbCredits.Size = new System.Drawing.Size(417, 248); + this.rtbCredits.Size = new System.Drawing.Size(411, 240); this.rtbCredits.TabIndex = 11; this.rtbCredits.Text = resources.GetString("rtbCredits.Text"); + this.rtbCredits.WordWrap = false; this.rtbCredits.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.rtb_LinkClicked); // // rtbShareXInfo @@ -186,19 +126,6 @@ private void InitializeComponent() this.lblOwners.TabIndex = 3; this.lblOwners.Text = "Owners:"; // - // pbMikeSteamURL - // - this.pbMikeSteamURL.BackColor = System.Drawing.Color.Transparent; - this.pbMikeSteamURL.Cursor = System.Windows.Forms.Cursors.Hand; - this.pbMikeSteamURL.Image = global::ShareX.Properties.Resources.steam; - this.pbMikeSteamURL.Location = new System.Drawing.Point(65, 166); - this.pbMikeSteamURL.Name = "pbMikeSteamURL"; - this.pbMikeSteamURL.Size = new System.Drawing.Size(16, 16); - this.pbMikeSteamURL.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pbMikeSteamURL.TabIndex = 34; - this.pbMikeSteamURL.TabStop = false; - this.pbMikeSteamURL.Click += new System.EventHandler(this.pbMikeSteamURL_Click); - // // cLogo // this.cLogo.Interval = 100; @@ -216,12 +143,86 @@ private void InitializeComponent() this.uclUpdate.Size = new System.Drawing.Size(224, 24); this.uclUpdate.TabIndex = 1; // + // pbMikeSteamURL + // + this.pbMikeSteamURL.BackColor = System.Drawing.Color.Transparent; + this.pbMikeSteamURL.Cursor = System.Windows.Forms.Cursors.Hand; + this.pbMikeSteamURL.Image = global::ShareX.Properties.Resources.steam; + this.pbMikeSteamURL.Location = new System.Drawing.Point(65, 166); + this.pbMikeSteamURL.Name = "pbMikeSteamURL"; + this.pbMikeSteamURL.Size = new System.Drawing.Size(16, 16); + this.pbMikeSteamURL.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pbMikeSteamURL.TabIndex = 34; + this.pbMikeSteamURL.TabStop = false; + this.pbMikeSteamURL.Click += new System.EventHandler(this.pbMikeSteamURL_Click); + // + // pbBerkSteamURL + // + this.pbBerkSteamURL.BackColor = System.Drawing.Color.Transparent; + this.pbBerkSteamURL.Cursor = System.Windows.Forms.Cursors.Hand; + this.pbBerkSteamURL.Image = global::ShareX.Properties.Resources.steam; + this.pbBerkSteamURL.Location = new System.Drawing.Point(65, 142); + this.pbBerkSteamURL.Name = "pbBerkSteamURL"; + this.pbBerkSteamURL.Size = new System.Drawing.Size(16, 16); + this.pbBerkSteamURL.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pbBerkSteamURL.TabIndex = 21; + this.pbBerkSteamURL.TabStop = false; + this.pbBerkSteamURL.Click += new System.EventHandler(this.pbBerkSteamURL_Click); + // + // pbMikeURL + // + this.pbMikeURL.BackColor = System.Drawing.Color.Transparent; + this.pbMikeURL.Cursor = System.Windows.Forms.Cursors.Hand; + this.pbMikeURL.Image = global::ShareX.Properties.Resources.GitHub; + this.pbMikeURL.Location = new System.Drawing.Point(41, 166); + this.pbMikeURL.Name = "pbMikeURL"; + this.pbMikeURL.Size = new System.Drawing.Size(16, 16); + this.pbMikeURL.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pbMikeURL.TabIndex = 14; + this.pbMikeURL.TabStop = false; + this.pbMikeURL.Click += new System.EventHandler(this.pbMikeURL_Click); + // + // pbAU + // + this.pbAU.BackColor = System.Drawing.Color.Transparent; + this.pbAU.Image = global::ShareX.Properties.Resources.au; + this.pbAU.Location = new System.Drawing.Point(17, 166); + this.pbAU.Name = "pbAU"; + this.pbAU.Size = new System.Drawing.Size(16, 16); + this.pbAU.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pbAU.TabIndex = 12; + this.pbAU.TabStop = false; + // + // pbBerkURL + // + this.pbBerkURL.BackColor = System.Drawing.Color.Transparent; + this.pbBerkURL.Cursor = System.Windows.Forms.Cursors.Hand; + this.pbBerkURL.Image = global::ShareX.Properties.Resources.GitHub; + this.pbBerkURL.Location = new System.Drawing.Point(41, 142); + this.pbBerkURL.Name = "pbBerkURL"; + this.pbBerkURL.Size = new System.Drawing.Size(16, 16); + this.pbBerkURL.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pbBerkURL.TabIndex = 10; + this.pbBerkURL.TabStop = false; + this.pbBerkURL.Click += new System.EventHandler(this.pbBerkURL_Click); + // + // pbTR + // + this.pbTR.BackColor = System.Drawing.Color.Transparent; + this.pbTR.Image = global::ShareX.Properties.Resources.tr; + this.pbTR.Location = new System.Drawing.Point(17, 142); + this.pbTR.Name = "pbTR"; + this.pbTR.Size = new System.Drawing.Size(16, 16); + this.pbTR.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pbTR.TabIndex = 8; + this.pbTR.TabStop = false; + // // AboutForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.WhiteSmoke; - this.ClientSize = new System.Drawing.Size(441, 457); + this.ClientSize = new System.Drawing.Size(435, 449); this.Controls.Add(this.pbMikeSteamURL); this.Controls.Add(this.lblOwners); this.Controls.Add(this.rtbShareXInfo); @@ -241,12 +242,12 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "ShareX - About"; this.Shown += new System.EventHandler(this.AboutForm_Shown); - ((System.ComponentModel.ISupportInitialize)(this.pbTR)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbBerkURL)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbMikeSteamURL)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbBerkSteamURL)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pbMikeURL)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pbAU)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbBerkSteamURL)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbMikeSteamURL)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbBerkURL)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbTR)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/ShareX/Forms/AboutForm.cs b/ShareX/Forms/AboutForm.cs index ca459593e..dcee623a5 100644 --- a/ShareX/Forms/AboutForm.cs +++ b/ShareX/Forms/AboutForm.cs @@ -40,10 +40,10 @@ public AboutForm() Text = Program.Title; lblProductName.Text = Program.Title; - uclUpdate.CheckUpdate(TaskHelpers.CheckUpdate); - rtbShareXInfo.AddContextMenu(); rtbCredits.AddContextMenu(); + + uclUpdate.CheckUpdate(TaskHelpers.CheckUpdate); } private void AboutForm_Shown(object sender, EventArgs e) diff --git a/ShareX/Forms/AboutForm.resx b/ShareX/Forms/AboutForm.resx index ea8ec223f..4b1af0c7c 100644 --- a/ShareX/Forms/AboutForm.resx +++ b/ShareX/Forms/AboutForm.resx @@ -120,10 +120,12 @@ Contributors: -Logo and icon: Mopsy - http://mpql.net -Jira, Gist and Mega support: gpailler (Grégoire Pailler) -Web site: dmxt (Dana) -Amazon S3 and DreamObjects support: Alan Edwardes - http://alanedwardes.com +Logo and icon: https://github.com/mopquill - http://mpql.net +Jira, Gist and Mega support: https://github.com/gpailler +Web site: https://github.com/dmxt +MediaCrush support: https://github.com/SirCmpwn - http://drewdevault.com +Amazon S3 and DreamObjects support: https://github.com/alanedwardes - http://alanedwardes.com +Gfycat support: https://github.com/Dinnerbone - http://dinnerbone.com External libraries: diff --git a/ShareX/Properties/Resources.Designer.cs b/ShareX/Properties/Resources.Designer.cs index 9c58dfd06..00bfce456 100644 --- a/ShareX/Properties/Resources.Designer.cs +++ b/ShareX/Properties/Resources.Designer.cs @@ -459,6 +459,16 @@ public static System.Drawing.Bitmap gear { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap GitHub { + get { + object obj = ResourceManager.GetObject("GitHub", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShareX/Properties/Resources.resx b/ShareX/Properties/Resources.resx index eb932971e..7a307140d 100644 --- a/ShareX/Properties/Resources.resx +++ b/ShareX/Properties/Resources.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + ..\Resources\Test.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -364,4 +364,7 @@ ..\Resources\barcode-2d.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\GitHub.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/ShareX/Resources/GitHub.png b/ShareX/Resources/GitHub.png new file mode 100644 index 0000000000000000000000000000000000000000..dc2469920b21b1b7408e1f8306d26580c5ae4345 GIT binary patch literal 434 zcmV;j0ZsmiP)UrKk3h^U3-xx+#oUbG6i?g+J z8p@L3B1OCpk*@FiDJ;oWWKXl%Y{B8l zQL#MyFqHQO)fs@JQuQ3MFK7Q(!`5>Q-~iUebJ___{S8ja!^$ZGu#f59pcUn`Ad&SN c{@pVE7Y}fZLUB;At^fc407*qoM6N<$f`ZA)BLDyZ literal 0 HcmV?d00001 diff --git a/ShareX/ShareX.csproj b/ShareX/ShareX.csproj index 1b29a75cd..f0d38f43f 100644 --- a/ShareX/ShareX.csproj +++ b/ShareX/ShareX.csproj @@ -494,6 +494,7 @@ + diff --git a/UploadersLib/Favicons/Gist.ico b/UploadersLib/Favicons/GitHub.ico similarity index 100% rename from UploadersLib/Favicons/Gist.ico rename to UploadersLib/Favicons/GitHub.ico diff --git a/UploadersLib/FileUploaders/GfycatUploader.cs b/UploadersLib/FileUploaders/GfycatUploader.cs index bdaad3642..e01612d8a 100644 --- a/UploadersLib/FileUploaders/GfycatUploader.cs +++ b/UploadersLib/FileUploaders/GfycatUploader.cs @@ -23,30 +23,42 @@ You should have received a copy of the GNU General Public License #endregion License Information (GPL v3) +// Credits: https://github.com/Dinnerbone + using HelpersLib; using Newtonsoft.Json; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.IO; +using System.Threading; using UploadersLib.HelperClasses; namespace UploadersLib.FileUploaders { public class GfycatUploader : FileUploader { + public bool NoResize { get; set; } + public bool IgnoreExisting { get; set; } + + public GfycatUploader() + { + NoResize = true; + IgnoreExisting = false; + } + public override UploadResult Upload(Stream stream, string fileName) { - Dictionary args = new Dictionary(); - // Magical official values from http://www.reddit.com/r/gfycat/comments/20xbth/any_word_on_allowing_uploading_a_gif_through_the/ + Dictionary args = new Dictionary(); args.Add("key", Helpers.GetRandomAlphanumeric(10)); args.Add("acl", "private"); args.Add("AWSAccessKeyId", "AKIAIT4VU4B7G2LQYKZQ"); args.Add("policy", "eyAiZXhwaXJhdGlvbiI6ICIyMDIwLTEyLTAxVDEyOjAwOjAwLjAwMFoiLAogICAgICAgICAgICAiY29uZGl0aW9ucyI6IFsKICAgICAgICAgICAgeyJidWNrZXQiOiAiZ2lmYWZmZSJ9LAogICAgICAgICAgICBbInN0YXJ0cy13aXRoIiwgIiRrZXkiLCAiIl0sCiAgICAgICAgICAgIHsiYWNsIjogInByaXZhdGUifSwKCSAgICB7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6ICIyMDAifSwKICAgICAgICAgICAgWyJzdGFydHMtd2l0aCIsICIkQ29udGVudC1UeXBlIiwgIiJdLAogICAgICAgICAgICBbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwgMCwgNTI0Mjg4MDAwXQogICAgICAgICAgICBdCiAgICAgICAgICB9"); args.Add("success_action_status", "200"); args.Add("signature", "mk9t/U/wRN4/uU01mXfeTe2Kcoc="); - args.Add("Content-Type", MimeTypes.GetMimeType(Path.GetExtension(fileName).ToLower())); + args.Add("Content-Type", Helpers.GetMimeType(fileName)); + UploadResult result = UploadData(stream, "https://gifaffe.s3.amazonaws.com/", fileName, "file", args); if (!result.IsError) @@ -59,12 +71,18 @@ public override UploadResult Upload(Stream stream, string fileName) private void TranscodeFile(string key, UploadResult result) { - string transcodeJson = SendRequest(HttpMethod.GET, "https://upload.gfycat.com/transcodeRelease/" + key + "?noResize=true"); + Dictionary args = new Dictionary(); + if (NoResize) args.Add("noResize", "true"); + if (IgnoreExisting) args.Add("noMd5", "true"); + + string url = CreateQuery("https://upload.gfycat.com/transcodeRelease/" + key, args); + string transcodeJson = SendRequest(HttpMethod.GET, url); GfycatTranscodeResponse transcodeResponse = JsonConvert.DeserializeObject(transcodeJson); if (transcodeResponse.IsOk) { ProgressManager progress = new ProgressManager(10000); + if (AllowReportProgress) { OnProgressChanged(progress); @@ -79,18 +97,20 @@ private void TranscodeFile(string key, UploadResult result) result.Errors.Add(response.Error); result.IsSuccess = false; break; - } else if (response.GfyName != null) { + } + else if (response.GfyName != null) + { result.IsSuccess = true; result.URL = "https://gfycat.com/" + response.GfyName; break; } - else + + if (AllowReportProgress && progress.UpdateProgress((progress.Length - progress.Position) / response.Time)) { - if (AllowReportProgress && progress.UpdateProgress((progress.Length - progress.Position) / response.Time)) - { - OnProgressChanged(progress); - } + OnProgressChanged(progress); } + + Thread.Sleep(100); } } else diff --git a/UploadersLib/FileUploaders/MediaCrushUploader.cs b/UploadersLib/FileUploaders/MediaCrushUploader.cs index 8df2f2578..6616db466 100644 --- a/UploadersLib/FileUploaders/MediaCrushUploader.cs +++ b/UploadersLib/FileUploaders/MediaCrushUploader.cs @@ -83,7 +83,7 @@ public override UploadResult Upload(Stream stream, string fileName) { case "processing": case "pending": - Thread.Sleep(1000); + Thread.Sleep(500); break; case "done": case "ready": diff --git a/UploadersLib/GUI/UploadersConfigForm.cs b/UploadersLib/GUI/UploadersConfigForm.cs index 318d75dd5..857ba3589 100644 --- a/UploadersLib/GUI/UploadersConfigForm.cs +++ b/UploadersLib/GUI/UploadersConfigForm.cs @@ -102,7 +102,7 @@ private void FormSettings() ImageList textUploadersImageList = new ImageList(); textUploadersImageList.ColorDepth = ColorDepth.Depth32Bit; textUploadersImageList.Images.Add("Pastebin", Resources.Pastebin); - textUploadersImageList.Images.Add("Gist", Resources.Gist); + textUploadersImageList.Images.Add("Gist", Resources.GitHub); textUploadersImageList.Images.Add("Upaste", Resources.Upaste); tcTextUploaders.ImageList = textUploadersImageList; diff --git a/UploadersLib/Properties/Resources.Designer.cs b/UploadersLib/Properties/Resources.Designer.cs index 858a76424..5532e5a09 100644 --- a/UploadersLib/Properties/Resources.Designer.cs +++ b/UploadersLib/Properties/Resources.Designer.cs @@ -193,9 +193,9 @@ internal static System.Drawing.Icon Gett { /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// - internal static System.Drawing.Icon Gist { + internal static System.Drawing.Icon GitHub { get { - object obj = ResourceManager.GetObject("Gist", resourceCulture); + object obj = ResourceManager.GetObject("GitHub", resourceCulture); return ((System.Drawing.Icon)(obj)); } } diff --git a/UploadersLib/Properties/Resources.resx b/UploadersLib/Properties/Resources.resx index fc430589a..7714b03b5 100644 --- a/UploadersLib/Properties/Resources.resx +++ b/UploadersLib/Properties/Resources.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + ..\Favicons\Dropbox.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -295,9 +295,6 @@ ..\Favicons\Mega.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Favicons\Gist.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\favicons\yourls.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -310,4 +307,7 @@ ..\favicons\AmazonS3.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Favicons\GitHub.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/UploadersLib/UploadersLib.csproj b/UploadersLib/UploadersLib.csproj index 0a1b5d31f..ec666ec34 100644 --- a/UploadersLib/UploadersLib.csproj +++ b/UploadersLib/UploadersLib.csproj @@ -358,7 +358,6 @@ - @@ -424,6 +423,7 @@ +