Adjust visibility of items in import ROM view.

This commit is contained in:
2025-07-24 21:13:45 +01:00
parent 55a6af0c74
commit 1435aa10ee
2 changed files with 7 additions and 2 deletions

View File

@@ -30,6 +30,8 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
readonly ConcurrentBag<DbMedia> _newMedias = []; readonly ConcurrentBag<DbMedia> _newMedias = [];
readonly Stopwatch _stopwatch = new(); readonly Stopwatch _stopwatch = new();
[ObservableProperty] [ObservableProperty]
bool _canChoose;
[ObservableProperty]
bool _canClose; bool _canClose;
[ObservableProperty] [ObservableProperty]
bool _canStart; bool _canStart;
@@ -75,7 +77,6 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
[ObservableProperty] [ObservableProperty]
bool _statusMessage2Visible; bool _statusMessage2Visible;
public ImportRomFolderViewModel() public ImportRomFolderViewModel()
{ {
SelectFolderCommand = new AsyncRelayCommand(SelectFolderAsync); SelectFolderCommand = new AsyncRelayCommand(SelectFolderAsync);
@@ -86,6 +87,7 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
KnownOnlyChecked = true; KnownOnlyChecked = true;
RecurseArchivesChecked = Settings.Settings.UnArUsable; RecurseArchivesChecked = Settings.Settings.UnArUsable;
RemoveFilesEnabled = false; RemoveFilesEnabled = false;
CanChoose = true;
} }
public ICommand SelectFolderCommand { get; } public ICommand SelectFolderCommand { get; }
@@ -122,6 +124,8 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
CanClose = false; CanClose = false;
CanStart = false; CanStart = false;
IsImporting = true; IsImporting = true;
IsReady = false;
CanChoose = false;
_ = Task.Run(() => _rootImporter.FindFiles(FolderPath)); _ = Task.Run(() => _rootImporter.FindFiles(FolderPath));
} }

View File

@@ -26,7 +26,8 @@
<Button Content="{x:Static resources:Localization.ChooseLabel}" <Button Content="{x:Static resources:Localization.ChooseLabel}"
Command="{Binding SelectFolderCommand, Mode=OneWay}" Command="{Binding SelectFolderCommand, Mode=OneWay}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" /> VerticalAlignment="Center"
IsVisible="{Binding CanChoose}" />
<TextBlock Text="{x:Static resources:Localization.PathLabel}" <TextBlock Text="{x:Static resources:Localization.PathLabel}"
FontWeight="Bold" FontWeight="Bold"
VerticalAlignment="Center" /> VerticalAlignment="Center" />