mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
ownCloud direct link
This commit is contained in:
parent
d1f9ce6a34
commit
5d80134937
5 changed files with 39 additions and 14 deletions
|
@ -934,7 +934,8 @@ public UploadResult UploadFile(Stream stream, string fileName)
|
||||||
fileUploader = new OwnCloud(Program.UploadersConfig.OwnCloudHost, Program.UploadersConfig.OwnCloudUsername, Program.UploadersConfig.OwnCloudPassword)
|
fileUploader = new OwnCloud(Program.UploadersConfig.OwnCloudHost, Program.UploadersConfig.OwnCloudUsername, Program.UploadersConfig.OwnCloudPassword)
|
||||||
{
|
{
|
||||||
Path = Program.UploadersConfig.OwnCloudPath,
|
Path = Program.UploadersConfig.OwnCloudPath,
|
||||||
CreateShare = Program.UploadersConfig.OwnCloudCreateShare
|
CreateShare = Program.UploadersConfig.OwnCloudCreateShare,
|
||||||
|
DirectLink = Program.UploadersConfig.OwnCloudDirectLink
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case FileDestination.Pushbullet:
|
case FileDestination.Pushbullet:
|
||||||
|
|
|
@ -42,6 +42,7 @@ public sealed class OwnCloud : FileUploader
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
public bool CreateShare { get; set; }
|
public bool CreateShare { get; set; }
|
||||||
|
public bool DirectLink { get; set; }
|
||||||
|
|
||||||
public OwnCloud(string host, string username, string password)
|
public OwnCloud(string host, string username, string password)
|
||||||
{
|
{
|
||||||
|
@ -114,7 +115,9 @@ public string ShareFile(string path)
|
||||||
{
|
{
|
||||||
if (result.ocs.data != null && result.ocs.meta.statuscode == 100)
|
if (result.ocs.data != null && result.ocs.meta.statuscode == 100)
|
||||||
{
|
{
|
||||||
return result.ocs.data.url;
|
string link = result.ocs.data.url;
|
||||||
|
if (DirectLink) link += "&download";
|
||||||
|
return link;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
38
UploadersLib/Forms/UploadersConfigForm.Designer.cs
generated
38
UploadersLib/Forms/UploadersConfigForm.Designer.cs
generated
|
@ -185,6 +185,8 @@ private void InitializeComponent()
|
||||||
this.cbGoogleDriveIsPublic = new System.Windows.Forms.CheckBox();
|
this.cbGoogleDriveIsPublic = new System.Windows.Forms.CheckBox();
|
||||||
this.oauth2GoogleDrive = new UploadersLib.OAuthControl();
|
this.oauth2GoogleDrive = new UploadersLib.OAuthControl();
|
||||||
this.tpOwnCloud = new System.Windows.Forms.TabPage();
|
this.tpOwnCloud = new System.Windows.Forms.TabPage();
|
||||||
|
this.cbOwnCloudDirectLink = new System.Windows.Forms.CheckBox();
|
||||||
|
this.cbOwnCloudCreateShare = new System.Windows.Forms.CheckBox();
|
||||||
this.txtOwnCloudPath = new System.Windows.Forms.TextBox();
|
this.txtOwnCloudPath = new System.Windows.Forms.TextBox();
|
||||||
this.txtOwnCloudPassword = new System.Windows.Forms.TextBox();
|
this.txtOwnCloudPassword = new System.Windows.Forms.TextBox();
|
||||||
this.txtOwnCloudUsername = new System.Windows.Forms.TextBox();
|
this.txtOwnCloudUsername = new System.Windows.Forms.TextBox();
|
||||||
|
@ -371,7 +373,6 @@ private void InitializeComponent()
|
||||||
this.ttlvMain = new HelpersLib.TabToListView();
|
this.ttlvMain = new HelpersLib.TabToListView();
|
||||||
this.lblWidthHint = new System.Windows.Forms.Label();
|
this.lblWidthHint = new System.Windows.Forms.Label();
|
||||||
this.actRapidShareAccountType = new UploadersLib.AccountTypeControl();
|
this.actRapidShareAccountType = new UploadersLib.AccountTypeControl();
|
||||||
this.cbOwnCloudCreateShare = new System.Windows.Forms.CheckBox();
|
|
||||||
this.tpOtherUploaders.SuspendLayout();
|
this.tpOtherUploaders.SuspendLayout();
|
||||||
this.tcOtherUploaders.SuspendLayout();
|
this.tcOtherUploaders.SuspendLayout();
|
||||||
this.tpCustomUploaders.SuspendLayout();
|
this.tpCustomUploaders.SuspendLayout();
|
||||||
|
@ -2047,6 +2048,7 @@ private void InitializeComponent()
|
||||||
//
|
//
|
||||||
// tpOwnCloud
|
// tpOwnCloud
|
||||||
//
|
//
|
||||||
|
this.tpOwnCloud.Controls.Add(this.cbOwnCloudDirectLink);
|
||||||
this.tpOwnCloud.Controls.Add(this.cbOwnCloudCreateShare);
|
this.tpOwnCloud.Controls.Add(this.cbOwnCloudCreateShare);
|
||||||
this.tpOwnCloud.Controls.Add(this.txtOwnCloudPath);
|
this.tpOwnCloud.Controls.Add(this.txtOwnCloudPath);
|
||||||
this.tpOwnCloud.Controls.Add(this.txtOwnCloudPassword);
|
this.tpOwnCloud.Controls.Add(this.txtOwnCloudPassword);
|
||||||
|
@ -2064,6 +2066,28 @@ private void InitializeComponent()
|
||||||
this.tpOwnCloud.Text = "ownCloud";
|
this.tpOwnCloud.Text = "ownCloud";
|
||||||
this.tpOwnCloud.UseVisualStyleBackColor = true;
|
this.tpOwnCloud.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// cbOwnCloudDirectLink
|
||||||
|
//
|
||||||
|
this.cbOwnCloudDirectLink.AutoSize = true;
|
||||||
|
this.cbOwnCloudDirectLink.Location = new System.Drawing.Point(19, 136);
|
||||||
|
this.cbOwnCloudDirectLink.Name = "cbOwnCloudDirectLink";
|
||||||
|
this.cbOwnCloudDirectLink.Size = new System.Drawing.Size(208, 17);
|
||||||
|
this.cbOwnCloudDirectLink.TabIndex = 9;
|
||||||
|
this.cbOwnCloudDirectLink.Text = "Direct link (Adds \"&&download\" to URL)";
|
||||||
|
this.cbOwnCloudDirectLink.UseVisualStyleBackColor = true;
|
||||||
|
this.cbOwnCloudDirectLink.CheckedChanged += new System.EventHandler(this.cbOwnCloudDirectLink_CheckedChanged);
|
||||||
|
//
|
||||||
|
// cbOwnCloudCreateShare
|
||||||
|
//
|
||||||
|
this.cbOwnCloudCreateShare.AutoSize = true;
|
||||||
|
this.cbOwnCloudCreateShare.Location = new System.Drawing.Point(19, 112);
|
||||||
|
this.cbOwnCloudCreateShare.Name = "cbOwnCloudCreateShare";
|
||||||
|
this.cbOwnCloudCreateShare.Size = new System.Drawing.Size(131, 17);
|
||||||
|
this.cbOwnCloudCreateShare.TabIndex = 8;
|
||||||
|
this.cbOwnCloudCreateShare.Text = "Create shareable URL";
|
||||||
|
this.cbOwnCloudCreateShare.UseVisualStyleBackColor = true;
|
||||||
|
this.cbOwnCloudCreateShare.CheckedChanged += new System.EventHandler(this.cbOwnCloudCreateShare_CheckedChanged);
|
||||||
|
//
|
||||||
// txtOwnCloudPath
|
// txtOwnCloudPath
|
||||||
//
|
//
|
||||||
this.txtOwnCloudPath.Location = new System.Drawing.Point(80, 84);
|
this.txtOwnCloudPath.Location = new System.Drawing.Point(80, 84);
|
||||||
|
@ -3969,17 +3993,6 @@ private void InitializeComponent()
|
||||||
this.actRapidShareAccountType.Size = new System.Drawing.Size(214, 29);
|
this.actRapidShareAccountType.Size = new System.Drawing.Size(214, 29);
|
||||||
this.actRapidShareAccountType.TabIndex = 16;
|
this.actRapidShareAccountType.TabIndex = 16;
|
||||||
//
|
//
|
||||||
// cbOwnCloudCreateShare
|
|
||||||
//
|
|
||||||
this.cbOwnCloudCreateShare.AutoSize = true;
|
|
||||||
this.cbOwnCloudCreateShare.Location = new System.Drawing.Point(19, 112);
|
|
||||||
this.cbOwnCloudCreateShare.Name = "cbOwnCloudCreateShare";
|
|
||||||
this.cbOwnCloudCreateShare.Size = new System.Drawing.Size(131, 17);
|
|
||||||
this.cbOwnCloudCreateShare.TabIndex = 8;
|
|
||||||
this.cbOwnCloudCreateShare.Text = "Create shareable URL";
|
|
||||||
this.cbOwnCloudCreateShare.UseVisualStyleBackColor = true;
|
|
||||||
this.cbOwnCloudCreateShare.CheckedChanged += new System.EventHandler(this.cbOwnCloudCreateShare_CheckedChanged);
|
|
||||||
//
|
|
||||||
// UploadersConfigForm
|
// UploadersConfigForm
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
@ -4438,5 +4451,6 @@ private void InitializeComponent()
|
||||||
private System.Windows.Forms.Label lblOwnCloudUsername;
|
private System.Windows.Forms.Label lblOwnCloudUsername;
|
||||||
private System.Windows.Forms.Label lblOwnCloudHost;
|
private System.Windows.Forms.Label lblOwnCloudHost;
|
||||||
private System.Windows.Forms.CheckBox cbOwnCloudCreateShare;
|
private System.Windows.Forms.CheckBox cbOwnCloudCreateShare;
|
||||||
|
private System.Windows.Forms.CheckBox cbOwnCloudDirectLink;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -483,6 +483,7 @@ public void LoadSettings(UploadersConfig uploadersConfig)
|
||||||
txtOwnCloudPassword.Text = Config.OwnCloudPassword;
|
txtOwnCloudPassword.Text = Config.OwnCloudPassword;
|
||||||
txtOwnCloudPath.Text = Config.OwnCloudPath;
|
txtOwnCloudPath.Text = Config.OwnCloudPath;
|
||||||
cbOwnCloudCreateShare.Checked = Config.OwnCloudCreateShare;
|
cbOwnCloudCreateShare.Checked = Config.OwnCloudCreateShare;
|
||||||
|
cbOwnCloudDirectLink.Checked = Config.OwnCloudDirectLink;
|
||||||
|
|
||||||
#endregion File uploaders
|
#endregion File uploaders
|
||||||
|
|
||||||
|
@ -1668,6 +1669,11 @@ private void cbOwnCloudCreateShare_CheckedChanged(object sender, EventArgs e)
|
||||||
Config.OwnCloudCreateShare = cbOwnCloudCreateShare.Checked;
|
Config.OwnCloudCreateShare = cbOwnCloudCreateShare.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void cbOwnCloudDirectLink_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Config.OwnCloudDirectLink = cbOwnCloudDirectLink.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion ownCloud
|
#endregion ownCloud
|
||||||
|
|
||||||
#region Pushbullet
|
#region Pushbullet
|
||||||
|
|
|
@ -211,6 +211,7 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
|
||||||
public string OwnCloudPassword = "";
|
public string OwnCloudPassword = "";
|
||||||
public string OwnCloudPath = "/";
|
public string OwnCloudPath = "/";
|
||||||
public bool OwnCloudCreateShare = true;
|
public bool OwnCloudCreateShare = true;
|
||||||
|
public bool OwnCloudDirectLink = false;
|
||||||
|
|
||||||
#endregion File uploaders
|
#endregion File uploaders
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue