Add Hubic.com file uploader support

This commit is contained in:
Leo Lam 2015-01-11 19:31:39 -05:00
parent 4025653176
commit 85f2f73584
13 changed files with 2380 additions and 5650 deletions

View file

@ -45,6 +45,8 @@ public static partial class APIKeys
public static string DropboxConsumerSecret = "";
public static string CopyConsumerKey = "";
public static string CopyConsumerSecret = "";
public static string HubicClientID = "";
public static string HubicClientSecret = "";
public static string MinusConsumerKey = "";
public static string MinusConsumerSecret = "";
public static string BoxClientID = "";

View file

@ -88,6 +88,8 @@ public enum FileDestination
GoogleDrive,
[Description("Copy")]
Copy,
[Description("Hubic")]
Hubic,
[Description("Box")]
Box,
[Description("MEGA")]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,268 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright © 2007-2015 ShareX Developers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using System;
using Newtonsoft.Json;
using ShareX.HelpersLib;
using ShareX.UploadersLib.HelperClasses;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Net;
using System.Text;
namespace ShareX.UploadersLib.FileUploaders
{
public sealed class Hubic : FileUploader, IOAuth2
{
public OAuth2Info AuthInfo { get; set; }
public HubicOpenstackAuthInfo HubicOpenstackAuthInfo { get; set; }
public HubicFolderInfo SelectedFolder { get; set; }
public bool Publish { get; set; }
public static HubicFolderInfo RootFolder = new HubicFolderInfo
{
name = ""
};
public const string Scope = @"usage.r,account.r,getAllLinks.r,credentials.r,sponsorCode.r,activate.w,sponsored.r,links.drw";
public const string URLApi = @"https://api.hubic.com/1.0/account/credentials/";
public Hubic(OAuth2Info oauth, HubicOpenstackAuthInfo osauth)
{
AuthInfo = oauth;
HubicOpenstackAuthInfo = osauth;
}
public string GetAuthorizationURL()
{
Dictionary<string, string> args = new Dictionary<string, string>();
//Hubic only accepts https callback URL
args.Add("redirect_uri", @"https://getsharex.com/callback/");
args.Add("client_id", AuthInfo.Client_ID);
args.Add("scope", Scope);
args.Add("response_type", "code");
return CreateQuery(@"https://api.hubic.com/oauth/auth/", args);
}
public bool GetAccessToken(string code)
{
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("code", code);
//Hubic only accepts https callback URL
args.Add("redirect_uri", @"https://getsharex.com/callback/");
args.Add("grant_type", "authorization_code");
string response = SendRequest(HttpMethod.POST, "https://api.hubic.com/oauth/token/", args, GetAuthHeaders("Basic"));
if (!string.IsNullOrEmpty(response))
{
OAuth2Token token = JsonConvert.DeserializeObject<OAuth2Token>(response);
if (token != null && !string.IsNullOrEmpty(token.access_token))
{
token.UpdateExpireDate();
AuthInfo.Token = token;
GetHubicOpenStackAuthInfo();
return true;
}
}
return false;
}
private NameValueCollection GetAuthHeaders(string headerType)
{
string secretInBase64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(AuthInfo.Client_ID + ":" + AuthInfo.Client_Secret));
NameValueCollection headers = new NameValueCollection();
switch (headerType)
{
case "Basic":
headers["Authorization"] = headerType + " " + secretInBase64;
break;
case "Bearer":
headers["Authorization"] = headerType + " " + AuthInfo.Token.access_token;
break;
case "X-Auth-Token":
headers["X-Auth-Token"] = " " + HubicOpenstackAuthInfo.token;
headers["X-Detect-Content-Type"] = " " + "true";
break;
}
return headers;
}
public bool RefreshAccessToken()
{
if (OAuth2Info.CheckOAuth(AuthInfo) && !string.IsNullOrEmpty(AuthInfo.Token.refresh_token))
{
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("grant_type", "refresh_token");
args.Add("refresh_token", AuthInfo.Token.refresh_token);
args.Add("client_id", AuthInfo.Client_ID);
args.Add("client_secret", AuthInfo.Client_Secret);
string response = SendRequest(HttpMethod.POST, "https://api.hubic.com/oauth/token", args);
if (!string.IsNullOrEmpty(response))
{
OAuth2Token token = JsonConvert.DeserializeObject<OAuth2Token>(response);
if (token != null && !string.IsNullOrEmpty(token.access_token))
{
token.UpdateExpireDate();
AuthInfo.Token = token;
return true;
}
}
}
return false;
}
public bool CheckAuthorization()
{
if (OAuth2Info.CheckOAuth(AuthInfo))
{
if (AuthInfo.Token.IsExpired && !RefreshAccessToken())
{
Errors.Add("Refresh access token failed.");
return false;
}
}
else
{
Errors.Add("Hubic login is required.");
return false;
}
return true;
}
public void GetHubicOpenStackAuthInfo()
{
string response = SendRequest(HttpMethod.GET, URLApi, headers: GetAuthHeaders("Bearer"));
if (!string.IsNullOrEmpty(response))
{
HubicOpenstackAuthInfo resp = JsonConvert.DeserializeObject<HubicOpenstackAuthInfo>(response);
HubicOpenstackAuthInfo.endpoint = resp.endpoint;
HubicOpenstackAuthInfo.expires = resp.expires;
HubicOpenstackAuthInfo.token = resp.token;
}
}
public List<HubicFolderInfo> GetFiles(HubicFolderInfo fileInfo)
{
if (!CheckAuthorization())
{
return null;
}
string response = SendRequest(HttpMethod.GET, HubicOpenstackAuthInfo.endpoint + "/default" + "/?path=" + fileInfo.name + "&format=json", headers: GetAuthHeaders("X-Auth-Token"));
if (!string.IsNullOrEmpty(response))
{
return JsonConvert.DeserializeObject<List<HubicFolderInfo>>(response);
}
return null;
}
public override UploadResult Upload(Stream stream, string fileName)
{
if (!CheckAuthorization())
{
return null;
}
WebClient wc = new WebClient();
wc.Headers.Add("X-Auth-Token", HubicOpenstackAuthInfo.token);
wc.Headers.Add("X-Detect-Content-Type", "true");
wc.UploadData(new Uri(HubicOpenstackAuthInfo.endpoint + "/default/" + SelectedFolder.path + "/" + fileName), "PUT", stream.GetBytes());
UploadResult result = new UploadResult();
if (Publish)
{
AllowReportProgress = false;
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("comment", fileName);
args.Add("container", "default");
args.Add("mode", "ro");
args.Add("ttl", "30");
args.Add("type", "file");
args.Add("uri", "/" + SelectedFolder.path + "/" + fileName);
string response = SendRequest(HttpMethod.POST, "https://api.hubic.com/1.0/account/links", args, GetAuthHeaders("Bearer"));
if (!string.IsNullOrEmpty(response))
{
HubicPublishURLResponse resp = JsonConvert.DeserializeObject<HubicPublishURLResponse>(response);
string url = resp.indirectUrl;
result.IsURLExpected = true;
result.URL = url;
}
}
return result;
}
}
public class HubicOpenstackAuthInfo
{
public string token { get; set; }
public string endpoint { get; set; }
public string expires { get; set; }
}
public class HubicFolderInfo
{
private string _name;
public string hash { get; set; }
public string last_modified { get; set; }
public int bytes { get; set; }
public string name
{
get
{
return _name;
}
set
{
//split the folder path and jsut store the folder name
path = value;
string[] temp = value.Split('/');
_name = temp[temp.Length - 1];
}
}
public string content_type { get; set; }
public string path { get; set; }
}
public class HubicPublishURLResponse
{
public string indirectUrl { get; set; }
public string mode { get; set; }
public string container { get; set; }
public string expirationDate { get; set; }
public string creationDate { get; set; }
public string comment { get; set; }
public string type { get; set; }
}
}

