mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Amazon S3 UI related changes
This commit is contained in:
parent
5541d6136f
commit
23c6c27dfb
5 changed files with 8228 additions and 2369 deletions
|
@ -155,7 +155,7 @@ private string GetUploadPath(string fileName)
|
|||
return URLHelpers.CombineURL(path, fileName);
|
||||
}
|
||||
|
||||
private string GenerateURL(string fileName)
|
||||
public string GenerateURL(string fileName)
|
||||
{
|
||||
string uploadPath = GetUploadPath(fileName);
|
||||
return URLHelpers.CombineURL($"https://s3.{Settings.Endpoint}.amazonaws.com", Settings.Bucket, uploadPath);
|
||||
|
|
|
@ -479,6 +479,7 @@ private void InitializeComponent()
|
|||
this.lblPaste_eeUserAPIKey = new System.Windows.Forms.Label();
|
||||
this.txtPaste_eeUserAPIKey = new System.Windows.Forms.TextBox();
|
||||
this.tpGist = new System.Windows.Forms.TabPage();
|
||||
this.lblGistCustomURLExample = new System.Windows.Forms.Label();
|
||||
this.lblGistOAuthInfo = new System.Windows.Forms.Label();
|
||||
this.lblGistCustomURL = new System.Windows.Forms.Label();
|
||||
this.txtGistCustomURL = new System.Windows.Forms.TextBox();
|
||||
|
@ -594,7 +595,6 @@ private void InitializeComponent()
|
|||
this.lblWidthHint = new System.Windows.Forms.Label();
|
||||
this.ttlvMain = new ShareX.HelpersLib.TabToListView();
|
||||
this.actRapidShareAccountType = new ShareX.UploadersLib.AccountTypeControl();
|
||||
this.lblGistCustomURLExample = new System.Windows.Forms.Label();
|
||||
this.tpOtherUploaders.SuspendLayout();
|
||||
this.tcOtherUploaders.SuspendLayout();
|
||||
this.tpTwitter.SuspendLayout();
|
||||
|
@ -2198,11 +2198,10 @@ private void InitializeComponent()
|
|||
//
|
||||
// cbAmazonS3Endpoint
|
||||
//
|
||||
this.cbAmazonS3Endpoint.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbAmazonS3Endpoint.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cbAmazonS3Endpoint, "cbAmazonS3Endpoint");
|
||||
this.cbAmazonS3Endpoint.Name = "cbAmazonS3Endpoint";
|
||||
this.cbAmazonS3Endpoint.SelectionChangeCommitted += new System.EventHandler(this.cbAmazonS3Endpoint_SelectionChangeCommitted);
|
||||
this.cbAmazonS3Endpoint.TextChanged += new System.EventHandler(this.cbAmazonS3Endpoint_TextChanged);
|
||||
//
|
||||
// lblAmazonS3BucketName
|
||||
//
|
||||
|
@ -3969,6 +3968,11 @@ private void InitializeComponent()
|
|||
this.tpGist.Name = "tpGist";
|
||||
this.tpGist.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblGistCustomURLExample
|
||||
//
|
||||
resources.ApplyResources(this.lblGistCustomURLExample, "lblGistCustomURLExample");
|
||||
this.lblGistCustomURLExample.Name = "lblGistCustomURLExample";
|
||||
//
|
||||
// lblGistOAuthInfo
|
||||
//
|
||||
resources.ApplyResources(this.lblGistOAuthInfo, "lblGistOAuthInfo");
|
||||
|
@ -4798,11 +4802,6 @@ private void InitializeComponent()
|
|||
this.actRapidShareAccountType.Name = "actRapidShareAccountType";
|
||||
this.actRapidShareAccountType.SelectedAccountType = ShareX.UploadersLib.AccountType.Anonymous;
|
||||
//
|
||||
// lblGistCustomURLExample
|
||||
//
|
||||
resources.ApplyResources(this.lblGistCustomURLExample, "lblGistCustomURLExample");
|
||||
this.lblGistCustomURLExample.Name = "lblGistCustomURLExample";
|
||||
//
|
||||
// UploadersConfigForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
|
|
|
@ -522,10 +522,7 @@ public void LoadSettings()
|
|||
txtAmazonS3CustomDomain.Enabled = Config.AmazonS3Settings.UseCustomCNAME;
|
||||
txtAmazonS3CustomDomain.Text = Config.AmazonS3Settings.CustomDomain;
|
||||
cbAmazonS3UseRRS.Checked = Config.AmazonS3Settings.UseReducedRedundancyStorage;
|
||||
|
||||
//cbAmazonS3Endpoint.Items.AddRange(AmazonS3.RegionEndpoints.ToArray());
|
||||
//cbAmazonS3Endpoint.SelectedItem = AmazonS3.GetCurrentRegion(Config.AmazonS3Settings);
|
||||
cbAmazonS3Endpoint.DisplayMember = "Name";
|
||||
cbAmazonS3Endpoint.Text = Config.AmazonS3Settings.Endpoint;
|
||||
UpdateAmazonS3Status();
|
||||
|
||||
// ownCloud
|
||||
|
@ -1975,14 +1972,9 @@ private void txtAmazonS3SecretKey_TextChanged(object sender, EventArgs e)
|
|||
Config.AmazonS3Settings.SecretAccessKey = txtAmazonS3SecretKey.Text;
|
||||
}
|
||||
|
||||
private void cbAmazonS3Endpoint_SelectionChangeCommitted(object sender, EventArgs e)
|
||||
private void cbAmazonS3Endpoint_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
/*AmazonS3Region region = cbAmazonS3Endpoint.SelectedItem as AmazonS3Region;
|
||||
if (region != null)
|
||||
{
|
||||
Config.AmazonS3Settings.Endpoint = region.Identifier;
|
||||
UpdateAmazonS3Status();
|
||||
}*/
|
||||
Config.AmazonS3Settings.Endpoint = cbAmazonS3Endpoint.Text;
|
||||
}
|
||||
|
||||
private void txtAmazonS3BucketName_TextChanged(object sender, EventArgs e)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -528,7 +528,7 @@ private void UpdateDropboxStatus()
|
|||
|
||||
private void UpdateAmazonS3Status()
|
||||
{
|
||||
//lblAmazonS3PathPreview.Text = new AmazonS3(Config.AmazonS3Settings).GetURL("Example.png");
|
||||
lblAmazonS3PathPreview.Text = new AmazonS3(Config.AmazonS3Settings).GenerateURL("Example.png");
|
||||
}
|
||||
|
||||
#endregion Amazon S3
|
||||
|
|
Loading…
Reference in a new issue