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