View file

@ -94,16 +94,12 @@ private void InitializeComponent()
this.txtCustomUploaderArgName = new System.Windows.Forms.TextBox();
this.tpTwitter = new System.Windows.Forms.TabPage();
this.btnTwitterLogin = new System.Windows.Forms.Button();
this.ucTwitterAccounts = new ShareX.UploadersLib.AccountsControl();
this.tpURLShorteners = new System.Windows.Forms.TabPage();
this.tcURLShorteners = new System.Windows.Forms.TabControl();
this.tpBitly = new System.Windows.Forms.TabPage();
this.txtBitlyDomain = new System.Windows.Forms.TextBox();
this.lblBitlyDomain = new System.Windows.Forms.Label();
this.oauth2Bitly = new ShareX.UploadersLib.OAuthControl();
this.tpGoogleURLShortener = new System.Windows.Forms.TabPage();
this.oauth2GoogleURLShortener = new ShareX.UploadersLib.OAuthControl();
this.atcGoogleURLShortenerAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.tpYourls = new System.Windows.Forms.TabPage();
this.txtYourlsPassword = new System.Windows.Forms.TextBox();
this.txtYourlsUsername = new System.Windows.Forms.TextBox();
@ -131,9 +127,7 @@ private void InitializeComponent()
this.cboFtpImages = new System.Windows.Forms.ComboBox();
this.cboFtpFiles = new System.Windows.Forms.ComboBox();
this.cboFtpText = new System.Windows.Forms.ComboBox();
this.ucFTPAccounts = new ShareX.UploadersLib.AccountsControl();
this.tpDropbox = new System.Windows.Forms.TabPage();
this.oauth2Dropbox = new ShareX.UploadersLib.OAuthControl();
this.cbDropboxURLType = new System.Windows.Forms.ComboBox();
this.cbDropboxAutoCreateShareableLink = new System.Windows.Forms.CheckBox();
this.btnDropboxShowFiles = new System.Windows.Forms.Button();
@ -147,7 +141,6 @@ private void InitializeComponent()
this.tvOneDrive = new System.Windows.Forms.TreeView();
this.lblOneDriveFolderID = new System.Windows.Forms.Label();
this.cbOneDriveCreateShareableLink = new System.Windows.Forms.CheckBox();
this.oAuth2OneDrive = new ShareX.UploadersLib.OAuthControl();
this.tpGoogleDrive = new System.Windows.Forms.TabPage();
this.cbGoogleDriveUseFolder = new System.Windows.Forms.CheckBox();
this.txtGoogleDriveFolderID = new System.Windows.Forms.TextBox();
@ -157,7 +150,6 @@ private void InitializeComponent()
this.chGoogleDriveDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.btnGoogleDriveRefreshFolders = new System.Windows.Forms.Button();
this.cbGoogleDriveIsPublic = new System.Windows.Forms.CheckBox();
this.oauth2GoogleDrive = new ShareX.UploadersLib.OAuthControl();
this.tpBox = new System.Windows.Forms.TabPage();
this.lblBoxFolderTip = new System.Windows.Forms.Label();
this.cbBoxShare = new System.Windows.Forms.CheckBox();
@ -165,7 +157,6 @@ private void InitializeComponent()
this.chBoxFoldersName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lblBoxFolderID = new System.Windows.Forms.Label();
this.btnBoxRefreshFolders = new System.Windows.Forms.Button();
this.oauth2Box = new ShareX.UploadersLib.OAuthControl();
this.tpCopy = new System.Windows.Forms.TabPage();
this.pbCopyLogo = new System.Windows.Forms.PictureBox();
this.lblCopyURLType = new System.Windows.Forms.Label();
@ -174,7 +165,6 @@ private void InitializeComponent()
this.lblCopyStatus = new System.Windows.Forms.Label();
this.lblCopyPath = new System.Windows.Forms.Label();
this.txtCopyPath = new System.Windows.Forms.TextBox();
this.oAuthCopy = new ShareX.UploadersLib.OAuthControl();
this.tpAmazonS3 = new System.Windows.Forms.TabPage();
this.txtAmazonS3CustomDomain = new System.Windows.Forms.TextBox();
this.lblAmazonS3PathPreviewLabel = new System.Windows.Forms.Label();
@ -244,7 +234,6 @@ private void InitializeComponent()
this.lblSendSpaceUsername = new System.Windows.Forms.Label();
this.txtSendSpacePassword = new System.Windows.Forms.TextBox();
this.txtSendSpaceUserName = new System.Windows.Forms.TextBox();
this.atcSendSpaceAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.tpMediaCrush = new System.Windows.Forms.TabPage();
this.cbMediaCrushDirectLink = new System.Windows.Forms.CheckBox();
this.tpGe_tt = new System.Windows.Forms.TabPage();
@ -284,7 +273,6 @@ private void InitializeComponent()
this.txtJiraConfigHelp = new System.Windows.Forms.TextBox();
this.txtJiraHost = new System.Windows.Forms.TextBox();
this.lblJiraHost = new System.Windows.Forms.Label();
this.oAuthJira = new ShareX.UploadersLib.OAuthControl();
this.tpEmail = new System.Windows.Forms.TabPage();
this.chkEmailConfirm = new System.Windows.Forms.CheckBox();
this.lblEmailSmtpServer = new System.Windows.Forms.Label();
@ -307,7 +295,13 @@ private void InitializeComponent()
this.lblSharedFolderImages = new System.Windows.Forms.Label();
this.cboSharedFolderText = new System.Windows.Forms.ComboBox();
this.cboSharedFolderImages = new System.Windows.Forms.ComboBox();
this.ucLocalhostAccounts = new ShareX.UploadersLib.AccountsControl();
this.tpHubic = new System.Windows.Forms.TabPage();
this.cbHubicPublishLink = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.lvHubicFolders = new ShareX.HelpersLib.MyListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.label2 = new System.Windows.Forms.Label();
this.btnHubicRefreshFolders = new System.Windows.Forms.Button();
this.btnCopyShowFiles = new System.Windows.Forms.Button();
this.tpTextUploaders = new System.Windows.Forms.TabPage();
this.tcTextUploaders = new System.Windows.Forms.TabControl();
@ -332,8 +326,6 @@ private void InitializeComponent()
this.txtPaste_eeUserAPIKey = new System.Windows.Forms.TextBox();
this.tpGist = new System.Windows.Forms.TabPage();
this.chkGistPublishPublic = new System.Windows.Forms.CheckBox();
this.oAuth2Gist = new ShareX.UploadersLib.OAuthControl();
this.atcGistAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.tpUpaste = new System.Windows.Forms.TabPage();
this.cbUpasteIsPublic = new System.Windows.Forms.CheckBox();
this.lblUpasteUserKey = new System.Windows.Forms.Label();
@ -348,8 +340,6 @@ private void InitializeComponent()
this.tpImgur = new System.Windows.Forms.TabPage();
this.cbImgurUploadSelectedAlbum = new System.Windows.Forms.CheckBox();
this.cbImgurDirectLink = new System.Windows.Forms.CheckBox();
this.atcImgurAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.oauth2Imgur = new ShareX.UploadersLib.OAuthControl();
this.lvImgurAlbumList = new System.Windows.Forms.ListView();
this.chImgurID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chImgurTitle = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@ -367,7 +357,6 @@ private void InitializeComponent()
this.txtImageShackPassword = new System.Windows.Forms.TextBox();
this.lblImageShackPassword = new System.Windows.Forms.Label();
this.tpTinyPic = new System.Windows.Forms.TabPage();
this.atcTinyPicAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.btnTinyPicLogin = new System.Windows.Forms.Button();
this.txtTinyPicPassword = new System.Windows.Forms.TextBox();
this.lblTinyPicPassword = new System.Windows.Forms.Label();
@ -408,7 +397,6 @@ private void InitializeComponent()
this.chPicasaName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chPicasaDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.btnPicasaRefreshAlbumList = new System.Windows.Forms.Button();
this.oauth2Picasa = new ShareX.UploadersLib.OAuthControl();
this.tpChevereto = new System.Windows.Forms.TabPage();
this.cbCheveretoDirectURL = new System.Windows.Forms.CheckBox();
this.lblCheveretoWebsiteTip = new System.Windows.Forms.Label();
@ -419,6 +407,26 @@ private void InitializeComponent()
this.tcUploaders = new System.Windows.Forms.TabControl();
this.lblWidthHint = new System.Windows.Forms.Label();
this.ttlvMain = new ShareX.HelpersLib.TabToListView();
this.atcImgurAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.oauth2Imgur = new ShareX.UploadersLib.OAuthControl();
this.atcTinyPicAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.oauth2Picasa = new ShareX.UploadersLib.OAuthControl();
this.oAuth2Gist = new ShareX.UploadersLib.OAuthControl();
this.atcGistAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.ucFTPAccounts = new ShareX.UploadersLib.AccountsControl();
this.oauth2Dropbox = new ShareX.UploadersLib.OAuthControl();
this.oAuth2OneDrive = new ShareX.UploadersLib.OAuthControl();
this.oauth2GoogleDrive = new ShareX.UploadersLib.OAuthControl();
this.oauth2Box = new ShareX.UploadersLib.OAuthControl();
this.oAuthCopy = new ShareX.UploadersLib.OAuthControl();
this.ucTwitterAccounts = new ShareX.UploadersLib.AccountsControl();
this.oauth2Bitly = new ShareX.UploadersLib.OAuthControl();
this.oauth2GoogleURLShortener = new ShareX.UploadersLib.OAuthControl();
this.atcGoogleURLShortenerAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.atcSendSpaceAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.oAuthJira = new ShareX.UploadersLib.OAuthControl();
this.ucLocalhostAccounts = new ShareX.UploadersLib.AccountsControl();
this.oAuth2Hubic = new ShareX.UploadersLib.OAuthControl();
this.actRapidShareAccountType = new ShareX.UploadersLib.AccountTypeControl();
this.tpOtherUploaders.SuspendLayout();
this.tcOtherUploaders.SuspendLayout();
@ -461,6 +469,7 @@ private void InitializeComponent()
this.tpEmail.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudEmailSmtpPort)).BeginInit();
this.tpSharedFolder.SuspendLayout();
this.tpHubic.SuspendLayout();
this.tpTextUploaders.SuspendLayout();
this.tcTextUploaders.SuspendLayout();
this.tpPastebin.SuspendLayout();
@ -963,11 +972,6 @@ private void InitializeComponent()
this.btnTwitterLogin.UseVisualStyleBackColor = true;
this.btnTwitterLogin.Click += new System.EventHandler(this.btnTwitterLogin_Click);
//
// ucTwitterAccounts
//
resources.ApplyResources(this.ucTwitterAccounts, "ucTwitterAccounts");
this.ucTwitterAccounts.Name = "ucTwitterAccounts";
//
// tpURLShorteners
//
this.tpURLShorteners.Controls.Add(this.tcURLShorteners);
@ -1005,15 +1009,6 @@ private void InitializeComponent()
resources.ApplyResources(this.lblBitlyDomain, "lblBitlyDomain");
this.lblBitlyDomain.Name = "lblBitlyDomain";
//
// oauth2Bitly
//
this.oauth2Bitly.IsRefreshable = false;
resources.ApplyResources(this.oauth2Bitly, "oauth2Bitly");
this.oauth2Bitly.Name = "oauth2Bitly";
this.oauth2Bitly.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Bitly_OpenButtonClicked);
this.oauth2Bitly.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Bitly_CompleteButtonClicked);
this.oauth2Bitly.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Bitly_ClearButtonClicked);
//
// tpGoogleURLShortener
//
this.tpGoogleURLShortener.Controls.Add(this.oauth2GoogleURLShortener);
@ -1022,22 +1017,6 @@ private void InitializeComponent()
this.tpGoogleURLShortener.Name = "tpGoogleURLShortener";
this.tpGoogleURLShortener.UseVisualStyleBackColor = true;
//
// oauth2GoogleURLShortener
//
resources.ApplyResources(this.oauth2GoogleURLShortener, "oauth2GoogleURLShortener");
this.oauth2GoogleURLShortener.Name = "oauth2GoogleURLShortener";
this.oauth2GoogleURLShortener.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2GoogleURLShortener_OpenButtonClicked);
this.oauth2GoogleURLShortener.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2GoogleURLShortener_CompleteButtonClicked);
this.oauth2GoogleURLShortener.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2GoogleURLShortener_ClearButtonClicked);
this.oauth2GoogleURLShortener.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2GoogleURLShortener_RefreshButtonClicked);
//
// atcGoogleURLShortenerAccountType
//
resources.ApplyResources(this.atcGoogleURLShortenerAccountType, "atcGoogleURLShortenerAccountType");
this.atcGoogleURLShortenerAccountType.Name = "atcGoogleURLShortenerAccountType";
this.atcGoogleURLShortenerAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcGoogleURLShortenerAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGoogleURLShortenerAccountType_AccountTypeChanged);
//
// tpYourls
//
this.tpYourls.Controls.Add(this.txtYourlsPassword);
@ -1160,6 +1139,7 @@ private void InitializeComponent()
this.tcFileUploaders.Controls.Add(this.tpGoogleDrive);
this.tcFileUploaders.Controls.Add(this.tpBox);
this.tcFileUploaders.Controls.Add(this.tpCopy);
this.tcFileUploaders.Controls.Add(this.tpHubic);
this.tcFileUploaders.Controls.Add(this.tpAmazonS3);
this.tcFileUploaders.Controls.Add(this.tpMega);
this.tcFileUploaders.Controls.Add(this.tpOwnCloud);
@ -1248,11 +1228,6 @@ private void InitializeComponent()
this.cboFtpText.Name = "cboFtpText";
this.cboFtpText.SelectedIndexChanged += new System.EventHandler(this.cboFtpText_SelectedIndexChanged);
//
// ucFTPAccounts
//
resources.ApplyResources(this.ucFTPAccounts, "ucFTPAccounts");
this.ucFTPAccounts.Name = "ucFTPAccounts";
//
// tpDropbox
//
this.tpDropbox.Controls.Add(this.oauth2Dropbox);
@ -1269,15 +1244,6 @@ private void InitializeComponent()
this.tpDropbox.Name = "tpDropbox";
this.tpDropbox.UseVisualStyleBackColor = true;
//
// oauth2Dropbox
//
this.oauth2Dropbox.IsRefreshable = false;
resources.ApplyResources(this.oauth2Dropbox, "oauth2Dropbox");
this.oauth2Dropbox.Name = "oauth2Dropbox";
this.oauth2Dropbox.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Dropbox_OpenButtonClicked);
this.oauth2Dropbox.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Dropbox_CompleteButtonClicked);
this.oauth2Dropbox.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Dropbox_ClearButtonClicked);
//
// cbDropboxURLType
//
this.cbDropboxURLType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@ -1365,15 +1331,6 @@ private void InitializeComponent()
this.cbOneDriveCreateShareableLink.UseVisualStyleBackColor = true;
this.cbOneDriveCreateShareableLink.CheckedChanged += new System.EventHandler(this.cbOneDriveCreateShareableLink_CheckedChanged);
//
// oAuth2OneDrive
//
resources.ApplyResources(this.oAuth2OneDrive, "oAuth2OneDrive");
this.oAuth2OneDrive.Name = "oAuth2OneDrive";
this.oAuth2OneDrive.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuth2OneDrive_OpenButtonClicked);
this.oAuth2OneDrive.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuth2OneDrive_CompleteButtonClicked);
this.oAuth2OneDrive.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuth2OneDrive_ClearButtonClicked);
this.oAuth2OneDrive.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oAuth2OneDrive_RefreshButtonClicked);
//
// tpGoogleDrive
//
this.tpGoogleDrive.Controls.Add(this.cbGoogleDriveUseFolder);
@ -1441,15 +1398,6 @@ private void InitializeComponent()
this.cbGoogleDriveIsPublic.UseVisualStyleBackColor = true;
this.cbGoogleDriveIsPublic.CheckedChanged += new System.EventHandler(this.cbGoogleDriveIsPublic_CheckedChanged);
//
// oauth2GoogleDrive
//
resources.ApplyResources(this.oauth2GoogleDrive, "oauth2GoogleDrive");
this.oauth2GoogleDrive.Name = "oauth2GoogleDrive";
this.oauth2GoogleDrive.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2GoogleDrive_OpenButtonClicked);
this.oauth2GoogleDrive.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2GoogleDrive_CompleteButtonClicked);
this.oauth2GoogleDrive.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2GoogleDrive_ClearButtonClicked);
this.oauth2GoogleDrive.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2GoogleDrive_RefreshButtonClicked);
//
// tpBox
//
this.tpBox.Controls.Add(this.lblBoxFolderTip);
@ -1503,15 +1451,6 @@ private void InitializeComponent()
this.btnBoxRefreshFolders.UseVisualStyleBackColor = true;
this.btnBoxRefreshFolders.Click += new System.EventHandler(this.btnBoxRefreshFolders_Click);
//
// oauth2Box
//
resources.ApplyResources(this.oauth2Box, "oauth2Box");
this.oauth2Box.Name = "oauth2Box";
this.oauth2Box.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Box_OpenButtonClicked);
this.oauth2Box.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Box_CompleteButtonClicked);
this.oauth2Box.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Box_ClearButtonClicked);
this.oauth2Box.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Box_RefreshButtonClicked);
//
// tpCopy
//
this.tpCopy.Controls.Add(this.pbCopyLogo);
@ -1570,15 +1509,6 @@ private void InitializeComponent()
this.txtCopyPath.Name = "txtCopyPath";
this.txtCopyPath.TextChanged += new System.EventHandler(this.txtCopyPath_TextChanged);
//
// oAuthCopy
//
this.oAuthCopy.IsRefreshable = false;
resources.ApplyResources(this.oAuthCopy, "oAuthCopy");
this.oAuthCopy.Name = "oAuthCopy";
this.oAuthCopy.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuthCopy_OpenButtonClicked);
this.oAuthCopy.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuthCopy_CompleteButtonClicked);
this.oAuthCopy.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuthCopy_ClearButtonClicked);
//
// tpAmazonS3
//
this.tpAmazonS3.Controls.Add(this.txtAmazonS3CustomDomain);
@ -2066,13 +1996,6 @@ private void InitializeComponent()
this.txtSendSpaceUserName.Name = "txtSendSpaceUserName";
this.txtSendSpaceUserName.TextChanged += new System.EventHandler(this.txtSendSpaceUserName_TextChanged);
//
// atcSendSpaceAccountType
//
resources.ApplyResources(this.atcSendSpaceAccountType, "atcSendSpaceAccountType");
this.atcSendSpaceAccountType.Name = "atcSendSpaceAccountType";
this.atcSendSpaceAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcSendSpaceAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcSendSpaceAccountType_AccountTypeChanged);
//
// tpMediaCrush
//
this.tpMediaCrush.Controls.Add(this.cbMediaCrushDirectLink);
@ -2342,15 +2265,6 @@ private void InitializeComponent()
resources.ApplyResources(this.lblJiraHost, "lblJiraHost");
this.lblJiraHost.Name = "lblJiraHost";
//
// oAuthJira
//
resources.ApplyResources(this.oAuthJira, "oAuthJira");
this.oAuthJira.Name = "oAuthJira";
this.oAuthJira.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuthJira_OpenButtonClicked);
this.oAuthJira.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuthJira_CompleteButtonClicked);
this.oAuthJira.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuthJira_ClearButtonClicked);
this.oAuthJira.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oAuthJira_RefreshButtonClicked);
//
// tpEmail
//
this.tpEmail.Controls.Add(this.chkEmailConfirm);
@ -2514,10 +2428,58 @@ private void InitializeComponent()
this.cboSharedFolderImages.Name = "cboSharedFolderImages";
this.cboSharedFolderImages.SelectedIndexChanged += new System.EventHandler(this.cboSharedFolderImages_SelectedIndexChanged);
//
// ucLocalhostAccounts
// tpHubic
//
resources.ApplyResources(this.ucLocalhostAccounts, "ucLocalhostAccounts");
this.ucLocalhostAccounts.Name = "ucLocalhostAccounts";
this.tpHubic.Controls.Add(this.cbHubicPublishLink);
this.tpHubic.Controls.Add(this.label1);
this.tpHubic.Controls.Add(this.lvHubicFolders);
this.tpHubic.Controls.Add(this.label2);
this.tpHubic.Controls.Add(this.btnHubicRefreshFolders);
this.tpHubic.Controls.Add(this.oAuth2Hubic);
resources.ApplyResources(this.tpHubic, "tpHubic");
this.tpHubic.Name = "tpHubic";
this.tpHubic.UseVisualStyleBackColor = true;
//
// cbHubicPublishLink
//
resources.ApplyResources(this.cbHubicPublishLink, "cbHubicPublishLink");
this.cbHubicPublishLink.Name = "cbHubicPublishLink";
this.cbHubicPublishLink.UseVisualStyleBackColor = true;
this.cbHubicPublishLink.CheckedChanged += new System.EventHandler(this.cbHubicPublishLink_CheckedChanged);
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// lvHubicFolders
//
this.lvHubicFolders.AutoFillColumn = true;
this.lvHubicFolders.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1});
this.lvHubicFolders.FullRowSelect = true;
resources.ApplyResources(this.lvHubicFolders, "lvHubicFolders");
this.lvHubicFolders.Name = "lvHubicFolders";
this.lvHubicFolders.UseCompatibleStateImageBehavior = false;
this.lvHubicFolders.View = System.Windows.Forms.View.Details;
this.lvHubicFolders.SelectedIndexChanged += new System.EventHandler(this.lvHubicFolders_SelectedIndexChanged);
this.lvHubicFolders.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvHubicFolders_MouseDoubleClick);
//
// columnHeader1
//
resources.ApplyResources(this.columnHeader1, "columnHeader1");
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// btnHubicRefreshFolders
//
resources.ApplyResources(this.btnHubicRefreshFolders, "btnHubicRefreshFolders");
this.btnHubicRefreshFolders.Name = "btnHubicRefreshFolders";
this.btnHubicRefreshFolders.UseVisualStyleBackColor = true;
this.btnHubicRefreshFolders.Click += new System.EventHandler(this.btnHubicRefreshFolders_Click);
//
// btnCopyShowFiles
//
@ -2691,22 +2653,6 @@ private void InitializeComponent()
this.chkGistPublishPublic.UseVisualStyleBackColor = true;
this.chkGistPublishPublic.CheckedChanged += new System.EventHandler(this.chkGistPublishPublic_CheckedChanged);
//
// oAuth2Gist
//
resources.ApplyResources(this.oAuth2Gist, "oAuth2Gist");
this.oAuth2Gist.IsRefreshable = false;
this.oAuth2Gist.Name = "oAuth2Gist";
this.oAuth2Gist.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuth2Gist_OpenButtonClicked);
this.oAuth2Gist.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuth2Gist_CompleteButtonClicked);
this.oAuth2Gist.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuth2Gist_ClearButtonClicked);
//
// atcGistAccountType
//
resources.ApplyResources(this.atcGistAccountType, "atcGistAccountType");
this.atcGistAccountType.Name = "atcGistAccountType";
this.atcGistAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcGistAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGistAccountType_AccountTypeChanged);
//
// tpUpaste
//
this.tpUpaste.Controls.Add(this.cbUpasteIsPublic);
@ -2815,22 +2761,6 @@ private void InitializeComponent()
this.cbImgurDirectLink.UseVisualStyleBackColor = true;
this.cbImgurDirectLink.CheckedChanged += new System.EventHandler(this.cbImgurDirectLink_CheckedChanged);
//
// atcImgurAccountType
//
resources.ApplyResources(this.atcImgurAccountType, "atcImgurAccountType");
this.atcImgurAccountType.Name = "atcImgurAccountType";
this.atcImgurAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcImgurAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcImgurAccountType_AccountTypeChanged);
//
// oauth2Imgur
//
resources.ApplyResources(this.oauth2Imgur, "oauth2Imgur");
this.oauth2Imgur.Name = "oauth2Imgur";
this.oauth2Imgur.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Imgur_OpenButtonClicked);
this.oauth2Imgur.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Imgur_CompleteButtonClicked);
this.oauth2Imgur.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Imgur_ClearButtonClicked);
this.oauth2Imgur.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Imgur_RefreshButtonClicked);
//
// lvImgurAlbumList
//
this.lvImgurAlbumList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
@ -2957,13 +2887,6 @@ private void InitializeComponent()
this.tpTinyPic.Name = "tpTinyPic";
this.tpTinyPic.UseVisualStyleBackColor = true;
//
// atcTinyPicAccountType
//
resources.ApplyResources(this.atcTinyPicAccountType, "atcTinyPicAccountType");
this.atcTinyPicAccountType.Name = "atcTinyPicAccountType";
this.atcTinyPicAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcTinyPicAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcTinyPicAccountType_AccountTypeChanged);
//
// btnTinyPicLogin
//
resources.ApplyResources(this.btnTinyPicLogin, "btnTinyPicLogin");
@ -3242,15 +3165,6 @@ private void InitializeComponent()
this.btnPicasaRefreshAlbumList.UseVisualStyleBackColor = true;
this.btnPicasaRefreshAlbumList.Click += new System.EventHandler(this.btnPicasaRefreshAlbumList_Click);
//
// oauth2Picasa
//
resources.ApplyResources(this.oauth2Picasa, "oauth2Picasa");
this.oauth2Picasa.Name = "oauth2Picasa";
this.oauth2Picasa.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Picasa_OpenButtonClicked);
this.oauth2Picasa.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Picasa_CompleteButtonClicked);
this.oauth2Picasa.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Picasa_ClearButtonClicked);
this.oauth2Picasa.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Picasa_RefreshButtonClicked);
//
// tpChevereto
//
this.tpChevereto.Controls.Add(this.cbCheveretoDirectURL);
@ -3322,6 +3236,164 @@ private void InitializeComponent()
this.ttlvMain.MainTabControl = null;
this.ttlvMain.Name = "ttlvMain";
//
// atcImgurAccountType
//
resources.ApplyResources(this.atcImgurAccountType, "atcImgurAccountType");
this.atcImgurAccountType.Name = "atcImgurAccountType";
this.atcImgurAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcImgurAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcImgurAccountType_AccountTypeChanged);
//
// oauth2Imgur
//
resources.ApplyResources(this.oauth2Imgur, "oauth2Imgur");
this.oauth2Imgur.Name = "oauth2Imgur";
this.oauth2Imgur.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Imgur_OpenButtonClicked);
this.oauth2Imgur.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Imgur_CompleteButtonClicked);
this.oauth2Imgur.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Imgur_ClearButtonClicked);
this.oauth2Imgur.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Imgur_RefreshButtonClicked);
//
// atcTinyPicAccountType
//
resources.ApplyResources(this.atcTinyPicAccountType, "atcTinyPicAccountType");
this.atcTinyPicAccountType.Name = "atcTinyPicAccountType";
this.atcTinyPicAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcTinyPicAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcTinyPicAccountType_AccountTypeChanged);
//
// oauth2Picasa
//
resources.ApplyResources(this.oauth2Picasa, "oauth2Picasa");
this.oauth2Picasa.Name = "oauth2Picasa";
this.oauth2Picasa.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Picasa_OpenButtonClicked);
this.oauth2Picasa.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Picasa_CompleteButtonClicked);
this.oauth2Picasa.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Picasa_ClearButtonClicked);
this.oauth2Picasa.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Picasa_RefreshButtonClicked);
//
// oAuth2Gist
//
resources.ApplyResources(this.oAuth2Gist, "oAuth2Gist");
this.oAuth2Gist.IsRefreshable = false;
this.oAuth2Gist.Name = "oAuth2Gist";
this.oAuth2Gist.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuth2Gist_OpenButtonClicked);
this.oAuth2Gist.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuth2Gist_CompleteButtonClicked);
this.oAuth2Gist.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuth2Gist_ClearButtonClicked);
//
// atcGistAccountType
//
resources.ApplyResources(this.atcGistAccountType, "atcGistAccountType");
this.atcGistAccountType.Name = "atcGistAccountType";
this.atcGistAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcGistAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGistAccountType_AccountTypeChanged);
//
// ucFTPAccounts
//
resources.ApplyResources(this.ucFTPAccounts, "ucFTPAccounts");
this.ucFTPAccounts.Name = "ucFTPAccounts";
//
// oauth2Dropbox
//
this.oauth2Dropbox.IsRefreshable = false;
resources.ApplyResources(this.oauth2Dropbox, "oauth2Dropbox");
this.oauth2Dropbox.Name = "oauth2Dropbox";
this.oauth2Dropbox.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Dropbox_OpenButtonClicked);
this.oauth2Dropbox.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Dropbox_CompleteButtonClicked);
this.oauth2Dropbox.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Dropbox_ClearButtonClicked);
//
// oAuth2OneDrive
//
resources.ApplyResources(this.oAuth2OneDrive, "oAuth2OneDrive");
this.oAuth2OneDrive.Name = "oAuth2OneDrive";
this.oAuth2OneDrive.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuth2OneDrive_OpenButtonClicked);
this.oAuth2OneDrive.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuth2OneDrive_CompleteButtonClicked);
this.oAuth2OneDrive.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuth2OneDrive_ClearButtonClicked);
this.oAuth2OneDrive.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oAuth2OneDrive_RefreshButtonClicked);
//
// oauth2GoogleDrive
//
resources.ApplyResources(this.oauth2GoogleDrive, "oauth2GoogleDrive");
this.oauth2GoogleDrive.Name = "oauth2GoogleDrive";
this.oauth2GoogleDrive.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2GoogleDrive_OpenButtonClicked);
this.oauth2GoogleDrive.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2GoogleDrive_CompleteButtonClicked);
this.oauth2GoogleDrive.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2GoogleDrive_ClearButtonClicked);
this.oauth2GoogleDrive.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2GoogleDrive_RefreshButtonClicked);
//
// oauth2Box
//
resources.ApplyResources(this.oauth2Box, "oauth2Box");
this.oauth2Box.Name = "oauth2Box";
this.oauth2Box.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Box_OpenButtonClicked);
this.oauth2Box.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Box_CompleteButtonClicked);
this.oauth2Box.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Box_ClearButtonClicked);
this.oauth2Box.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2Box_RefreshButtonClicked);
//
// oAuthCopy
//
this.oAuthCopy.IsRefreshable = false;
resources.ApplyResources(this.oAuthCopy, "oAuthCopy");
this.oAuthCopy.Name = "oAuthCopy";
this.oAuthCopy.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuthCopy_OpenButtonClicked);
this.oAuthCopy.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuthCopy_CompleteButtonClicked);
this.oAuthCopy.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuthCopy_ClearButtonClicked);
//
// ucTwitterAccounts
//
resources.ApplyResources(this.ucTwitterAccounts, "ucTwitterAccounts");
this.ucTwitterAccounts.Name = "ucTwitterAccounts";
//
// oauth2Bitly
//
this.oauth2Bitly.IsRefreshable = false;
resources.ApplyResources(this.oauth2Bitly, "oauth2Bitly");
this.oauth2Bitly.Name = "oauth2Bitly";
this.oauth2Bitly.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2Bitly_OpenButtonClicked);
this.oauth2Bitly.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2Bitly_CompleteButtonClicked);
this.oauth2Bitly.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2Bitly_ClearButtonClicked);
//
// oauth2GoogleURLShortener
//
resources.ApplyResources(this.oauth2GoogleURLShortener, "oauth2GoogleURLShortener");
this.oauth2GoogleURLShortener.Name = "oauth2GoogleURLShortener";
this.oauth2GoogleURLShortener.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2GoogleURLShortener_OpenButtonClicked);
this.oauth2GoogleURLShortener.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2GoogleURLShortener_CompleteButtonClicked);
this.oauth2GoogleURLShortener.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2GoogleURLShortener_ClearButtonClicked);
this.oauth2GoogleURLShortener.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2GoogleURLShortener_RefreshButtonClicked);
//
// atcGoogleURLShortenerAccountType
//
resources.ApplyResources(this.atcGoogleURLShortenerAccountType, "atcGoogleURLShortenerAccountType");
this.atcGoogleURLShortenerAccountType.Name = "atcGoogleURLShortenerAccountType";
this.atcGoogleURLShortenerAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcGoogleURLShortenerAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGoogleURLShortenerAccountType_AccountTypeChanged);
//
// atcSendSpaceAccountType
//
resources.ApplyResources(this.atcSendSpaceAccountType, "atcSendSpaceAccountType");
this.atcSendSpaceAccountType.Name = "atcSendSpaceAccountType";
this.atcSendSpaceAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
this.atcSendSpaceAccountType.AccountTypeChanged += new ShareX.UploadersLib.AccountTypeControl.AccountTypeChangedEventHandler(this.atcSendSpaceAccountType_AccountTypeChanged);
//
// oAuthJira
//
resources.ApplyResources(this.oAuthJira, "oAuthJira");
this.oAuthJira.Name = "oAuthJira";
this.oAuthJira.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuthJira_OpenButtonClicked);
this.oAuthJira.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuthJira_CompleteButtonClicked);
this.oAuthJira.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuthJira_ClearButtonClicked);
this.oAuthJira.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oAuthJira_RefreshButtonClicked);
//
// ucLocalhostAccounts
//
resources.ApplyResources(this.ucLocalhostAccounts, "ucLocalhostAccounts");
this.ucLocalhostAccounts.Name = "ucLocalhostAccounts";
//
// oAuth2Hubic
//
resources.ApplyResources(this.oAuth2Hubic, "oAuth2Hubic");
this.oAuth2Hubic.Name = "oAuth2Hubic";
this.oAuth2Hubic.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oAuth2Hubic_OpenButtonClicked);
this.oAuth2Hubic.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oAuth2Hubic_CompleteButtonClicked);
this.oAuth2Hubic.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oAuth2Hubic_ClearButtonClicked);
this.oAuth2Hubic.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oAuth2Hubic_RefreshButtonClicked);
//
// actRapidShareAccountType
//
resources.ApplyResources(this.actRapidShareAccountType, "actRapidShareAccountType");
@ -3411,6 +3483,8 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.nudEmailSmtpPort)).EndInit();
this.tpSharedFolder.ResumeLayout(false);
this.tpSharedFolder.PerformLayout();
this.tpHubic.ResumeLayout(false);
this.tpHubic.PerformLayout();
this.tpTextUploaders.ResumeLayout(false);
this.tcTextUploaders.ResumeLayout(false);
this.tpPastebin.ResumeLayout(false);
@ -3839,6 +3913,14 @@ private void InitializeComponent()
private System.Windows.Forms.Label lblHastebinCustomDomain;
private System.Windows.Forms.CheckBox cbOneDriveCreateShareableLink;
private System.Windows.Forms.Label lblOneDriveFolderID;
private System.Windows.Forms.TreeView tvOneDrive;
private System.Windows.Forms.TreeView tvOneDrive;
private System.Windows.Forms.TabPage tpHubic;
private OAuthControl oAuth2Hubic;
private System.Windows.Forms.Label label1;
private HelpersLib.MyListView lvHubicFolders;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnHubicRefreshFolders;
private System.Windows.Forms.CheckBox cbHubicPublishLink;
}
}

