MatchCurrent

This commit is contained in:
Michael Bucari-Tovo 2022-05-11 23:44:33 -06:00
parent 71b8bca86d
commit d5ba405de0
3 changed files with 77 additions and 79 deletions

View File

@ -1,33 +1,33 @@
namespace LibationWinForms namespace LibationWinForms
{ {
partial class Form1 partial class Form1
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary> /// <summary>
/// Clean up any resources being used. /// Clean up any resources being used.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing && (components != null)) if (disposing && (components != null))
{ {
components.Dispose(); components.Dispose();
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
#region Windows Form Designer generated code #region Windows Form Designer generated code
/// <summary> /// <summary>
/// Required method for Designer support - do not modify /// Required method for Designer support - do not modify
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.gridPanel = new System.Windows.Forms.Panel(); this.gridPanel = new System.Windows.Forms.Panel();
this.filterHelpBtn = new System.Windows.Forms.Button(); this.filterHelpBtn = new System.Windows.Forms.Button();
@ -445,38 +445,38 @@
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.Panel gridPanel; private System.Windows.Forms.Panel gridPanel;
private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
private System.Windows.Forms.StatusStrip statusStrip1; private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel springLbl; private System.Windows.Forms.ToolStripStatusLabel springLbl;
private System.Windows.Forms.ToolStripStatusLabel visibleCountLbl; private System.Windows.Forms.ToolStripStatusLabel visibleCountLbl;
private System.Windows.Forms.ToolStripMenuItem liberateToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem liberateToolStripMenuItem;
private System.Windows.Forms.ToolStripStatusLabel backupsCountsLbl; private System.Windows.Forms.ToolStripStatusLabel backupsCountsLbl;
private System.Windows.Forms.ToolStripMenuItem beginBookBackupsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem beginBookBackupsToolStripMenuItem;
private System.Windows.Forms.ToolStripStatusLabel pdfsCountsLbl; private System.Windows.Forms.ToolStripStatusLabel pdfsCountsLbl;
private System.Windows.Forms.ToolStripMenuItem beginPdfBackupsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem beginPdfBackupsToolStripMenuItem;
private System.Windows.Forms.TextBox filterSearchTb; private System.Windows.Forms.TextBox filterSearchTb;
private System.Windows.Forms.Button filterBtn; private System.Windows.Forms.Button filterBtn;
private System.Windows.Forms.Button filterHelpBtn; private System.Windows.Forms.Button filterHelpBtn;
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem scanLibraryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem scanLibraryToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem quickFiltersToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem quickFiltersToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem firstFilterIsDefaultToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem firstFilterIsDefaultToolStripMenuItem;
private System.Windows.Forms.Button addFilterBtn; private System.Windows.Forms.Button addFilterBtn;
private System.Windows.Forms.ToolStripMenuItem editQuickFiltersToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem editQuickFiltersToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem basicSettingsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem basicSettingsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem accountsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem accountsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem scanLibraryOfAllAccountsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem scanLibraryOfAllAccountsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem scanLibraryOfSomeAccountsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem scanLibraryOfSomeAccountsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem noAccountsYetAddAccountToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem noAccountsYetAddAccountToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportLibraryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exportLibraryToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem convertAllM4bToMp3ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem convertAllM4bToMp3ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeLibraryBooksToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem removeLibraryBooksToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeAllAccountsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem removeAllAccountsToolStripMenuItem;

View File

@ -42,9 +42,9 @@ namespace LibationWinForms
this.FormClosing += (_, _) => this.SaveSizeAndLocation(Configuration.Instance); this.FormClosing += (_, _) => this.SaveSizeAndLocation(Configuration.Instance);
LibraryCommands.LibrarySizeChanged += reloadGridAndUpdateBottomNumbers; LibraryCommands.LibrarySizeChanged += reloadGridAndUpdateBottomNumbers;
LibraryCommands.BookUserDefinedItemCommitted += setBackupCounts; LibraryCommands.BookUserDefinedItemCommitted += setBackupCounts;
QuickFilters.Updated += updateFiltersMenu; QuickFilters.Updated += updateFiltersMenu;
LibraryCommands.ScanBegin += LibraryCommands_ScanBegin; LibraryCommands.ScanBegin += LibraryCommands_ScanBegin;
LibraryCommands.ScanEnd += LibraryCommands_ScanEnd; LibraryCommands.ScanEnd += LibraryCommands_ScanEnd;
// accounts updated // accounts updated
this.Load += refreshImportMenu; this.Load += refreshImportMenu;
@ -86,7 +86,7 @@ namespace LibationWinForms
this.UIThreadAsync(() => doFilter(lastGoodFilter)); this.UIThreadAsync(() => doFilter(lastGoodFilter));
setBackupCounts(); setBackupCounts();
} }
#region bottom: backup counts #region bottom: backup counts
private System.ComponentModel.BackgroundWorker updateCountsBw; private System.ComponentModel.BackgroundWorker updateCountsBw;
@ -258,7 +258,7 @@ namespace LibationWinForms
Configuration.Instance.AutoScanChanged += startAutoScan; Configuration.Instance.AutoScanChanged += startAutoScan;
} }
private List<(string AccountId, string LocaleName)> preSaveDefaultAccounts; private List<(string AccountId, string LocaleName)> preSaveDefaultAccounts;
private List<(string AccountId, string LocaleName)> getDefaultAccounts() private List<(string AccountId, string LocaleName)> getDefaultAccounts()
{ {
using var persister = AudibleApiStorage.GetAccountsSettingsPersister(); using var persister = AudibleApiStorage.GetAccountsSettingsPersister();
@ -317,11 +317,11 @@ namespace LibationWinForms
} }
private async void scanLibraryToolStripMenuItem_Click(object sender, EventArgs e) private async void scanLibraryToolStripMenuItem_Click(object sender, EventArgs e)
{ {
using var persister = AudibleApiStorage.GetAccountsSettingsPersister(); using var persister = AudibleApiStorage.GetAccountsSettingsPersister();
var firstAccount = persister.AccountsSettings.GetAll().FirstOrDefault(); var firstAccount = persister.AccountsSettings.GetAll().FirstOrDefault();
await scanLibrariesAsync(firstAccount); await scanLibrariesAsync(firstAccount);
} }
private async void scanLibraryOfAllAccountsToolStripMenuItem_Click(object sender, EventArgs e) private async void scanLibraryOfAllAccountsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
@ -518,7 +518,8 @@ namespace LibationWinForms
#region Visible Books menu #region Visible Books menu
private void configVisibleBooksMenu() private void configVisibleBooksMenu()
{ {
productsGrid.VisibleCountChanged += (_, qty) => { productsGrid.VisibleCountChanged += (_, qty) =>
{
visibleBooksToolStripMenuItem.Text = string.Format(visibleBooksToolStripMenuItem_format, qty); visibleBooksToolStripMenuItem.Text = string.Format(visibleBooksToolStripMenuItem_format, qty);
visibleBooksToolStripMenuItem.Enabled = qty > 0; visibleBooksToolStripMenuItem.Enabled = qty > 0;
@ -572,11 +573,11 @@ namespace LibationWinForms
private void basicSettingsToolStripMenuItem_Click(object sender, EventArgs e) => new SettingsDialog().ShowDialog(); private void basicSettingsToolStripMenuItem_Click(object sender, EventArgs e) => new SettingsDialog().ShowDialog();
private void aboutToolStripMenuItem_Click(object sender, EventArgs e) private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
=> MessageBox.Show($"Running Libation version {AppScaffolding.LibationScaffolding.BuildVersion}", $"Libation v{AppScaffolding.LibationScaffolding.BuildVersion}"); => MessageBox.Show($"Running Libation version {AppScaffolding.LibationScaffolding.BuildVersion}", $"Libation v{AppScaffolding.LibationScaffolding.BuildVersion}");
#endregion #endregion
#region Scanning label #region Scanning label
private void LibraryCommands_ScanBegin(object sender, int accountsLength) private void LibraryCommands_ScanBegin(object sender, int accountsLength)
{ {
scanLibraryToolStripMenuItem.Enabled = false; scanLibraryToolStripMenuItem.Enabled = false;
@ -598,6 +599,6 @@ namespace LibationWinForms
this.scanningToolStripMenuItem.Visible = false; this.scanningToolStripMenuItem.Visible = false;
} }
#endregion #endregion
} }
} }

