mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[TUI] Add status bar.
This commit is contained in:
@@ -29,7 +29,11 @@ public sealed partial class MainWindowViewModel : ViewModelBase
|
||||
ObservableCollection<FileModel> _files = [];
|
||||
[ObservableProperty]
|
||||
string _informationalVersion;
|
||||
[ObservableProperty]
|
||||
bool _isStatusVisible;
|
||||
FileModel? _selectedFile;
|
||||
[ObservableProperty]
|
||||
string _status;
|
||||
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
@@ -43,6 +47,7 @@ public sealed partial class MainWindowViewModel : ViewModelBase
|
||||
"?.?.?";
|
||||
|
||||
Copyright = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyCopyrightAttribute>()?.Copyright ?? "";
|
||||
Status = "Loading...";
|
||||
}
|
||||
|
||||
public FileModel? SelectedFile
|
||||
@@ -89,6 +94,8 @@ public sealed partial class MainWindowViewModel : ViewModelBase
|
||||
|
||||
public void LoadFiles()
|
||||
{
|
||||
IsStatusVisible = true;
|
||||
Status = "Loading...";
|
||||
CurrentPath = Directory.GetCurrentDirectory();
|
||||
Files.Clear();
|
||||
|
||||
@@ -141,6 +148,9 @@ public sealed partial class MainWindowViewModel : ViewModelBase
|
||||
|
||||
void Worker()
|
||||
{
|
||||
IsStatusVisible = true;
|
||||
Status = "Loading file information...";
|
||||
|
||||
foreach(FileModel file in Files)
|
||||
{
|
||||
try
|
||||
@@ -260,6 +270,9 @@ public sealed partial class MainWindowViewModel : ViewModelBase
|
||||
SentrySdk.CaptureException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
Status = "Done.";
|
||||
IsStatusVisible = false;
|
||||
}
|
||||
|
||||
void OpenSelectedFile()
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
<console:LineBrush LineStyle="DoubleLine"
|
||||
Brush="Blue" />
|
||||
</Border.BorderBrush>
|
||||
<Grid ColumnDefinitions="*,*">
|
||||
<Grid RowDefinitions="*,Auto">
|
||||
<Grid ColumnDefinitions="*,*"
|
||||
Grid.Row="0">
|
||||
<ListBox Grid.Column="0"
|
||||
ItemsSource="{Binding Files, Mode=OneWay}"
|
||||
BorderThickness="1"
|
||||
@@ -156,6 +158,10 @@
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding Status, Mode=OneWay}"
|
||||
IsVisible="{Binding IsStatusVisible, Mode=OneWay}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user