mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-01-03 19:37:56 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3180ea993c | ||
|
|
9f2fd54018 | ||
|
|
07532f7e65 | ||
|
|
4bae07d36c |
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
@@ -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
|
||||
//
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user