Rename link variables

This commit is contained in:
Jaex 2022-05-15 00:32:09 +03:00
parent 6a559719f8
commit f1734a3474
21 changed files with 54 additions and 54 deletions

View file

@ -27,23 +27,23 @@ namespace ShareX.HelpersLib
{ {
public static class Links public static class Links
{ {
public const string URL_WEBSITE = "https://getsharex.com"; public const string Website = "https://getsharex.com";
public const string URL_GITHUB = "https://github.com/ShareX/ShareX"; public const string GitHub = "https://github.com/ShareX/ShareX";
public const string URL_ISSUES = URL_GITHUB + "/issues?q=is%3Aissue"; public const string GitHubIssues = GitHub + "/issues?q=is%3Aissue";
public const string URL_CALLBACK = URL_WEBSITE + "/callback/"; public const string Callback = Website + "/callback/";
public const string URL_CHANGELOG = URL_WEBSITE + "/changelog"; public const string Changelog = Website + "/changelog";
public const string URL_DONATE = URL_WEBSITE + "/donate"; public const string Donate = Website + "/donate";
public const string URL_PRIVACY_POLICY = URL_WEBSITE + "/privacy-policy"; public const string PrivacyPolicy = Website + "/privacy-policy";
public const string URL_IMAGE_EFFECTS = URL_WEBSITE + "/image-effects"; public const string ImageEffects = Website + "/image-effects";
public const string URL_ACTIONS = URL_WEBSITE + "/actions"; public const string Actions = Website + "/actions";
public const string URL_JAEX = "https://github.com/Jaex"; public const string Jaex = "https://github.com/Jaex";
public const string URL_MCORED = "https://github.com/McoreD"; public const string McoreD = "https://github.com/McoreD";
public const string URL_STEAM = "http://store.steampowered.com/app/400040/"; public const string Steam = "http://store.steampowered.com/app/400040/";
public const string URL_DISCORD = "https://discord.gg/ShareX"; public const string Discord = "https://discord.gg/ShareX";
public const string URL_TWITTER = "https://twitter.com/ShareX"; public const string Twitter = "https://twitter.com/ShareX";
private const string URL_DOCS = URL_WEBSITE + "/docs"; private const string Docs = Website + "/docs";
public const string URL_CUSTOM_UPLOADER = URL_DOCS + "/custom-uploader"; public const string DocsCustomUploader = Docs + "/custom-uploader";
public const string URL_REGION_CAPTURE = URL_DOCS + "/region-capture"; public const string DocsRegionCapture = Docs + "/region-capture";
public const string URL_CUSTOM_UPLOADERS = "https://github.com/ShareX/CustomUploaders"; public const string CustomUploaders = "https://github.com/ShareX/CustomUploaders";
} }
} }

View file

@ -118,7 +118,7 @@ private void UpdateMessageBox_Shown(object sender, EventArgs e)
private void lblViewChangelog_Click(object sender, EventArgs e) private void lblViewChangelog_Click(object sender, EventArgs e)
{ {
URLHelpers.OpenURL(Links.URL_CHANGELOG); URLHelpers.OpenURL(Links.Changelog);
} }
private void cbDontShow_CheckedChanged(object sender, EventArgs e) private void cbDontShow_CheckedChanged(object sender, EventArgs e)

View file

@ -753,7 +753,7 @@ private void btnPackager_Click(object sender, EventArgs e)
private void btnImageEffects_Click(object sender, EventArgs e) private void btnImageEffects_Click(object sender, EventArgs e)
{ {
URLHelpers.OpenURL(Links.URL_IMAGE_EFFECTS); URLHelpers.OpenURL(Links.ImageEffects);
} }
private void tsmiLoadImageFromFile_Click(object sender, EventArgs e) private void tsmiLoadImageFromFile_Click(object sender, EventArgs e)

View file

@ -160,7 +160,7 @@ private string GetFileNameRow(FileInfo fi)
private string GetFooter() private string GetFooter()
{ {
return $"Generated by <a href=\"{Links.URL_WEBSITE}\">ShareX Directory Indexer</a> on {DateTime.UtcNow:yyyy-MM-dd 'at' HH:mm:ss 'UTC'}"; return $"Generated by <a href=\"{Links.Website}\">ShareX Directory Indexer</a> on {DateTime.UtcNow:yyyy-MM-dd 'at' HH:mm:ss 'UTC'}";
} }
private string GetCssStyle() private string GetCssStyle()

