From f9f2e6b2a881bfb6c674e2737cf3f0cc81d4a672 Mon Sep 17 00:00:00 2001 From: osfancy Date: Wed, 14 Sep 2016 02:04:02 -0400 Subject: [PATCH] Updating Uplea Configuration (#1906) * Initial check-in to address feature enhancement request #1466. * Checking in missing constructor parameter so fork is stable. * Wrapping up Uplea integration support for #1466. * Reverted Uploader.cs to earlier version as those changes weren't actually needed. * Removed use of DataContractJsonSerializer, using JSON .NET instead. Updated the Uplea class to not store the configuration object internally, but to only pull out the API key when the config is passed through its constructor. * Incorporating recent round of refactoring changes suggested by Jaex. * Addressing issue with user workflow on the Uplea destination configuration tab. * Attempt to reconcile UploadersConfigForm.resx. * Fixing the name for an unnamed label. Updating resx formatting for base64 encoded pbDropboxLogo.Image value; since the diff on GitHub was showing a material change although VS diff ignores the formatting difference. Removed unneeded string.Format from Upload() in Uplea along with the set for IsURLExpected (since it is already true by default). * Removed extra whitespace next to the end of the value tag since GitHub diff was still showing a difference. * Removing references to label4 from resx which weren't removed by VS automatically when the control was renamed. The new entries for the renamed control lblUpleaEmailAddress already exist in the file. * Updating Uplea config to not store the username/password entered on the Uplea configuration tab. Removed associated event handlers. Renamed Login button to Get API Key to be more representative of the action. Made the API key textbox editable so users can blank out the key if they wish to turn off Uplea integration. --- .../Forms/UploadersConfigForm.Designer.cs | 2 -- ShareX.UploadersLib/Forms/UploadersConfigForm.cs | 12 ------------ ShareX.UploadersLib/Forms/UploadersConfigForm.resx | 4 ++-- ShareX.UploadersLib/UploadersConfig.cs | 2 -- 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs b/ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs index 3792d85b9..d4fd7cb5c 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs +++ b/ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs @@ -3227,13 +3227,11 @@ private void InitializeComponent() // resources.ApplyResources(this.txtUpleaPassword, "txtUpleaPassword"); this.txtUpleaPassword.Name = "txtUpleaPassword"; - this.txtUpleaPassword.TextChanged += new System.EventHandler(this.txtUpleaPassword_TextChanged); // // txtUpleaUsername // resources.ApplyResources(this.txtUpleaUsername, "txtUpleaUsername"); this.txtUpleaUsername.Name = "txtUpleaUsername"; - this.txtUpleaUsername.TextChanged += new System.EventHandler(this.txtUpleaUsername_TextChanged); // // gbUpleaUserInformation // diff --git a/ShareX.UploadersLib/Forms/UploadersConfigForm.cs b/ShareX.UploadersLib/Forms/UploadersConfigForm.cs index 93385bcee..b4c8988e9 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigForm.cs +++ b/ShareX.UploadersLib/Forms/UploadersConfigForm.cs @@ -580,8 +580,6 @@ public void LoadSettings() // Uplea txtUpleaApiKey.Text = Config.UpleaApiKey; - txtUpleaUsername.Text = Config.UpleaUsername; - txtUpleaPassword.Text = Config.UpleaPassword; txtUpleaEmailAddress.Text = Config.UpleaEmailAddress; cbUpleaInstantDownloadEnabled.Checked = Config.UpleaInstantDownloadEnabled; cbUpleaIsPremium.Checked = Config.UpleaIsPremiumMember; @@ -2590,16 +2588,6 @@ private void btnUpleaLogin_Click(object sender, EventArgs e) } - private void txtUpleaUsername_TextChanged(object sender, EventArgs e) - { - Config.UpleaUsername = (sender as TextBox).Text; - } - - private void txtUpleaPassword_TextChanged(object sender, EventArgs e) - { - Config.UpleaPassword = (sender as TextBox).Text; - } - private void txtUpleaApiKey_TextChanged(object sender, EventArgs e) { Config.UpleaApiKey = (sender as TextBox).Text; diff --git a/ShareX.UploadersLib/Forms/UploadersConfigForm.resx b/ShareX.UploadersLib/Forms/UploadersConfigForm.resx index 0dc6d36fb..daee1d564 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigForm.resx +++ b/ShareX.UploadersLib/Forms/UploadersConfigForm.resx @@ -13652,7 +13652,7 @@ Using an encrypted library disables sharing. 13 - Login + Get API Key True @@ -13775,7 +13775,7 @@ Using an encrypted library disables sharing. Username: - False + True 81, 78 diff --git a/ShareX.UploadersLib/UploadersConfig.cs b/ShareX.UploadersLib/UploadersConfig.cs index 53f28ada8..eedaa5d35 100644 --- a/ShareX.UploadersLib/UploadersConfig.cs +++ b/ShareX.UploadersLib/UploadersConfig.cs @@ -289,8 +289,6 @@ public class UploadersConfig : SettingsBase // Uplea public string UpleaApiKey = string.Empty; - public string UpleaUsername = string.Empty; - public string UpleaPassword = string.Empty; public string UpleaEmailAddress = string.Empty; public bool UpleaIsPremiumMember = false; public bool UpleaInstantDownloadEnabled = false;