Skip to content

Commit

Permalink
Move SupportUrl to about window, reuse constant
Browse files Browse the repository at this point in the history
  • Loading branch information
robinvanpoppel committed Apr 11, 2020
1 parent 38ccd36 commit 0f0138a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
7 changes: 6 additions & 1 deletion KeeTrayTOTP/FormAbout.cs
Expand Up @@ -10,6 +10,11 @@ namespace KeeTrayTOTP
/// </summary>
internal partial class FormAbout : Form
{
/// <summary>
/// Tray TOTP Support Url
/// </summary>
private static readonly Uri SupportUrl = new Uri("https://github.com/KeeTrayTOTP/KeeTrayTOTP/issues", UriKind.Absolute);

/// <summary>
/// Windows Form Constructor.
/// </summary>
Expand All @@ -33,7 +38,7 @@ private void FormAbout_Load(object sender, EventArgs e)
ListViewAbout.Items[1].SubItems.Add(AssemblyCompany);
ListViewAbout.Items[2].SubItems.Add(AssemblyVersion);
ListViewAbout.Items[3].SubItems.Add(AssemblyTrademark);
ListViewAbout.Items[4].SubItems.Add(KeeTrayTOTPExt.SupportUrl);
ListViewAbout.Items[4].SubItems.Add(SupportUrl.AbsoluteUri);
LabelCopyright.Text = AssemblyCopyright;
}

Expand Down
4 changes: 2 additions & 2 deletions KeeTrayTOTP/FormSettings.cs
Expand Up @@ -307,7 +307,7 @@ private void WorkerLoad_DoWork(object sender, DoWorkEventArgs e)

// Time Correction
CheckBoxTimeCorrection.Checked = _plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_TimeCorrection_Enable, false);
NumericTimeCorrectionInterval.Value = Convert.ToDecimal(_plugin.PluginHost.CustomConfig.GetULong(KeeTrayTOTPExt.setname_ulong_TimeCorrection_RefreshTime, KeeTrayTOTPExt.setdef_ulong_TimeCorrection_RefreshTime));
NumericTimeCorrectionInterval.Value = Convert.ToDecimal(_plugin.PluginHost.CustomConfig.GetULong(KeeTrayTOTPExt.setname_ulong_TimeCorrection_RefreshTime, KeeTrayTOTPExt.setdef_TimeCorrection_RefreshTime));
ListViewTimeCorrectionList.Items.AddRange(_plugin.TimeCorrections.ToLvi());
if (WorkerLoad.CancellationPending) { e.Cancel = true; return; }

Expand Down Expand Up @@ -464,7 +464,7 @@ private void WorkerReset_DoWork(object sender, DoWorkEventArgs e)
// Time Correction
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_bool_TimeCorrection_Enable, null);
_plugin.PluginHost.CustomConfig.SetString(KeeTrayTOTPExt.setname_ulong_TimeCorrection_RefreshTime, null);
Libraries.TimeCorrectionProvider.Interval = Convert.ToInt16(KeeTrayTOTPExt.setdef_ulong_TimeCorrection_RefreshTime);
Libraries.TimeCorrectionProvider.Interval = Convert.ToInt16(KeeTrayTOTPExt.setdef_TimeCorrection_RefreshTime);
_plugin.TimeCorrections.ResetThenAddRangeFromString(string.Empty);

// Storage
Expand Down
2 changes: 1 addition & 1 deletion KeeTrayTOTP/Libraries/TimeCorrectionProvider.cs
Expand Up @@ -54,7 +54,7 @@ public class TimeCorrectionProvider

static TimeCorrectionProvider()
{
Interval = 60;
Interval = KeeTrayTOTPExt.setdef_TimeCorrection_RefreshTime;
}

/// <summary>
Expand Down
9 changes: 2 additions & 7 deletions KeeTrayTOTP/TrayTOTP_Plugin.cs
Expand Up @@ -30,11 +30,6 @@ public sealed class KeeTrayTOTPExt : Plugin
/// </summary>
internal IPluginHost PluginHost;

/// <summary>
/// Tray TOTP Support Url
/// </summary>
internal const string SupportUrl = "https://github.com/KeeTrayTOTP/KeeTrayTOTP/issues";

/// <summary>
/// Constants (keepass form object names).
/// </summary>
Expand Down Expand Up @@ -68,7 +63,7 @@ public sealed class KeeTrayTOTPExt : Plugin
/// Constants (default settings values).
/// </summary>
internal const string setdef_string_AutoType_FieldName = "TOTP";
internal const long setdef_ulong_TimeCorrection_RefreshTime = 60;
internal const int setdef_TimeCorrection_RefreshTime = 60;

/// <summary>
/// Constants (static settings value).
Expand Down Expand Up @@ -274,7 +269,7 @@ public override bool Initialize(IPluginHost host)

//Time Correction.
TimeCorrections = new TimeCorrectionCollection(PluginHost.CustomConfig.GetBool(setname_bool_TimeCorrection_Enable, false));
TimeCorrectionProvider.Interval = Convert.ToInt16(PluginHost.CustomConfig.GetULong(KeeTrayTOTPExt.setname_ulong_TimeCorrection_RefreshTime, KeeTrayTOTPExt.setdef_ulong_TimeCorrection_RefreshTime));
TimeCorrectionProvider.Interval = Convert.ToInt16(PluginHost.CustomConfig.GetULong(KeeTrayTOTPExt.setname_ulong_TimeCorrection_RefreshTime, KeeTrayTOTPExt.setdef_TimeCorrection_RefreshTime));
TimeCorrections.AddRangeFromList(PluginHost.CustomConfig.GetString(setname_string_TimeCorrection_List, string.Empty).Split(';').ToList());

return true;
Expand Down

0 comments on commit 0f0138a

Please sign in to comment.