Compare commits

..

4 Commits

Author SHA1 Message Date
Robert McRackan
3180ea993c Startup logging: which logging levels are enabled 2021-07-09 11:06:57 -04:00
Robert McRackan
9f2fd54018 It helps if you wire-up the event. D'oh! 2021-07-09 10:20:46 -04:00
Robert McRackan
07532f7e65 "check for update" should not include pre-releases 2021-07-08 21:00:36 -04:00
Robert McRackan
4bae07d36c debugging added 2021-07-08 20:43:14 -04:00
4 changed files with 31 additions and 9 deletions

View File

@@ -13,7 +13,7 @@
<!-- <PublishSingleFile>true</PublishSingleFile> -->
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Version>5.1.4.1</Version>
<Version>5.1.6.1</Version>
</PropertyGroup>
<ItemGroup>

View File

@@ -379,7 +379,7 @@ namespace LibationLauncher
// https://octokitnet.readthedocs.io/en/latest/releases/
var releases = gitHubClient.Repository.Release.GetAll("rmcrackan", "Libation").GetAwaiter().GetResult();
var latest = releases.First(r => !r.Draft);
var latest = releases.First(r => !r.Draft && !r.Prerelease);
var latestVersionString = latest.TagName.Trim('v');
if (!Version.TryParse(latestVersionString, out var latestRelease))
@@ -437,6 +437,13 @@ namespace LibationLauncher
{
Version = BuildVersion.ToString(),
LogLevel_Verbose_Enabled = Serilog.Log.Logger.IsEnabled(Serilog.Events.LogEventLevel.Verbose),
LogLevel_Debug_Enabled = Serilog.Log.Logger.IsEnabled(Serilog.Events.LogEventLevel.Debug),
LogLevel_Information_Enabled = Serilog.Log.Logger.IsEnabled(Serilog.Events.LogEventLevel.Information),
LogLevel_Warning_Enabled = Serilog.Log.Logger.IsEnabled(Serilog.Events.LogEventLevel.Warning),
LogLevel_Error_Enabled = Serilog.Log.Logger.IsEnabled(Serilog.Events.LogEventLevel.Error),
LogLevel_Fatal_Enabled = Serilog.Log.Logger.IsEnabled(Serilog.Events.LogEventLevel.Fatal),
config.LibationFiles,
AudibleFileStorage.BooksDirectory,

View File

@@ -44,6 +44,7 @@ namespace LibationWinForms.Dialogs.Login
this.submitBtn.TabIndex = 3;
this.submitBtn.Text = "Submit";
this.submitBtn.UseVisualStyleBackColor = true;
this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click);
//
// radioButton1
//

View File

@@ -12,19 +12,20 @@ namespace LibationWinForms.Dialogs.Login
{
public partial class MfaDialog : Form
{
private RadioButton[] radioButtons { get; }
public MfaDialog(AudibleApi.MfaConfig mfaConfig)
{
InitializeComponent();
radioButtons = new[] { this.radioButton1, this.radioButton2, this.radioButton3 };
// optional string settings
if (!string.IsNullOrWhiteSpace(mfaConfig.Title))
this.Text = mfaConfig.Title;
if (!string.IsNullOrWhiteSpace(mfaConfig.Button1Text))
this.radioButton1.Text = mfaConfig.Button1Text;
if (!string.IsNullOrWhiteSpace(mfaConfig.Button2Text))
this.radioButton2.Text = mfaConfig.Button2Text;
if (!string.IsNullOrWhiteSpace(mfaConfig.Button3Text))
this.radioButton3.Text = mfaConfig.Button3Text;
setOptional(this.radioButton1, mfaConfig.Button1Text);
setOptional(this.radioButton2, mfaConfig.Button2Text);
setOptional(this.radioButton3, mfaConfig.Button3Text);
// mandatory values
radioButton1.Name = mfaConfig.Button1Name;
@@ -37,13 +38,26 @@ namespace LibationWinForms.Dialogs.Login
radioButton3.Tag = mfaConfig.Button3Value;
}
private static void setOptional(RadioButton radioButton, string text)
{
if (!string.IsNullOrWhiteSpace(text))
radioButton.Text = text;
}
public string SelectedName { get; private set; }
public string SelectedValue { get; private set; }
private void submitBtn_Click(object sender, EventArgs e)
{
var radioButtons = new[] { this.radioButton1, this.radioButton2, this.radioButton3 };
Serilog.Log.Logger.Debug("RadioButton states: {@DebugInfo}", new {
rb1_checked = radioButton1.Checked,
r21_checked = radioButton2.Checked,
rb3_checked = radioButton3.Checked
});
var selected = radioButtons.Single(rb => rb.Checked);
Serilog.Log.Logger.Debug("Selected: {@DebugInfo}", new { isSelected = selected is not null, name = selected?.Name, value = selected?.Tag });
SelectedName = selected.Name;
SelectedValue = (string)selected.Tag;