View file

@ -112,7 +112,7 @@ private string GetFileNameRow(FileInfo fi, int level)
private string GetFooter() private string GetFooter()
{ {
return $"Generated by ShareX Directory Indexer on {DateTime.UtcNow:yyyy-MM-dd 'at' HH:mm:ss 'UTC'}. Latest version can be downloaded from: {Links.URL_WEBSITE}"; return $"Generated by ShareX Directory Indexer on {DateTime.UtcNow:yyyy-MM-dd 'at' HH:mm:ss 'UTC'}. Latest version can be downloaded from: {Links.Website}";
} }
} }
} }

View file

@ -1084,7 +1084,7 @@ internal void CreateToolbar()
} }
} }
URLHelpers.OpenURL(Links.URL_REGION_CAPTURE); URLHelpers.OpenURL(Links.DocsRegionCapture);
}; };
tsddbOptions.DropDownItems.Add(tsmiKeybinds); tsddbOptions.DropDownItems.Add(tsmiKeybinds);

View file

@ -68,7 +68,7 @@ public Copy(OAuthInfo oauth, CopyAccountInfo accountInfo) : this(oauth)
public string GetAuthorizationURL() public string GetAuthorizationURL()
{ {
Dictionary<string, string> args = new Dictionary<string, string>(); Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("oauth_callback", Links.URL_CALLBACK); args.Add("oauth_callback", Links.Callback);
return GetAuthorizationURL(URLRequestToken, URLAuthorize, AuthInfo, args); return GetAuthorizationURL(URLRequestToken, URLAuthorize, AuthInfo, args);
} }

View file

@ -96,7 +96,7 @@ public string GetAuthorizationURL()
args.Add("scope", "all"); args.Add("scope", "all");
args.Add("state", "ShareX"); args.Add("state", "ShareX");
args.Add("response_type", "code"); args.Add("response_type", "code");
args.Add("redirect_uri", Links.URL_CALLBACK); args.Add("redirect_uri", Links.Callback);
return URLHelpers.CreateQueryString(URL_AUTHORIZE, args); return URLHelpers.CreateQueryString(URL_AUTHORIZE, args);
} }
@ -108,7 +108,7 @@ public bool GetAccessToken(string code)
client_id = AuthInfo.Client_ID, client_id = AuthInfo.Client_ID,
client_secret = AuthInfo.Client_Secret, client_secret = AuthInfo.Client_Secret,
grant_type = "authorization_code", grant_type = "authorization_code",
redirect_uri = Links.URL_CALLBACK, redirect_uri = Links.Callback,
code = code code = code
}); });

View file

