#130: Removed shutdown minus.com uploader

This commit is contained in:
Jaex 2017-10-19 16:31:30 +03:00
parent 27398925d3
commit 9a3f872575
13 changed files with 15 additions and 1295 deletions

View file

@ -1924,33 +1924,6 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Direct.
/// </summary>
internal static string MinusLinkType_Direct {
get {
return ResourceManager.GetString("MinusLinkType_Direct", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Page.
/// </summary>
internal static string MinusLinkType_Page {
get {
return ResourceManager.GetString("MinusLinkType_Page", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Raw.
/// </summary>
internal static string MinusLinkType_Raw {
get {
return ResourceManager.GetString("MinusLinkType_Raw", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>

View file

@ -1115,13 +1115,4 @@ Would you like to download it?</value>
<data name="PastebinExpiration_M1" xml:space="preserve">
<value>1 Month</value>
</data>
<data name="MinusLinkType_Direct" xml:space="preserve">
<value>Direct</value>
</data>
<data name="MinusLinkType_Page" xml:space="preserve">
<value>Page</value>
</data>
<data name="MinusLinkType_Raw" xml:space="preserve">
<value>Raw</value>
</data>
</root>

View file

@ -50,8 +50,6 @@ public static partial class APIKeys
public static string CopyConsumerSecret = "";
public static string HubicClientID = "";
public static string HubicClientSecret = "";
public static string MinusConsumerKey = "";
public static string MinusConsumerSecret = "";
public static string BoxClientID = "";
public static string BoxClientSecret = "";
public static string SendSpaceKey = "";

View file

@ -111,8 +111,6 @@ public enum FileDestination
Pushbullet,
[Description("SendSpace")]
SendSpace,
[Description("Minus")]
Minus,
[Description("Ge.tt")]
Ge_tt,
[Description("Hostr")]

View file

@ -1,394 +0,0 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2017 ShareX Team
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 Newtonsoft.Json;
using ShareX.HelpersLib;
using ShareX.UploadersLib.Properties;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
namespace ShareX.UploadersLib.FileUploaders
{
public class MinusFileUploaderService : FileUploaderService
{
public override FileDestination EnumValue { get; } = FileDestination.Minus;
public override Icon ServiceIcon => Resources.Minus;
public override bool CheckConfig(UploadersConfig config)
{
return config.MinusConfig != null && config.MinusConfig.MinusUser != null;
}
public override GenericUploader CreateUploader(UploadersConfig config, TaskReferenceHelper taskInfo)
{
return new Minus(config.MinusConfig, config.MinusOAuth2Info);
}
public override TabPage GetUploadersConfigTabPage(UploadersConfigForm form) => form.tpMinus;
}
public class Minus : FileUploader
{
private const string URL_HOST = "https://minus.com";
private const string URL_OAUTH_TOKEN = URL_HOST + "/oauth/token";
private const string URL_API = URL_HOST + "/api/v2";
public MinusOptions Config { get; set; }
public OAuth2Info AuthInfo { get; set; }
public Minus(MinusOptions config, OAuth2Info auth)
{
Config = config;
AuthInfo = auth;
}
public bool GetAccessToken()
{
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("grant_type", "password");
args.Add("client_id", AuthInfo.Client_ID);
args.Add("client_secret", AuthInfo.Client_Secret);
args.Add("scope", "read_public read_all upload_new modify_all");
args.Add("username", Config.Username);
args.Add("password", Config.Password);
string response = SendRequestMultiPart(URL_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 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("client_id", AuthInfo.Client_ID);
args.Add("client_secret", AuthInfo.Client_Secret);
args.Add("scope", AuthInfo.Token.scope);
args.Add("refresh_token", AuthInfo.Token.refresh_token);
string response = SendRequestMultiPart(URL_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("Login is required.");
return false;
}
return true;
}
private string GetActiveUserFolderURL()
{
MinusUser user = Config.MinusUser ?? (Config.MinusUser = GetActiveUser());
return URL_API + "/users/" + user.slug + "/folders?bearer_token=" + AuthInfo.Token.access_token;
}
public MinusUser GetActiveUser()
{
string url = URL_API + "/activeuser?bearer_token=" + AuthInfo.Token.access_token;
string response = SendRequest(HttpMethod.GET, url);
return JsonConvert.DeserializeObject<MinusUser>(response);
}
private MinusFolderListResponse GetUserFolderList()
{
string response = SendRequest(HttpMethod.GET, GetActiveUserFolderURL());
return JsonConvert.DeserializeObject<MinusFolderListResponse>(response);
}
public List<MinusFolder> ReadFolderList()
{
MinusFolderListResponse mflr = GetUserFolderList();
if (mflr.results != null && mflr.results.Length > 0)
{
Config.FolderList.Clear();
foreach (MinusFolder minusFolder in mflr.results)
{
Config.FolderList.Add(minusFolder);
}
}
else
{
MinusFolder mf = CreateFolder("ShareX", true);
if (mf != null)
{
Config.FolderList.Add(mf);
}
}
Config.FolderID = 0;
return Config.FolderList;
}
public MinusFolder CreateFolder(string name, bool is_public)
{
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("name", name);
args.Add("is_public", is_public.ToString().ToLower());
MinusFolder dir;
string response = SendRequestMultiPart(GetActiveUserFolderURL(), args);
if (!string.IsNullOrEmpty(response))
{
dir = JsonConvert.DeserializeObject<MinusFolder>(response);
if (dir != null && !string.IsNullOrEmpty(dir.id))
{
Config.FolderList.Add(dir);
return dir;
}
}
return null;
}
public bool DeleteFolder(int index)
{
if (index >= 0 && index < Config.FolderList.Count)
{
MinusFolder folder = Config.FolderList[index];
string url = string.Format("{0}/folders/{1}?bearer_token={2}", URL_API, folder.id, AuthInfo.Token.access_token);
try
{
string response = SendRequest(HttpMethod.DELETE, url);
}
catch
{
return false;
}
Config.FolderList.RemoveAt(index);
return true;
}
return false;
}
public override UploadResult Upload(Stream stream, string fileName)
{
if (!CheckAuthorization())
{
return null;
}
string url = string.Format("{0}/folders/{1}/files?bearer_token={2}", URL_API, Config.GetActiveFolder().id, AuthInfo.Token.access_token);
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("caption", fileName);
args.Add("filename", fileName);
UploadResult result = SendRequestFile(url, stream, fileName, "file", args);
if (result.IsSuccess)
{
MinusFile minusFile = JsonConvert.DeserializeObject<MinusFile>(result.Response);
if (minusFile != null)
{
string ext = Path.GetExtension(minusFile.name);
switch (Config.LinkType)
{
case MinusLinkType.Direct:
result.URL = string.Format("http://i.minus.com/i{0}{1}", minusFile.id, ext);
break;
case MinusLinkType.Page:
result.URL = string.Format("http://minus.com/l{0}", minusFile.id);
break;
case MinusLinkType.Raw:
result.URL = minusFile.url_rawfile;
break;
}
result.ShortenedURL = string.Format("http://i.min.us/i{0}{1}", minusFile.id, ext);
result.ThumbnailURL = string.Format("http://i.minus.com/j{0}_xs{1}", minusFile.id, ext);
}
}
return result;
}
}
public enum MinusLinkType // Localized
{
Direct,
Page,
Raw
}
public abstract class MinusListResponse
{
public int page { get; set; }
public string next { get; set; }
public int per_page { get; set; }
public int total { get; set; }
public int pages { get; set; }
public string previous { get; set; }
}
public class MinusFolderListResponse : MinusListResponse
{
public MinusFolder[] results { get; set; }
}
public class MinusFileListResponse : MinusListResponse
{
public MinusFile[] results { get; set; }
}
public class MinusOptions
{
public string Username { get; set; }
public string Password { get; set; }
public MinusUser MinusUser { get; set; }
public List<MinusFolder> FolderList { get; set; }
public int FolderID { get; set; }
public MinusLinkType LinkType { get; set; }
public MinusOptions()
{
FolderList = new List<MinusFolder>();
LinkType = MinusLinkType.Direct;
}
public MinusFolder GetActiveFolder()
{
return FolderList.ReturnIfValidIndex(FolderID);
}
}
public class MinusUser
{
public string username { get; set; }
public string display_name { get; set; }
public string description { get; set; }
public string email { get; set; }
public string slug { get; set; }
public string fb_profile_link { get; set; }
public string fb_username { get; set; }
public string twitter_screen_name { get; set; }
public int visits { get; set; }
public int karma { get; set; }
public int shared { get; set; }
public string folders { get; set; }
public string url { get; set; }
public string avatar { get; set; }
public long storage_used { get; set; }
public long storage_quota { get; set; }
public override string ToString()
{
return username;
}
}
public class MinusFolder
{
public string id { get; set; }
public string thumbnail_url { get; set; }
public string name { get; set; }
public bool is_public { get; set; }
public int view_count { get; set; }
public string creator { get; set; }
public int file_count { get; set; }
public DateTime date_last_updated { get; set; }
public string files { get; set; }
public string url { get; set; }
public override string ToString()
{
return name;
}
}
public class MinusFile
{
public string id { get; set; }
public string name { get; set; }
public string title { get; set; }
public string caption { get; set; }
public int width { get; set; }
public int height { get; set; }
public int filesize { get; set; }
public string mimetype { get; set; }
public string folder { get; set; }
public string url { get; set; }
public DateTime uploaded { get; set; }
public string url_rawfile { get; set; }
public string url_thumbnail { get; set; }
public override string ToString()
{
return url_rawfile;
}
}
}

View file

@ -368,23 +368,6 @@ private void InitializeComponent()
this.lblLocalhostrEmail = new System.Windows.Forms.Label();
this.txtLocalhostrPassword = new System.Windows.Forms.TextBox();
this.txtLocalhostrEmail = new System.Windows.Forms.TextBox();
this.tpMinus = new System.Windows.Forms.TabPage();
this.lblMinusURLType = new System.Windows.Forms.Label();
this.cbMinusURLType = new System.Windows.Forms.ComboBox();
this.gbMinusUserPass = new System.Windows.Forms.GroupBox();
this.lblMinusAuthStatus = new System.Windows.Forms.Label();
this.btnMinusRefreshAuth = new System.Windows.Forms.Button();
this.lblMinusPassword = new System.Windows.Forms.Label();
this.lblMinusUsername = new System.Windows.Forms.Label();
this.txtMinusPassword = new System.Windows.Forms.TextBox();
this.txtMinusUsername = new System.Windows.Forms.TextBox();
this.btnMinusAuth = new System.Windows.Forms.Button();
this.gbMinusUpload = new System.Windows.Forms.GroupBox();
this.btnMinusReadFolderList = new System.Windows.Forms.Button();
this.cbMinusPublic = new System.Windows.Forms.CheckBox();
this.btnMinusFolderAdd = new System.Windows.Forms.Button();
this.btnMinusFolderRemove = new System.Windows.Forms.Button();
this.cboMinusFolders = new System.Windows.Forms.ComboBox();
this.tpJira = new System.Windows.Forms.TabPage();
this.txtJiraIssuePrefix = new System.Windows.Forms.TextBox();
this.lblJiraIssuePrefix = new System.Windows.Forms.Label();
@ -697,9 +680,6 @@ private void InitializeComponent()
this.tpSendSpace.SuspendLayout();
this.tpGe_tt.SuspendLayout();
this.tpHostr.SuspendLayout();
this.tpMinus.SuspendLayout();
this.gbMinusUserPass.SuspendLayout();
this.gbMinusUpload.SuspendLayout();
this.tpJira.SuspendLayout();
this.gbJiraServer.SuspendLayout();
this.tpLambda.SuspendLayout();
@ -1816,7 +1796,6 @@ private void InitializeComponent()
this.tcFileUploaders.Controls.Add(this.tpSendSpace);
this.tcFileUploaders.Controls.Add(this.tpGe_tt);
this.tcFileUploaders.Controls.Add(this.tpHostr);
this.tcFileUploaders.Controls.Add(this.tpMinus);
this.tcFileUploaders.Controls.Add(this.tpJira);
this.tcFileUploaders.Controls.Add(this.tpLambda);
this.tcFileUploaders.Controls.Add(this.tpPomf);
@ -3252,127 +3231,6 @@ private void InitializeComponent()
this.txtLocalhostrEmail.Name = "txtLocalhostrEmail";
this.txtLocalhostrEmail.TextChanged += new System.EventHandler(this.txtLocalhostrEmail_TextChanged);
//
// tpMinus
//
this.tpMinus.Controls.Add(this.lblMinusURLType);
this.tpMinus.Controls.Add(this.cbMinusURLType);
this.tpMinus.Controls.Add(this.gbMinusUserPass);
this.tpMinus.Controls.Add(this.gbMinusUpload);
resources.ApplyResources(this.tpMinus, "tpMinus");
this.tpMinus.Name = "tpMinus";
this.tpMinus.UseVisualStyleBackColor = true;
//
// lblMinusURLType
//
resources.ApplyResources(this.lblMinusURLType, "lblMinusURLType");
this.lblMinusURLType.Name = "lblMinusURLType";
//
// cbMinusURLType
//
this.cbMinusURLType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbMinusURLType.FormattingEnabled = true;
resources.ApplyResources(this.cbMinusURLType, "cbMinusURLType");
this.cbMinusURLType.Name = "cbMinusURLType";
this.cbMinusURLType.SelectedIndexChanged += new System.EventHandler(this.cbMinusURLType_SelectedIndexChanged);
//
// gbMinusUserPass
//
this.gbMinusUserPass.Controls.Add(this.lblMinusAuthStatus);
this.gbMinusUserPass.Controls.Add(this.btnMinusRefreshAuth);
this.gbMinusUserPass.Controls.Add(this.lblMinusPassword);
this.gbMinusUserPass.Controls.Add(this.lblMinusUsername);
this.gbMinusUserPass.Controls.Add(this.txtMinusPassword);
this.gbMinusUserPass.Controls.Add(this.txtMinusUsername);
this.gbMinusUserPass.Controls.Add(this.btnMinusAuth);
resources.ApplyResources(this.gbMinusUserPass, "gbMinusUserPass");
this.gbMinusUserPass.Name = "gbMinusUserPass";
this.gbMinusUserPass.TabStop = false;
//
// lblMinusAuthStatus
//
resources.ApplyResources(this.lblMinusAuthStatus, "lblMinusAuthStatus");
this.lblMinusAuthStatus.Name = "lblMinusAuthStatus";
//
// btnMinusRefreshAuth
//
resources.ApplyResources(this.btnMinusRefreshAuth, "btnMinusRefreshAuth");
this.btnMinusRefreshAuth.Name = "btnMinusRefreshAuth";
this.btnMinusRefreshAuth.UseVisualStyleBackColor = true;
this.btnMinusRefreshAuth.Click += new System.EventHandler(this.btnAuthRefresh_Click);
//
// lblMinusPassword
//
resources.ApplyResources(this.lblMinusPassword, "lblMinusPassword");
this.lblMinusPassword.Name = "lblMinusPassword";
//
// lblMinusUsername
//
resources.ApplyResources(this.lblMinusUsername, "lblMinusUsername");
this.lblMinusUsername.Name = "lblMinusUsername";
//
// txtMinusPassword
//
resources.ApplyResources(this.txtMinusPassword, "txtMinusPassword");
this.txtMinusPassword.Name = "txtMinusPassword";
this.txtMinusPassword.UseSystemPasswordChar = true;
//
// txtMinusUsername
//
resources.ApplyResources(this.txtMinusUsername, "txtMinusUsername");
this.txtMinusUsername.Name = "txtMinusUsername";
//
// btnMinusAuth
//
resources.ApplyResources(this.btnMinusAuth, "btnMinusAuth");
this.btnMinusAuth.Name = "btnMinusAuth";
this.btnMinusAuth.UseVisualStyleBackColor = true;
this.btnMinusAuth.Click += new System.EventHandler(this.btnMinusAuth_Click);
//
// gbMinusUpload
//
this.gbMinusUpload.Controls.Add(this.btnMinusReadFolderList);
this.gbMinusUpload.Controls.Add(this.cbMinusPublic);
this.gbMinusUpload.Controls.Add(this.btnMinusFolderAdd);
this.gbMinusUpload.Controls.Add(this.btnMinusFolderRemove);
this.gbMinusUpload.Controls.Add(this.cboMinusFolders);
resources.ApplyResources(this.gbMinusUpload, "gbMinusUpload");
this.gbMinusUpload.Name = "gbMinusUpload";
this.gbMinusUpload.TabStop = false;
//
// btnMinusReadFolderList
//
resources.ApplyResources(this.btnMinusReadFolderList, "btnMinusReadFolderList");
this.btnMinusReadFolderList.Name = "btnMinusReadFolderList";
this.btnMinusReadFolderList.UseVisualStyleBackColor = true;
this.btnMinusReadFolderList.Click += new System.EventHandler(this.btnMinusReadFolderList_Click);
//
// cbMinusPublic
//
resources.ApplyResources(this.cbMinusPublic, "cbMinusPublic");
this.cbMinusPublic.Name = "cbMinusPublic";
this.cbMinusPublic.UseVisualStyleBackColor = true;
//
// btnMinusFolderAdd
//
resources.ApplyResources(this.btnMinusFolderAdd, "btnMinusFolderAdd");
this.btnMinusFolderAdd.Name = "btnMinusFolderAdd";
this.btnMinusFolderAdd.UseVisualStyleBackColor = true;
this.btnMinusFolderAdd.Click += new System.EventHandler(this.btnMinusFolderAdd_Click);
//
// btnMinusFolderRemove
//
resources.ApplyResources(this.btnMinusFolderRemove, "btnMinusFolderRemove");
this.btnMinusFolderRemove.Name = "btnMinusFolderRemove";
this.btnMinusFolderRemove.UseVisualStyleBackColor = true;
this.btnMinusFolderRemove.Click += new System.EventHandler(this.btnMinusFolderRemove_Click);
//
// cboMinusFolders
//
this.cboMinusFolders.FormattingEnabled = true;
resources.ApplyResources(this.cboMinusFolders, "cboMinusFolders");
this.cboMinusFolders.Name = "cboMinusFolders";
this.cboMinusFolders.SelectedIndexChanged += new System.EventHandler(this.cboMinusFolders_SelectedIndexChanged);
//
// tpJira
//
this.tpJira.Controls.Add(this.txtJiraIssuePrefix);
@ -5392,12 +5250,6 @@ private void InitializeComponent()
this.tpGe_tt.PerformLayout();
this.tpHostr.ResumeLayout(false);
this.tpHostr.PerformLayout();
this.tpMinus.ResumeLayout(false);
this.tpMinus.PerformLayout();
this.gbMinusUserPass.ResumeLayout(false);
this.gbMinusUserPass.PerformLayout();
this.gbMinusUpload.ResumeLayout(false);
this.gbMinusUpload.PerformLayout();
this.tpJira.ResumeLayout(false);
this.tpJira.PerformLayout();
this.gbJiraServer.ResumeLayout(false);
@ -5625,22 +5477,6 @@ private void InitializeComponent()
private System.Windows.Forms.Label lblLocalhostrEmail;
private System.Windows.Forms.TextBox txtLocalhostrPassword;
private System.Windows.Forms.TextBox txtLocalhostrEmail;
private System.Windows.Forms.Label lblMinusURLType;
private System.Windows.Forms.ComboBox cbMinusURLType;
private System.Windows.Forms.GroupBox gbMinusUserPass;
private System.Windows.Forms.Label lblMinusAuthStatus;
private System.Windows.Forms.Button btnMinusRefreshAuth;
private System.Windows.Forms.Label lblMinusPassword;
private System.Windows.Forms.Label lblMinusUsername;
private System.Windows.Forms.TextBox txtMinusPassword;
private System.Windows.Forms.TextBox txtMinusUsername;
private System.Windows.Forms.Button btnMinusAuth;
private System.Windows.Forms.GroupBox gbMinusUpload;
private System.Windows.Forms.Button btnMinusReadFolderList;
private System.Windows.Forms.CheckBox cbMinusPublic;
private System.Windows.Forms.Button btnMinusFolderAdd;
private System.Windows.Forms.Button btnMinusFolderRemove;
private System.Windows.Forms.ComboBox cboMinusFolders;
private System.Windows.Forms.TextBox txtJiraIssuePrefix;
private System.Windows.Forms.Label lblJiraIssuePrefix;
private System.Windows.Forms.GroupBox gbJiraServer;
@ -5943,7 +5779,6 @@ private void InitializeComponent()
internal System.Windows.Forms.TabPage tpSendSpace;
internal System.Windows.Forms.TabPage tpGe_tt;
internal System.Windows.Forms.TabPage tpHostr;
internal System.Windows.Forms.TabPage tpMinus;
internal System.Windows.Forms.TabPage tpJira;
internal System.Windows.Forms.TabPage tpLambda;
internal System.Windows.Forms.TabPage tpLithiio;

View file

@ -430,14 +430,6 @@ public void LoadSettings()
#endregion
#region Minus
cbMinusURLType.Items.Clear();
cbMinusURLType.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<MinusLinkType>());
MinusUpdateControls();
#endregion
#region Box
if (OAuth2Info.CheckOAuth(Config.BoxOAuth2Info))
@ -1975,99 +1967,6 @@ private void lvBoxFolders_MouseDoubleClick(object sender, MouseEventArgs e)
#endregion Box
#region Minus
private void btnMinusAuth_Click(object sender, EventArgs e)
{
MinusAuth();
}
private void btnAuthRefresh_Click(object sender, EventArgs e)
{
MinusAuthRefresh();
}
private void cboMinusFolders_SelectedIndexChanged(object sender, EventArgs e)
{
if (Config.MinusConfig != null)
{
Config.MinusConfig.FolderID = cboMinusFolders.SelectedIndex;
MinusFolder tempMf = Config.MinusConfig.GetActiveFolder();
cbMinusPublic.Checked = tempMf.is_public;
}
}
private void btnMinusFolderAdd_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(cboMinusFolders.Text) && !MinusHasFolder(cboMinusFolders.Text))
{
btnMinusFolderAdd.Enabled = false;
Minus minus = new Minus(Config.MinusConfig, Config.MinusOAuth2Info);
MinusFolder dir = minus.CreateFolder(cboMinusFolders.Text, cbMinusPublic.Checked);
if (dir != null)
{
cboMinusFolders.Items.Add(dir);
cboMinusFolders.SelectedIndex = cboMinusFolders.Items.Count - 1;
}
btnMinusFolderAdd.Enabled = true;
}
}
private void btnMinusFolderRemove_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(cboMinusFolders.Text) && MinusHasFolder(cboMinusFolders.Text))
{
btnMinusFolderRemove.Enabled = false;
Minus minus = new Minus(Config.MinusConfig, Config.MinusOAuth2Info);
int index = cboMinusFolders.SelectedIndex;
if (minus.DeleteFolder(index))
{
cboMinusFolders.Items.RemoveAt(index);
if (cboMinusFolders.Items.Count > 0)
{
cboMinusFolders.SelectedIndex = 0;
}
}
btnMinusFolderRemove.Enabled = true;
}
}
private void btnMinusReadFolderList_Click(object sender, EventArgs e)
{
if (Config.MinusConfig != null)
{
btnMinusReadFolderList.Enabled = false;
List<MinusFolder> tempListMf = new Minus(Config.MinusConfig, Config.MinusOAuth2Info).ReadFolderList();
if (tempListMf.Count > 0)
{
cboMinusFolders.Items.Clear();
cboMinusFolders.Items.AddRange(tempListMf.ToArray());
cboMinusFolders.SelectedIndex = Config.MinusConfig.FolderID;
}
btnMinusReadFolderList.Enabled = true;
}
}
private void cbMinusURLType_SelectedIndexChanged(object sender, EventArgs e)
{
if (Config.MinusConfig != null)
{
Config.MinusConfig.LinkType = (MinusLinkType)cbMinusURLType.SelectedIndex;
}
}
#endregion Minus
#region Email
private void txtSmtpServer_TextChanged(object sender, EventArgs e)
@ -3481,7 +3380,8 @@ private void btnCustomUploaderArgAdd_Click(object sender, EventArgs e)
if (uploader.Arguments.ContainsKey(name))
{
MessageBox.Show(Resources.UploadersConfigForm_An_argument_with_the_same_name_already_exists, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Warning);
MessageBox.Show(Resources.UploadersConfigForm_An_argument_with_the_same_name_already_exists, "ShareX",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
@ -3567,7 +3467,8 @@ private void btnCustomUploaderHeaderAdd_Click(object sender, EventArgs e)
if (uploader.Headers.ContainsKey(name))
{
MessageBox.Show(Resources.UploadersConfigForm_A_header_with_the_same_name_already_exists, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Warning);
MessageBox.Show(Resources.UploadersConfigForm_A_header_with_the_same_name_already_exists, "ShareX",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{

View file

@ -8824,456 +8824,6 @@ store.book[0].title</value>
<data name="&gt;&gt;tpHostr.ZOrder" xml:space="preserve">
<value>15</value>
</data>
<data name="lblMinusURLType.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblMinusURLType.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblMinusURLType.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 328</value>
</data>
<data name="lblMinusURLType.Size" type="System.Drawing.Size, System.Drawing">
<value>55, 13</value>
</data>
<data name="lblMinusURLType.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="lblMinusURLType.Text" xml:space="preserve">
<value>URL type:</value>
</data>
<data name="&gt;&gt;lblMinusURLType.Name" xml:space="preserve">
<value>lblMinusURLType</value>
</data>
<data name="&gt;&gt;lblMinusURLType.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblMinusURLType.Parent" xml:space="preserve">
<value>tpMinus</value>
</data>
<data name="&gt;&gt;lblMinusURLType.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="cbMinusURLType.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 344</value>
</data>
<data name="cbMinusURLType.Size" type="System.Drawing.Size, System.Drawing">
<value>88, 21</value>
</data>
<data name="cbMinusURLType.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;cbMinusURLType.Name" xml:space="preserve">
<value>cbMinusURLType</value>
</data>
<data name="&gt;&gt;cbMinusURLType.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cbMinusURLType.Parent" xml:space="preserve">
<value>tpMinus</value>
</data>
<data name="&gt;&gt;cbMinusURLType.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="lblMinusAuthStatus.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblMinusAuthStatus.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblMinusAuthStatus.Location" type="System.Drawing.Point, System.Drawing">
<value>256, 126</value>
</data>
<data name="lblMinusAuthStatus.Size" type="System.Drawing.Size, System.Drawing">
<value>67, 13</value>
</data>
<data name="lblMinusAuthStatus.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="lblMinusAuthStatus.Text" xml:space="preserve">
<value>Login status:</value>
</data>
<data name="&gt;&gt;lblMinusAuthStatus.Name" xml:space="preserve">
<value>lblMinusAuthStatus</value>
</data>
<data name="&gt;&gt;lblMinusAuthStatus.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblMinusAuthStatus.Parent" xml:space="preserve">
<value>gbMinusUserPass</value>
</data>
<data name="&gt;&gt;lblMinusAuthStatus.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnMinusRefreshAuth.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnMinusRefreshAuth.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 152</value>
</data>
<data name="btnMinusRefreshAuth.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 24</value>
</data>
<data name="btnMinusRefreshAuth.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnMinusRefreshAuth.Text" xml:space="preserve">
<value>Refresh authorization</value>
</data>
<data name="&gt;&gt;btnMinusRefreshAuth.Name" xml:space="preserve">
<value>btnMinusRefreshAuth</value>
</data>
<data name="&gt;&gt;btnMinusRefreshAuth.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnMinusRefreshAuth.Parent" xml:space="preserve">
<value>gbMinusUserPass</value>
</data>
<data name="&gt;&gt;btnMinusRefreshAuth.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="lblMinusPassword.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblMinusPassword.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblMinusPassword.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 72</value>
</data>
<data name="lblMinusPassword.Size" type="System.Drawing.Size, System.Drawing">
<value>56, 13</value>
</data>
<data name="lblMinusPassword.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="lblMinusPassword.Text" xml:space="preserve">
<value>Password:</value>
</data>
<data name="&gt;&gt;lblMinusPassword.Name" xml:space="preserve">
<value>lblMinusPassword</value>
</data>
<data name="&gt;&gt;lblMinusPassword.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblMinusPassword.Parent" xml:space="preserve">
<value>gbMinusUserPass</value>
</data>
<data name="&gt;&gt;lblMinusPassword.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="lblMinusUsername.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblMinusUsername.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblMinusUsername.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 24</value>
</data>
<data name="lblMinusUsername.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
</data>
<data name="lblMinusUsername.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="lblMinusUsername.Text" xml:space="preserve">
<value>Username:</value>
</data>
<data name="&gt;&gt;lblMinusUsername.Name" xml:space="preserve">
<value>lblMinusUsername</value>
</data>
<data name="&gt;&gt;lblMinusUsername.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblMinusUsername.Parent" xml:space="preserve">
<value>gbMinusUserPass</value>
</data>
<data name="&gt;&gt;lblMinusUsername.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="txtMinusPassword.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 88</value>
</data>
<data name="txtMinusPassword.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 20</value>
</data>
<data name="txtMinusPassword.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;txtMinusPassword.Name" xml:space="preserve">
<value>txtMinusPassword</value>
</data>
<data name="&gt;&gt;txtMinusPassword.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtMinusPassword.Parent" xml:space="preserve">
<value>gbMinusUserPass</value>
</data>
<data name="&gt;&gt;txtMinusPassword.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="txtMinusUsername.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 40</value>
</data>
<data name="txtMinusUsername.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 20</value>
</data>
<data name="txtMinusUsername.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;txtMinusUsername.Name" xml:space="preserve">
<value>txtMinusUsername</value>
</data>
<data name="&gt;&gt;txtMinusUsername.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtMinusUsername.Parent" xml:space="preserve">
<value>gbMinusUserPass</value>
</data>
<data name="&gt;&gt;txtMinusUsername.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="btnMinusAuth.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnMinusAuth.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 120</value>
</data>
<data name="btnMinusAuth.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 24</value>
</data>
<data name="btnMinusAuth.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnMinusAuth.Text" xml:space="preserve">
<value>Authorize</value>
</data>
<data name="&gt;&gt;btnMinusAuth.Name" xml:space="preserve">
<value>btnMinusAuth</value>
</data>
<data name="&gt;&gt;btnMinusAuth.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnMinusAuth.Parent" xml:space="preserve">
<value>gbMinusUserPass</value>
</data>
<data name="&gt;&gt;btnMinusAuth.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="gbMinusUserPass.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 16</value>
</data>
<data name="gbMinusUserPass.Size" type="System.Drawing.Size, System.Drawing">
<value>712, 200</value>
</data>
<data name="gbMinusUserPass.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="gbMinusUserPass.Text" xml:space="preserve">
<value>Authentication</value>
</data>
<data name="&gt;&gt;gbMinusUserPass.Name" xml:space="preserve">
<value>gbMinusUserPass</value>
</data>
<data name="&gt;&gt;gbMinusUserPass.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;gbMinusUserPass.Parent" xml:space="preserve">
<value>tpMinus</value>
</data>
<data name="&gt;&gt;gbMinusUserPass.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="btnMinusReadFolderList.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnMinusReadFolderList.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnMinusReadFolderList.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 24</value>
</data>
<data name="btnMinusReadFolderList.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 23</value>
</data>
<data name="btnMinusReadFolderList.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="btnMinusReadFolderList.Text" xml:space="preserve">
<value>Reload folder list</value>
</data>
<data name="&gt;&gt;btnMinusReadFolderList.Name" xml:space="preserve">
<value>btnMinusReadFolderList</value>
</data>
<data name="&gt;&gt;btnMinusReadFolderList.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnMinusReadFolderList.Parent" xml:space="preserve">
<value>gbMinusUpload</value>
</data>
<data name="&gt;&gt;btnMinusReadFolderList.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="cbMinusPublic.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cbMinusPublic.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="cbMinusPublic.Location" type="System.Drawing.Point, System.Drawing">
<value>464, 58</value>
</data>
<data name="cbMinusPublic.Size" type="System.Drawing.Size, System.Drawing">
<value>55, 17</value>
</data>
<data name="cbMinusPublic.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="cbMinusPublic.Text" xml:space="preserve">
<value>Public</value>
</data>
<data name="&gt;&gt;cbMinusPublic.Name" xml:space="preserve">
<value>cbMinusPublic</value>
</data>
<data name="&gt;&gt;cbMinusPublic.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cbMinusPublic.Parent" xml:space="preserve">
<value>gbMinusUpload</value>
</data>
<data name="&gt;&gt;cbMinusPublic.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnMinusFolderAdd.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnMinusFolderAdd.Location" type="System.Drawing.Point, System.Drawing">
<value>160, 24</value>
</data>
<data name="btnMinusFolderAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 23</value>
</data>
<data name="btnMinusFolderAdd.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="btnMinusFolderAdd.Text" xml:space="preserve">
<value>Add folder</value>
</data>
<data name="&gt;&gt;btnMinusFolderAdd.Name" xml:space="preserve">
<value>btnMinusFolderAdd</value>
</data>
<data name="&gt;&gt;btnMinusFolderAdd.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnMinusFolderAdd.Parent" xml:space="preserve">
<value>gbMinusUpload</value>
</data>
<data name="&gt;&gt;btnMinusFolderAdd.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="btnMinusFolderRemove.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnMinusFolderRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnMinusFolderRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>312, 24</value>
</data>
<data name="btnMinusFolderRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 23</value>
</data>
<data name="btnMinusFolderRemove.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="btnMinusFolderRemove.Text" xml:space="preserve">
<value>Remove folder</value>
</data>
<data name="&gt;&gt;btnMinusFolderRemove.Name" xml:space="preserve">
<value>btnMinusFolderRemove</value>
</data>
<data name="&gt;&gt;btnMinusFolderRemove.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnMinusFolderRemove.Parent" xml:space="preserve">
<value>gbMinusUpload</value>
</data>
<data name="&gt;&gt;btnMinusFolderRemove.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="cboMinusFolders.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 56</value>
</data>
<data name="cboMinusFolders.Size" type="System.Drawing.Size, System.Drawing">
<value>448, 21</value>
</data>
<data name="cboMinusFolders.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;cboMinusFolders.Name" xml:space="preserve">
<value>cboMinusFolders</value>
</data>
<data name="&gt;&gt;cboMinusFolders.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cboMinusFolders.Parent" xml:space="preserve">
<value>gbMinusUpload</value>
</data>
<data name="&gt;&gt;cboMinusFolders.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="gbMinusUpload.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 224</value>
</data>
<data name="gbMinusUpload.Size" type="System.Drawing.Size, System.Drawing">
<value>712, 88</value>
</data>
<data name="gbMinusUpload.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="gbMinusUpload.Text" xml:space="preserve">
<value>Upload images to</value>
</data>
<data name="&gt;&gt;gbMinusUpload.Name" xml:space="preserve">
<value>gbMinusUpload</value>
</data>
<data name="&gt;&gt;gbMinusUpload.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;gbMinusUpload.Parent" xml:space="preserve">
<value>tpMinus</value>
</data>
<data name="&gt;&gt;gbMinusUpload.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="tpMinus.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 40</value>
</data>
<data name="tpMinus.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="tpMinus.Size" type="System.Drawing.Size, System.Drawing">
<value>972, 519</value>
</data>
<data name="tpMinus.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="tpMinus.Text" xml:space="preserve">
<value>Minus</value>
</data>
<data name="&gt;&gt;tpMinus.Name" xml:space="preserve">
<value>tpMinus</value>
</data>
<data name="&gt;&gt;tpMinus.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tpMinus.Parent" xml:space="preserve">
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpMinus.ZOrder" xml:space="preserve">
<value>16</value>
</data>
<data name="txtJiraIssuePrefix.Location" type="System.Drawing.Point, System.Drawing">
<value>472, 277</value>
</data>
@ -9479,7 +9029,7 @@ store.book[0].title</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpJira.ZOrder" xml:space="preserve">
<value>17</value>
<value>16</value>
</data>
<data name="lblLambdaInfo.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -9638,7 +9188,7 @@ store.book[0].title</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpLambda.ZOrder" xml:space="preserve">
<value>18</value>
<value>17</value>
</data>
<data name="btnPomfTest.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -9848,7 +9398,7 @@ store.book[0].title</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpPomf.ZOrder" xml:space="preserve">
<value>19</value>
<value>18</value>
</data>
<data name="cbSeafileAPIURL.Items" xml:space="preserve">
<value>https://seacloud.cc/api2/</value>
@ -10809,7 +10359,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpSeafile.ZOrder" xml:space="preserve">
<value>20</value>
<value>19</value>
</data>
<data name="cbStreamableUseDirectURL.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -11010,7 +10560,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpStreamable.ZOrder" xml:space="preserve">
<value>21</value>
<value>20</value>
</data>
<data name="sulKeyLink.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -11118,7 +10668,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpSul.ZOrder" xml:space="preserve">
<value>22</value>
<value>21</value>
</data>
<data name="btnLithiioGetAPIKey.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -11223,7 +10773,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpLithiio.ZOrder" xml:space="preserve">
<value>23</value>
<value>22</value>
</data>
<data name="btnUpleaLogin.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -11598,7 +11148,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpUplea.ZOrder" xml:space="preserve">
<value>24</value>
<value>23</value>
</data>
<data name="cbPlikOneShot.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -12105,7 +11655,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpPlik.ZOrder" xml:space="preserve">
<value>25</value>
<value>24</value>
</data>
<data name="lblSharedFolderFiles.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -12312,7 +11862,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpSharedFolder.ZOrder" xml:space="preserve">
<value>26</value>
<value>25</value>
</data>
<data name="txtEmailAutomaticSendTo.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 408</value>
@ -12732,7 +12282,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpEmail.ZOrder" xml:space="preserve">
<value>27</value>
<value>26</value>
</data>
<data name="tcFileUploaders.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>

View file

@ -817,106 +817,6 @@ private void OneDriveAddFolder(OneDriveFileInfo folder, TreeNode tnParent)
#endregion OneDrive
#region Minus
public void MinusAuth()
{
if (!string.IsNullOrEmpty(txtMinusUsername.Text) && !string.IsNullOrEmpty(txtMinusPassword.Text))
{
btnMinusAuth.Enabled = false;
btnMinusRefreshAuth.Enabled = false;
try
{
Config.MinusConfig.Username = txtMinusUsername.Text;
Config.MinusConfig.Password = txtMinusPassword.Text;
Config.MinusOAuth2Info = new OAuth2Info(APIKeys.MinusConsumerKey, APIKeys.MinusConsumerSecret);
Minus minus = new Minus(Config.MinusConfig, Config.MinusOAuth2Info);
if (minus.GetAccessToken())
{
minus.ReadFolderList();
MinusUpdateControls();
MessageBox.Show(Resources.UploadersConfigForm_Login_successful, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show(Resources.UploadersConfigForm_Login_failed, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
catch (Exception ex)
{
ex.ShowError();
}
finally
{
btnMinusAuth.Enabled = true;
btnMinusRefreshAuth.Enabled = true;
}
}
}
public void MinusAuthRefresh()
{
btnMinusAuth.Enabled = false;
btnMinusRefreshAuth.Enabled = false;
try
{
if (OAuth2Info.CheckOAuth(Config.MinusOAuth2Info))
{
bool result = new Minus(Config.MinusConfig, Config.MinusOAuth2Info).RefreshAccessToken();
if (result)
{
MessageBox.Show(Resources.UploadersConfigForm_Login_successful, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show(Resources.UploadersConfigForm_Login_failed, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
catch (Exception ex)
{
ex.ShowError();
}
finally
{
btnMinusAuth.Enabled = true;
btnMinusRefreshAuth.Enabled = true;
}
}
public void MinusUpdateControls()
{
if (Config.MinusConfig != null && Config.MinusConfig.MinusUser != null && OAuth2Info.CheckOAuth(Config.MinusOAuth2Info))
{
lblMinusAuthStatus.Text = string.Format(Resources.UploadersConfigForm_MinusUpdateControls_Logged_in_as__0__, Config.MinusConfig.MinusUser.display_name);
txtMinusUsername.Text = Config.MinusConfig.Username;
txtMinusPassword.Text = Config.MinusConfig.Password;
cboMinusFolders.Items.Clear();
if (Config.MinusConfig.FolderList.Count > 0)
{
cboMinusFolders.Items.AddRange(Config.MinusConfig.FolderList.ToArray());
cboMinusFolders.SelectedIndex = Config.MinusConfig.FolderID.BetweenOrDefault(0, cboMinusFolders.Items.Count - 1);
}
cbMinusURLType.SelectedIndex = (int)Config.MinusConfig.LinkType;
}
else
{
lblMinusAuthStatus.Text = Resources.UploadersConfigForm_MinusUpdateControls_Not_logged_in_;
btnMinusRefreshAuth.Enabled = false;
}
}
private bool MinusHasFolder(string name)
{
return cboMinusFolders.Items.Cast<MinusFolder>().Any(mf => mf.name == name);
}
#endregion Minus
#region FTP
private bool FTPCheckAccount(int index)

View file

@ -858,24 +858,6 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Logged in as {0}..
/// </summary>
internal static string UploadersConfigForm_MinusUpdateControls_Logged_in_as__0__ {
get {
return ResourceManager.GetString("UploadersConfigForm_MinusUpdateControls_Logged_in_as__0__", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Not logged in..
/// </summary>
internal static string UploadersConfigForm_MinusUpdateControls_Not_logged_in_ {
get {
return ResourceManager.GetString("UploadersConfigForm_MinusUpdateControls_Not_logged_in_", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Refresh authorization is not supported..
/// </summary>

View file

@ -305,9 +305,6 @@ Created folders:</value>
<data name="UploadersConfigForm_FTPOpenClient_FTP_client_only_supports_FTP_or_FTPS_" xml:space="preserve">
<value>FTP client only supports FTP or FTPS.</value>
</data>
<data name="UploadersConfigForm_MinusUpdateControls_Not_logged_in_" xml:space="preserve">
<value>Not logged in.</value>
</data>
<data name="UploadersConfigForm_MegaConfigureTab_Configured" xml:space="preserve">
<value>Configured</value>
</data>
@ -326,9 +323,6 @@ Created folders:</value>
<data name="UploadersConfigForm_LoadSettings_Invalid_device_name" xml:space="preserve">
<value>Invalid device name</value>
</data>
<data name="UploadersConfigForm_MinusUpdateControls_Logged_in_as__0__" xml:space="preserve">
<value>Logged in as {0}.</value>
</data>
<data name="CustomFileUploader_Upload_Response_parse_failed_" xml:space="preserve">
<value>Response parse failed.</value>
</data>

View file

@ -160,7 +160,6 @@
<Compile Include="FileUploaders\Pomf.cs" />
<Compile Include="FileUploaders\PomfUploader.cs" />
<Compile Include="FileUploaders\SFTP.cs" />
<Compile Include="FileUploaders\Minus.cs" />
<Compile Include="FileUploaders\SharedFolderUploader.cs" />
<Compile Include="FileUploaders\Transfersh.cs" />
<Compile Include="FileUploaders\Uguu.cs" />

View file

@ -219,13 +219,6 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
#endregion
#region Minus
public OAuth2Info MinusOAuth2Info = null;
public MinusOptions MinusConfig = new MinusOptions();
#endregion
#region Box
public OAuth2Info BoxOAuth2Info = null;