View file

@ -78,6 +78,7 @@ private void FormSettings()
AddIconToTab(tpBitly, Resources.Bitly);
AddIconToTab(tpBox, Resources.Box);
AddIconToTab(tpCopy, Resources.Copy);
AddIconToTab(tpHubic, Resources.Hubic);
AddIconToTab(tpChevereto, Resources.Chevereto);
AddIconToTab(tpCustomUploaders, Resources.globe_network);
AddIconToTab(tpDropbox, Resources.Dropbox);
@ -363,6 +364,16 @@ public void LoadSettings(UploadersConfig uploadersConfig)
cbBoxShare.Checked = Config.BoxShare;
lblBoxFolderID.Text = Resources.UploadersConfigForm_LoadSettings_Selected_folder_ + " " + Config.BoxSelectedFolder.name;
// Hubic
if (OAuth2Info.CheckOAuth(Config.HubicOAuth2Info))
{
oAuth2Hubic.Status = OAuthLoginStatus.LoginSuccessful;
btnHubicRefreshFolders.Enabled = true;
}
cbHubicPublishLink.Checked = Config.HubicPublish;
// Ge.tt
if (Config.Ge_ttLogin != null && !string.IsNullOrEmpty(Config.Ge_ttLogin.AccessToken))
@ -1122,6 +1133,68 @@ private void cbCopyURLType_SelectedIndexChanged(object sender, EventArgs e)
#endregion Copy
#region Hubic
private void oAuth2Hubic_OpenButtonClicked()
{
HubicAuthOpen();
}
private void oAuth2Hubic_CompleteButtonClicked(string code)
{
HubicAuthComplete(code);
}
private void oAuth2Hubic_RefreshButtonClicked()
{
HubicAuthRefresh();
}
private void oAuth2Hubic_ClearButtonClicked()
{
Config.HubicOAuth2Info = null;
Config.HubicOpenstackAuthInfo = null;
}
private void btnHubicRefreshFolders_Click(object sender, EventArgs e)
{
HubicListFolders(Hubic.RootFolder);
}
private void lvHubicFolders_SelectedIndexChanged(object sender, EventArgs e)
{
if (lvHubicFolders.SelectedItems.Count > 0)
{
ListViewItem lvi = lvHubicFolders.SelectedItems[0];
HubicFolderInfo folder = lvi.Tag as HubicFolderInfo;
if (folder != null)
{
Config.HubicSelectedFolder = folder;
}
}
}
private void lvHubicFolders_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left && lvHubicFolders.SelectedItems.Count > 0)
{
ListViewItem lvi = lvHubicFolders.SelectedItems[0];
HubicFolderInfo folder = lvi.Tag as HubicFolderInfo;
if (folder != null)
{
lvHubicFolders.Items.Clear();
HubicListFolders(folder);
}
}
}
private void cbHubicPublishLink_CheckedChanged(object sender, EventArgs e)
{
Config.HubicPublish = cbHubicPublishLink.Checked;
}
#endregion Hubic
#region OneDrive
private void oAuth2OneDrive_OpenButtonClicked()

