diff --git a/HelpersLib/Helpers/Helpers.cs b/HelpersLib/Helpers/Helpers.cs index 5592dc4a1..fa05b4e76 100644 --- a/HelpersLib/Helpers/Helpers.cs +++ b/HelpersLib/Helpers/Helpers.cs @@ -50,7 +50,7 @@ public static class Helpers public const string Alphanumeric = Numbers + AlphabetCapital + Alphabet; public const string URLCharacters = Alphanumeric + "-._~"; // 45 46 95 126 public const string URLPathCharacters = URLCharacters + "/"; // 47 - public const string ValidURLCharacters = URLPathCharacters + ":?#[]@!$&'()*+,;="; + public const string ValidURLCharacters = URLPathCharacters + ":?#[]@!$&'()*+,;= "; private static readonly object randomLock = new object(); private static readonly Random random = new Random(); @@ -201,7 +201,7 @@ public static string GetValidFilePath(string filePath) return GetValidFolderPath(folderPath) + Path.DirectorySeparatorChar + GetValidFileName(fileName); } - public static string GetValidURL(string url, bool replaceSpace = true) + public static string GetValidURL(string url, bool replaceSpace = false) { if (replaceSpace) url = url.Replace(' ', '_'); return new string(url.Where(c => ValidURLCharacters.Contains(c)).ToArray()); diff --git a/ShareX/UploadTask.cs b/ShareX/UploadTask.cs index c3e75efda..5e528c38c 100644 --- a/ShareX/UploadTask.cs +++ b/ShareX/UploadTask.cs @@ -740,7 +740,7 @@ public UploadResult UploadFile(Stream stream, string fileName) { UploadPath = uploadPath, AutoCreateShareableLink = Program.UploadersConfig.DropboxAutoCreateShareableLink, - ShortURL = Program.UploadersConfig.DropboxShortURL + ShareURLType = Program.UploadersConfig.DropboxURLType }; break; case FileDestination.GoogleDrive: diff --git a/UploadersLib/FileUploaders/Dropbox.cs b/UploadersLib/FileUploaders/Dropbox.cs index 2483fc09a..66c47ce65 100644 --- a/UploadersLib/FileUploaders/Dropbox.cs +++ b/UploadersLib/FileUploaders/Dropbox.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.RegularExpressions; using UploadersLib.HelperClasses; namespace UploadersLib.FileUploaders @@ -39,7 +40,7 @@ public sealed class Dropbox : FileUploader, IOAuth public string UploadPath { get; set; } public bool AutoCreateShareableLink { get; set; } - public bool ShortURL { get; set; } + public DropboxURLType ShareURLType { get; set; } private const string APIVersion = "1"; private const string Root = "dropbox"; // dropbox or sandbox @@ -55,7 +56,8 @@ public sealed class Dropbox : FileUploader, IOAuth private const string URLCreateFolder = URLAPI + "/fileops/create_folder"; private const string URLDelete = URLAPI + "/fileops/delete"; private const string URLMove = URLAPI + "/fileops/move"; - private const string URLPublic = "https://dl.dropboxusercontent.com/u"; + private const string URLPublicDirect = "https://dl.dropboxusercontent.com/u"; + private const string URLShareDirect = "https://dl.dropboxusercontent.com/s"; private const string URLRequestToken = URLAPI + "/oauth/request_token"; private const string URLAuthorize = "https://www.dropbox.com/" + APIVersion + "/oauth/authorize"; @@ -131,7 +133,7 @@ public bool DownloadFile(string path, Stream downloadStream) } // https://www.dropbox.com/developers/core/api#files-POST - public UploadResult UploadFile(Stream stream, string path, string fileName, bool createShareableURL = false, bool shortURL = true) + public UploadResult UploadFile(Stream stream, string path, string fileName, bool createShareableURL = false, DropboxURLType urlType = DropboxURLType.Default) { if (!OAuthInfo.CheckOAuth(AuthInfo)) { @@ -157,12 +159,7 @@ public UploadResult UploadFile(Stream stream, string path, string fileName, bool { if (createShareableURL) { - DropboxShares shares = CreateShareableLink(content.Path, shortURL); - - if (shares != null) - { - result.URL = shares.URL; - } + result.URL = CreateShareableLink(content.Path, urlType); } else { @@ -206,16 +203,14 @@ public bool IsExists(string path) } // https://www.dropbox.com/developers/core/api#shares - public DropboxShares CreateShareableLink(string path, bool short_url = true) + public string CreateShareableLink(string path, DropboxURLType urlType) { - DropboxShares shares = null; - if (!string.IsNullOrEmpty(path) && OAuthInfo.CheckOAuth(AuthInfo)) { string url = Helpers.CombineURL(URLShares, Helpers.URLPathEncode(path)); Dictionary args = new Dictionary(); - args.Add("short_url", short_url ? "true" : "false"); + args.Add("short_url", urlType == DropboxURLType.Shortened ? "true" : "false"); string query = OAuthManager.GenerateQuery(url, args, HttpMethod.POST, AuthInfo); @@ -223,11 +218,28 @@ public DropboxShares CreateShareableLink(string path, bool short_url = true) if (!string.IsNullOrEmpty(response)) { - shares = JsonConvert.DeserializeObject(response); + DropboxShares shares = JsonConvert.DeserializeObject(response); + + if (urlType == DropboxURLType.Direct) + { + Match match = Regex.Match(shares.URL, @"https?://(?:www\.)?dropbox.com/s/(?\w+/.+)"); + if (match.Success) + { + string urlPath = match.Groups["path"].Value; + if (!string.IsNullOrEmpty(urlPath)) + { + return Helpers.CombineURL(URLShareDirect, urlPath); + } + } + } + else + { + return shares.URL; + } } } - return shares; + return null; } #endregion Files and metadata @@ -336,7 +348,7 @@ public DropboxContentInfo Move(string from_path, string to_path) public override UploadResult Upload(Stream stream, string fileName) { - return UploadFile(stream, UploadPath, fileName, AutoCreateShareableLink, ShortURL); + return UploadFile(stream, UploadPath, fileName, AutoCreateShareableLink, ShareURLType); } public string GetPublicURL(string path) @@ -353,7 +365,7 @@ public static string GetPublicURL(long userID, string path) if (path.StartsWith("Public/", StringComparison.InvariantCultureIgnoreCase)) { path = Helpers.URLPathEncode((path.Substring(7))); - return Helpers.CombineURL(URLPublic, userID.ToString(), path); + return Helpers.CombineURL(URLPublicDirect, userID.ToString(), path); } } @@ -371,6 +383,13 @@ public static string TidyUploadPath(string uploadPath) } } + public enum DropboxURLType + { + Default, + Shortened, + Direct + } + public class DropboxAccountInfo { public string Referral_link { get; set; } // The user's referral link. diff --git a/UploadersLib/GUI/UploadersConfigForm.Designer.cs b/UploadersLib/GUI/UploadersConfigForm.Designer.cs index 793633d5a..421c75edb 100644 --- a/UploadersLib/GUI/UploadersConfigForm.Designer.cs +++ b/UploadersLib/GUI/UploadersConfigForm.Designer.cs @@ -34,6 +34,7 @@ private void InitializeComponent() this.tpImageUploaders = new System.Windows.Forms.TabPage(); this.tcImageUploaders = new System.Windows.Forms.TabControl(); this.tpImgur = new System.Windows.Forms.TabPage(); + this.oauth2Imgur = new UploadersLib.GUI.OAuth2Control(); this.txtImgurAlbumID = new System.Windows.Forms.TextBox(); this.lblImgurAlbumID = new System.Windows.Forms.Label(); this.lvImgurAlbumList = new System.Windows.Forms.ListView(); @@ -43,7 +44,9 @@ private void InitializeComponent() this.btnImgurRefreshAlbumList = new System.Windows.Forms.Button(); this.cbImgurThumbnailType = new System.Windows.Forms.ComboBox(); this.lblImgurThumbnailType = new System.Windows.Forms.Label(); + this.atcImgurAccountType = new UploadersLib.GUI.AccountTypeControl(); this.tpImageShack = new System.Windows.Forms.TabPage(); + this.atcImageShackAccountType = new UploadersLib.GUI.AccountTypeControl(); this.btnImageShackLogin = new System.Windows.Forms.Button(); this.btnImageShackOpenPublicProfile = new System.Windows.Forms.Button(); this.cbImageShackIsPublic = new System.Windows.Forms.CheckBox(); @@ -53,6 +56,7 @@ 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 UploadersLib.GUI.AccountTypeControl(); this.btnTinyPicLogin = new System.Windows.Forms.Button(); this.txtTinyPicPassword = new System.Windows.Forms.TextBox(); this.lblTinyPicPassword = new System.Windows.Forms.Label(); @@ -105,6 +109,7 @@ private void InitializeComponent() this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.btnPicasaRefreshAlbumList = new System.Windows.Forms.Button(); + this.oauth2Picasa = new UploadersLib.GUI.OAuth2Control(); this.tpTextUploaders = new System.Windows.Forms.TabPage(); this.tcTextUploaders = new System.Windows.Forms.TabControl(); this.tpPastebin = new System.Windows.Forms.TabPage(); @@ -115,6 +120,8 @@ 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 UploadersLib.GUI.OAuth2Control(); + this.atcGistAccountType = new UploadersLib.GUI.AccountTypeControl(); this.tpUpaste = new System.Windows.Forms.TabPage(); this.cbUpasteIsPublic = new System.Windows.Forms.CheckBox(); this.lblUpasteUserKey = new System.Windows.Forms.Label(); @@ -122,7 +129,6 @@ private void InitializeComponent() this.tpFileUploaders = new System.Windows.Forms.TabPage(); this.tcFileUploaders = new System.Windows.Forms.TabControl(); this.tpDropbox = new System.Windows.Forms.TabPage(); - this.cbDropboxShortURL = new System.Windows.Forms.CheckBox(); this.cbDropboxAutoCreateShareableLink = new System.Windows.Forms.CheckBox(); this.btnDropboxShowFiles = new System.Windows.Forms.Button(); this.btnDropboxCompleteAuth = new System.Windows.Forms.Button(); @@ -139,6 +145,7 @@ private void InitializeComponent() this.btnFtpClient = new System.Windows.Forms.Button(); this.btnFTPExport = new System.Windows.Forms.Button(); this.btnFTPImport = new System.Windows.Forms.Button(); + this.ucFTPAccounts = new UploadersLib.AccountsControl(); this.gbFtpSettings = new System.Windows.Forms.GroupBox(); this.lblFtpFiles = new System.Windows.Forms.Label(); this.lblFtpText = new System.Windows.Forms.Label(); @@ -182,10 +189,13 @@ private void InitializeComponent() this.txtPushbulletUserKey = new System.Windows.Forms.TextBox(); this.tpGoogleDrive = new System.Windows.Forms.TabPage(); this.cbGoogleDriveIsPublic = new System.Windows.Forms.CheckBox(); + this.oauth2GoogleDrive = new UploadersLib.GUI.OAuth2Control(); this.tpBox = new System.Windows.Forms.TabPage(); + this.lblBoxFolderTip = new System.Windows.Forms.Label(); this.cbBoxShare = new System.Windows.Forms.CheckBox(); this.lvBoxFolders = new HelpersLib.MyListView(); this.chBoxFoldersName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.oauth2Box = new UploadersLib.GUI.OAuth2Control(); this.lblBoxFolderID = new System.Windows.Forms.Label(); this.btnBoxRefreshFolders = new System.Windows.Forms.Button(); this.tpRapidShare = new System.Windows.Forms.TabPage(); @@ -203,6 +213,7 @@ 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 UploadersLib.GUI.AccountTypeControl(); this.tpGe_tt = new System.Windows.Forms.TabPage(); this.lblGe_ttAccessToken = new System.Windows.Forms.Label(); this.lblGe_ttPassword = new System.Windows.Forms.Label(); @@ -240,6 +251,7 @@ 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 UploadersLib.GUI.OAuth2Control(); this.tpEmail = new System.Windows.Forms.TabPage(); this.chkEmailConfirm = new System.Windows.Forms.CheckBox(); this.lblEmailSmtpServer = new System.Windows.Forms.Label(); @@ -257,6 +269,7 @@ private void InitializeComponent() this.txtEmailDefaultSubject = new System.Windows.Forms.TextBox(); this.tpSharedFolder = new System.Windows.Forms.TabPage(); this.tlpSharedFolders = new System.Windows.Forms.TableLayoutPanel(); + this.ucLocalhostAccounts = new UploadersLib.AccountsControl(); this.gbSharedFolder = new System.Windows.Forms.GroupBox(); this.lblSharedFolderFiles = new System.Windows.Forms.Label(); this.lblSharedFolderText = new System.Windows.Forms.Label(); @@ -267,7 +280,10 @@ private void InitializeComponent() this.tpURLShorteners = new System.Windows.Forms.TabPage(); this.tcURLShorteners = new System.Windows.Forms.TabControl(); this.tpBitly = new System.Windows.Forms.TabPage(); + this.oauth2Bitly = new UploadersLib.GUI.OAuth2Control(); this.tpGoogleURLShortener = new System.Windows.Forms.TabPage(); + this.oauth2GoogleURLShortener = new UploadersLib.GUI.OAuth2Control(); + this.atcGoogleURLShortenerAccountType = new UploadersLib.GUI.AccountTypeControl(); this.tpYourls = new System.Windows.Forms.TabPage(); this.txtYourlsPassword = new System.Windows.Forms.TextBox(); this.txtYourlsUsername = new System.Windows.Forms.TextBox(); @@ -282,6 +298,7 @@ private void InitializeComponent() this.tcSocialNetworkingServices = new System.Windows.Forms.TabControl(); this.tpTwitter = new System.Windows.Forms.TabPage(); this.btnTwitterLogin = new System.Windows.Forms.Button(); + this.ucTwitterAccounts = new UploadersLib.AccountsControl(); this.tpCustomUploaders = new System.Windows.Forms.TabPage(); this.btnCustomUploaderHelp = new System.Windows.Forms.Button(); this.lblCustomUploaderImageUploader = new System.Windows.Forms.Label(); @@ -340,25 +357,8 @@ private void InitializeComponent() this.txtCustomUploaderArgName = new System.Windows.Forms.TextBox(); this.txtRapidSharePremiumUserName = new System.Windows.Forms.TextBox(); this.ttHelpTip = new System.Windows.Forms.ToolTip(this.components); - this.oauth2Imgur = new UploadersLib.GUI.OAuth2Control(); - this.atcImgurAccountType = new UploadersLib.GUI.AccountTypeControl(); - this.atcImageShackAccountType = new UploadersLib.GUI.AccountTypeControl(); - this.atcTinyPicAccountType = new UploadersLib.GUI.AccountTypeControl(); - this.oauth2Picasa = new UploadersLib.GUI.OAuth2Control(); - this.oAuth2Gist = new UploadersLib.GUI.OAuth2Control(); - this.atcGistAccountType = new UploadersLib.GUI.AccountTypeControl(); - this.ucFTPAccounts = new UploadersLib.AccountsControl(); - this.oauth2GoogleDrive = new UploadersLib.GUI.OAuth2Control(); - this.oauth2Box = new UploadersLib.GUI.OAuth2Control(); - this.atcSendSpaceAccountType = new UploadersLib.GUI.AccountTypeControl(); - this.oAuthJira = new UploadersLib.GUI.OAuth2Control(); - this.ucLocalhostAccounts = new UploadersLib.AccountsControl(); - this.oauth2Bitly = new UploadersLib.GUI.OAuth2Control(); - this.oauth2GoogleURLShortener = new UploadersLib.GUI.OAuth2Control(); - this.atcGoogleURLShortenerAccountType = new UploadersLib.GUI.AccountTypeControl(); - this.ucTwitterAccounts = new UploadersLib.AccountsControl(); this.actRapidShareAccountType = new UploadersLib.GUI.AccountTypeControl(); - this.lblBoxFolderTip = new System.Windows.Forms.Label(); + this.cbDropboxURLType = new System.Windows.Forms.ComboBox(); this.tcUploaders.SuspendLayout(); this.tpImageUploaders.SuspendLayout(); this.tcImageUploaders.SuspendLayout(); @@ -485,6 +485,18 @@ private void InitializeComponent() this.tpImgur.Text = "Imgur"; this.tpImgur.UseVisualStyleBackColor = true; // + // oauth2Imgur + // + this.oauth2Imgur.Location = new System.Drawing.Point(16, 16); + this.oauth2Imgur.LoginStatus = false; + this.oauth2Imgur.Name = "oauth2Imgur"; + this.oauth2Imgur.Size = new System.Drawing.Size(328, 207); + this.oauth2Imgur.Status = "Status: Login required."; + this.oauth2Imgur.TabIndex = 6; + this.oauth2Imgur.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2Imgur_OpenButtonClicked); + this.oauth2Imgur.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2Imgur_CompleteButtonClicked); + this.oauth2Imgur.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2Imgur_RefreshButtonClicked); + // // txtImgurAlbumID // this.txtImgurAlbumID.Location = new System.Drawing.Point(592, 28); @@ -563,6 +575,15 @@ private void InitializeComponent() this.lblImgurThumbnailType.TabIndex = 1; this.lblImgurThumbnailType.Text = "Thumbnail type:"; // + // atcImgurAccountType + // + this.atcImgurAccountType.Location = new System.Drawing.Point(8, 232); + this.atcImgurAccountType.Name = "atcImgurAccountType"; + this.atcImgurAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; + this.atcImgurAccountType.Size = new System.Drawing.Size(272, 29); + this.atcImgurAccountType.TabIndex = 0; + this.atcImgurAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcImgurAccountType_AccountTypeChanged); + // // tpImageShack // this.tpImageShack.Controls.Add(this.atcImageShackAccountType); @@ -582,6 +603,15 @@ private void InitializeComponent() this.tpImageShack.Text = "ImageShack"; this.tpImageShack.UseVisualStyleBackColor = true; // + // atcImageShackAccountType + // + this.atcImageShackAccountType.Location = new System.Drawing.Point(8, 16); + this.atcImageShackAccountType.Name = "atcImageShackAccountType"; + this.atcImageShackAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; + this.atcImageShackAccountType.Size = new System.Drawing.Size(272, 29); + this.atcImageShackAccountType.TabIndex = 10; + this.atcImageShackAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcImageShackAccountType_AccountTypeChanged); + // // btnImageShackLogin // this.btnImageShackLogin.Location = new System.Drawing.Point(296, 82); @@ -675,6 +705,15 @@ private void InitializeComponent() this.tpTinyPic.Text = "TinyPic"; this.tpTinyPic.UseVisualStyleBackColor = true; // + // atcTinyPicAccountType + // + this.atcTinyPicAccountType.Location = new System.Drawing.Point(8, 16); + this.atcTinyPicAccountType.Name = "atcTinyPicAccountType"; + this.atcTinyPicAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; + this.atcTinyPicAccountType.Size = new System.Drawing.Size(272, 29); + this.atcTinyPicAccountType.TabIndex = 0; + this.atcTinyPicAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcTinyPicAccountType_AccountTypeChanged); + // // btnTinyPicLogin // this.btnTinyPicLogin.Location = new System.Drawing.Point(296, 82); @@ -1206,6 +1245,18 @@ private void InitializeComponent() this.btnPicasaRefreshAlbumList.UseVisualStyleBackColor = true; this.btnPicasaRefreshAlbumList.Click += new System.EventHandler(this.btnPicasaRefreshAlbumList_Click); // + // oauth2Picasa + // + this.oauth2Picasa.Location = new System.Drawing.Point(16, 16); + this.oauth2Picasa.LoginStatus = false; + this.oauth2Picasa.Name = "oauth2Picasa"; + this.oauth2Picasa.Size = new System.Drawing.Size(328, 207); + this.oauth2Picasa.Status = "Login required."; + this.oauth2Picasa.TabIndex = 0; + this.oauth2Picasa.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2Picasa_OpenButtonClicked); + this.oauth2Picasa.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2Picasa_CompleteButtonClicked); + this.oauth2Picasa.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2Picasa_RefreshButtonClicked); + // // tpTextUploaders // this.tpTextUploaders.Controls.Add(this.tcTextUploaders); @@ -1313,6 +1364,28 @@ private void InitializeComponent() this.chkGistPublishPublic.UseVisualStyleBackColor = true; this.chkGistPublishPublic.CheckedChanged += new System.EventHandler(this.chkGistPublishPublic_CheckedChanged); // + // oAuth2Gist + // + this.oAuth2Gist.Enabled = false; + this.oAuth2Gist.IsRefreshable = false; + this.oAuth2Gist.Location = new System.Drawing.Point(16, 51); + this.oAuth2Gist.LoginStatus = false; + this.oAuth2Gist.Name = "oAuth2Gist"; + this.oAuth2Gist.Size = new System.Drawing.Size(328, 173); + this.oAuth2Gist.Status = "Status: Login required."; + this.oAuth2Gist.TabIndex = 16; + this.oAuth2Gist.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oAuth2Gist_OpenButtonClicked); + this.oAuth2Gist.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oAuth2Gist_CompleteButtonClicked); + // + // atcGistAccountType + // + this.atcGistAccountType.Location = new System.Drawing.Point(15, 16); + this.atcGistAccountType.Name = "atcGistAccountType"; + this.atcGistAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; + this.atcGistAccountType.Size = new System.Drawing.Size(214, 29); + this.atcGistAccountType.TabIndex = 15; + this.atcGistAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGistAccountType_AccountTypeChanged); + // // tpUpaste // this.tpUpaste.Controls.Add(this.cbUpasteIsPublic); @@ -1392,7 +1465,7 @@ private void InitializeComponent() // // tpDropbox // - this.tpDropbox.Controls.Add(this.cbDropboxShortURL); + this.tpDropbox.Controls.Add(this.cbDropboxURLType); this.tpDropbox.Controls.Add(this.cbDropboxAutoCreateShareableLink); this.tpDropbox.Controls.Add(this.btnDropboxShowFiles); this.tpDropbox.Controls.Add(this.btnDropboxCompleteAuth); @@ -1411,32 +1484,21 @@ private void InitializeComponent() this.tpDropbox.Text = "Dropbox"; this.tpDropbox.UseVisualStyleBackColor = true; // - // cbDropboxShortURL - // - this.cbDropboxShortURL.AutoSize = true; - this.cbDropboxShortURL.Location = new System.Drawing.Point(160, 152); - this.cbDropboxShortURL.Name = "cbDropboxShortURL"; - this.cbDropboxShortURL.Size = new System.Drawing.Size(137, 17); - this.cbDropboxShortURL.TabIndex = 8; - this.cbDropboxShortURL.Text = "Shorten shareable URL"; - this.cbDropboxShortURL.UseVisualStyleBackColor = true; - this.cbDropboxShortURL.CheckedChanged += new System.EventHandler(this.cbDropboxShortURL_CheckedChanged); - // // cbDropboxAutoCreateShareableLink // this.cbDropboxAutoCreateShareableLink.AutoSize = true; - this.cbDropboxAutoCreateShareableLink.Location = new System.Drawing.Point(18, 152); + this.cbDropboxAutoCreateShareableLink.Location = new System.Drawing.Point(19, 176); this.cbDropboxAutoCreateShareableLink.Name = "cbDropboxAutoCreateShareableLink"; - this.cbDropboxAutoCreateShareableLink.Size = new System.Drawing.Size(131, 17); + this.cbDropboxAutoCreateShareableLink.Size = new System.Drawing.Size(134, 17); this.cbDropboxAutoCreateShareableLink.TabIndex = 7; - this.cbDropboxAutoCreateShareableLink.Text = "Create shareable URL"; + this.cbDropboxAutoCreateShareableLink.Text = "Create shareable URL:"; this.cbDropboxAutoCreateShareableLink.UseVisualStyleBackColor = true; this.cbDropboxAutoCreateShareableLink.CheckedChanged += new System.EventHandler(this.cbDropboxAutoCreateShareableLink_CheckedChanged); // // btnDropboxShowFiles // this.btnDropboxShowFiles.Enabled = false; - this.btnDropboxShowFiles.Location = new System.Drawing.Point(344, 120); + this.btnDropboxShowFiles.Location = new System.Drawing.Point(368, 122); this.btnDropboxShowFiles.Name = "btnDropboxShowFiles"; this.btnDropboxShowFiles.Size = new System.Drawing.Size(64, 24); this.btnDropboxShowFiles.TabIndex = 5; @@ -1480,7 +1542,7 @@ private void InitializeComponent() // this.lblDropboxStatus.AutoSize = true; this.lblDropboxStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162))); - this.lblDropboxStatus.Location = new System.Drawing.Point(16, 176); + this.lblDropboxStatus.Location = new System.Drawing.Point(16, 208); this.lblDropboxStatus.Name = "lblDropboxStatus"; this.lblDropboxStatus.Size = new System.Drawing.Size(82, 16); this.lblDropboxStatus.TabIndex = 9; @@ -1489,16 +1551,17 @@ private void InitializeComponent() // lblDropboxPathTip // this.lblDropboxPathTip.AutoSize = true; - this.lblDropboxPathTip.Location = new System.Drawing.Point(416, 126); + this.lblDropboxPathTip.Location = new System.Drawing.Point(16, 152); this.lblDropboxPathTip.Name = "lblDropboxPathTip"; - this.lblDropboxPathTip.Size = new System.Drawing.Size(208, 13); + this.lblDropboxPathTip.Size = new System.Drawing.Size(585, 13); this.lblDropboxPathTip.TabIndex = 6; - this.lblDropboxPathTip.Text = "Use \"Public\" folder for be able to get URL."; + this.lblDropboxPathTip.Text = "If you are using the \"Public\" folder, a shareable url is already generated. You d" + + "on\'t need to check \"Create shareable URL\"."; // // lblDropboxPath // this.lblDropboxPath.AutoSize = true; - this.lblDropboxPath.Location = new System.Drawing.Point(16, 126); + this.lblDropboxPath.Location = new System.Drawing.Point(16, 128); this.lblDropboxPath.Name = "lblDropboxPath"; this.lblDropboxPath.Size = new System.Drawing.Size(68, 13); this.lblDropboxPath.TabIndex = 3; @@ -1516,9 +1579,9 @@ private void InitializeComponent() // // txtDropboxPath // - this.txtDropboxPath.Location = new System.Drawing.Point(88, 122); + this.txtDropboxPath.Location = new System.Drawing.Point(88, 124); this.txtDropboxPath.Name = "txtDropboxPath"; - this.txtDropboxPath.Size = new System.Drawing.Size(248, 20); + this.txtDropboxPath.Size = new System.Drawing.Size(272, 20); this.txtDropboxPath.TabIndex = 4; this.txtDropboxPath.TextChanged += new System.EventHandler(this.txtDropboxPath_TextChanged); // @@ -1545,7 +1608,7 @@ private void InitializeComponent() this.tlpFtp.RowCount = 2; this.tlpFtp.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 75F)); this.tlpFtp.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tlpFtp.Size = new System.Drawing.Size(798, 469); + this.tlpFtp.Size = new System.Drawing.Size(798, 451); this.tlpFtp.TabIndex = 0; // // panelFtp @@ -1557,7 +1620,7 @@ private void InitializeComponent() this.panelFtp.Dock = System.Windows.Forms.DockStyle.Fill; this.panelFtp.Location = new System.Drawing.Point(3, 3); this.panelFtp.Name = "panelFtp"; - this.panelFtp.Size = new System.Drawing.Size(792, 345); + this.panelFtp.Size = new System.Drawing.Size(792, 332); this.panelFtp.TabIndex = 0; // // btnFtpClient @@ -1598,6 +1661,15 @@ private void InitializeComponent() this.btnFTPImport.UseVisualStyleBackColor = true; this.btnFTPImport.Click += new System.EventHandler(this.btnFTPImport_Click); // + // ucFTPAccounts + // + this.ucFTPAccounts.Dock = System.Windows.Forms.DockStyle.Fill; + this.ucFTPAccounts.Location = new System.Drawing.Point(0, 0); + this.ucFTPAccounts.Margin = new System.Windows.Forms.Padding(4); + this.ucFTPAccounts.Name = "ucFTPAccounts"; + this.ucFTPAccounts.Size = new System.Drawing.Size(792, 332); + this.ucFTPAccounts.TabIndex = 0; + // // gbFtpSettings // this.gbFtpSettings.Controls.Add(this.lblFtpFiles); @@ -1607,9 +1679,9 @@ private void InitializeComponent() this.gbFtpSettings.Controls.Add(this.cboFtpText); this.gbFtpSettings.Controls.Add(this.cboFtpImages); this.gbFtpSettings.Dock = System.Windows.Forms.DockStyle.Fill; - this.gbFtpSettings.Location = new System.Drawing.Point(3, 354); + this.gbFtpSettings.Location = new System.Drawing.Point(3, 341); this.gbFtpSettings.Name = "gbFtpSettings"; - this.gbFtpSettings.Size = new System.Drawing.Size(792, 112); + this.gbFtpSettings.Size = new System.Drawing.Size(792, 107); this.gbFtpSettings.TabIndex = 1; this.gbFtpSettings.TabStop = false; this.gbFtpSettings.Text = "FTP Settings"; @@ -2056,6 +2128,18 @@ private void InitializeComponent() this.cbGoogleDriveIsPublic.UseVisualStyleBackColor = true; this.cbGoogleDriveIsPublic.CheckedChanged += new System.EventHandler(this.cbGoogleDriveIsPublic_CheckedChanged); // + // oauth2GoogleDrive + // + this.oauth2GoogleDrive.Location = new System.Drawing.Point(16, 16); + this.oauth2GoogleDrive.LoginStatus = false; + this.oauth2GoogleDrive.Name = "oauth2GoogleDrive"; + this.oauth2GoogleDrive.Size = new System.Drawing.Size(328, 207); + this.oauth2GoogleDrive.Status = "Status: Login required."; + this.oauth2GoogleDrive.TabIndex = 0; + this.oauth2GoogleDrive.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2GoogleDrive_OpenButtonClicked); + this.oauth2GoogleDrive.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2GoogleDrive_CompleteButtonClicked); + this.oauth2GoogleDrive.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2GoogleDrive_RefreshButtonClicked); + // // tpBox // this.tpBox.Controls.Add(this.lblBoxFolderTip); @@ -2072,6 +2156,15 @@ private void InitializeComponent() this.tpBox.Text = "Box"; this.tpBox.UseVisualStyleBackColor = true; // + // lblBoxFolderTip + // + this.lblBoxFolderTip.AutoSize = true; + this.lblBoxFolderTip.Location = new System.Drawing.Point(352, 424); + this.lblBoxFolderTip.Name = "lblBoxFolderTip"; + this.lblBoxFolderTip.Size = new System.Drawing.Size(304, 13); + this.lblBoxFolderTip.TabIndex = 10; + this.lblBoxFolderTip.Text = "Note: You can double click folder name to go inside that folder."; + // // cbBoxShare // this.cbBoxShare.AutoSize = true; @@ -2103,6 +2196,18 @@ private void InitializeComponent() this.chBoxFoldersName.Text = "Folder name"; this.chBoxFoldersName.Width = 435; // + // oauth2Box + // + this.oauth2Box.Location = new System.Drawing.Point(16, 16); + this.oauth2Box.LoginStatus = false; + this.oauth2Box.Name = "oauth2Box"; + this.oauth2Box.Size = new System.Drawing.Size(328, 207); + this.oauth2Box.Status = "Status: Login required."; + this.oauth2Box.TabIndex = 7; + this.oauth2Box.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2Box_OpenButtonClicked); + this.oauth2Box.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2Box_CompleteButtonClicked); + this.oauth2Box.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2Box_RefreshButtonClicked); + // // lblBoxFolderID // this.lblBoxFolderID.AutoSize = true; @@ -2272,6 +2377,15 @@ private void InitializeComponent() this.txtSendSpaceUserName.TabIndex = 3; this.txtSendSpaceUserName.TextChanged += new System.EventHandler(this.txtSendSpaceUserName_TextChanged); // + // atcSendSpaceAccountType + // + this.atcSendSpaceAccountType.Location = new System.Drawing.Point(8, 16); + this.atcSendSpaceAccountType.Name = "atcSendSpaceAccountType"; + this.atcSendSpaceAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; + this.atcSendSpaceAccountType.Size = new System.Drawing.Size(214, 29); + this.atcSendSpaceAccountType.TabIndex = 0; + this.atcSendSpaceAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcSendSpaceAccountType_AccountTypeChanged); + // // tpGe_tt // this.tpGe_tt.Controls.Add(this.lblGe_ttAccessToken); @@ -2650,6 +2764,18 @@ private void InitializeComponent() this.lblJiraHost.TabIndex = 0; this.lblJiraHost.Text = "Jira host: "; // + // oAuthJira + // + this.oAuthJira.Location = new System.Drawing.Point(473, 13); + this.oAuthJira.LoginStatus = false; + this.oAuthJira.Name = "oAuthJira"; + this.oAuthJira.Size = new System.Drawing.Size(328, 207); + this.oAuthJira.Status = "Status: Login required."; + this.oAuthJira.TabIndex = 1; + this.oAuthJira.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oAuthJira_OpenButtonClicked); + this.oAuthJira.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oAuthJira_CompleteButtonClicked); + this.oAuthJira.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oAuthJira_RefreshButtonClicked); + // // tpEmail // this.tpEmail.Controls.Add(this.chkEmailConfirm); @@ -2842,6 +2968,15 @@ private void InitializeComponent() this.tlpSharedFolders.Size = new System.Drawing.Size(798, 451); this.tlpSharedFolders.TabIndex = 0; // + // ucLocalhostAccounts + // + this.ucLocalhostAccounts.Dock = System.Windows.Forms.DockStyle.Fill; + this.ucLocalhostAccounts.Location = new System.Drawing.Point(4, 4); + this.ucLocalhostAccounts.Margin = new System.Windows.Forms.Padding(4); + this.ucLocalhostAccounts.Name = "ucLocalhostAccounts"; + this.ucLocalhostAccounts.Size = new System.Drawing.Size(790, 330); + this.ucLocalhostAccounts.TabIndex = 0; + // // gbSharedFolder // this.gbSharedFolder.Controls.Add(this.lblSharedFolderFiles); @@ -2949,6 +3084,18 @@ private void InitializeComponent() this.tpBitly.Text = "bit.ly"; this.tpBitly.UseVisualStyleBackColor = true; // + // oauth2Bitly + // + this.oauth2Bitly.IsRefreshable = false; + this.oauth2Bitly.Location = new System.Drawing.Point(16, 16); + this.oauth2Bitly.LoginStatus = false; + this.oauth2Bitly.Name = "oauth2Bitly"; + this.oauth2Bitly.Size = new System.Drawing.Size(328, 168); + this.oauth2Bitly.Status = "Login required."; + this.oauth2Bitly.TabIndex = 0; + this.oauth2Bitly.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2Bitly_OpenButtonClicked); + this.oauth2Bitly.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2Bitly_CompleteButtonClicked); + // // tpGoogleURLShortener // this.tpGoogleURLShortener.Controls.Add(this.oauth2GoogleURLShortener); @@ -2961,6 +3108,27 @@ private void InitializeComponent() this.tpGoogleURLShortener.Text = "Google"; this.tpGoogleURLShortener.UseVisualStyleBackColor = true; // + // oauth2GoogleURLShortener + // + this.oauth2GoogleURLShortener.Location = new System.Drawing.Point(16, 56); + this.oauth2GoogleURLShortener.LoginStatus = false; + this.oauth2GoogleURLShortener.Name = "oauth2GoogleURLShortener"; + this.oauth2GoogleURLShortener.Size = new System.Drawing.Size(328, 207); + this.oauth2GoogleURLShortener.Status = "Status: Login required."; + this.oauth2GoogleURLShortener.TabIndex = 1; + this.oauth2GoogleURLShortener.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2GoogleURLShortener_OpenButtonClicked); + this.oauth2GoogleURLShortener.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2GoogleURLShortener_CompleteButtonClicked); + this.oauth2GoogleURLShortener.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2GoogleURLShortener_RefreshButtonClicked); + // + // atcGoogleURLShortenerAccountType + // + this.atcGoogleURLShortenerAccountType.Location = new System.Drawing.Point(8, 16); + this.atcGoogleURLShortenerAccountType.Name = "atcGoogleURLShortenerAccountType"; + this.atcGoogleURLShortenerAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; + this.atcGoogleURLShortenerAccountType.Size = new System.Drawing.Size(214, 29); + this.atcGoogleURLShortenerAccountType.TabIndex = 0; + this.atcGoogleURLShortenerAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGoogleURLShortenerAccountType_AccountTypeChanged); + // // tpYourls // this.tpYourls.Controls.Add(this.txtYourlsPassword); @@ -3101,6 +3269,14 @@ private void InitializeComponent() this.btnTwitterLogin.UseVisualStyleBackColor = true; this.btnTwitterLogin.Click += new System.EventHandler(this.btnTwitterLogin_Click); // + // ucTwitterAccounts + // + this.ucTwitterAccounts.Dock = System.Windows.Forms.DockStyle.Fill; + this.ucTwitterAccounts.Location = new System.Drawing.Point(3, 3); + this.ucTwitterAccounts.Name = "ucTwitterAccounts"; + this.ucTwitterAccounts.Size = new System.Drawing.Size(798, 469); + this.ucTwitterAccounts.TabIndex = 0; + // // tpCustomUploaders // this.tpCustomUploaders.Controls.Add(this.btnCustomUploaderHelp); @@ -3692,183 +3868,6 @@ private void InitializeComponent() this.ttHelpTip.UseAnimation = false; this.ttHelpTip.UseFading = false; // - // oauth2Imgur - // - this.oauth2Imgur.Location = new System.Drawing.Point(16, 16); - this.oauth2Imgur.LoginStatus = false; - this.oauth2Imgur.Name = "oauth2Imgur"; - this.oauth2Imgur.Size = new System.Drawing.Size(328, 207); - this.oauth2Imgur.Status = "Status: Login required."; - this.oauth2Imgur.TabIndex = 6; - this.oauth2Imgur.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2Imgur_OpenButtonClicked); - this.oauth2Imgur.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2Imgur_CompleteButtonClicked); - this.oauth2Imgur.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2Imgur_RefreshButtonClicked); - // - // atcImgurAccountType - // - this.atcImgurAccountType.Location = new System.Drawing.Point(8, 232); - this.atcImgurAccountType.Name = "atcImgurAccountType"; - this.atcImgurAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; - this.atcImgurAccountType.Size = new System.Drawing.Size(272, 29); - this.atcImgurAccountType.TabIndex = 0; - this.atcImgurAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcImgurAccountType_AccountTypeChanged); - // - // atcImageShackAccountType - // - this.atcImageShackAccountType.Location = new System.Drawing.Point(8, 16); - this.atcImageShackAccountType.Name = "atcImageShackAccountType"; - this.atcImageShackAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; - this.atcImageShackAccountType.Size = new System.Drawing.Size(272, 29); - this.atcImageShackAccountType.TabIndex = 10; - this.atcImageShackAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcImageShackAccountType_AccountTypeChanged); - // - // atcTinyPicAccountType - // - this.atcTinyPicAccountType.Location = new System.Drawing.Point(8, 16); - this.atcTinyPicAccountType.Name = "atcTinyPicAccountType"; - this.atcTinyPicAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; - this.atcTinyPicAccountType.Size = new System.Drawing.Size(272, 29); - this.atcTinyPicAccountType.TabIndex = 0; - this.atcTinyPicAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcTinyPicAccountType_AccountTypeChanged); - // - // oauth2Picasa - // - this.oauth2Picasa.Location = new System.Drawing.Point(16, 16); - this.oauth2Picasa.LoginStatus = false; - this.oauth2Picasa.Name = "oauth2Picasa"; - this.oauth2Picasa.Size = new System.Drawing.Size(328, 207); - this.oauth2Picasa.Status = "Login required."; - this.oauth2Picasa.TabIndex = 0; - this.oauth2Picasa.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2Picasa_OpenButtonClicked); - this.oauth2Picasa.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2Picasa_CompleteButtonClicked); - this.oauth2Picasa.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2Picasa_RefreshButtonClicked); - // - // oAuth2Gist - // - this.oAuth2Gist.Enabled = false; - this.oAuth2Gist.IsRefreshable = false; - this.oAuth2Gist.Location = new System.Drawing.Point(16, 51); - this.oAuth2Gist.LoginStatus = false; - this.oAuth2Gist.Name = "oAuth2Gist"; - this.oAuth2Gist.Size = new System.Drawing.Size(328, 173); - this.oAuth2Gist.Status = "Status: Login required."; - this.oAuth2Gist.TabIndex = 16; - this.oAuth2Gist.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oAuth2Gist_OpenButtonClicked); - this.oAuth2Gist.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oAuth2Gist_CompleteButtonClicked); - // - // atcGistAccountType - // - this.atcGistAccountType.Location = new System.Drawing.Point(15, 16); - this.atcGistAccountType.Name = "atcGistAccountType"; - this.atcGistAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; - this.atcGistAccountType.Size = new System.Drawing.Size(214, 29); - this.atcGistAccountType.TabIndex = 15; - this.atcGistAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGistAccountType_AccountTypeChanged); - // - // ucFTPAccounts - // - this.ucFTPAccounts.Dock = System.Windows.Forms.DockStyle.Fill; - this.ucFTPAccounts.Location = new System.Drawing.Point(0, 0); - this.ucFTPAccounts.Margin = new System.Windows.Forms.Padding(4); - this.ucFTPAccounts.Name = "ucFTPAccounts"; - this.ucFTPAccounts.Size = new System.Drawing.Size(792, 345); - this.ucFTPAccounts.TabIndex = 0; - // - // oauth2GoogleDrive - // - this.oauth2GoogleDrive.Location = new System.Drawing.Point(16, 16); - this.oauth2GoogleDrive.LoginStatus = false; - this.oauth2GoogleDrive.Name = "oauth2GoogleDrive"; - this.oauth2GoogleDrive.Size = new System.Drawing.Size(328, 207); - this.oauth2GoogleDrive.Status = "Status: Login required."; - this.oauth2GoogleDrive.TabIndex = 0; - this.oauth2GoogleDrive.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2GoogleDrive_OpenButtonClicked); - this.oauth2GoogleDrive.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2GoogleDrive_CompleteButtonClicked); - this.oauth2GoogleDrive.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2GoogleDrive_RefreshButtonClicked); - // - // oauth2Box - // - this.oauth2Box.Location = new System.Drawing.Point(16, 16); - this.oauth2Box.LoginStatus = false; - this.oauth2Box.Name = "oauth2Box"; - this.oauth2Box.Size = new System.Drawing.Size(328, 207); - this.oauth2Box.Status = "Status: Login required."; - this.oauth2Box.TabIndex = 7; - this.oauth2Box.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2Box_OpenButtonClicked); - this.oauth2Box.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2Box_CompleteButtonClicked); - this.oauth2Box.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2Box_RefreshButtonClicked); - // - // atcSendSpaceAccountType - // - this.atcSendSpaceAccountType.Location = new System.Drawing.Point(8, 16); - this.atcSendSpaceAccountType.Name = "atcSendSpaceAccountType"; - this.atcSendSpaceAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; - this.atcSendSpaceAccountType.Size = new System.Drawing.Size(214, 29); - this.atcSendSpaceAccountType.TabIndex = 0; - this.atcSendSpaceAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcSendSpaceAccountType_AccountTypeChanged); - // - // oAuthJira - // - this.oAuthJira.Location = new System.Drawing.Point(473, 13); - this.oAuthJira.LoginStatus = false; - this.oAuthJira.Name = "oAuthJira"; - this.oAuthJira.Size = new System.Drawing.Size(328, 207); - this.oAuthJira.Status = "Status: Login required."; - this.oAuthJira.TabIndex = 1; - this.oAuthJira.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oAuthJira_OpenButtonClicked); - this.oAuthJira.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oAuthJira_CompleteButtonClicked); - this.oAuthJira.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oAuthJira_RefreshButtonClicked); - // - // ucLocalhostAccounts - // - this.ucLocalhostAccounts.Dock = System.Windows.Forms.DockStyle.Fill; - this.ucLocalhostAccounts.Location = new System.Drawing.Point(4, 4); - this.ucLocalhostAccounts.Margin = new System.Windows.Forms.Padding(4); - this.ucLocalhostAccounts.Name = "ucLocalhostAccounts"; - this.ucLocalhostAccounts.Size = new System.Drawing.Size(790, 330); - this.ucLocalhostAccounts.TabIndex = 0; - // - // oauth2Bitly - // - this.oauth2Bitly.IsRefreshable = false; - this.oauth2Bitly.Location = new System.Drawing.Point(16, 16); - this.oauth2Bitly.LoginStatus = false; - this.oauth2Bitly.Name = "oauth2Bitly"; - this.oauth2Bitly.Size = new System.Drawing.Size(328, 168); - this.oauth2Bitly.Status = "Login required."; - this.oauth2Bitly.TabIndex = 0; - this.oauth2Bitly.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2Bitly_OpenButtonClicked); - this.oauth2Bitly.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2Bitly_CompleteButtonClicked); - // - // oauth2GoogleURLShortener - // - this.oauth2GoogleURLShortener.Location = new System.Drawing.Point(16, 56); - this.oauth2GoogleURLShortener.LoginStatus = false; - this.oauth2GoogleURLShortener.Name = "oauth2GoogleURLShortener"; - this.oauth2GoogleURLShortener.Size = new System.Drawing.Size(328, 207); - this.oauth2GoogleURLShortener.Status = "Status: Login required."; - this.oauth2GoogleURLShortener.TabIndex = 1; - this.oauth2GoogleURLShortener.OpenButtonClicked += new UploadersLib.GUI.OAuth2Control.OpenButtonClickedEventHandler(this.oauth2GoogleURLShortener_OpenButtonClicked); - this.oauth2GoogleURLShortener.CompleteButtonClicked += new UploadersLib.GUI.OAuth2Control.CompleteButtonClickedEventHandler(this.oauth2GoogleURLShortener_CompleteButtonClicked); - this.oauth2GoogleURLShortener.RefreshButtonClicked += new UploadersLib.GUI.OAuth2Control.RefreshButtonClickedEventHandler(this.oauth2GoogleURLShortener_RefreshButtonClicked); - // - // atcGoogleURLShortenerAccountType - // - this.atcGoogleURLShortenerAccountType.Location = new System.Drawing.Point(8, 16); - this.atcGoogleURLShortenerAccountType.Name = "atcGoogleURLShortenerAccountType"; - this.atcGoogleURLShortenerAccountType.SelectedAccountType = UploadersLib.AccountType.Anonymous; - this.atcGoogleURLShortenerAccountType.Size = new System.Drawing.Size(214, 29); - this.atcGoogleURLShortenerAccountType.TabIndex = 0; - this.atcGoogleURLShortenerAccountType.AccountTypeChanged += new UploadersLib.GUI.AccountTypeControl.AccountTypeChangedEventHandler(this.atcGoogleURLShortenerAccountType_AccountTypeChanged); - // - // ucTwitterAccounts - // - this.ucTwitterAccounts.Dock = System.Windows.Forms.DockStyle.Fill; - this.ucTwitterAccounts.Location = new System.Drawing.Point(3, 3); - this.ucTwitterAccounts.Name = "ucTwitterAccounts"; - this.ucTwitterAccounts.Size = new System.Drawing.Size(798, 469); - this.ucTwitterAccounts.TabIndex = 0; - // // actRapidShareAccountType // this.actRapidShareAccountType.Location = new System.Drawing.Point(8, 16); @@ -3877,14 +3876,15 @@ private void InitializeComponent() this.actRapidShareAccountType.Size = new System.Drawing.Size(214, 29); this.actRapidShareAccountType.TabIndex = 16; // - // lblBoxFolderTip + // cbDropboxURLType // - this.lblBoxFolderTip.AutoSize = true; - this.lblBoxFolderTip.Location = new System.Drawing.Point(352, 424); - this.lblBoxFolderTip.Name = "lblBoxFolderTip"; - this.lblBoxFolderTip.Size = new System.Drawing.Size(304, 13); - this.lblBoxFolderTip.TabIndex = 10; - this.lblBoxFolderTip.Text = "Note: You can double click folder name to go inside that folder."; + this.cbDropboxURLType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbDropboxURLType.FormattingEnabled = true; + this.cbDropboxURLType.Location = new System.Drawing.Point(160, 174); + this.cbDropboxURLType.Name = "cbDropboxURLType"; + this.cbDropboxURLType.Size = new System.Drawing.Size(121, 21); + this.cbDropboxURLType.TabIndex = 20; + this.cbDropboxURLType.SelectedIndexChanged += new System.EventHandler(this.cbDropboxURLType_SelectedIndexChanged); // // UploadersConfigForm // @@ -4267,7 +4267,6 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtJiraConfigHelp; private System.Windows.Forms.TextBox txtJiraIssuePrefix; private System.Windows.Forms.Label lblJiraIssuePrefix; - private System.Windows.Forms.CheckBox cbDropboxShortURL; private System.Windows.Forms.TabPage tpMega; private System.Windows.Forms.Label lblMegaPassword; private System.Windows.Forms.Label lblMegaEmail; @@ -4335,5 +4334,6 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader chBoxFoldersName; private System.Windows.Forms.CheckBox cbBoxShare; private System.Windows.Forms.Label lblBoxFolderTip; + private System.Windows.Forms.ComboBox cbDropboxURLType; } } \ No newline at end of file diff --git a/UploadersLib/GUI/UploadersConfigForm.cs b/UploadersLib/GUI/UploadersConfigForm.cs index e12256ba6..4da39b00a 100644 --- a/UploadersLib/GUI/UploadersConfigForm.cs +++ b/UploadersLib/GUI/UploadersConfigForm.cs @@ -478,12 +478,12 @@ private void btnDropboxShowFiles_Click(object sender, EventArgs e) private void cbDropboxAutoCreateShareableLink_CheckedChanged(object sender, EventArgs e) { Config.DropboxAutoCreateShareableLink = cbDropboxAutoCreateShareableLink.Checked; - cbDropboxShortURL.Enabled = Config.DropboxAutoCreateShareableLink; + cbDropboxURLType.Enabled = Config.DropboxAutoCreateShareableLink; } - private void cbDropboxShortURL_CheckedChanged(object sender, EventArgs e) + private void cbDropboxURLType_SelectedIndexChanged(object sender, EventArgs e) { - Config.DropboxShortURL = cbDropboxShortURL.Checked; + Config.DropboxURLType = (DropboxURLType)cbDropboxURLType.SelectedIndex; } #endregion Dropbox diff --git a/UploadersLib/GUI/UploadersConfigForm.resx b/UploadersLib/GUI/UploadersConfigForm.resx index 729e9c971..8986f98c7 100644 --- a/UploadersLib/GUI/UploadersConfigForm.resx +++ b/UploadersLib/GUI/UploadersConfigForm.resx @@ -242,6 +242,9 @@ With this option, objects are cheaper to store, but have 99.99% durability, instead of 99.999999999%. This means that they may be lost from Amazon S3 at some point. + + 17, 17 + 72 diff --git a/UploadersLib/GUI/UploadersConfigFormGUI.cs b/UploadersLib/GUI/UploadersConfigFormGUI.cs index 72e389efb..6a32b9928 100644 --- a/UploadersLib/GUI/UploadersConfigFormGUI.cs +++ b/UploadersLib/GUI/UploadersConfigFormGUI.cs @@ -266,8 +266,9 @@ public void LoadSettings(UploadersConfig uploadersConfig) txtDropboxPath.Text = Config.DropboxUploadPath; cbDropboxAutoCreateShareableLink.Checked = Config.DropboxAutoCreateShareableLink; - cbDropboxShortURL.Enabled = Config.DropboxAutoCreateShareableLink; - cbDropboxShortURL.Checked = Config.DropboxShortURL; + cbDropboxURLType.Enabled = Config.DropboxAutoCreateShareableLink; + cbDropboxURLType.Items.AddRange(Helpers.GetEnumNamesProper()); + cbDropboxURLType.SelectedIndex = (int)Config.DropboxURLType; UpdateDropboxStatus(); // Google Drive diff --git a/UploadersLib/UploadersConfig.cs b/UploadersLib/UploadersConfig.cs index 56b1cde73..8a2617bd0 100644 --- a/UploadersLib/UploadersConfig.cs +++ b/UploadersLib/UploadersConfig.cs @@ -120,7 +120,7 @@ public class UploadersConfig : SettingsBase public DropboxAccountInfo DropboxAccountInfo = null; public string DropboxUploadPath = "Public/ShareX/%y/%mo"; public bool DropboxAutoCreateShareableLink = false; - public bool DropboxShortURL = true; + public DropboxURLType DropboxURLType = DropboxURLType.Default; // Google Drive