mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-04 14:11:38 +12:00
fixed #797: Imgur GIFV URL option
This commit is contained in:
parent
7f3e257910
commit
7444eac51b
|
@ -136,6 +136,11 @@ private void InitializeComponent()
|
|||
this.tpCoinURL = new System.Windows.Forms.TabPage();
|
||||
this.txtCoinURLUUID = new System.Windows.Forms.TextBox();
|
||||
this.lblCoinURLUUID = new System.Windows.Forms.Label();
|
||||
this.tpPolr = new System.Windows.Forms.TabPage();
|
||||
this.txtPolrAPIKey = new System.Windows.Forms.TextBox();
|
||||
this.lblPolrAPIKey = new System.Windows.Forms.Label();
|
||||
this.txtPolrAPIHostname = new System.Windows.Forms.TextBox();
|
||||
this.lblPolrAPIHostname = new System.Windows.Forms.Label();
|
||||
this.tpFileUploaders = new System.Windows.Forms.TabPage();
|
||||
this.tcFileUploaders = new System.Windows.Forms.TabControl();
|
||||
this.tpFTP = new System.Windows.Forms.TabPage();
|
||||
|
@ -446,11 +451,7 @@ private void InitializeComponent()
|
|||
this.lblWidthHint = new System.Windows.Forms.Label();
|
||||
this.ttlvMain = new ShareX.HelpersLib.TabToListView();
|
||||
this.actRapidShareAccountType = new ShareX.UploadersLib.AccountTypeControl();
|
||||
this.tpPolr = new System.Windows.Forms.TabPage();
|
||||
this.txtPolrAPIHostname = new System.Windows.Forms.TextBox();
|
||||
this.lblPolrAPIHostname = new System.Windows.Forms.Label();
|
||||
this.txtPolrAPIKey = new System.Windows.Forms.TextBox();
|
||||
this.lblPolrAPIKey = new System.Windows.Forms.Label();
|
||||
this.cbImgurUseGIFV = new System.Windows.Forms.CheckBox();
|
||||
this.tpOtherUploaders.SuspendLayout();
|
||||
this.tcOtherUploaders.SuspendLayout();
|
||||
this.tpTwitter.SuspendLayout();
|
||||
|
@ -466,6 +467,7 @@ private void InitializeComponent()
|
|||
this.tpAdFly.SuspendLayout();
|
||||
this.tpLnkU.SuspendLayout();
|
||||
this.tpCoinURL.SuspendLayout();
|
||||
this.tpPolr.SuspendLayout();
|
||||
this.tpFileUploaders.SuspendLayout();
|
||||
this.tcFileUploaders.SuspendLayout();
|
||||
this.tpFTP.SuspendLayout();
|
||||
|
@ -516,7 +518,6 @@ private void InitializeComponent()
|
|||
this.tpPicasa.SuspendLayout();
|
||||
this.tpChevereto.SuspendLayout();
|
||||
this.tcUploaders.SuspendLayout();
|
||||
this.tpPolr.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtRapidSharePremiumUserName
|
||||
|
@ -1303,6 +1304,38 @@ private void InitializeComponent()
|
|||
resources.ApplyResources(this.lblCoinURLUUID, "lblCoinURLUUID");
|
||||
this.lblCoinURLUUID.Name = "lblCoinURLUUID";
|
||||
//
|
||||
// tpPolr
|
||||
//
|
||||
this.tpPolr.Controls.Add(this.txtPolrAPIKey);
|
||||
this.tpPolr.Controls.Add(this.lblPolrAPIKey);
|
||||
this.tpPolr.Controls.Add(this.txtPolrAPIHostname);
|
||||
this.tpPolr.Controls.Add(this.lblPolrAPIHostname);
|
||||
resources.ApplyResources(this.tpPolr, "tpPolr");
|
||||
this.tpPolr.Name = "tpPolr";
|
||||
this.tpPolr.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// txtPolrAPIKey
|
||||
//
|
||||
resources.ApplyResources(this.txtPolrAPIKey, "txtPolrAPIKey");
|
||||
this.txtPolrAPIKey.Name = "txtPolrAPIKey";
|
||||
this.txtPolrAPIKey.TextChanged += new System.EventHandler(this.txtPolrAPIKey_TextChanged);
|
||||
//
|
||||
// lblPolrAPIKey
|
||||
//
|
||||
resources.ApplyResources(this.lblPolrAPIKey, "lblPolrAPIKey");
|
||||
this.lblPolrAPIKey.Name = "lblPolrAPIKey";
|
||||
//
|
||||
// txtPolrAPIHostname
|
||||
//
|
||||
resources.ApplyResources(this.txtPolrAPIHostname, "txtPolrAPIHostname");
|
||||
this.txtPolrAPIHostname.Name = "txtPolrAPIHostname";
|
||||
this.txtPolrAPIHostname.TextChanged += new System.EventHandler(this.txtPolrAPIHostname_TextChanged);
|
||||
//
|
||||
// lblPolrAPIHostname
|
||||
//
|
||||
resources.ApplyResources(this.lblPolrAPIHostname, "lblPolrAPIHostname");
|
||||
this.lblPolrAPIHostname.Name = "lblPolrAPIHostname";
|
||||
//
|
||||
// tpFileUploaders
|
||||
//
|
||||
this.tpFileUploaders.Controls.Add(this.tcFileUploaders);
|
||||
|
@ -3010,6 +3043,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// tpImgur
|
||||
//
|
||||
this.tpImgur.Controls.Add(this.cbImgurUseGIFV);
|
||||
this.tpImgur.Controls.Add(this.cbImgurUploadSelectedAlbum);
|
||||
this.tpImgur.Controls.Add(this.cbImgurDirectLink);
|
||||
this.tpImgur.Controls.Add(this.atcImgurAccountType);
|
||||
|
@ -3551,37 +3585,12 @@ private void InitializeComponent()
|
|||
this.actRapidShareAccountType.Name = "actRapidShareAccountType";
|
||||
this.actRapidShareAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
|
||||
//
|
||||
// tpPolr
|
||||
// cbImgurUseGIFV
|
||||
//
|
||||
this.tpPolr.Controls.Add(this.txtPolrAPIKey);
|
||||
this.tpPolr.Controls.Add(this.lblPolrAPIKey);
|
||||
this.tpPolr.Controls.Add(this.txtPolrAPIHostname);
|
||||
this.tpPolr.Controls.Add(this.lblPolrAPIHostname);
|
||||
resources.ApplyResources(this.tpPolr, "tpPolr");
|
||||
this.tpPolr.Name = "tpPolr";
|
||||
this.tpPolr.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// txtPolrAPIHostname
|
||||
//
|
||||
resources.ApplyResources(this.txtPolrAPIHostname, "txtPolrAPIHostname");
|
||||
this.txtPolrAPIHostname.Name = "txtPolrAPIHostname";
|
||||
this.txtPolrAPIHostname.TextChanged += new System.EventHandler(this.txtPolrAPIHostname_TextChanged);
|
||||
//
|
||||
// lblPolrAPIHostname
|
||||
//
|
||||
resources.ApplyResources(this.lblPolrAPIHostname, "lblPolrAPIHostname");
|
||||
this.lblPolrAPIHostname.Name = "lblPolrAPIHostname";
|
||||
//
|
||||
// txtPolrAPIKey
|
||||
//
|
||||
resources.ApplyResources(this.txtPolrAPIKey, "txtPolrAPIKey");
|
||||
this.txtPolrAPIKey.Name = "txtPolrAPIKey";
|
||||
this.txtPolrAPIKey.TextChanged += new System.EventHandler(this.txtPolrAPIKey_TextChanged);
|
||||
//
|
||||
// lblPolrAPIKey
|
||||
//
|
||||
resources.ApplyResources(this.lblPolrAPIKey, "lblPolrAPIKey");
|
||||
this.lblPolrAPIKey.Name = "lblPolrAPIKey";
|
||||
resources.ApplyResources(this.cbImgurUseGIFV, "cbImgurUseGIFV");
|
||||
this.cbImgurUseGIFV.Name = "cbImgurUseGIFV";
|
||||
this.cbImgurUseGIFV.UseVisualStyleBackColor = true;
|
||||
this.cbImgurUseGIFV.CheckedChanged += new System.EventHandler(this.cbImgurUseGIFV_CheckedChanged);
|
||||
//
|
||||
// UploadersConfigForm
|
||||
//
|
||||
|
@ -3620,6 +3629,8 @@ private void InitializeComponent()
|
|||
this.tpLnkU.PerformLayout();
|
||||
this.tpCoinURL.ResumeLayout(false);
|
||||
this.tpCoinURL.PerformLayout();
|
||||
this.tpPolr.ResumeLayout(false);
|
||||
this.tpPolr.PerformLayout();
|
||||
this.tpFileUploaders.ResumeLayout(false);
|
||||
this.tcFileUploaders.ResumeLayout(false);
|
||||
this.tpFTP.ResumeLayout(false);
|
||||
|
@ -3708,8 +3719,6 @@ private void InitializeComponent()
|
|||
this.tpChevereto.ResumeLayout(false);
|
||||
this.tpChevereto.PerformLayout();
|
||||
this.tcUploaders.ResumeLayout(false);
|
||||
this.tpPolr.ResumeLayout(false);
|
||||
this.tpPolr.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -4137,5 +4146,6 @@ private void InitializeComponent()
|
|||
private System.Windows.Forms.Label lblPolrAPIKey;
|
||||
private System.Windows.Forms.TextBox txtPolrAPIHostname;
|
||||
private System.Windows.Forms.Label lblPolrAPIHostname;
|
||||
private System.Windows.Forms.CheckBox cbImgurUseGIFV;
|
||||
}
|
||||
}
|
|
@ -181,6 +181,7 @@ public void LoadSettings(UploadersConfig uploadersConfig)
|
|||
cbImgurThumbnailType.Items.Clear();
|
||||
cbImgurThumbnailType.Items.AddRange(Helpers.GetEnumDescriptions<ImgurThumbnailType>());
|
||||
cbImgurThumbnailType.SelectedIndex = (int)Config.ImgurThumbnailType;
|
||||
cbImgurUseGIFV.Checked = Config.ImgurUseGIFV;
|
||||
cbImgurUploadSelectedAlbum.Checked = Config.ImgurUploadSelectedAlbum;
|
||||
ImgurFillAlbumList();
|
||||
|
||||
|
@ -671,6 +672,11 @@ private void cbImgurThumbnailType_SelectedIndexChanged(object sender, EventArgs
|
|||
Config.ImgurThumbnailType = (ImgurThumbnailType)cbImgurThumbnailType.SelectedIndex;
|
||||
}
|
||||
|
||||
private void cbImgurUseGIFV_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Config.ImgurUseGIFV = cbImgurUseGIFV.Checked;
|
||||
}
|
||||
|
||||
private void cbImgurUploadSelectedAlbum_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Config.ImgurUploadSelectedAlbum = cbImgurUploadSelectedAlbum.Checked;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -56,6 +56,7 @@ public sealed class Imgur : ImageUploader, IOAuth2
|
|||
public ImgurThumbnailType ThumbnailType { get; set; }
|
||||
public string UploadAlbumID { get; set; }
|
||||
public bool DirectLink { get; set; }
|
||||
public bool UseGIFV { get; set; }
|
||||
|
||||
public Imgur(OAuth2Info oauth)
|
||||
{
|
||||
|
@ -215,7 +216,7 @@ public override UploadResult Upload(Stream stream, string fileName)
|
|||
{
|
||||
if (DirectLink)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(imageData.gifv))
|
||||
if (UseGIFV && !string.IsNullOrEmpty(imageData.gifv))
|
||||
{
|
||||
result.URL = imageData.gifv;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
|
|||
public AccountType ImgurAccountType = AccountType.Anonymous;
|
||||
public bool ImgurDirectLink = true;
|
||||
public ImgurThumbnailType ImgurThumbnailType = ImgurThumbnailType.Large_Thumbnail;
|
||||
public bool ImgurUseGIFV = true;
|
||||
public OAuth2Info ImgurOAuth2Info = null;
|
||||
public bool ImgurUploadSelectedAlbum = false;
|
||||
public ImgurAlbumData ImgurSelectedAlbum = null;
|
||||
|
|
|
@ -706,6 +706,7 @@ public UploadResult UploadImage(Stream stream, string fileName)
|
|||
UploadMethod = Program.UploadersConfig.ImgurAccountType,
|
||||
DirectLink = Program.UploadersConfig.ImgurDirectLink,
|
||||
ThumbnailType = Program.UploadersConfig.ImgurThumbnailType,
|
||||
UseGIFV = Program.UploadersConfig.ImgurUseGIFV,
|
||||
UploadAlbumID = albumID
|
||||
};
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue