New config setting: ShowImportedStats -- "Show number of newly imported titles? When unchecked, no pop-up will appear after library scan."

This commit is contained in:
Robert McRackan 2021-11-29 11:06:23 -05:00
parent 2c9ccd9c78
commit 7f5cf8f018
7 changed files with 525 additions and 495 deletions

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Version>6.5.1.1</Version> <Version>6.5.2.1</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -60,6 +60,7 @@ namespace AppScaffolding
Migrations.migrate_to_v6_1_2(config); Migrations.migrate_to_v6_1_2(config);
Migrations.migrate_to_v6_2_0(config); Migrations.migrate_to_v6_2_0(config);
Migrations.migrate_to_v6_2_9(config); Migrations.migrate_to_v6_2_9(config);
Migrations.migrate_to_v6_5_2(config);
} }
/// <summary>Initialize logging. Run after migration</summary> /// <summary>Initialize logging. Run after migration</summary>
@ -359,5 +360,12 @@ namespace AppScaffolding
if (!config.Exists(nameof(config.ChapterFileTemplate))) if (!config.Exists(nameof(config.ChapterFileTemplate)))
config.ChapterFileTemplate = Templates.ChapterFile.DefaultTemplate; config.ChapterFileTemplate = Templates.ChapterFile.DefaultTemplate;
} }
// add config.ShowImportedStats
public static void migrate_to_v6_5_2(Configuration config)
{
if (!config.Exists(nameof(config.ShowImportedStats)))
config.ShowImportedStats = true;
}
} }
} }

View File

@ -133,6 +133,13 @@ namespace LibationFileManager
set => persistentDictionary.SetString(nameof(BadBook), value.ToString()); set => persistentDictionary.SetString(nameof(BadBook), value.ToString());
} }
[Description("Show number of newly imported titles? When unchecked, no pop-up will appear after library scan.")]
public bool ShowImportedStats
{
get => persistentDictionary.GetNonString<bool>(nameof(ShowImportedStats));
set => persistentDictionary.SetNonString(nameof(ShowImportedStats), value);
}
[Description("Import episodes? (eg: podcasts) When unchecked, episodes will not be imported into Libation.")] [Description("Import episodes? (eg: podcasts) When unchecked, episodes will not be imported into Libation.")]
public bool ImportEpisodes public bool ImportEpisodes
{ {

View File

@ -65,6 +65,7 @@
this.folderTemplateBtn = new System.Windows.Forms.Button(); this.folderTemplateBtn = new System.Windows.Forms.Button();
this.folderTemplateTb = new System.Windows.Forms.TextBox(); this.folderTemplateTb = new System.Windows.Forms.TextBox();
this.folderTemplateLbl = new System.Windows.Forms.Label(); this.folderTemplateLbl = new System.Windows.Forms.Label();
this.showImportedStatsCb = new System.Windows.Forms.CheckBox();
this.badBookGb.SuspendLayout(); this.badBookGb.SuspendLayout();
this.decryptAndConvertGb.SuspendLayout(); this.decryptAndConvertGb.SuspendLayout();
this.tabControl.SuspendLayout(); this.tabControl.SuspendLayout();
@ -124,20 +125,20 @@
// importEpisodesCb // importEpisodesCb
// //
this.importEpisodesCb.AutoSize = true; this.importEpisodesCb.AutoSize = true;
this.importEpisodesCb.Location = new System.Drawing.Point(6, 6); this.importEpisodesCb.Location = new System.Drawing.Point(6, 31);
this.importEpisodesCb.Name = "importEpisodesCb"; this.importEpisodesCb.Name = "importEpisodesCb";
this.importEpisodesCb.Size = new System.Drawing.Size(146, 19); this.importEpisodesCb.Size = new System.Drawing.Size(146, 19);
this.importEpisodesCb.TabIndex = 7; this.importEpisodesCb.TabIndex = 2;
this.importEpisodesCb.Text = "[import episodes desc]"; this.importEpisodesCb.Text = "[import episodes desc]";
this.importEpisodesCb.UseVisualStyleBackColor = true; this.importEpisodesCb.UseVisualStyleBackColor = true;
// //
// downloadEpisodesCb // downloadEpisodesCb
// //
this.downloadEpisodesCb.AutoSize = true; this.downloadEpisodesCb.AutoSize = true;
this.downloadEpisodesCb.Location = new System.Drawing.Point(6, 31); this.downloadEpisodesCb.Location = new System.Drawing.Point(6, 56);
this.downloadEpisodesCb.Name = "downloadEpisodesCb"; this.downloadEpisodesCb.Name = "downloadEpisodesCb";
this.downloadEpisodesCb.Size = new System.Drawing.Size(163, 19); this.downloadEpisodesCb.Size = new System.Drawing.Size(163, 19);
this.downloadEpisodesCb.TabIndex = 8; this.downloadEpisodesCb.TabIndex = 3;
this.downloadEpisodesCb.Text = "[download episodes desc]"; this.downloadEpisodesCb.Text = "[download episodes desc]";
this.downloadEpisodesCb.UseVisualStyleBackColor = true; this.downloadEpisodesCb.UseVisualStyleBackColor = true;
// //
@ -347,6 +348,7 @@
// //
// tab2ImportLibrary // tab2ImportLibrary
// //
this.tab2ImportLibrary.Controls.Add(this.showImportedStatsCb);
this.tab2ImportLibrary.Controls.Add(this.importEpisodesCb); this.tab2ImportLibrary.Controls.Add(this.importEpisodesCb);
this.tab2ImportLibrary.Controls.Add(this.downloadEpisodesCb); this.tab2ImportLibrary.Controls.Add(this.downloadEpisodesCb);
this.tab2ImportLibrary.Location = new System.Drawing.Point(4, 24); this.tab2ImportLibrary.Location = new System.Drawing.Point(4, 24);
@ -494,6 +496,16 @@
this.folderTemplateLbl.TabIndex = 0; this.folderTemplateLbl.TabIndex = 0;
this.folderTemplateLbl.Text = "[folder template desc]"; this.folderTemplateLbl.Text = "[folder template desc]";
// //
// showImportedStatsCb
//
this.showImportedStatsCb.AutoSize = true;
this.showImportedStatsCb.Location = new System.Drawing.Point(6, 6);
this.showImportedStatsCb.Name = "showImportedStatsCb";
this.showImportedStatsCb.Size = new System.Drawing.Size(168, 19);
this.showImportedStatsCb.TabIndex = 1;
this.showImportedStatsCb.Text = "[show imported stats desc]";
this.showImportedStatsCb.UseVisualStyleBackColor = true;
//
// SettingsDialog // SettingsDialog
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
@ -568,5 +580,6 @@
private System.Windows.Forms.Button folderTemplateBtn; private System.Windows.Forms.Button folderTemplateBtn;
private System.Windows.Forms.TextBox folderTemplateTb; private System.Windows.Forms.TextBox folderTemplateTb;
private System.Windows.Forms.Label folderTemplateLbl; private System.Windows.Forms.Label folderTemplateLbl;
private System.Windows.Forms.CheckBox showImportedStatsCb;
} }
} }