View File

@ -15,6 +15,7 @@ using LibationWinForms.Dialogs;
namespace LibationWinForms namespace LibationWinForms
{ {
#region // legacy instructions to update data_grid_view #region // legacy instructions to update data_grid_view
// INSTRUCTIONS TO UPDATE DATA_GRID_VIEW // INSTRUCTIONS TO UPDATE DATA_GRID_VIEW
// - delete current DataGridView // - delete current DataGridView
@ -36,7 +37,6 @@ namespace LibationWinForms
public partial class ProductsGrid : UserControl public partial class ProductsGrid : UserControl
{ {
internal event EventHandler<GridEntry> LiberateClicked;
/// <summary>Number of visible rows has changed</summary> /// <summary>Number of visible rows has changed</summary>
public event EventHandler<int> VisibleCountChanged; public event EventHandler<int> VisibleCountChanged;
@ -124,7 +124,7 @@ namespace LibationWinForms
displayWindow.Show(this); displayWindow.Show(this);
} }
private async Task Liberate_Click(GridEntry liveGridEntry) private static async Task Liberate_Click(GridEntry liveGridEntry)
{ {
var libraryBook = liveGridEntry.LibraryBook; var libraryBook = liveGridEntry.LibraryBook;
@ -271,9 +271,6 @@ namespace LibationWinForms
.Select(row => ((GridEntry)row.DataBoundItem).LibraryBook) .Select(row => ((GridEntry)row.DataBoundItem).LibraryBook)
.ToList(); .ToList();
internal IEnumerable<GridEntry> AllEntries
=> bindingList;
private GridEntry getGridEntry(int rowIndex) => _dataGridView.GetBoundItem<GridEntry>(rowIndex); private GridEntry getGridEntry(int rowIndex) => _dataGridView.GetBoundItem<GridEntry>(rowIndex);
#region Column Customizations #region Column Customizations