New button in settings to open file logs folder

This commit is contained in:
Robert McRackan 2021-07-20 14:37:32 -04:00
parent c49edbc77b
commit b86bd76726
3 changed files with 31 additions and 15 deletions

View File

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

View File

@ -39,6 +39,7 @@
this.allowLibationFixupCbox = new System.Windows.Forms.CheckBox(); this.allowLibationFixupCbox = new System.Windows.Forms.CheckBox();
this.booksSelectControl = new LibationWinForms.Dialogs.DirectoryOrCustomSelectControl(); this.booksSelectControl = new LibationWinForms.Dialogs.DirectoryOrCustomSelectControl();
this.booksGb = new System.Windows.Forms.GroupBox(); this.booksGb = new System.Windows.Forms.GroupBox();
this.logsBtn = new System.Windows.Forms.Button();
this.advancedSettingsGb.SuspendLayout(); this.advancedSettingsGb.SuspendLayout();
this.booksGb.SuspendLayout(); this.booksGb.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@ -92,6 +93,7 @@
// //
this.advancedSettingsGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.advancedSettingsGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.advancedSettingsGb.Controls.Add(this.logsBtn);
this.advancedSettingsGb.Controls.Add(this.convertLossyRb); this.advancedSettingsGb.Controls.Add(this.convertLossyRb);
this.advancedSettingsGb.Controls.Add(this.convertLosslessRb); this.advancedSettingsGb.Controls.Add(this.convertLosslessRb);
this.advancedSettingsGb.Controls.Add(this.inProgressSelectControl); this.advancedSettingsGb.Controls.Add(this.inProgressSelectControl);
@ -172,6 +174,16 @@
this.booksGb.TabStop = false; this.booksGb.TabStop = false;
this.booksGb.Text = "Books location"; this.booksGb.Text = "Books location";
// //
// logsBtn
//
this.logsBtn.Location = new System.Drawing.Point(826, 18);
this.logsBtn.Name = "logsBtn";
this.logsBtn.Size = new System.Drawing.Size(75, 64);
this.logsBtn.TabIndex = 3;
this.logsBtn.Text = "Open log\r\nfiles folder";
this.logsBtn.UseVisualStyleBackColor = true;
this.logsBtn.Click += new System.EventHandler(this.logsBtn_Click);
//
// SettingsDialog // SettingsDialog
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
@ -209,5 +221,6 @@
private System.Windows.Forms.RadioButton convertLossyRb; private System.Windows.Forms.RadioButton convertLossyRb;
private System.Windows.Forms.RadioButton convertLosslessRb; private System.Windows.Forms.RadioButton convertLosslessRb;
private System.Windows.Forms.GroupBox booksGb; private System.Windows.Forms.GroupBox booksGb;
private System.Windows.Forms.Button logsBtn;
} }
} }

View File

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using Dinah.Core;
using FileManager; using FileManager;
namespace LibationWinForms.Dialogs namespace LibationWinForms.Dialogs
@ -49,6 +50,19 @@ namespace LibationWinForms.Dialogs
inProgressSelectControl.SelectDirectory(config.InProgress); inProgressSelectControl.SelectDirectory(config.InProgress);
} }
private void allowLibationFixupCbox_CheckedChanged(object sender, EventArgs e)
{
convertLosslessRb.Enabled = allowLibationFixupCbox.Checked;
convertLossyRb.Enabled = allowLibationFixupCbox.Checked;
if (!allowLibationFixupCbox.Checked)
{
convertLosslessRb.Checked = true;
}
}
private void logsBtn_Click(object sender, EventArgs e) => Go.To.Folder(Configuration.Instance.LibationFiles);
private void saveBtn_Click(object sender, EventArgs e) private void saveBtn_Click(object sender, EventArgs e)
{ {
config.AllowLibationFixup = allowLibationFixupCbox.Checked; config.AllowLibationFixup = allowLibationFixupCbox.Checked;
@ -87,16 +101,5 @@ namespace LibationWinForms.Dialogs
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
this.Close(); this.Close();
} }
private void allowLibationFixupCbox_CheckedChanged(object sender, EventArgs e)
{
convertLosslessRb.Enabled = allowLibationFixupCbox.Checked;
convertLossyRb.Enabled = allowLibationFixupCbox.Checked;
if (!allowLibationFixupCbox.Checked)
{
convertLosslessRb.Checked = true;
}
}
} }
} }