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 = [];
|
ObservableCollection<FileModel> _files = [];
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
string _informationalVersion;
|
string _informationalVersion;
|
||||||
|
[ObservableProperty]
|
||||||
|
bool _isStatusVisible;
|
||||||
FileModel? _selectedFile;
|
FileModel? _selectedFile;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _status;
|
||||||
|
|
||||||
public MainWindowViewModel()
|
public MainWindowViewModel()
|
||||||
{
|
{
|
||||||
@@ -43,6 +47,7 @@ public sealed partial class MainWindowViewModel : ViewModelBase
|
|||||||
"?.?.?";
|
"?.?.?";
|
||||||
|
|
||||||
Copyright = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyCopyrightAttribute>()?.Copyright ?? "";
|
Copyright = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyCopyrightAttribute>()?.Copyright ?? "";
|
||||||
|
Status = "Loading...";
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileModel? SelectedFile
|
public FileModel? SelectedFile
|
||||||
@@ -89,6 +94,8 @@ public sealed partial class MainWindowViewModel : ViewModelBase
|
|||||||
|
|
||||||
public void LoadFiles()
|
public void LoadFiles()
|
||||||
{
|
{
|
||||||
|
IsStatusVisible = true;
|
||||||
|
Status = "Loading...";
|
||||||
CurrentPath = Directory.GetCurrentDirectory();
|
CurrentPath = Directory.GetCurrentDirectory();
|
||||||
Files.Clear();
|
Files.Clear();
|
||||||
|
|
||||||
@@ -141,6 +148,9 @@ public sealed partial class MainWindowViewModel : ViewModelBase
|
|||||||
|
|
||||||
void Worker()
|
void Worker()
|
||||||
{
|
{
|
||||||
|
IsStatusVisible = true;
|
||||||
|
Status = "Loading file information...";
|
||||||
|
|
||||||
foreach(FileModel file in Files)
|
foreach(FileModel file in Files)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -260,6 +270,9 @@ public sealed partial class MainWindowViewModel : ViewModelBase
|
|||||||
SentrySdk.CaptureException(ex);
|
SentrySdk.CaptureException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status = "Done.";
|
||||||
|
IsStatusVisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenSelectedFile()
|
void OpenSelectedFile()
|
||||||
|
|||||||
@@ -20,7 +20,9 @@
|
|||||||
<console:LineBrush LineStyle="DoubleLine"
|
<console:LineBrush LineStyle="DoubleLine"
|
||||||
Brush="Blue" />
|
Brush="Blue" />
|
||||||
</Border.BorderBrush>
|
</Border.BorderBrush>
|
||||||
<Grid ColumnDefinitions="*,*">
|
<Grid RowDefinitions="*,Auto">
|
||||||
|
<Grid ColumnDefinitions="*,*"
|
||||||
|
Grid.Row="0">
|
||||||
<ListBox Grid.Column="0"
|
<ListBox Grid.Column="0"
|
||||||
ItemsSource="{Binding Files, Mode=OneWay}"
|
ItemsSource="{Binding Files, Mode=OneWay}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
@@ -156,6 +158,10 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<TextBlock Grid.Row="1"
|
||||||
|
Text="{Binding Status, Mode=OneWay}"
|
||||||
|
IsVisible="{Binding IsStatusVisible, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Window>
|
</Window>
|
||||||
Reference in New Issue
Block a user