Skip to content

Commit

Permalink
Modify 166aa70
Browse files Browse the repository at this point in the history
Added missing checkbox checkmark if enabled
Added polling every 30s
Updated dependencies
Code cleanup
  • Loading branch information
Plenyx committed Nov 11, 2023
1 parent 166aa70 commit 911d777
Show file tree
Hide file tree
Showing 16 changed files with 890 additions and 846 deletions.
2 changes: 1 addition & 1 deletion Aleeva/AleevaIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal Team Team

string IListViewItemInfo<AleevaIntegration>.NameToDisplay => Name;

string IListViewItemInfo<AleevaIntegration>.TextToDisplay => ((!string.IsNullOrWhiteSpace(Name)) ? Name : (!string.IsNullOrWhiteSpace(Channel) ? $"C{Channel}" : $"S{Server}"));
string IListViewItemInfo<AleevaIntegration>.TextToDisplay => (!string.IsNullOrWhiteSpace(Name)) ? Name : (!string.IsNullOrWhiteSpace(Channel) ? $"C{Channel}" : $"S{Server}");

bool IListViewItemInfo<AleevaIntegration>.CheckedToDisplay => Active;

Expand Down
8 changes: 4 additions & 4 deletions Forms/FormAleevaIntegrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ internal void OnAuthoriseResult(object sender, EventArgs e)
groupBoxAleevaStatus.Enabled = toggle;
if (groupBoxAleevaStatus.InvokeRequired)
{
groupBoxAleevaStatus.Invoke((Action)(() => groupBoxAleevaStatus.Text = (toggle) ? "Status: Aleeva successfully authorised" : "Status: Not authorised"));
groupBoxAleevaStatus.Invoke((Action)(() => groupBoxAleevaStatus.Text = toggle ? "Status: Aleeva successfully authorised" : "Status: Not authorised"));
}
else
{
groupBoxAleevaStatus.Text = (toggle) ? "Status: Aleeva successfully authorised" : "Status: Not authorised";
groupBoxAleevaStatus.Text = toggle ? "Status: Aleeva successfully authorised" : "Status: Not authorised";
}
if (buttonGetBearerFromAccess.InvokeRequired)
{
buttonGetBearerFromAccess.Invoke((Action)(() => buttonGetBearerFromAccess.Text = (toggle) ? "Deauthorise" : "Authorise"));
buttonGetBearerFromAccess.Invoke((Action)(() => buttonGetBearerFromAccess.Text = toggle ? "Deauthorise" : "Authorise"));
}
else
{
buttonGetBearerFromAccess.Text = (toggle) ? "Deauthorise" : "Authorise";
buttonGetBearerFromAccess.Text = toggle ? "Deauthorise" : "Authorise";
}
if (textBoxAccessCode.InvokeRequired)
{
Expand Down
2 changes: 1 addition & 1 deletion Forms/FormArcPluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private void CheckBoxModuleEnabled_CheckedChanged(object sender, EventArgs e)
ApplicationSettings.Current.Save();
groupBoxModuleControls.Enabled = toggle;
checkedListBoxArcDpsPlugins.Enabled = toggle;
if (Visible && toggle && (string.IsNullOrWhiteSpace(ApplicationSettings.Current.Gw2Location)))
if (Visible && toggle && string.IsNullOrWhiteSpace(ApplicationSettings.Current.Gw2Location))
{
ButtonChangeGW2Location_Click(this, EventArgs.Empty);
}
Expand Down
4 changes: 2 additions & 2 deletions Forms/FormDiscordWebhooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,15 @@ internal async Task SendLogViaWebhooks(bool success, int bossId, BossData bossDa
if (!webhook.Active
|| (webhook.SuccessFailToggle.Equals(DiscordWebhookDataSuccessToggle.OnSuccessOnly) && !success)
|| (webhook.SuccessFailToggle.Equals(DiscordWebhookDataSuccessToggle.OnFailOnly) && success)
|| (webhook.BossesDisable.Contains(bossId))
|| webhook.BossesDisable.Contains(bossId)
|| (!webhook.AllowUnknownBossIds && (bossData is null))
|| (!webhook.Team.IsSatisfied(players)))
{
continue;
}
try
{
var jsonToSend = (webhook.SummaryType) switch
var jsonToSend = webhook.SummaryType switch
{
DiscordWebhookDataLogSummaryType.None => jsonContentNone,
DiscordWebhookDataLogSummaryType.SquadOnly => jsonContentSquad,
Expand Down
6 changes: 3 additions & 3 deletions Forms/FormDpsReportSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ private void CheckedListBoxUserTokens_DoubleClick(object sender, EventArgs e)
checkedListBoxUserTokens.SelectedItem = null;
}

private void ButtonAddUserToken_Click(object sender, EventArgs e) => (new FormEditDpsReportUserToken(this, mainLink.HttpClientController)).ShowDialog();
private void ButtonAddUserToken_Click(object sender, EventArgs e) => new FormEditDpsReportUserToken(this, mainLink.HttpClientController).ShowDialog();

private void ToolStripMenuItemAddUserToken_Click(object sender, EventArgs e) => (new FormEditDpsReportUserToken(this, mainLink.HttpClientController)).ShowDialog();
private void ToolStripMenuItemAddUserToken_Click(object sender, EventArgs e) => new FormEditDpsReportUserToken(this, mainLink.HttpClientController).ShowDialog();

private void ToolStripMenuItemEditUserToken_Click(object sender, EventArgs e) => (new FormEditDpsReportUserToken(this, mainLink.HttpClientController, (ApplicationSettingsUploadUserToken)checkedListBoxUserTokens.SelectedItem)).ShowDialog();
private void ToolStripMenuItemEditUserToken_Click(object sender, EventArgs e) => new FormEditDpsReportUserToken(this, mainLink.HttpClientController, (ApplicationSettingsUploadUserToken)checkedListBoxUserTokens.SelectedItem).ShowDialog();

private void ToolStripMenuItemDeleteUserToken_Click(object sender, EventArgs e)
{
Expand Down
4 changes: 2 additions & 2 deletions Forms/FormEditAleevaIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private async Task AleevaLoadServers()
aleevaServers.AddRange(servers);
}
AddServersToView();
comboBoxServer.Text = (!string.IsNullOrWhiteSpace(selectedServer) ? aleevaServers.Find(x => x.Id.Equals(selectedServer))?.ToString() : "");
comboBoxServer.Text = !string.IsNullOrWhiteSpace(selectedServer) ? aleevaServers.Find(x => x.Id.Equals(selectedServer))?.ToString() : "";
if (!string.IsNullOrWhiteSpace(selectedServer))
{
await AleevaLoadChannels(selectedServer);
Expand Down Expand Up @@ -186,7 +186,7 @@ private async Task AleevaLoadChannels(string serverId)
aleevaServerChannels.AddRange(channels);
}
AddChannelsToView();
comboBoxChannel.Text = (!string.IsNullOrWhiteSpace(selectedChannel) ? aleevaServerChannels.Find(x => x.Id.Equals(selectedChannel))?.ToString() : "");
comboBoxChannel.Text = !string.IsNullOrWhiteSpace(selectedChannel) ? aleevaServerChannels.Find(x => x.Id.Equals(selectedChannel))?.ToString() : "";
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion Forms/FormEditGw2Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private async void TimerCheckToken_Tick(object sender, EventArgs e)
timerCheckToken.Stop();
timerCheckToken.Enabled = false;
using var response = await httpClientController.GetAsync($"https://api.guildwars2.com/v2/tokeninfo?access_token={textBoxAPIKeyKey.Text}");
labelIsTokenValid.Text = (response.IsSuccessStatusCode) ? "Token is valid." : "Token is not valid.";
labelIsTokenValid.Text = response.IsSuccessStatusCode ? "Token is valid." : "Token is not valid.";
}
}
}
2 changes: 1 addition & 1 deletion Forms/FormEditPing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal FormEditPing(FormPings pingLink, int reservedId, bool addNew, PingConfi
this.addNew = addNew;
InitializeComponent();
Icon = Properties.Resources.AppIcon;
Text = (addNew) ? "Add a new ping configuration" : "Edit an existing ping configuration";
Text = addNew ? "Add a new ping configuration" : "Edit an existing ping configuration";
textBoxName.Text = config?.Name ?? "";
textBoxURL.Text = config?.Url ?? "";
textBoxAuthName.Text = config?.Authentication.AuthName ?? "Bearer";
Expand Down
8 changes: 4 additions & 4 deletions Forms/FormGw2Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ private void ContextMenuStripEditAPIKeys_Opening(object sender, System.Component
toolStripMenuItemRemoveKey.Enabled = !toggle;
}

private void ToolStripMenuItemAddKey_Click(object sender, EventArgs e) => (new FormEditGw2Api(this, null)).ShowDialog();
private void ToolStripMenuItemAddKey_Click(object sender, EventArgs e) => new FormEditGw2Api(this, null).ShowDialog();

private void ToolStripMenuItemEditKey_Click(object sender, EventArgs e) => (new FormEditGw2Api(this, (ApplicationSettingsGw2Api)listBoxAPIKeys.SelectedItem)).ShowDialog();
private void ToolStripMenuItemEditKey_Click(object sender, EventArgs e) => new FormEditGw2Api(this, (ApplicationSettingsGw2Api)listBoxAPIKeys.SelectedItem).ShowDialog();

private void ToolStripMenuItemRemoveKey_Click(object sender, EventArgs e)
{
Expand All @@ -66,7 +66,7 @@ private void ToolStripMenuItemRemoveKey_Click(object sender, EventArgs e)
RedrawList();
}

private void ButtonAddAPIKey_Click(object sender, EventArgs e) => (new FormEditGw2Api(this, null)).ShowDialog();
private void ButtonAddAPIKey_Click(object sender, EventArgs e) => new FormEditGw2Api(this, null).ShowDialog();

private void ButtonGetHardStuckCode_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -131,7 +131,7 @@ private void ButtonGetHardStuckCode_Click(object sender, EventArgs e)

private void ButtonBuildCodeCompressionSettings_Click(object sender, EventArgs e)
{
(new FormHsBuildCodeCompressionSettings()).ShowDialog();
new FormHsBuildCodeCompressionSettings().ShowDialog();
}
}
}
Loading

0 comments on commit 911d777

Please sign in to comment.