File diff suppressed because it is too large Load diff

View file

@ -894,6 +894,129 @@ private void BoxAddFolder(BoxFileEntry folder)
#endregion Box
#region Hubic
public void HubicAuthOpen()
{
try
{
OAuth2Info oauth = new OAuth2Info(APIKeys.HubicClientID, APIKeys.HubicClientSecret);
HubicOpenstackAuthInfo osauth = new HubicOpenstackAuthInfo();
string url = new Hubic(oauth, osauth).GetAuthorizationURL();
if (!string.IsNullOrEmpty(url))
{
Config.HubicOAuth2Info = oauth;
Config.HubicOpenstackAuthInfo = osauth;
DebugHelper.WriteLine("HubicAuthOpen - Authorization URL is opened: " + url);
using (OAuthWebForm oauthForm = new OAuthWebForm(url, "https://getsharex.com/callback/"))
{
if (oauthForm.ShowDialog() == DialogResult.OK)
{
HubicAuthComplete(oauthForm.Code);
}
}
}
else
{
DebugHelper.WriteLine("HubicAuthOpen - Authorization URL is empty.");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Resources.UploadersConfigForm_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
public void HubicAuthComplete(string code)
{
try
{
if (!string.IsNullOrEmpty(code) && Config.HubicOAuth2Info != null)
{
bool result = new Hubic(Config.HubicOAuth2Info, Config.HubicOpenstackAuthInfo).GetAccessToken(code);
if (result)
{
oAuth2Hubic.Status = OAuthLoginStatus.LoginSuccessful;
MessageBox.Show(Resources.UploadersConfigForm_Login_successful, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
oAuth2Hubic.Status = OAuthLoginStatus.LoginFailed;
MessageBox.Show(Resources.UploadersConfigForm_Login_failed, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
btnHubicRefreshFolders.Enabled = result;
btnHubicRefreshFolders.PerformClick();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Resources.UploadersConfigForm_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
public void HubicAuthRefresh()
{
try
{
if (OAuth2Info.CheckOAuth(Config.HubicOAuth2Info))
{
bool result = new Hubic(Config.HubicOAuth2Info, Config.HubicOpenstackAuthInfo).RefreshAccessToken();
if (result)
{
oAuth2Hubic.Status = OAuthLoginStatus.LoginSuccessful;
MessageBox.Show(Resources.UploadersConfigForm_Login_successful, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
oAuth2Hubic.Status = OAuthLoginStatus.LoginFailed;
MessageBox.Show(Resources.UploadersConfigForm_Login_failed, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), Resources.UploadersConfigForm_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
public void HubicListFolders(HubicFolderInfo fileInfo)
{
lvHubicFolders.Items.Clear();
if (!OAuth2Info.CheckOAuth(Config.HubicOAuth2Info))
{
MessageBox.Show(Resources.UploadersConfigForm_ListFolders_Authentication_required_, Resources.UploadersConfigForm_HubicListFolders_Hubic_refresh_folders_list_failed,
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
Hubic hubic = new Hubic(Config.HubicOAuth2Info, Config.HubicOpenstackAuthInfo);
List<HubicFolderInfo> folders = hubic.GetFiles(fileInfo);
if (folders != null && folders.Count != 0)
{
foreach (HubicFolderInfo folder in folders.Where(x => x.content_type == "application/directory" && x.name[0] != '.'))
{
HubicAddFolder(folder);
}
}
}
}
private void HubicAddFolder(HubicFolderInfo folder)
{
ListViewItem lvi = new ListViewItem(folder.name);
lvi.Tag = folder;
lvHubicFolders.Items.Add(lvi);
}
#endregion Hubic
#region OneDrive
public void OneDriveAuthOpen()

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -353,6 +353,16 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon Hubic {
get {
object obj = ResourceManager.GetObject("Hubic", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
@ -942,6 +952,15 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Hubic refresh folders list failed.
/// </summary>
internal static string UploadersConfigForm_HubicListFolders_Hubic_refresh_folders_list_failed {
get {
return ResourceManager.GetString("UploadersConfigForm_HubicListFolders_Hubic_refresh_folders_list_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Authentication required..
/// </summary>

View file

@ -379,6 +379,9 @@
<data name="UploadersConfigForm_BoxListFolders_Box_refresh_folders_list_failed" xml:space="preserve">
<value>Box refresh folders list failed</value>
</data>
<data name="UploadersConfigForm_HubicListFolders_Hubic_refresh_folders_list_failed" xml:space="preserve">
<value>Hubic refresh folders list failed</value>
</data>
<data name="UploadersConfigForm_MinusUpdateControls_Logged_in_as__0__" xml:space="preserve">
<value>Logged in as {0}.</value>
</data>
@ -464,4 +467,7 @@ Created folders:</value>
<data name="OneDrive_RootFolder_Root_folder" xml:space="preserve">
<value>Root folder</value>
</data>
<data name="Hubic" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Favicons\hubic.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -105,6 +105,7 @@
<Compile Include="FileUploaders\Ge_tt.cs" />
<Compile Include="FileUploaders\AmazonS3.cs" />
<Compile Include="FileUploaders\GoogleDrive.cs" />
<Compile Include="FileUploaders\Hubic.cs" />
<Compile Include="FileUploaders\Jira.cs" />
<Compile Include="FileUploaders\Hostr.cs" />
<Compile Include="FileUploaders\MediaFire.cs" />
@ -502,6 +503,9 @@
<ItemGroup>
<None Include="Favicons\Hastebin.png" />
</ItemGroup>
<ItemGroup>
<None Include="Favicons\hubic.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<PropertyGroup>

View file

@ -134,6 +134,13 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
public string CopyUploadPath = "ShareX/%y/%mo";
public CopyURLType CopyURLType = CopyURLType.Shortened;
// Hubic
public OAuth2Info HubicOAuth2Info = null;
public HubicOpenstackAuthInfo HubicOpenstackAuthInfo = null;
public HubicFolderInfo HubicSelectedFolder = Hubic.RootFolder;
public bool HubicPublish = false;
// Google Drive
public OAuth2Info GoogleDriveOAuth2Info = null;

View file

@ -850,6 +850,13 @@ public UploadResult UploadFile(Stream stream, string fileName)
URLType = Program.UploadersConfig.CopyURLType
};
break;
case FileDestination.Hubic:
fileUploader = new Hubic(Program.UploadersConfig.HubicOAuth2Info, Program.UploadersConfig.HubicOpenstackAuthInfo)
{
SelectedFolder = Program.UploadersConfig.HubicSelectedFolder,
Publish = Program.UploadersConfig.HubicPublish
};
break;
case FileDestination.RapidShare:
fileUploader = new RapidShare(Program.UploadersConfig.RapidShareUsername, Program.UploadersConfig.RapidSharePassword, Program.UploadersConfig.RapidShareFolderID);
break;