mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[TUI] Add filesystem information display in image window
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text;
|
||||
using System.Windows.Input;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
@@ -10,6 +11,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Humanizer;
|
||||
using Humanizer.Bytes;
|
||||
using Partition = Aaru.CommonTypes.Partition;
|
||||
|
||||
namespace Aaru.Tui.ViewModels.Windows;
|
||||
|
||||
@@ -21,6 +23,10 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
|
||||
[ObservableProperty]
|
||||
public string _filePath;
|
||||
[ObservableProperty]
|
||||
string _filesystemInformation;
|
||||
[ObservableProperty]
|
||||
bool _isFilesystemInformationVisible;
|
||||
[ObservableProperty]
|
||||
bool _isPartitionInformationVisible;
|
||||
[ObservableProperty]
|
||||
bool _isStatusVisible;
|
||||
@@ -95,7 +101,18 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
|
||||
else
|
||||
IsPartitionInformationVisible = false;
|
||||
|
||||
if(_selectedNode.Filesystem is not null)
|
||||
{
|
||||
IsFilesystemInformationVisible = true;
|
||||
FilesystemInformation = _selectedNode.FilesystemInformation ?? "";
|
||||
|
||||
OnPropertyChanged(nameof(FilesystemInformation));
|
||||
}
|
||||
else
|
||||
IsFilesystemInformationVisible = false;
|
||||
|
||||
OnPropertyChanged(nameof(IsPartitionInformationVisible));
|
||||
OnPropertyChanged(nameof(IsFilesystemInformationVisible));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,6 +184,17 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
|
||||
Filesystem = fs
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
fs.GetInformation(_imageFormat, partition, Encoding.ASCII, out string? information, out _);
|
||||
|
||||
fsNode.FilesystemInformation = information;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
SentrySdk.CaptureException(ex);
|
||||
}
|
||||
|
||||
subNodes.Add(fsNode);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user