Commit edits before refresh
This commit is contained in:
parent
708cdcc24c
commit
2e49c7f697
@ -77,7 +77,7 @@ namespace LibationAvalonia.ViewModels
|
||||
//Run query on new list
|
||||
FilteredInGridEntries = QueryResults(SOURCE, FilterString);
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(GridEntries.Refresh);
|
||||
await refreshGrid();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -86,6 +86,14 @@ namespace LibationAvalonia.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private async Task refreshGrid()
|
||||
{
|
||||
if (GridEntries.IsEditingItem)
|
||||
await Dispatcher.UIThread.InvokeAsync(GridEntries.CommitEdit);
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(GridEntries.Refresh);
|
||||
}
|
||||
|
||||
private static List<GridEntry> CreateGridEntries(IEnumerable<LibraryBook> dbBooks)
|
||||
{
|
||||
var geList = dbBooks
|
||||
@ -118,10 +126,11 @@ namespace LibationAvalonia.ViewModels
|
||||
return bookList;
|
||||
}
|
||||
|
||||
public void ToggleSeriesExpanded(SeriesEntry seriesEntry)
|
||||
public async Task ToggleSeriesExpanded(SeriesEntry seriesEntry)
|
||||
{
|
||||
seriesEntry.Liberate.Expanded = !seriesEntry.Liberate.Expanded;
|
||||
GridEntries.Refresh();
|
||||
|
||||
await refreshGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -140,7 +149,7 @@ namespace LibationAvalonia.ViewModels
|
||||
|
||||
FilteredInGridEntries = QueryResults(SOURCE, searchString);
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(GridEntries.Refresh);
|
||||
await refreshGrid();
|
||||
}
|
||||
|
||||
private bool CollectionFilter(object item)
|
||||
@ -176,11 +185,7 @@ namespace LibationAvalonia.ViewModels
|
||||
if (filterResults is not null && FilteredInGridEntries.Intersect(filterResults).Count() != FilteredInGridEntries.Count)
|
||||
{
|
||||
FilteredInGridEntries = filterResults;
|
||||
|
||||
if (GridEntries.IsEditingItem)
|
||||
await Dispatcher.UIThread.InvokeAsync(GridEntries.CommitEdit);
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(GridEntries.Refresh);
|
||||
await refreshGrid();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using ApplicationServices;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Platform.Storage;
|
||||
using LibationFileManager;
|
||||
using System;
|
||||
@ -6,6 +7,7 @@ using System.Linq;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private void Configure_Export() { }
|
||||
|
||||
@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
protected void Configure_Filter() { }
|
||||
|
||||
@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private void Configure_Liberate() { }
|
||||
|
||||
@ -5,6 +5,7 @@ using System.Linq;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private void Configure_QuickFilters()
|
||||
|
||||
@ -4,6 +4,7 @@ using System.Linq;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private void Configure_RemoveBooks()
|
||||
|
||||
@ -9,6 +9,7 @@ using System.Linq;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private InterruptableTimer autoScanTimer;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using ApplicationServices;
|
||||
using AudibleUtilities;
|
||||
using Avalonia.Controls;
|
||||
using LibationFileManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -8,6 +9,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private void Configure_ScanManual()
|
||||
|
||||
@ -4,6 +4,7 @@ using System.Linq;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private void Configure_ScanNotification()
|
||||
|
||||
@ -3,6 +3,7 @@ using System.Linq;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private void Configure_Settings() { }
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
using ApplicationServices;
|
||||
using Avalonia.Threading;
|
||||
using DataLayer;
|
||||
using Dinah.Core;
|
||||
using LibationFileManager;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private void Configure_VisibleBooks()
|
||||
|
||||
@ -84,7 +84,12 @@ namespace LibationFileManager
|
||||
|
||||
// temp/working dir(s) should be outside of dropbox
|
||||
[Description("Temporary location of files while they're in process of being downloaded and decrypted.\r\nWhen decryption is complete, the final file will be in Books location\r\nRecommend not using a folder which is backed up real time. Eg: Dropbox, iCloud, Google Drive")]
|
||||
public string InProgress { get => GetString(defaultValue: WinTemp); set => SetString(value); }
|
||||
public string InProgress { get
|
||||
{
|
||||
var tempDir = GetString();
|
||||
return string.IsNullOrWhiteSpace(tempDir) ? WinTemp : tempDir;
|
||||
}
|
||||
set => SetString(value); }
|
||||
|
||||
[Description("Allow Libation to fix up audiobook metadata")]
|
||||
public bool AllowLibationFixup { get => GetNonString(defaultValue: true); set => SetNonString(value); }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user