Added beta opt-in setting

This commit is contained in:
Michael Bucari-Tovo 2022-07-16 23:57:12 -06:00
parent ad6b86fcb4
commit 8bb17d09c3
7 changed files with 100 additions and 29 deletions

View File

@ -66,6 +66,9 @@ namespace AppScaffolding
{ {
config.InProgress ??= Configuration.WinTemp; config.InProgress ??= Configuration.WinTemp;
if (!config.Exists(nameof(config.BetaOptIn)))
config.BetaOptIn = false;
if (!config.Exists(nameof(config.AllowLibationFixup))) if (!config.Exists(nameof(config.AllowLibationFixup)))
config.AllowLibationFixup = true; config.AllowLibationFixup = true;

View File

@ -74,6 +74,13 @@ namespace LibationFileManager
public bool Exists(string propertyName) => persistentDictionary.Exists(propertyName); public bool Exists(string propertyName) => persistentDictionary.Exists(propertyName);
[Description("Use the beta version of Libation\r\nNew and experimental features, but probably buggy.\r\n(requires restart to take effect)")]
public bool BetaOptIn
{
get => persistentDictionary.GetNonString<bool>(nameof(BetaOptIn));
set => persistentDictionary.SetNonString(nameof(BetaOptIn), value);
}
[Description("Location for book storage. Includes destination of newly liberated books")] [Description("Location for book storage. Includes destination of newly liberated books")]
public string Books public string Books
{ {

View File

@ -172,6 +172,7 @@
<!-- Product Display Grid --> <!-- Product Display Grid -->
<views:ProductsDisplay2 <views:ProductsDisplay2
Name="productsDisplay"
Initialized="ProductsDisplay_Initialized1" Initialized="ProductsDisplay_Initialized1"
DataContext="{Binding ProductsDisplay}" DataContext="{Binding ProductsDisplay}"
LiberateClicked="ProductsDisplay_LiberateClicked"/> LiberateClicked="ProductsDisplay_LiberateClicked"/>

View File

@ -57,6 +57,12 @@ namespace LibationWinForms.AvaloniaUI.Views
Closing += (_,_) => this.SaveSizeAndLocation(Configuration.Instance); Closing += (_,_) => this.SaveSizeAndLocation(Configuration.Instance);
} }
Opened += MainWindow_Opened; Opened += MainWindow_Opened;
Closing += MainWindow_Closing;
}
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
productsDisplay?.CloseImageDisplay();
} }
private async void MainWindow_Opened(object sender, EventArgs e) private async void MainWindow_Opened(object sender, EventArgs e)
@ -86,6 +92,7 @@ namespace LibationWinForms.AvaloniaUI.Views
private void FindAllControls() private void FindAllControls()
{ {
quickFiltersToolStripMenuItem = this.FindControl<MenuItem>(nameof(quickFiltersToolStripMenuItem)); quickFiltersToolStripMenuItem = this.FindControl<MenuItem>(nameof(quickFiltersToolStripMenuItem));
productsDisplay = this.FindControl<ProductsDisplay2>(nameof(productsDisplay));
} }
protected override void OnDataContextChanged(EventArgs e) protected override void OnDataContextChanged(EventArgs e)

View File

