diff --git a/.idea/.idea.Aaru/.idea/contentModel.xml b/.idea/.idea.Aaru/.idea/contentModel.xml
index 3de275a97..7ec2970e5 100644
--- a/.idea/.idea.Aaru/.idea/contentModel.xml
+++ b/.idea/.idea.Aaru/.idea/contentModel.xml
@@ -1252,14 +1252,14 @@
+
+
-
-
@@ -1297,6 +1297,7 @@
+
diff --git a/Aaru.Gui/Models/FileSystemModel.cs b/Aaru.Gui/Models/FileSystemModel.cs
index a1652bc28..e15362c61 100644
--- a/Aaru.Gui/Models/FileSystemModel.cs
+++ b/Aaru.Gui/Models/FileSystemModel.cs
@@ -1,4 +1,5 @@
using Aaru.CommonTypes.Interfaces;
+using Aaru.Gui.ViewModels;
namespace Aaru.Gui.Models
{
@@ -7,5 +8,6 @@ namespace Aaru.Gui.Models
public string VolumeName { get; set; }
public IFilesystem Filesystem { get; set; }
public IReadOnlyFilesystem ReadOnlyFilesystem { get; set; }
+ public FileSystemViewModel ViewModel { get; set; }
}
}
\ No newline at end of file
diff --git a/Aaru.Gui/Panels/FileSystemPanel.xaml b/Aaru.Gui/Panels/FileSystemPanel.xaml
new file mode 100644
index 000000000..3d5a6631d
--- /dev/null
+++ b/Aaru.Gui/Panels/FileSystemPanel.xaml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Aaru.Gui/Panels/FileSystemPanel.xaml.cs b/Aaru.Gui/Panels/FileSystemPanel.xaml.cs
new file mode 100644
index 000000000..a760eb8dc
--- /dev/null
+++ b/Aaru.Gui/Panels/FileSystemPanel.xaml.cs
@@ -0,0 +1,12 @@
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace Aaru.Gui.Panels
+{
+ public class FileSystemPanel : UserControl
+ {
+ public FileSystemPanel() => InitializeComponent();
+
+ void InitializeComponent() => AvaloniaXamlLoader.Load(this);
+ }
+}
\ No newline at end of file
diff --git a/Aaru.Gui/Panels/pnlFilesystem.xeto b/Aaru.Gui/Panels/pnlFilesystem.xeto
deleted file mode 100644
index 8f31e3aae..000000000
--- a/Aaru.Gui/Panels/pnlFilesystem.xeto
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Aaru.Gui/Panels/pnlFilesystem.xeto.cs b/Aaru.Gui/Panels/pnlFilesystem.xeto.cs
deleted file mode 100644
index 1e53dc214..000000000
--- a/Aaru.Gui/Panels/pnlFilesystem.xeto.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-// /***************************************************************************
-// Aaru Data Preservation Suite
-// ----------------------------------------------------------------------------
-//
-// Filename : pnlFilesystem.xeto.cs
-// Author(s) : Natalia Portillo claunia@claunia.com>
-//
-// Component : Filesystem information panel.
-//
-// --[ Description ] ----------------------------------------------------------
-//
-// Implements the filesystem information panel.
-//
-// --[ License ] --------------------------------------------------------------
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General public License as
-// published by the Free Software Foundation, either version 3 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General public License for more details.
-//
-// You should have received a copy of the GNU General public License
-// along with this program. If not, see http://www.gnu.org/licenses/>.
-//
-// ----------------------------------------------------------------------------
-// Copyright © 2011-2020 Natalia Portillo
-// ****************************************************************************/
-
-using Eto.Forms;
-using Eto.Serialization.Xaml;
-using Schemas;
-
-namespace Aaru.Gui.Panels
-{
- public class pnlFilesystem : Panel
- {
- public pnlFilesystem(FileSystemType xmlFsType, string information)
- {
- XamlReader.Load(this);
-
- lblType.Text = $"Filesystem type: {xmlFsType.Type}";
- lblVolumeName.Text = $"Volume name: {xmlFsType.VolumeName}";
- lblSerialNumber.Text = $"Serial number: {xmlFsType.VolumeSerial}";
- lblApplicationIdentifier.Text = $"Application identifier: {xmlFsType.ApplicationIdentifier}";
- lblSystemIdentifier.Text = $"System identifier: {xmlFsType.SystemIdentifier}";
- lblVolumeSetIdentifier.Text = $"Volume set identifier: {xmlFsType.VolumeSetIdentifier}";
- lblDataPreparerIdentifier.Text = $"Data preparer identifier: {xmlFsType.DataPreparerIdentifier}";
- lblPublisherIdentifier.Text = $"Publisher identifier: {xmlFsType.PublisherIdentifier}";
- lblCreationDate.Text = $"Volume created on {xmlFsType.CreationDate:F}";
- lblEffectiveDate.Text = $"Volume effective from {xmlFsType.EffectiveDate:F}";
- lblModificationDate.Text = $"Volume last modified on {xmlFsType.ModificationDate:F}";
- lblExpirationDate.Text = $"Volume expired on {xmlFsType.ExpirationDate:F}";
- lblBackupDate.Text = $"Volume last backed up on {xmlFsType.BackupDate:F}";
-
- lblClusters.Text =
- $"Volume has {xmlFsType.Clusters} clusters of {xmlFsType.ClusterSize} bytes each (total of {xmlFsType.Clusters * xmlFsType.ClusterSize} bytes)";
-
- lblFreeClusters.Text =
- $"Volume has {xmlFsType.FreeClusters} {xmlFsType.FreeClusters / xmlFsType.Clusters:P}";
-
- lblFiles.Text = $"Volume contains {xmlFsType.Files} files";
- chkBootable.Checked = xmlFsType.Bootable;
- chkDirty.Checked = xmlFsType.Dirty;
- txtInformation.Text = information;
-
- lblVolumeName.Visible = !string.IsNullOrEmpty(xmlFsType.VolumeName);
- lblSerialNumber.Visible = !string.IsNullOrEmpty(xmlFsType.VolumeSerial);
- lblApplicationIdentifier.Visible = !string.IsNullOrEmpty(xmlFsType.ApplicationIdentifier);
- lblSystemIdentifier.Visible = !string.IsNullOrEmpty(xmlFsType.SystemIdentifier);
- lblVolumeSetIdentifier.Visible = !string.IsNullOrEmpty(xmlFsType.VolumeSetIdentifier);
- lblDataPreparerIdentifier.Visible = !string.IsNullOrEmpty(xmlFsType.DataPreparerIdentifier);
- lblPublisherIdentifier.Visible = !string.IsNullOrEmpty(xmlFsType.PublisherIdentifier);
- lblCreationDate.Visible = xmlFsType.CreationDateSpecified;
- lblEffectiveDate.Visible = xmlFsType.EffectiveDateSpecified;
- lblModificationDate.Visible = xmlFsType.ModificationDateSpecified;
- lblExpirationDate.Visible = xmlFsType.ExpirationDateSpecified;
- lblBackupDate.Visible = xmlFsType.BackupDateSpecified;
- lblFreeClusters.Visible = xmlFsType.FreeClustersSpecified;
- lblFiles.Visible = xmlFsType.FilesSpecified;
- grpInformation.Visible = !string.IsNullOrEmpty(information);
- }
-
- #region XAML controls
- #pragma warning disable 169
- #pragma warning disable 649
- Label lblType;
- Label lblVolumeName;
- Label lblSerialNumber;
- Label lblApplicationIdentifier;
- Label lblSystemIdentifier;
- Label lblVolumeSetIdentifier;
- Label lblDataPreparerIdentifier;
- Label lblPublisherIdentifier;
- Label lblCreationDate;
- Label lblEffectiveDate;
- Label lblModificationDate;
- Label lblExpirationDate;
- Label lblBackupDate;
- Label lblClusters;
- Label lblFreeClusters;
- Label lblFiles;
- CheckBox chkBootable;
- CheckBox chkDirty;
- GroupBox grpInformation;
- TextArea txtInformation;
- #pragma warning restore 169
- #pragma warning restore 649
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Aaru.Gui/ViewModels/FileSystemViewModel.cs b/Aaru.Gui/ViewModels/FileSystemViewModel.cs
new file mode 100644
index 000000000..9d5d7003d
--- /dev/null
+++ b/Aaru.Gui/ViewModels/FileSystemViewModel.cs
@@ -0,0 +1,70 @@
+using Schemas;
+
+namespace Aaru.Gui.ViewModels
+{
+ public class FileSystemViewModel
+ {
+ public FileSystemViewModel(FileSystemType xmlFsType, string information)
+ {
+ TypeText = $"Filesystem type: {xmlFsType.Type}";
+ VolumeNameText = $"Volume name: {xmlFsType.VolumeName}";
+ SerialNumberText = $"Serial number: {xmlFsType.VolumeSerial}";
+ ApplicationIdentifierText = $"Application identifier: {xmlFsType.ApplicationIdentifier}";
+ SystemIdentifierText = $"System identifier: {xmlFsType.SystemIdentifier}";
+ VolumeSetIdentifierText = $"Volume set identifier: {xmlFsType.VolumeSetIdentifier}";
+ DataPreparerIdentifierText = $"Data preparer identifier: {xmlFsType.DataPreparerIdentifier}";
+ PublisherIdentifierText = $"Publisher identifier: {xmlFsType.PublisherIdentifier}";
+ CreationDateText = $"Volume created on {xmlFsType.CreationDate:F}";
+ EffectiveDateText = $"Volume effective from {xmlFsType.EffectiveDate:F}";
+ ModificationDateText = $"Volume last modified on {xmlFsType.ModificationDate:F}";
+ ExpirationDateText = $"Volume expired on {xmlFsType.ExpirationDate:F}";
+ BackupDateText = $"Volume last backed up on {xmlFsType.BackupDate:F}";
+
+ ClustersText =
+ $"Volume has {xmlFsType.Clusters} clusters of {xmlFsType.ClusterSize} bytes each (total of {xmlFsType.Clusters * xmlFsType.ClusterSize} bytes)";
+
+ FreeClustersText =
+ $"Volume has {xmlFsType.FreeClusters} clusters free ({xmlFsType.FreeClusters / xmlFsType.Clusters:P})";
+
+ FilesText = $"Volume contains {xmlFsType.Files} files";
+ BootableChecked = xmlFsType.Bootable;
+ DirtyChecked = xmlFsType.Dirty;
+ InformationText = information;
+
+ CreationDateVisible = xmlFsType.CreationDateSpecified;
+ EffectiveDateVisible = xmlFsType.EffectiveDateSpecified;
+ ModificationDateVisible = xmlFsType.ModificationDateSpecified;
+ ExpirationDateVisible = xmlFsType.ExpirationDateSpecified;
+ BackupDateVisible = xmlFsType.BackupDateSpecified;
+ FreeClustersVisible = xmlFsType.FreeClustersSpecified;
+ FilesVisible = xmlFsType.FilesSpecified;
+ }
+
+ public string TypeText { get; }
+ public string VolumeNameText { get; }
+ public string SerialNumberText { get; }
+ public string ApplicationIdentifierText { get; }
+ public string SystemIdentifierText { get; }
+ public string VolumeSetIdentifierText { get; }
+ public string DataPreparerIdentifierText { get; }
+ public string PublisherIdentifierText { get; }
+ public string CreationDateText { get; }
+ public string EffectiveDateText { get; }
+ public string ModificationDateText { get; }
+ public string ExpirationDateText { get; }
+ public string BackupDateText { get; }
+ public string ClustersText { get; }
+ public string FreeClustersText { get; }
+ public string FilesText { get; }
+ public bool BootableChecked { get; }
+ public bool DirtyChecked { get; }
+ public string InformationText { get; }
+ public bool CreationDateVisible { get; }
+ public bool EffectiveDateVisible { get; }
+ public bool ModificationDateVisible { get; }
+ public bool ExpirationDateVisible { get; }
+ public bool BackupDateVisible { get; }
+ public bool FreeClustersVisible { get; }
+ public bool FilesVisible { get; }
+ }
+}
\ No newline at end of file
diff --git a/Aaru.Gui/ViewModels/MainWindowViewModel.cs b/Aaru.Gui/ViewModels/MainWindowViewModel.cs
index f9ef3fa27..ebd4c997d 100644
--- a/Aaru.Gui/ViewModels/MainWindowViewModel.cs
+++ b/Aaru.Gui/ViewModels/MainWindowViewModel.cs
@@ -154,6 +154,12 @@ namespace Aaru.Gui.ViewModels
DataContext = partitionModel.ViewModel
};
+ if(value is FileSystemModel fileSystemModel)
+ ContentPanel = new FileSystemPanel
+ {
+ DataContext = fileSystemModel.ViewModel
+ };
+
this.RaiseAndSetIfChanged(ref _treeViewSelectedItem, value);
}
}
@@ -464,7 +470,8 @@ namespace Aaru.Gui.ViewModels
VolumeName =
plugin.XmlFsType.VolumeName is null ? $"{plugin.XmlFsType.Type}"
: $"{plugin.XmlFsType.VolumeName} ({plugin.XmlFsType.Type})",
- Filesystem = plugin, ReadOnlyFilesystem = fsPlugin
+ Filesystem = plugin, ReadOnlyFilesystem = fsPlugin,
+ ViewModel = new FileSystemViewModel(plugin.XmlFsType, information)
};
/* TODO: Trap expanding item
@@ -520,7 +527,8 @@ namespace Aaru.Gui.ViewModels
{
VolumeName = plugin.XmlFsType.VolumeName is null ? $"{plugin.XmlFsType.Type}"
: $"{plugin.XmlFsType.VolumeName} ({plugin.XmlFsType.Type})",
- Filesystem = plugin, ReadOnlyFilesystem = fsPlugin
+ Filesystem = plugin, ReadOnlyFilesystem = fsPlugin,
+ ViewModel = new FileSystemViewModel(plugin.XmlFsType, information)
};
/* TODO: Trap expanding item