@ -85,7 +85,7 @@ public string GetAuthorizationURL()
args.Add("client_id", AuthInfo.Client_ID); args.Add("client_id", AuthInfo.Client_ID);
args.Add("scope", "offline_access files.readwrite"); args.Add("scope", "offline_access files.readwrite");
args.Add("response_type", "code"); args.Add("response_type", "code");
args.Add("redirect_uri", Links.URL_CALLBACK); args.Add("redirect_uri", Links.Callback);
if (AuthInfo.Proof != null) if (AuthInfo.Proof != null)
{ {
args.Add("code_challenge", AuthInfo.Proof.CodeChallenge); args.Add("code_challenge", AuthInfo.Proof.CodeChallenge);
@ -99,7 +99,7 @@ public bool GetAccessToken(string code)
{ {
Dictionary<string, string> args = new Dictionary<string, string>(); Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("client_id", AuthInfo.Client_ID); args.Add("client_id", AuthInfo.Client_ID);
args.Add("redirect_uri", Links.URL_CALLBACK); args.Add("redirect_uri", Links.Callback);
args.Add("client_secret", AuthInfo.Client_Secret); args.Add("client_secret", AuthInfo.Client_Secret);
args.Add("code", code); args.Add("code", code);
args.Add("grant_type", "authorization_code"); args.Add("grant_type", "authorization_code");

View file

@ -142,7 +142,7 @@ public bool GetAccessToken(string code)
args.Add("client_id", AuthInfo.Client_ID); args.Add("client_id", AuthInfo.Client_ID);
args.Add("client_secret", AuthInfo.Client_Secret); args.Add("client_secret", AuthInfo.Client_Secret);
args.Add("grant_type", "authorization_code"); args.Add("grant_type", "authorization_code");
args.Add("redirect_uri", Links.URL_CALLBACK); args.Add("redirect_uri", Links.Callback);
args.Add("code", code); args.Add("code", code);
string response = SendRequestURLEncoded(HttpMethod.POST, AuthUrl + "/connect/token", args); string response = SendRequestURLEncoded(HttpMethod.POST, AuthUrl + "/connect/token", args);
@ -165,7 +165,7 @@ public string GetAuthorizationURL()
{ {
Dictionary<string, string> args = new Dictionary<string, string>(); Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("response_type", "code"); args.Add("response_type", "code");
args.Add("redirect_uri", Links.URL_CALLBACK); args.Add("redirect_uri", Links.Callback);
args.Add("scope", "openid teknik-api.write offline_access"); args.Add("scope", "openid teknik-api.write offline_access");
args.Add("client_id", AuthInfo.Client_ID); args.Add("client_id", AuthInfo.Client_ID);

View file

@ -652,12 +652,12 @@ private async Task TestCustomUploader(CustomUploaderDestinationType type, int in
break; break;
case CustomUploaderDestinationType.URLShortener: case CustomUploaderDestinationType.URLShortener:
CustomURLShortener urlShortener = new CustomURLShortener(item); CustomURLShortener urlShortener = new CustomURLShortener(item);
result = urlShortener.ShortenURL(Links.URL_WEBSITE); result = urlShortener.ShortenURL(Links.Website);
result.Errors.AddRange(urlShortener.Errors); result.Errors.AddRange(urlShortener.Errors);
break; break;
case CustomUploaderDestinationType.URLSharingService: case CustomUploaderDestinationType.URLSharingService:
CustomURLSharer urlSharer = new CustomURLSharer(item); CustomURLSharer urlSharer = new CustomURLSharer(item);
result = urlSharer.ShareURL(Links.URL_WEBSITE); result = urlSharer.ShareURL(Links.Website);
result.Errors.AddRange(urlSharer.Errors); result.Errors.AddRange(urlSharer.Errors);
break; break;
} }
@ -885,12 +885,12 @@ private void eiCustomUploaders_ImportCompleted()
private void tsmiCustomUploaderGuide_Click(object sender, EventArgs e) private void tsmiCustomUploaderGuide_Click(object sender, EventArgs e)
{ {
URLHelpers.OpenURL(Links.URL_CUSTOM_UPLOADER); URLHelpers.OpenURL(Links.DocsCustomUploader);
} }
private void tsmiCustomUploaderExamples_Click(object sender, EventArgs e) private void tsmiCustomUploaderExamples_Click(object sender, EventArgs e)
{ {
URLHelpers.OpenURL(Links.URL_CUSTOM_UPLOADERS); URLHelpers.OpenURL(Links.CustomUploaders);
} }
private void tsmiClearUploaders_Click(object sender, EventArgs e) private void tsmiClearUploaders_Click(object sender, EventArgs e)

View file

@ -496,7 +496,7 @@ private void LoadFileUploaderSettings()
- Consumer Name: {1} - Consumer Name: {1}
- Public Key (without quotes): '{3}' - Public Key (without quotes): '{3}'
- You can now authenticate to Jira", Links.URL_WEBSITE, "ShareX", APIKeys.JiraConsumerKey, Jira.PublicKey); - You can now authenticate to Jira", Links.Website, "ShareX", APIKeys.JiraConsumerKey, Jira.PublicKey);
} }
catch (Exception e) catch (Exception e)
{ {

View file

@ -73,7 +73,7 @@ public FlickrUploader(OAuthInfo oauth, FlickrSettings settings)
public string GetAuthorizationURL() public string GetAuthorizationURL()
{ {
Dictionary<string, string> args = new Dictionary<string, string>(); Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("oauth_callback", Links.URL_CALLBACK); args.Add("oauth_callback", Links.Callback);
string url = GetAuthorizationURL("https://www.flickr.com/services/oauth/request_token", "https://www.flickr.com/services/oauth/authorize", AuthInfo, args); string url = GetAuthorizationURL("https://www.flickr.com/services/oauth/request_token", "https://www.flickr.com/services/oauth/authorize", AuthInfo, args);

View file

@ -78,7 +78,7 @@ public string GetAuthorizationURL()
{ {
Dictionary<string, string> args = new Dictionary<string, string>(); Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("client_id", AuthInfo.Client_ID); args.Add("client_id", AuthInfo.Client_ID);
args.Add("redirect_uri", Links.URL_CALLBACK); args.Add("redirect_uri", Links.Callback);
args.Add("scope", "gist"); args.Add("scope", "gist");
return URLHelpers.CreateQueryString("https://github.com/login/oauth/authorize", args); return URLHelpers.CreateQueryString("https://github.com/login/oauth/authorize", args);

View file

@ -80,7 +80,7 @@ public string GetAuthorizationURL()
{ {
Dictionary<string, string> args = new Dictionary<string, string>(); Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("client_id", AuthInfo.Client_ID); args.Add("client_id", AuthInfo.Client_ID);
args.Add("redirect_uri", Links.URL_CALLBACK); args.Add("redirect_uri", Links.Callback);
return URLHelpers.CreateQueryString("https://bitly.com/oauth/authorize", args); return URLHelpers.CreateQueryString("https://bitly.com/oauth/authorize", args);
} }
@ -91,7 +91,7 @@ public bool GetAccessToken(string code)
args.Add("client_id", AuthInfo.Client_ID); args.Add("client_id", AuthInfo.Client_ID);
args.Add("client_secret", AuthInfo.Client_Secret); args.Add("client_secret", AuthInfo.Client_Secret);
args.Add("code", code); args.Add("code", code);
args.Add("redirect_uri", Links.URL_CALLBACK); args.Add("redirect_uri", Links.Callback);
string response = SendRequestURLEncoded(HttpMethod.POST, URLAccessToken, args); string response = SendRequestURLEncoded(HttpMethod.POST, URLAccessToken, args);

View file

@ -64,15 +64,15 @@ public AboutForm()
#endif #endif
rtbInfo.AppendLine(Resources.AboutForm_AboutForm_Links, FontStyle.Bold, 13); rtbInfo.AppendLine(Resources.AboutForm_AboutForm_Links, FontStyle.Bold, 13);
rtbInfo.AppendLine($@"{Resources.AboutForm_AboutForm_Website}: {Links.URL_WEBSITE} rtbInfo.AppendLine($@"{Resources.AboutForm_AboutForm_Website}: {Links.Website}
{Resources.AboutForm_AboutForm_Project_page}: {Links.URL_GITHUB} {Resources.AboutForm_AboutForm_Project_page}: {Links.GitHub}
{Resources.AboutForm_AboutForm_Changelog}: {Links.URL_CHANGELOG} {Resources.AboutForm_AboutForm_Changelog}: {Links.Changelog}
{Resources.AboutForm_AboutForm_Privacy_policy}: {Links.URL_PRIVACY_POLICY} {Resources.AboutForm_AboutForm_Privacy_policy}: {Links.PrivacyPolicy}
", FontStyle.Regular); ", FontStyle.Regular);
rtbInfo.AppendLine(Resources.AboutForm_AboutForm_Team, FontStyle.Bold, 13); rtbInfo.AppendLine(Resources.AboutForm_AboutForm_Team, FontStyle.Bold, 13);
rtbInfo.AppendLine($@"Jaex: {Links.URL_JAEX} rtbInfo.AppendLine($@"Jaex: {Links.Jaex}
McoreD (Michael Delpach): {Links.URL_MCORED} McoreD: {Links.McoreD}
", FontStyle.Regular); ", FontStyle.Regular);
rtbInfo.AppendLine(Resources.AboutForm_AboutForm_Translators, FontStyle.Bold, 13); rtbInfo.AppendLine(Resources.AboutForm_AboutForm_Translators, FontStyle.Bold, 13);

View file

@ -1914,27 +1914,27 @@ private void tsmiTestFileUpload_Click(object sender, EventArgs e)
private void tsmiTestURLShortener_Click(object sender, EventArgs e) private void tsmiTestURLShortener_Click(object sender, EventArgs e)
{ {
UploadManager.ShortenURL(Links.URL_WEBSITE); UploadManager.ShortenURL(Links.Website);
} }
private void tsmiTestURLSharing_Click(object sender, EventArgs e) private void tsmiTestURLSharing_Click(object sender, EventArgs e)
{ {
UploadManager.ShareURL(Links.URL_WEBSITE); UploadManager.ShareURL(Links.Website);
} }
private void tsbDonate_Click(object sender, EventArgs e) private void tsbDonate_Click(object sender, EventArgs e)
{ {
URLHelpers.OpenURL(Links.URL_DONATE); URLHelpers.OpenURL(Links.Donate);
} }
private void tsbTwitter_Click(object sender, EventArgs e) private void tsbTwitter_Click(object sender, EventArgs e)
{ {
URLHelpers.OpenURL(Links.URL_TWITTER); URLHelpers.OpenURL(Links.Twitter);
} }
private void tsbDiscord_Click(object sender, EventArgs e) private void tsbDiscord_Click(object sender, EventArgs e)
{ {
URLHelpers.OpenURL(Links.URL_DISCORD); URLHelpers.OpenURL(Links.Discord);
} }
private void tsbAbout_Click(object sender, EventArgs e) private void tsbAbout_Click(object sender, EventArgs e)

View file

@ -1647,7 +1647,7 @@ private void btnActionsRemove_Click(object sender, EventArgs e)
private void btnActions_Click(object sender, EventArgs e) private void btnActions_Click(object sender, EventArgs e)
{ {
URLHelpers.OpenURL(Links.URL_ACTIONS); URLHelpers.OpenURL(Links.Actions);
} }
private void lvActions_SelectedIndexChanged(object sender, EventArgs e) private void lvActions_SelectedIndexChanged(object sender, EventArgs e)

View file

@ -72,7 +72,7 @@ private List<NewsItem> GetNews()
wc.Headers.Add(HttpRequestHeader.UserAgent, ShareXResources.UserAgent); wc.Headers.Add(HttpRequestHeader.UserAgent, ShareXResources.UserAgent);
wc.Proxy = HelpersOptions.CurrentProxy.GetWebProxy(); wc.Proxy = HelpersOptions.CurrentProxy.GetWebProxy();
string url = URLHelpers.CombineURL(Links.URL_WEBSITE, "news.json"); string url = URLHelpers.CombineURL(Links.Website, "news.json");
string response = wc.DownloadString(url); string response = wc.DownloadString(url);
if (!string.IsNullOrEmpty(response)) if (!string.IsNullOrEmpty(response))

View file

@ -625,7 +625,7 @@ private static void CurrentDomain_UnhandledException(object sender, UnhandledExc
private static void OnError(Exception e) private static void OnError(Exception e)
{ {
using (ErrorForm errorForm = new ErrorForm(e.Message, $"{e}\r\n\r\n{Title}", LogsFilePath, Links.URL_ISSUES)) using (ErrorForm errorForm = new ErrorForm(e.Message, $"{e}\r\n\r\n{Title}", LogsFilePath, Links.GitHubIssues))
{ {
errorForm.ShowDialog(); errorForm.ShowDialog();
} }

View file

@ -294,7 +294,7 @@ public void ShowErrorWindow()
if (!string.IsNullOrEmpty(errors)) if (!string.IsNullOrEmpty(errors))
{ {
using (ErrorForm form = new ErrorForm(Resources.UploadInfoManager_ShowErrors_Upload_errors, errors, Program.LogsFilePath, Links.URL_ISSUES, false)) using (ErrorForm form = new ErrorForm(Resources.UploadInfoManager_ShowErrors_Upload_errors, errors, Program.LogsFilePath, Links.GitHubIssues, false))
{ {
form.ShowDialog(); form.ShowDialog();
} }