@ -206,6 +206,12 @@ namespace LibationWinForms.AvaloniaUI.Views
} }
} }
public void CloseImageDisplay()
{
if (imageDisplayDialog is not null && imageDisplayDialog.IsVisible)
imageDisplayDialog.Close();
}
public void Cover_Click(object sender, Avalonia.Interactivity.RoutedEventArgs args) public void Cover_Click(object sender, Avalonia.Interactivity.RoutedEventArgs args)
{ {
if (sender is not Image tblock || tblock.DataContext is not GridEntry2 gEntry) if (sender is not Image tblock || tblock.DataContext is not GridEntry2 gEntry)

View File

@ -51,6 +51,7 @@
this.loggingLevelCb = new System.Windows.Forms.ComboBox(); this.loggingLevelCb = new System.Windows.Forms.ComboBox();
this.tabControl = new System.Windows.Forms.TabControl(); this.tabControl = new System.Windows.Forms.TabControl();
this.tab1ImportantSettings = new System.Windows.Forms.TabPage(); this.tab1ImportantSettings = new System.Windows.Forms.TabPage();
this.betaOptInCbox = new System.Windows.Forms.CheckBox();
this.booksGb = new System.Windows.Forms.GroupBox(); this.booksGb = new System.Windows.Forms.GroupBox();
this.saveEpisodesToSeriesFolderCbox = new System.Windows.Forms.CheckBox(); this.saveEpisodesToSeriesFolderCbox = new System.Windows.Forms.CheckBox();
this.tab2ImportLibrary = new System.Windows.Forms.TabPage(); this.tab2ImportLibrary = new System.Windows.Forms.TabPage();
@ -71,6 +72,8 @@
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.tab4AudioFileOptions = new System.Windows.Forms.TabPage(); this.tab4AudioFileOptions = new System.Windows.Forms.TabPage();
this.audiobookFixupsGb = new System.Windows.Forms.GroupBox();
this.stripUnabridgedCbox = new System.Windows.Forms.CheckBox();
this.chapterTitleTemplateGb = new System.Windows.Forms.GroupBox(); this.chapterTitleTemplateGb = new System.Windows.Forms.GroupBox();
this.chapterTitleTemplateBtn = new System.Windows.Forms.Button(); this.chapterTitleTemplateBtn = new System.Windows.Forms.Button();
this.chapterTitleTemplateTb = new System.Windows.Forms.TextBox(); this.chapterTitleTemplateTb = new System.Windows.Forms.TextBox();
@ -104,12 +107,10 @@
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lameTargetQualityRb = new System.Windows.Forms.RadioButton(); this.lameTargetQualityRb = new System.Windows.Forms.RadioButton();
this.lameTargetBitrateRb = new System.Windows.Forms.RadioButton(); this.lameTargetBitrateRb = new System.Windows.Forms.RadioButton();
this.stripUnabridgedCbox = new System.Windows.Forms.CheckBox();
this.mergeOpeningEndCreditsCbox = new System.Windows.Forms.CheckBox(); this.mergeOpeningEndCreditsCbox = new System.Windows.Forms.CheckBox();
this.retainAaxFileCbox = new System.Windows.Forms.CheckBox(); this.retainAaxFileCbox = new System.Windows.Forms.CheckBox();
this.downloadCoverArtCbox = new System.Windows.Forms.CheckBox(); this.downloadCoverArtCbox = new System.Windows.Forms.CheckBox();
this.createCueSheetCbox = new System.Windows.Forms.CheckBox(); this.createCueSheetCbox = new System.Windows.Forms.CheckBox();
this.audiobookFixupsGb = new System.Windows.Forms.GroupBox();
this.badBookGb.SuspendLayout(); this.badBookGb.SuspendLayout();
this.tabControl.SuspendLayout(); this.tabControl.SuspendLayout();
this.tab1ImportantSettings.SuspendLayout(); this.tab1ImportantSettings.SuspendLayout();
@ -119,6 +120,7 @@
this.inProgressFilesGb.SuspendLayout(); this.inProgressFilesGb.SuspendLayout();
this.customFileNamingGb.SuspendLayout(); this.customFileNamingGb.SuspendLayout();
this.tab4AudioFileOptions.SuspendLayout(); this.tab4AudioFileOptions.SuspendLayout();
this.audiobookFixupsGb.SuspendLayout();
this.chapterTitleTemplateGb.SuspendLayout(); this.chapterTitleTemplateGb.SuspendLayout();
this.lameOptionsGb.SuspendLayout(); this.lameOptionsGb.SuspendLayout();
this.lameBitrateGb.SuspendLayout(); this.lameBitrateGb.SuspendLayout();
@ -126,7 +128,6 @@
this.lameQualityGb.SuspendLayout(); this.lameQualityGb.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).BeginInit();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.audiobookFixupsGb.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// booksLocationDescLbl // booksLocationDescLbl
@ -374,6 +375,7 @@
// //
// tab1ImportantSettings // tab1ImportantSettings
// //
this.tab1ImportantSettings.Controls.Add(this.betaOptInCbox);
this.tab1ImportantSettings.Controls.Add(this.booksGb); this.tab1ImportantSettings.Controls.Add(this.booksGb);
this.tab1ImportantSettings.Controls.Add(this.logsBtn); this.tab1ImportantSettings.Controls.Add(this.logsBtn);
this.tab1ImportantSettings.Controls.Add(this.loggingLevelCb); this.tab1ImportantSettings.Controls.Add(this.loggingLevelCb);
@ -386,6 +388,16 @@
this.tab1ImportantSettings.Text = "Important settings"; this.tab1ImportantSettings.Text = "Important settings";
this.tab1ImportantSettings.UseVisualStyleBackColor = true; this.tab1ImportantSettings.UseVisualStyleBackColor = true;
// //
// betaOptInCbox
//
this.betaOptInCbox.AutoSize = true;
this.betaOptInCbox.Location = new System.Drawing.Point(13, 358);
this.betaOptInCbox.Name = "betaOptInCbox";
this.betaOptInCbox.Size = new System.Drawing.Size(107, 19);
this.betaOptInCbox.TabIndex = 6;
this.betaOptInCbox.Text = "[Opt in to Beta]";
this.betaOptInCbox.UseVisualStyleBackColor = true;
//
// booksGb // booksGb
// //
this.booksGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.booksGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -621,6 +633,30 @@
this.tab4AudioFileOptions.Text = "Audio File Options"; this.tab4AudioFileOptions.Text = "Audio File Options";
this.tab4AudioFileOptions.UseVisualStyleBackColor = true; this.tab4AudioFileOptions.UseVisualStyleBackColor = true;
// //
// audiobookFixupsGb
//
this.audiobookFixupsGb.Controls.Add(this.splitFilesByChapterCbox);
this.audiobookFixupsGb.Controls.Add(this.stripUnabridgedCbox);
this.audiobookFixupsGb.Controls.Add(this.convertLosslessRb);
this.audiobookFixupsGb.Controls.Add(this.convertLossyRb);
this.audiobookFixupsGb.Controls.Add(this.stripAudibleBrandingCbox);
this.audiobookFixupsGb.Location = new System.Drawing.Point(6, 143);
this.audiobookFixupsGb.Name = "audiobookFixupsGb";
this.audiobookFixupsGb.Size = new System.Drawing.Size(403, 160);
this.audiobookFixupsGb.TabIndex = 19;
this.audiobookFixupsGb.TabStop = false;
this.audiobookFixupsGb.Text = "Audiobook Fix-ups";
//
// stripUnabridgedCbox
//
this.stripUnabridgedCbox.AutoSize = true;
this.stripUnabridgedCbox.Location = new System.Drawing.Point(13, 47);
this.stripUnabridgedCbox.Name = "stripUnabridgedCbox";
this.stripUnabridgedCbox.Size = new System.Drawing.Size(147, 19);
this.stripUnabridgedCbox.TabIndex = 13;
this.stripUnabridgedCbox.Text = "[StripUnabridged desc]";
this.stripUnabridgedCbox.UseVisualStyleBackColor = true;
//
// chapterTitleTemplateGb // chapterTitleTemplateGb
// //
this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateBtn); this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateBtn);
@ -977,16 +1013,6 @@
this.lameTargetBitrateRb.UseVisualStyleBackColor = true; this.lameTargetBitrateRb.UseVisualStyleBackColor = true;
this.lameTargetBitrateRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged); this.lameTargetBitrateRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged);
// //
// stripUnabridgedCbox
//
this.stripUnabridgedCbox.AutoSize = true;
this.stripUnabridgedCbox.Location = new System.Drawing.Point(13, 47);
this.stripUnabridgedCbox.Name = "stripUnabridgedCbox";
this.stripUnabridgedCbox.Size = new System.Drawing.Size(147, 19);
this.stripUnabridgedCbox.TabIndex = 13;
this.stripUnabridgedCbox.Text = "[StripUnabridged desc]";
this.stripUnabridgedCbox.UseVisualStyleBackColor = true;
//
// mergeOpeningEndCreditsCbox // mergeOpeningEndCreditsCbox
// //
this.mergeOpeningEndCreditsCbox.AutoSize = true; this.mergeOpeningEndCreditsCbox.AutoSize = true;
@ -1034,20 +1060,6 @@
this.createCueSheetCbox.UseVisualStyleBackColor = true; this.createCueSheetCbox.UseVisualStyleBackColor = true;
this.createCueSheetCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); this.createCueSheetCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged);
// //
// audiobookFixupsGb
//
this.audiobookFixupsGb.Controls.Add(this.splitFilesByChapterCbox);
this.audiobookFixupsGb.Controls.Add(this.stripUnabridgedCbox);
this.audiobookFixupsGb.Controls.Add(this.convertLosslessRb);
this.audiobookFixupsGb.Controls.Add(this.convertLossyRb);
this.audiobookFixupsGb.Controls.Add(this.stripAudibleBrandingCbox);
this.audiobookFixupsGb.Location = new System.Drawing.Point(6, 143);
this.audiobookFixupsGb.Name = "audiobookFixupsGb";
this.audiobookFixupsGb.Size = new System.Drawing.Size(403, 160);
this.audiobookFixupsGb.TabIndex = 19;
this.audiobookFixupsGb.TabStop = false;
this.audiobookFixupsGb.Text = "Audiobook Fix-ups";
//
// SettingsDialog // SettingsDialog
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
@ -1082,6 +1094,8 @@
this.customFileNamingGb.PerformLayout(); this.customFileNamingGb.PerformLayout();
this.tab4AudioFileOptions.ResumeLayout(false); this.tab4AudioFileOptions.ResumeLayout(false);
this.tab4AudioFileOptions.PerformLayout(); this.tab4AudioFileOptions.PerformLayout();
this.audiobookFixupsGb.ResumeLayout(false);
this.audiobookFixupsGb.PerformLayout();
this.chapterTitleTemplateGb.ResumeLayout(false); this.chapterTitleTemplateGb.ResumeLayout(false);
this.chapterTitleTemplateGb.PerformLayout(); this.chapterTitleTemplateGb.PerformLayout();
this.lameOptionsGb.ResumeLayout(false); this.lameOptionsGb.ResumeLayout(false);
@ -1094,8 +1108,6 @@
((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).EndInit();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
this.audiobookFixupsGb.ResumeLayout(false);
this.audiobookFixupsGb.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -1183,5 +1195,6 @@
private System.Windows.Forms.Button editCharreplacementBtn; private System.Windows.Forms.Button editCharreplacementBtn;
private System.Windows.Forms.CheckBox mergeOpeningEndCreditsCbox; private System.Windows.Forms.CheckBox mergeOpeningEndCreditsCbox;
private System.Windows.Forms.GroupBox audiobookFixupsGb; private System.Windows.Forms.GroupBox audiobookFixupsGb;
private System.Windows.Forms.CheckBox betaOptInCbox;
} }
} }

