diff --git a/Source/LibationWinForms/AvaloniaUI/ViewModels/GridEntry2.cs b/Source/LibationWinForms/AvaloniaUI/ViewModels/GridEntry2.cs index 2b85abd6..e04f7205 100644 --- a/Source/LibationWinForms/AvaloniaUI/ViewModels/GridEntry2.cs +++ b/Source/LibationWinForms/AvaloniaUI/ViewModels/GridEntry2.cs @@ -55,6 +55,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels public abstract bool IsSeries { get; } public abstract bool IsEpisode { get; } public abstract bool IsBook { get; } + public IBrush BackgroundBrush => IsEpisode ? App.SeriesEntryGridBackgroundBrush : null; #endregion diff --git a/Source/LibationWinForms/AvaloniaUI/ViewModels/MainWindowViewModel.cs b/Source/LibationWinForms/AvaloniaUI/ViewModels/MainWindowViewModel.cs index 3c2ed52b..918a9019 100644 --- a/Source/LibationWinForms/AvaloniaUI/ViewModels/MainWindowViewModel.cs +++ b/Source/LibationWinForms/AvaloniaUI/ViewModels/MainWindowViewModel.cs @@ -9,6 +9,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels { private string _filterString; private string _removeBooksButtonText = "Remove # Books from Libation"; + private bool _removeBooksButtonEnabled = true; private bool _autoScanChecked = true; private bool _firstFilterIsDefault = true; private bool _removeButtonsVisible = true; @@ -31,6 +32,10 @@ namespace LibationWinForms.AvaloniaUI.ViewModels public string RemoveBooksButtonText { get => _removeBooksButtonText; set => this.RaiseAndSetIfChanged(ref _removeBooksButtonText, value); } + /// Indicates if the "Remove # Books from Libation" button is enabled + public bool RemoveBooksButtonEnabled { get => _removeBooksButtonEnabled; set { this.RaiseAndSetIfChanged(ref _removeBooksButtonEnabled, value); } } + + /// Auto scanning accounts is enables public bool AutoScanChecked { @@ -44,7 +49,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels } - /// Indicates that the first quick filter is the default filter + /// Indicates if the first quick filter is the default filter public bool FirstFilterIsDefault { get => _firstFilterIsDefault; @@ -57,7 +62,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels } - /// Indicates if the "Remove # Books from Libation" and "Done Removing" buttons shouls be visible + /// Indicates if the "Remove # Books from Libation" and "Done Removing" buttons should be visible public bool RemoveButtonsVisible { get => _removeButtonsVisible; @@ -70,6 +75,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels + /// The number of accounts currently being scanned public int NumAccountsScanning { @@ -83,7 +89,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels } } - /// Indicates that Libation is currently scanning account(s) + /// Indicates if Libation is currently scanning account(s) public bool ActivelyScanning => _numAccountsScanning > 0; /// Indicates if the "Remove Books" menu items are enabled public bool RemoveMenuItemsEnabled => !RemoveButtonsVisible && !ActivelyScanning; @@ -183,16 +189,12 @@ namespace LibationWinForms.AvaloniaUI.ViewModels ? $"Begin _PDF Only Backups: {LibraryStats.pdfsNotDownloaded} remaining" : "All PDFs have been downloaded"; - - this.RaisePropertyChanged(nameof(HasBookResults)); this.RaisePropertyChanged(nameof(StatusCountText)); this.RaisePropertyChanged(nameof(BookBackupsToolStripText)); this.RaisePropertyChanged(nameof(PdfBackupsToolStripText)); } } - /// Indicates whether the library contains any books - public bool HasBookResults => LibraryStats?.HasBookResults ?? false; /// Bottom-left library statistics display text public string StatusCountText { get; private set; } = "[Calculating backed up book quantities] | [Calculating backed up PDFs]"; /// The "Begin Book and PDF Backup" menu item header text diff --git a/Source/LibationWinForms/AvaloniaUI/Views/MainWindow/MainWindow.RemoveBooks.axaml.cs b/Source/LibationWinForms/AvaloniaUI/Views/MainWindow/MainWindow.RemoveBooks.axaml.cs index 756e1098..8100245d 100644 --- a/Source/LibationWinForms/AvaloniaUI/Views/MainWindow/MainWindow.RemoveBooks.axaml.cs +++ b/Source/LibationWinForms/AvaloniaUI/Views/MainWindow/MainWindow.RemoveBooks.axaml.cs @@ -61,6 +61,7 @@ namespace LibationWinForms.AvaloniaUI.Views productsDisplay.Filter(null); + _viewModel.RemoveBooksButtonEnabled = true; _viewModel.RemoveButtonsVisible = true; await productsDisplay.ScanAndRemoveBooksAsync(accounts); @@ -68,7 +69,9 @@ namespace LibationWinForms.AvaloniaUI.Views public async void removeBooksBtn_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) { + _viewModel.RemoveBooksButtonEnabled = false; await productsDisplay.RemoveCheckedBooksAsync(); + _viewModel.RemoveBooksButtonEnabled = true; } public async void doneRemovingBtn_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) diff --git a/Source/LibationWinForms/AvaloniaUI/Views/MainWindow/MainWindow.axaml b/Source/LibationWinForms/AvaloniaUI/Views/MainWindow/MainWindow.axaml index 22be4f5a..cef046e9 100644 --- a/Source/LibationWinForms/AvaloniaUI/Views/MainWindow/MainWindow.axaml +++ b/Source/LibationWinForms/AvaloniaUI/Views/MainWindow/MainWindow.axaml @@ -41,11 +41,13 @@ + + @@ -77,7 +79,7 @@ - + @@ -149,7 +151,7 @@ -