Copy from ISO

This commit is contained in:
2023-09-04 18:05:01 +02:00
parent a323edafd3
commit 3a29991948
20 changed files with 241 additions and 48 deletions

View File

@@ -100,6 +100,9 @@ public class ContainerSizeSizeScanProvider : ContentProviderBase, IContainerSize
public override VolumeSizeInfo? GetVolumeSizeInfo(FullName path) => null;
public override ValueTask<NativePath?> GetSupportedPathPart(NativePath nativePath)
=> ValueTask.FromResult<NativePath?>(nativePath);
public ISizeScanTask StartSizeScan(IContainer scanSizeOf)
{
var searchTask = _serviceProvider

View File

@@ -22,6 +22,7 @@ namespace FileTime.App.Core.Services.UserCommandHandler;
public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
{
private const int PageSize = 8;
private readonly IAppState _appState;
private readonly IServiceProvider _serviceProvider;
private readonly ILocalContentProvider _localContentProvider;
@@ -33,6 +34,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
private readonly IContentProviderRegistry _contentProviderRegistry;
private readonly ILogger<NavigationUserCommandHandlerService> _logger;
private readonly ApplicationConfiguration _applicationConfiguration;
private ITabViewModel? _selectedTab;
private IDeclarativeProperty<IContainer?>? _currentLocation;
private IDeclarativeProperty<IItemViewModel?>? _currentSelectedItem;
@@ -147,9 +149,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
}
private async Task GoByFrequency()
{
await _frequencyNavigationService.OpenNavigationWindow();
}
=> await _frequencyNavigationService.OpenNavigationWindow();
private async Task GoToPath()
{
@@ -166,6 +166,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
}
catch
{
// ignored
}
if (resolvedPath is IContainer container)
@@ -173,10 +174,10 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
await _userCommandHandlerService.HandleCommandAsync(
new OpenContainerCommand(new AbsolutePath(_timelessContentProvider, container)));
}
else if (resolvedPath is IElement element)
else if (resolvedPath is IElement {Parent: { } parent})
{
await _userCommandHandlerService.HandleCommandAsync(
new OpenContainerCommand(element.Parent!));
new OpenContainerCommand(parent));
}
else
{
@@ -492,7 +493,10 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
private Task CloseTab()
{
if ((!_applicationConfiguration.AllowCloseLastTab && _appState.Tabs.Count < 2) || _selectedTab == null) return Task.CompletedTask;
if ((!_applicationConfiguration.AllowCloseLastTab && _appState.Tabs.Count < 2) || _selectedTab == null)
{
return Task.CompletedTask;
}
var tabToRemove = _selectedTab;
_appState.RemoveTab(tabToRemove!);
@@ -503,6 +507,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
}
catch
{
// ignored
}
return Task.CompletedTask;

View File

@@ -80,6 +80,7 @@ public class SearchContentProvider : ContentProviderBase, ISearchContentProvider
public override Task<bool> CanHandlePathAsync(NativePath path) => Task.FromResult(path.Path.StartsWith(ContentProviderName));
public override VolumeSizeInfo? GetVolumeSizeInfo(FullName path) => null;
public override ValueTask<NativePath?> GetSupportedPathPart(NativePath nativePath) => throw new NotImplementedException();
public async Task<ISearchTask> StartSearchAsync(ISearchMatcher matcher, IContainer searchIn)
{