View File

@ -22,6 +22,7 @@ namespace LibationWinForms.Dialogs
} }
booksLocationDescLbl.Text = desc(nameof(config.Books)); booksLocationDescLbl.Text = desc(nameof(config.Books));
betaOptInCbox.Text = desc(nameof(config.BetaOptIn));
this.saveEpisodesToSeriesFolderCbox.Text = desc(nameof(config.SavePodcastsToParentFolder)); this.saveEpisodesToSeriesFolderCbox.Text = desc(nameof(config.SavePodcastsToParentFolder));
booksSelectControl.SetSearchTitle("books location"); booksSelectControl.SetSearchTitle("books location");
@ -37,6 +38,10 @@ namespace LibationWinForms.Dialogs
booksSelectControl.SelectDirectory(config.Books); booksSelectControl.SelectDirectory(config.Books);
saveEpisodesToSeriesFolderCbox.Checked = config.SavePodcastsToParentFolder; saveEpisodesToSeriesFolderCbox.Checked = config.SavePodcastsToParentFolder;
betaOptInCbox.Checked = config.BetaOptIn;
if (!betaOptInCbox.Checked)
betaOptInCbox.CheckedChanged += betaOptInCbox_CheckedChanged;
} }
private void Save_Important(Configuration config) private void Save_Important(Configuration config)
@ -88,6 +93,35 @@ namespace LibationWinForms.Dialogs
} }
config.SavePodcastsToParentFolder = saveEpisodesToSeriesFolderCbox.Checked; config.SavePodcastsToParentFolder = saveEpisodesToSeriesFolderCbox.Checked;
config.BetaOptIn = betaOptInCbox.Checked;
}
private void betaOptInCbox_CheckedChanged(object sender, EventArgs e)
{
if (!betaOptInCbox.Checked)
return;
var result = MessageBox.Show(this, @"
You've chosen to opt-in to Libation's beta releases. Thank you! We need all the testers we can get.
These features are works in progress and potentially very buggy. Libation may crash unexpectedly, and your library database may even be corruted. We suggest you back up your LibationContext.db file before proceding.
If bad/weird things happen, please report them at getlibation.com.
".Trim(), "A word of warning...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
if (result == DialogResult.Yes)
{
betaOptInCbox.CheckedChanged -= betaOptInCbox_CheckedChanged;
}
else
{
betaOptInCbox.Checked = false;
}
} }
} }
} }