View File

@ -27,6 +27,7 @@ namespace LibationWinForms.Dialogs
loggingLevelCb.SelectedItem = config.LogLevel; loggingLevelCb.SelectedItem = config.LogLevel;
} }
this.showImportedStatsCb.Text = desc(nameof(config.ShowImportedStats));
this.importEpisodesCb.Text = desc(nameof(config.ImportEpisodes)); this.importEpisodesCb.Text = desc(nameof(config.ImportEpisodes));
this.downloadEpisodesCb.Text = desc(nameof(config.DownloadEpisodes)); this.downloadEpisodesCb.Text = desc(nameof(config.DownloadEpisodes));
this.booksLocationDescLbl.Text = desc(nameof(config.Books)); this.booksLocationDescLbl.Text = desc(nameof(config.Books));
@ -46,6 +47,7 @@ namespace LibationWinForms.Dialogs
"Books"); "Books");
booksSelectControl.SelectDirectory(config.Books); booksSelectControl.SelectDirectory(config.Books);
showImportedStatsCb.Checked = config.ShowImportedStats;
importEpisodesCb.Checked = config.ImportEpisodes; importEpisodesCb.Checked = config.ImportEpisodes;
downloadEpisodesCb.Checked = config.DownloadEpisodes; downloadEpisodesCb.Checked = config.DownloadEpisodes;
allowLibationFixupCbox.Checked = config.AllowLibationFixup; allowLibationFixupCbox.Checked = config.AllowLibationFixup;
@ -166,6 +168,7 @@ namespace LibationWinForms.Dialogs
MessageBoxVerboseLoggingWarning.ShowIfTrue(); MessageBoxVerboseLoggingWarning.ShowIfTrue();
} }
config.ShowImportedStats = showImportedStatsCb.Checked;
config.ImportEpisodes = importEpisodesCb.Checked; config.ImportEpisodes = importEpisodesCb.Checked;
config.DownloadEpisodes = downloadEpisodesCb.Checked; config.DownloadEpisodes = downloadEpisodesCb.Checked;
config.AllowLibationFixup = allowLibationFixupCbox.Checked; config.AllowLibationFixup = allowLibationFixupCbox.Checked;

View File

@ -334,6 +334,7 @@ namespace LibationWinForms
var totalProcessed = dialog.TotalBooksProcessed; var totalProcessed = dialog.TotalBooksProcessed;
var newAdded = dialog.NewBooksAdded; var newAdded = dialog.NewBooksAdded;
if (Configuration.Instance.ShowImportedStats)
MessageBox.Show($"Total processed: {totalProcessed}\r\nNew: {newAdded}"); MessageBox.Show($"Total processed: {totalProcessed}\r\nNew: {newAdded}");
} }
#endregion #endregion

View File

@ -30,9 +30,7 @@ namespace LibationWinForms
//// Only use while debugging. Acts erratically in the wild //// Only use while debugging. Acts erratically in the wild
//AllocConsole(); //AllocConsole();
Application.SetHighDpiMode(HighDpiMode.SystemAware); ApplicationConfiguration.Initialize();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//***********************************************// //***********************************************//
// // // //