diff --git a/.idea/.idea.Aaru/.idea/contentModel.xml b/.idea/.idea.Aaru/.idea/contentModel.xml
index 74435f4d0..533b6e43a 100644
--- a/.idea/.idea.Aaru/.idea/contentModel.xml
+++ b/.idea/.idea.Aaru/.idea/contentModel.xml
@@ -1219,8 +1219,6 @@
-
-
@@ -1269,10 +1267,10 @@
+
+
-
-
@@ -1318,6 +1316,7 @@
+
diff --git a/Aaru.Gui/Forms/frmMain.xeto b/Aaru.Gui/Forms/frmMain.xeto
deleted file mode 100644
index cebe11f9d..000000000
--- a/Aaru.Gui/Forms/frmMain.xeto
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Aaru.Gui/Forms/frmMain.xeto.cs b/Aaru.Gui/Forms/frmMain.xeto.cs
deleted file mode 100644
index d6fcd24e8..000000000
--- a/Aaru.Gui/Forms/frmMain.xeto.cs
+++ /dev/null
@@ -1,321 +0,0 @@
-// /***************************************************************************
-// Aaru Data Preservation Suite
-// ----------------------------------------------------------------------------
-//
-// Filename : frmMain.xeto.cs
-// Author(s) : Natalia Portillo
-//
-// Component : Main window.
-//
-// --[ Description ] ----------------------------------------------------------
-//
-// Implements main GUI window.
-//
-// --[ 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 .
-//
-// ----------------------------------------------------------------------------
-// Copyright © 2011-2020 Natalia Portillo
-// ****************************************************************************/
-
-using System;
-using System.ComponentModel;
-using System.IO;
-using Aaru.Console;
-using Aaru.Core;
-using Aaru.Core.Media.Info;
-using Aaru.Devices;
-using Aaru.Gui.Panels;
-using Eto.Drawing;
-using Eto.Forms;
-using Eto.Serialization.Xaml;
-
-namespace Aaru.Gui.Forms
-{
- public class frmMain : Form
- {
- readonly Bitmap devicesIcon;
- readonly Bitmap ejectIcon;
- readonly Bitmap hardDiskIcon;
- readonly Bitmap imagesIcon;
- readonly Label lblError;
- /// This is to remember that column is an image to be set in future
- readonly Image nullImage;
- readonly Bitmap opticalIcon;
- readonly TreeGridItem placeholderItem;
- readonly Bitmap removableIcon;
- readonly Bitmap sdIcon;
- readonly Bitmap tapeIcon;
- readonly TreeGridItemCollection treeImagesItems;
- readonly ContextMenu treeImagesMenu;
- readonly Bitmap usbIcon;
- bool closing;
- GridView grdFiles;
- TreeGridView treeImages;
-
- public frmMain(bool debug, bool verbose)
- {
- XamlReader.Load(this);
-
- lblError = new Label();
- grdFiles = new GridView();
- nullImage = null;
-
- ConsoleHandler.Init();
- ConsoleHandler.Debug = debug;
- ConsoleHandler.Verbose = verbose;
-
- treeImagesItems = new TreeGridItemCollection();
-
- treeImages.Columns.Add(new GridColumn
- {
- HeaderText = "Name", DataCell = new ImageTextCell(0, 1)
- });
-
- treeImages.AllowMultipleSelection = false;
- treeImages.ShowHeader = false;
- treeImages.DataStore = treeImagesItems;
-
- // TODO: SVG
- imagesIcon =
- new Bitmap(ResourceHandler.
- GetResourceStream("Aaru.Gui.Assets.Icons.oxygen._32x32.inode-directory.png"));
-
- devicesIcon =
- new Bitmap(ResourceHandler.GetResourceStream("Aaru.Gui.Assets.Icons.oxygen._32x32.computer.png"));
-
- hardDiskIcon =
- new Bitmap(ResourceHandler.GetResourceStream("Aaru.Gui.Assets.Icons.oxygen._32x32.drive-harddisk.png"));
-
- opticalIcon =
- new Bitmap(ResourceHandler.GetResourceStream("Aaru.Gui.Assets.Icons.oxygen._32x32.drive-optical.png"));
-
- usbIcon =
- new Bitmap(ResourceHandler.
- GetResourceStream("Aaru.Gui.Assets.Icons.oxygen._32x32.drive-removable-media-usb.png"));
-
- removableIcon =
- new Bitmap(ResourceHandler.
- GetResourceStream("Aaru.Gui.Assets.Icons.oxygen._32x32.drive-removable-media.png"));
-
- sdIcon =
- new Bitmap(ResourceHandler.
- GetResourceStream("Aaru.Gui.Assets.Icons.oxygen._32x32.media-flash-sd-mmc.png"));
-
- tapeIcon =
- new Bitmap(ResourceHandler.GetResourceStream("Aaru.Gui.Assets.Icons.oxygen._32x32.media-tape.png"));
-
- ejectIcon =
- new Bitmap(ResourceHandler.GetResourceStream("Aaru.Gui.Assets.Icons.oxygen._32x32.media-eject.png"));
-
- imagesRoot = new TreeGridItem
- {
- Values = new object[]
- {
- imagesIcon, "Images"
- }
- };
-
- devicesRoot = new TreeGridItem
- {
- Values = new object[]
- {
- devicesIcon, "Devices"
- }
- };
-
- treeImagesItems.Add(imagesRoot);
- treeImagesItems.Add(devicesRoot);
-
- placeholderItem = new TreeGridItem
- {
- Values = new object[]
- {
- nullImage, "You should not be seeing this"
- }
- };
-
- Closing += OnClosing;
-
- treeImagesMenu = new ContextMenu();
- treeImagesMenu.Opening += OnTreeImagesMenuOpening;
- treeImages.ContextMenu = treeImagesMenu;
- }
-
- void OnTreeImagesMenuOpening(object sender, EventArgs e)
- {
- OnTreeImagesSelectedItemChanged(treeImages, e);
-
- treeImagesMenu.Items.Clear();
-
- var menuItem = new ButtonMenuItem
- {
- Text = "Close all images"
- };
-
- menuItem.Click += CloseAllImages;
- treeImagesMenu.Items.Add(menuItem);
-
- menuItem = new ButtonMenuItem
- {
- Text = "Refresh devices"
- };
-
- // menuItem.Click += OnDeviceRefresh;
- treeImagesMenu.Items.Add(menuItem);
-
- if(!(treeImages.SelectedItem is TreeGridItem selectedItem))
- return;
-
- if(selectedItem.Values.Length < 4)
- return;
- }
-
- // TODO
- void CloseAllImages(object sender, EventArgs eventArgs) => Eto.Forms.MessageBox.Show("Not yet implemented");
-
- void OnClosing(object sender, CancelEventArgs e)
- {
- // This prevents an infinite loop of crashes :p
- if(closing)
- return;
-
- closing = true;
- Application.Instance.Quit();
- }
-
- protected void OnTreeImagesSelectedItemChanged(object sender, EventArgs e)
- {
- if(!(sender is TreeGridView tree))
- return;
-
- if(!(tree.SelectedItem is TreeGridItem selectedItem))
- return;
-
- splMain.Panel2 = null;
-
- if(selectedItem.Values.Length >= 4 &&
- selectedItem.Values[3] is Panel infoPanel)
- {
- splMain.Panel2 = infoPanel;
-
- return;
- }
-
- if(selectedItem.Values.Length < 4)
- return;
-
- switch(selectedItem.Values[3])
- {
- case string devErrorMessage when selectedItem.Parent == devicesRoot:
- lblError.Text = devErrorMessage;
- splMain.Panel2 = lblError;
-
- break;
- }
- }
-
- protected void OnTreeImagesItemExpanding(object sender, TreeGridViewItemCancelEventArgs e)
- {
- // First expansion of a device
- if((e.Item as TreeGridItem)?.Children?.Count != 1 ||
- ((TreeGridItem)e.Item).Children[0] != placeholderItem)
- return;
-
- if(((TreeGridItem)e.Item).Parent == devicesRoot)
- {
- var deviceItem = (TreeGridItem)e.Item;
-
- deviceItem.Children.Clear();
- Device dev;
-
- try
- {
- dev = new Device((string)deviceItem.Values[2]);
-
- if(dev.IsRemote)
- Statistics.AddRemote(dev.RemoteApplication, dev.RemoteVersion, dev.RemoteOperatingSystem,
- dev.RemoteOperatingSystemVersion, dev.RemoteArchitecture);
-
- if(dev.Error)
- {
- deviceItem.Values[3] = $"Error {dev.LastError} opening device";
- e.Cancel = true;
- treeImages.ReloadData();
- treeImages.SelectedItem = deviceItem;
-
- return;
- }
- }
- catch(SystemException ex)
- {
- deviceItem.Values[3] = ex.Message;
- e.Cancel = true;
- treeImages.ReloadData();
- AaruConsole.ErrorWriteLine(ex.Message);
- treeImages.SelectedItem = deviceItem;
-
- return;
- }
-
- if(!dev.IsRemovable)
- deviceItem.Children.Add(new TreeGridItem
- {
- Values = new object[]
- {
- nullImage, "Non-removable device commands not yet implemented"
- }
- });
- else
- {
- // TODO: Removable non-SCSI?
- var scsiInfo = new ScsiInfo(dev);
-
- if(!scsiInfo.MediaInserted)
- deviceItem.Children.Add(new TreeGridItem
- {
- Values = new object[]
- {
- ejectIcon, "No media inserted"
- }
- });
- else
- {
- // TODO: SVG
- Stream logo =
- ResourceHandler.GetResourceStream($"Aaru.Gui.Assets.Logos.Media.{scsiInfo.MediaType}.png");
-
- deviceItem.Children.Add(new TreeGridItem
- {
- Values = new[]
- {
- logo == null ? null : new Bitmap(logo), scsiInfo.MediaType, deviceItem.Values[2],
- new pnlScsiInfo(scsiInfo, (string)deviceItem.Values[2])
- }
- });
- }
- }
-
- dev.Close();
- }
- }
-
- #region XAML IDs
- readonly TreeGridItem devicesRoot;
- readonly TreeGridItem imagesRoot;
- Splitter splMain;
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Aaru.Gui/Models/MediaModel.cs b/Aaru.Gui/Models/MediaModel.cs
index d56f91d9c..1c979b401 100644
--- a/Aaru.Gui/Models/MediaModel.cs
+++ b/Aaru.Gui/Models/MediaModel.cs
@@ -1,11 +1,15 @@
+using Aaru.Gui.ViewModels;
using Avalonia.Media.Imaging;
namespace Aaru.Gui.Models
{
public class MediaModel
{
- public Bitmap Icon { get; set; }
- public string Name { get; set; }
- public string DevicePath { get; set; }
+ public Bitmap Icon { get; set; }
+ public string Name { get; set; }
+ public string DevicePath { get; set; }
+ public bool NonRemovable { get; set; }
+ public bool NoMediaInserted { get; set; }
+ public MediaInfoViewModel ViewModel { get; set; }
}
}
\ No newline at end of file
diff --git a/Aaru.Gui/Panels/MediaInfoPanel.xaml b/Aaru.Gui/Panels/MediaInfoPanel.xaml
new file mode 100644
index 000000000..3e5485c58
--- /dev/null
+++ b/Aaru.Gui/Panels/MediaInfoPanel.xaml
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Aaru.Gui/Panels/MediaInfoPanel.xaml.cs b/Aaru.Gui/Panels/MediaInfoPanel.xaml.cs
new file mode 100644
index 000000000..383eda1d0
--- /dev/null
+++ b/Aaru.Gui/Panels/MediaInfoPanel.xaml.cs
@@ -0,0 +1,12 @@
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace Aaru.Gui.Panels
+{
+ public class MediaInfoPanel : UserControl
+ {
+ public MediaInfoPanel() => InitializeComponent();
+
+ void InitializeComponent() => AvaloniaXamlLoader.Load(this);
+ }
+}
\ No newline at end of file
diff --git a/Aaru.Gui/Panels/pnlScsiInfo.xeto b/Aaru.Gui/Panels/pnlScsiInfo.xeto
deleted file mode 100644
index 187156a1e..000000000
--- a/Aaru.Gui/Panels/pnlScsiInfo.xeto
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Aaru.Gui/Panels/pnlScsiInfo.xeto.cs b/Aaru.Gui/Panels/pnlScsiInfo.xeto.cs
deleted file mode 100644
index 6d26f2380..000000000
--- a/Aaru.Gui/Panels/pnlScsiInfo.xeto.cs
+++ /dev/null
@@ -1,318 +0,0 @@
-// /***************************************************************************
-// Aaru Data Preservation Suite
-// ----------------------------------------------------------------------------
-//
-// Filename : pnlScsiInfo.xeto.cs
-// Author(s) : Natalia Portillo
-//
-// Component : SCSI media information panel.
-//
-// --[ Description ] ----------------------------------------------------------
-//
-// Implements the SCSI media 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 .
-//
-// ----------------------------------------------------------------------------
-// Copyright © 2011-2020 Natalia Portillo
-// ****************************************************************************/
-
-using System;
-using System.IO;
-using System.Text;
-using Aaru.CommonTypes;
-using Aaru.Core.Media.Info;
-using Aaru.Decoders.SCSI.SSC;
-using Aaru.Gui.Controls;
-using Aaru.Gui.Forms;
-using Aaru.Gui.Tabs;
-using Eto.Drawing;
-using Eto.Forms;
-using Eto.Serialization.Xaml;
-
-namespace Aaru.Gui.Panels
-{
- public class pnlScsiInfo : Panel
- {
- readonly string devicePath;
- readonly ScsiInfo scsiInfo;
-
- public pnlScsiInfo(ScsiInfo scsiInfo, string devicePath)
- {
- XamlReader.Load(this);
-
- this.scsiInfo = scsiInfo;
-
- Stream logo = ResourceHandler.GetResourceStream($"Aaru.Gui.Assets.Logos.Media.{scsiInfo.MediaType}.svg");
- /* if(logo != null)
- {
- svgMediaLogo.SvgStream = logo;
- svgMediaLogo.Visible = true;
- }
- else
- {*/
- logo = ResourceHandler.GetResourceStream($"Aaru.Gui.Assets.Logos.Media.{scsiInfo.MediaType}.png");
-
- if(logo != null)
- {
- imgMediaLogo.Image = new Bitmap(logo);
- imgMediaLogo.Visible = true;
- }
-
- //}
-
- txtType.Text = scsiInfo.MediaType.ToString();
-
- lblMediaSize.Text =
- $"Media has {scsiInfo.Blocks} blocks of {scsiInfo.BlockSize} bytes/each. (for a total of {scsiInfo.Blocks * scsiInfo.BlockSize} bytes)";
-
- lblMediaSize.Visible = scsiInfo.Blocks != 0 && scsiInfo.BlockSize != 0;
-
- if(scsiInfo.MediaSerialNumber != null)
- {
- stkMediaSerial.Visible = true;
- var sbSerial = new StringBuilder();
-
- for(int i = 4; i < scsiInfo.MediaSerialNumber.Length; i++)
- sbSerial.AppendFormat("{0:X2}", scsiInfo.MediaSerialNumber[i]);
-
- txtMediaSerial.Text = sbSerial.ToString();
- }
-
- btnSaveReadMediaSerial.Visible = this.scsiInfo.MediaSerialNumber != null;
- btnSaveReadCapacity.Visible = this.scsiInfo.ReadCapacity != null;
- btnSaveReadCapacity16.Visible = this.scsiInfo.ReadCapacity16 != null;
-
- btnSaveGetConfiguration.Visible = this.scsiInfo.MmcConfiguration != null;
- btnSaveRecognizedFormatLayers.Visible = this.scsiInfo.RecognizedFormatLayers != null;
- btnSaveWriteProtectionStatus.Visible = this.scsiInfo.WriteProtectionStatus != null;
-
- tabMmc.Visible = btnSaveGetConfiguration.Visible || btnSaveRecognizedFormatLayers.Visible ||
- btnSaveWriteProtectionStatus.Visible;
-
- if(this.scsiInfo.DensitySupportHeader.HasValue)
- {
- grpDensitySupport.Visible = true;
- txtDensitySupport.Text = DensitySupport.PrettifyDensity(scsiInfo.DensitySupportHeader);
- }
-
- if(this.scsiInfo.MediaTypeSupportHeader.HasValue)
- {
- grpMediumSupport.Visible = true;
- txtMediumSupport.Text = DensitySupport.PrettifyMediumType(scsiInfo.MediaTypeSupportHeader);
- }
-
- btnSaveDensitySupport.Visible = scsiInfo.DensitySupport != null;
- btnSaveMediumSupport.Visible = scsiInfo.MediaTypeSupport != null;
-
- tabSsc.Visible = grpDensitySupport.Visible || grpMediumSupport.Visible || btnSaveDensitySupport.Visible ||
- btnSaveMediumSupport.Visible;
-
- /*
- var tabCompactDiscInfo = new tabCompactDiscInfo();
-
- tabCompactDiscInfo.LoadData(scsiInfo.Toc, scsiInfo.Atip, scsiInfo.CompactDiscInformation, scsiInfo.Session,
- scsiInfo.RawToc, this.scsiInfo.Pma, this.scsiInfo.CdTextLeadIn,
- this.scsiInfo.DecodedToc, this.scsiInfo.DecodedAtip,
- this.scsiInfo.DecodedSession, this.scsiInfo.FullToc,
- this.scsiInfo.DecodedCdTextLeadIn, this.scsiInfo.DecodedCompactDiscInformation,
- this.scsiInfo.Mcn, this.scsiInfo.Isrcs);
-
- tabInfos.Pages.Add(tabCompactDiscInfo);
- */
- /*
- var tabDvdInfo = new tabDvdInfo();
-
- tabDvdInfo.LoadData(scsiInfo.MediaType, scsiInfo.DvdPfi, scsiInfo.DvdDmi, scsiInfo.DvdCmi,
- scsiInfo.HddvdCopyrightInformation, scsiInfo.DvdBca, scsiInfo.DvdAacs,
- this.scsiInfo.DecodedPfi);
-
- tabInfos.Pages.Add(tabDvdInfo);
- */
- /*
- var tabXboxInfo = new tabXboxInfo();
-
- tabXboxInfo.LoadData(scsiInfo.XgdInfo, scsiInfo.DvdDmi, scsiInfo.XboxSecuritySector,
- scsiInfo.DecodedXboxSecuritySector);
-
- tabInfos.Pages.Add(tabXboxInfo);
- */
- /*
- var tabDvdWritableInfo = new tabDvdWritableInfo();
-
- tabDvdWritableInfo.LoadData(scsiInfo.MediaType, scsiInfo.DvdRamDds, scsiInfo.DvdRamCartridgeStatus,
- scsiInfo.DvdRamSpareArea, scsiInfo.LastBorderOutRmd,
- scsiInfo.DvdPreRecordedInfo, scsiInfo.DvdrMediaIdentifier,
- scsiInfo.DvdrPhysicalInformation, scsiInfo.HddvdrMediumStatus,
- scsiInfo.HddvdrLastRmd, scsiInfo.DvdrLayerCapacity,
- scsiInfo.DvdrDlMiddleZoneStart, scsiInfo.DvdrDlJumpIntervalSize,
- scsiInfo.DvdrDlManualLayerJumpStartLba, scsiInfo.DvdrDlRemapAnchorPoint,
- scsiInfo.DvdPlusAdip, scsiInfo.DvdPlusDcb);
-
- tabInfos.Pages.Add(tabDvdWritableInfo);
- */
- /*
- var tabBlurayInfo = new tabBlurayInfo();
-
- tabBlurayInfo.LoadData(scsiInfo.BlurayDiscInformation, scsiInfo.BlurayBurstCuttingArea, scsiInfo.BlurayDds,
- scsiInfo.BlurayCartridgeStatus, scsiInfo.BluraySpareAreaInformation,
- scsiInfo.BlurayPowResources, scsiInfo.BlurayTrackResources, scsiInfo.BlurayRawDfl,
- scsiInfo.BlurayPac);
-
- tabInfos.Pages.Add(tabBlurayInfo);
- */
- this.devicePath = devicePath;
- }
-
- void SaveElement(byte[] data)
- {
- var dlgSaveBinary = new SaveFileDialog();
-
- dlgSaveBinary.Filters.Add(new FileFilter
- {
- Extensions = new[]
- {
- "*.bin"
- },
- Name = "Binary"
- });
-
- DialogResult result = dlgSaveBinary.ShowDialog(this);
-
- if(result != DialogResult.Ok)
- return;
-
- var saveFs = new FileStream(dlgSaveBinary.FileName, FileMode.Create);
- saveFs.Write(data, 0, data.Length);
-
- saveFs.Close();
- }
-
- protected void OnBtnSaveReadMediaSerialClick(object sender, EventArgs e) =>
- SaveElement(scsiInfo.MediaSerialNumber);
-
- protected void OnBtnSaveReadCapacityClick(object sender, EventArgs e) => SaveElement(scsiInfo.ReadCapacity);
-
- protected void OnBtnSaveReadCapacity16Click(object sender, EventArgs e) => SaveElement(scsiInfo.ReadCapacity16);
-
- protected void OnBtnSaveGetConfigurationClick(object sender, EventArgs e) =>
- SaveElement(scsiInfo.MmcConfiguration);
-
- protected void OnBtnSaveRecognizedFormatLayersClick(object sender, EventArgs e) =>
- SaveElement(scsiInfo.RecognizedFormatLayers);
-
- protected void OnBtnSaveWriteProtectionStatusClick(object sender, EventArgs e) =>
- SaveElement(scsiInfo.WriteProtectionStatus);
-
- protected void OnBtnSaveDensitySupportClick(object sender, EventArgs e) => SaveElement(scsiInfo.DensitySupport);
-
- protected void OnBtnSaveMediumSupportClick(object sender, EventArgs e) =>
- SaveElement(scsiInfo.MediaTypeSupport);
-
- protected void OnBtnSaveXboxSsClick(object sender, EventArgs e) => SaveElement(scsiInfo.XboxSecuritySector);
-
- protected void OnBtnDumpClick(object sender, EventArgs e)
- {
- if(scsiInfo.MediaType == MediaType.GDR ||
- scsiInfo.MediaType == MediaType.GDROM)
- {
- Eto.Forms.MessageBox.Show("GD-ROM dump support is not yet implemented.", MessageBoxType.Error);
-
- return;
- }
-
- if((scsiInfo.MediaType == MediaType.XGD || scsiInfo.MediaType == MediaType.XGD2 ||
- scsiInfo.MediaType == MediaType.XGD3) &&
- scsiInfo.DeviceInfo.ScsiInquiry?.KreonPresent != true)
- Eto.Forms.MessageBox.Show("Dumping Xbox discs require a Kreon drive.", MessageBoxType.Error);
-
- var dumpForm = new frmDump(devicePath, scsiInfo.DeviceInfo, scsiInfo);
- dumpForm.Show();
- }
-
- protected void OnBtnScanClick(object sender, EventArgs e)
- {
- if(scsiInfo.MediaType == MediaType.GDR ||
- scsiInfo.MediaType == MediaType.GDROM)
- {
- Eto.Forms.MessageBox.Show("GD-ROM scan support is not yet implemented.", MessageBoxType.Error);
-
- return;
- }
-
- if(scsiInfo.MediaType == MediaType.XGD ||
- scsiInfo.MediaType == MediaType.XGD2 ||
- scsiInfo.MediaType == MediaType.XGD3)
- Eto.Forms.MessageBox.Show("Scanning Xbox discs is not yet supported.", MessageBoxType.Error);
-
- var scanForm = new frmMediaScan(devicePath, scsiInfo.DeviceInfo, scsiInfo);
- scanForm.Show();
- }
-
- #region XAML controls
- #pragma warning disable 169
- #pragma warning disable 649
- Label lblMediaInfo;
- TabControl tabInfos;
- TabPage tabGeneral;
- Label lblType;
- TextBox txtType;
- Label lblMediaSize;
- StackLayout stkMediaSerial;
- Label lblMediaSerial;
- TextBox txtMediaSerial;
- Button btnSaveReadCapacity;
- Button btnSaveReadCapacity16;
- Button btnSaveReadMediaSerial;
- TabPage tabMmc;
- Button btnSaveGetConfiguration;
- Button btnSaveRecognizedFormatLayers;
- Button btnSaveWriteProtectionStatus;
- TabPage tabSsc;
- GroupBox grpDensitySupport;
- TextArea txtDensitySupport;
- GroupBox grpMediumSupport;
- TextArea txtMediumSupport;
- Button btnSaveDensitySupport;
- Button btnSaveMediumSupport;
- TabPage tabXbox;
- StackLayout stkXboxInformation;
- Label lblXboxL0Video;
- TextBox txtXboxL0Video;
- Label lblXboxL1Video;
- TextBox txtXboxL1Video;
- Label lblXboxMiddleZone;
- TextBox txtXboxMiddleZone;
- Label lblXboxGameSize;
- TextBox txtXboxGameSize;
- Label lblXboxTotalSize;
- TextBox txtXboxTotalSize;
- Label lblXboxRealBreak;
- TextBox txtXboxRealBreak;
- GroupBox grpXboxDmi;
- TextArea txtXboxDmi;
- GroupBox grpXboxSs;
- TextArea txtXboxSs;
- Button btnSaveXboxSs;
- Button btnDump;
- ImageView imgMediaLogo;
- SvgImageView svgMediaLogo;
- Button btnScan;
- #pragma warning restore 169
- #pragma warning restore 649
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Aaru.Gui/ViewModels/MainWindowViewModel.cs b/Aaru.Gui/ViewModels/MainWindowViewModel.cs
index da16c6d2a..d96cc9dd4 100644
--- a/Aaru.Gui/ViewModels/MainWindowViewModel.cs
+++ b/Aaru.Gui/ViewModels/MainWindowViewModel.cs
@@ -13,6 +13,7 @@ using Aaru.CommonTypes.Structs;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Console;
using Aaru.Core;
+using Aaru.Core.Media.Info;
using Aaru.Database;
using Aaru.Devices;
using Aaru.Gui.Models;
@@ -170,74 +171,132 @@ namespace Aaru.Gui.ViewModels
this.RaiseAndSetIfChanged(ref _treeViewSelectedItem, value);
- if(value is ImageModel imageModel)
- ContentPanel = new ImageInfoPanel
- {
- DataContext = imageModel.ViewModel
- };
+ ContentPanel = null;
- if(value is PartitionModel partitionModel)
- ContentPanel = new PartitionPanel
- {
- DataContext = partitionModel.ViewModel
- };
-
- if(value is FileSystemModel fileSystemModel)
- ContentPanel = new FileSystemPanel
- {
- DataContext = fileSystemModel.ViewModel
- };
-
- if(value is SubdirectoryModel subdirectoryModel)
+ switch(value)
{
- ContentPanel = new SubdirectoryPanel
- {
- DataContext = new SubdirectoryViewModel(subdirectoryModel, _view)
- };
- }
-
- if(value is DeviceModel deviceModel)
- {
- if(deviceModel.ViewModel is null)
- {
- try
+ case ImageModel imageModel:
+ ContentPanel = new ImageInfoPanel
{
- var dev = new Device(deviceModel.Path);
+ DataContext = imageModel.ViewModel
+ };
- if(dev.IsRemote)
- Statistics.AddRemote(dev.RemoteApplication, dev.RemoteVersion,
- dev.RemoteOperatingSystem, dev.RemoteOperatingSystemVersion,
- dev.RemoteArchitecture);
+ break;
+ case PartitionModel partitionModel:
+ ContentPanel = new PartitionPanel
+ {
+ DataContext = partitionModel.ViewModel
+ };
- if(dev.Error)
+ break;
+ case FileSystemModel fileSystemModel:
+ ContentPanel = new FileSystemPanel
+ {
+ DataContext = fileSystemModel.ViewModel
+ };
+
+ break;
+ case SubdirectoryModel subdirectoryModel:
+ ContentPanel = new SubdirectoryPanel
+ {
+ DataContext = new SubdirectoryViewModel(subdirectoryModel, _view)
+ };
+
+ break;
+ case DeviceModel deviceModel:
+ {
+ if(deviceModel.ViewModel is null)
+ {
+ try
{
- ContentPanel = $"Error {dev.LastError} opening device";
+ var dev = new Device(deviceModel.Path);
+
+ if(dev.IsRemote)
+ Statistics.AddRemote(dev.RemoteApplication, dev.RemoteVersion,
+ dev.RemoteOperatingSystem, dev.RemoteOperatingSystemVersion,
+ dev.RemoteArchitecture);
+
+ if(dev.Error)
+ {
+ ContentPanel = $"Error {dev.LastError} opening device";
+
+ return;
+ }
+
+ var devInfo = new DeviceInfo(dev);
+
+ deviceModel.ViewModel = new DeviceInfoViewModel(devInfo, _view);
+
+ if(!dev.IsRemovable)
+ deviceModel.Media.Add(new MediaModel
+ {
+ NonRemovable = true, Name = "Non-removable device commands not yet implemented"
+ });
+ else
+ {
+ // TODO: Removable non-SCSI?
+ var scsiInfo = new ScsiInfo(dev);
+
+ if(!scsiInfo.MediaInserted)
+ deviceModel.Media.Add(new MediaModel
+ {
+ NoMediaInserted = true, Icon = _ejectIcon, Name = "No media inserted"
+ });
+ else
+ {
+ var mediaResource =
+ new Uri($"avares://Aaru.Gui/Assets/Logos/Media/{scsiInfo.MediaType}.png");
+
+ deviceModel.Media.Add(new MediaModel
+ {
+ DevicePath = deviceModel.Path,
+ Icon = _assets.Exists(mediaResource)
+ ? new Bitmap(_assets.Open(mediaResource)) : null,
+ Name = $"{scsiInfo.MediaType}",
+ ViewModel = new MediaInfoViewModel(scsiInfo, deviceModel.Path, _view)
+ });
+ }
+ }
+
+ dev.Close();
+ }
+ catch(SystemException ex)
+ {
+ if(Debugger.IsAttached)
+ throw;
+
+ ContentPanel = ex.Message;
+ AaruConsole.ErrorWriteLine(ex.Message);
return;
}
-
- var devInfo = new DeviceInfo(dev);
-
- deviceModel.ViewModel = new DeviceInfoViewModel(devInfo, _view);
-
- dev.Close();
}
- catch(SystemException ex)
+
+ ContentPanel = new DeviceInfoPanel
{
- if(Debugger.IsAttached)
- throw;
+ DataContext = deviceModel.ViewModel
+ };
- ContentPanel = ex.Message;
- AaruConsole.ErrorWriteLine(ex.Message);
-
- return;
- }
+ break;
}
+ case MediaModel mediaModel when mediaModel.NonRemovable:
+ ContentPanel = "Non-removable device commands not yet implemented";
- ContentPanel = new DeviceInfoPanel
+ break;
+ case MediaModel mediaModel when mediaModel.NoMediaInserted:
+ ContentPanel = "No media inserted";
+
+ break;
+ case MediaModel mediaModel:
{
- DataContext = deviceModel.ViewModel
- };
+ if(mediaModel.ViewModel != null)
+ ContentPanel = new MediaInfoPanel
+ {
+ DataContext = mediaModel.ViewModel
+ };
+
+ break;
+ }
}
}
}
diff --git a/Aaru.Gui/ViewModels/MediaInfoViewModel.cs b/Aaru.Gui/ViewModels/MediaInfoViewModel.cs
new file mode 100644
index 000000000..3eef867dc
--- /dev/null
+++ b/Aaru.Gui/ViewModels/MediaInfoViewModel.cs
@@ -0,0 +1,378 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Reactive;
+using System.Text;
+using Aaru.Core.Media.Info;
+using Aaru.Gui.Tabs;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Media.Imaging;
+using Avalonia.Platform;
+using ReactiveUI;
+
+namespace Aaru.Gui.ViewModels
+{
+ public class MediaInfoViewModel : ViewModelBase
+ {
+ readonly string _devicePath;
+ readonly ScsiInfo _scsiInfo;
+ readonly Window _view;
+ BlurayInfoTab _blurayInfo;
+ CompactDiscInfoTab _compactDiscInfo;
+ string _densitySupport;
+ DvdInfoTab _dvdInfo;
+ DvdWritableInfoTab _dvdWritableInfo;
+ string _generalVisible;
+ Bitmap _mediaLogo;
+ string _mediaSerial;
+ string _mediaSize;
+ string _mediaType;
+ string _mediumSupport;
+ bool _mmcVisible;
+ bool _saveDensitySupportVisible;
+ bool _saveGetConfigurationVisible;
+ bool _saveMediumSupportVisible;
+ bool _saveReadCapacity16Visible;
+ bool _saveReadCapacityVisible;
+ bool _saveReadMediaSerialVisible;
+ bool _saveRecognizedFormatLayersVisible;
+ bool _saveWriteProtectionStatusVisible;
+ bool _sscVisible;
+ XboxInfoTab _xboxInfo;
+
+ public MediaInfoViewModel(ScsiInfo scsiInfo, string devicePath, Window view)
+ {
+ _view = view;
+ SaveReadMediaSerialCommand = ReactiveCommand.Create(ExecuteSaveReadMediaSerialCommand);
+ SaveReadCapacityCommand = ReactiveCommand.Create(ExecuteSaveReadCapacityCommand);
+ SaveReadCapacity16Command = ReactiveCommand.Create(ExecuteSaveReadCapacity16Command);
+ SaveGetConfigurationCommand = ReactiveCommand.Create(ExecuteSaveGetConfigurationCommand);
+ SaveRecognizedFormatLayersCommand = ReactiveCommand.Create(ExecuteSaveRecognizedFormatLayersCommand);
+ SaveWriteProtectionStatusCommand = ReactiveCommand.Create(ExecuteSaveWriteProtectionStatusCommand);
+ SaveDensitySupportCommand = ReactiveCommand.Create(ExecuteSaveDensitySupportCommand);
+ SaveMediumSupportCommand = ReactiveCommand.Create(ExecuteSaveMediumSupportCommand);
+ DumpCommand = ReactiveCommand.Create(ExecuteDumpCommand);
+ ScanCommand = ReactiveCommand.Create(ExecuteScanCommand);
+ IAssetLoader assets = AvaloniaLocator.Current.GetService();
+ _devicePath = devicePath;
+ _scsiInfo = scsiInfo;
+
+ var mediaResource = new Uri($"avares://Aaru.Gui/Assets/Logos/Media/{scsiInfo.MediaType}.png");
+
+ MediaLogo = assets.Exists(mediaResource) ? new Bitmap(assets.Open(mediaResource)) : null;
+
+ MediaType = scsiInfo.MediaType.ToString();
+
+ if(scsiInfo.Blocks != 0 &&
+ scsiInfo.BlockSize != 0)
+ MediaSize =
+ $"Media has {scsiInfo.Blocks} blocks of {scsiInfo.BlockSize} bytes/each. (for a total of {scsiInfo.Blocks * scsiInfo.BlockSize} bytes)";
+
+ if(scsiInfo.MediaSerialNumber != null)
+ {
+ var sbSerial = new StringBuilder();
+
+ for(int i = 4; i < scsiInfo.MediaSerialNumber.Length; i++)
+ sbSerial.AppendFormat("{0:X2}", scsiInfo.MediaSerialNumber[i]);
+
+ MediaSerial = sbSerial.ToString();
+ }
+
+ SaveReadMediaSerialVisible = scsiInfo.MediaSerialNumber != null;
+ SaveReadCapacityVisible = scsiInfo.ReadCapacity != null;
+ SaveReadCapacity16Visible = scsiInfo.ReadCapacity16 != null;
+
+ SaveGetConfigurationVisible = scsiInfo.MmcConfiguration != null;
+ SaveRecognizedFormatLayersVisible = scsiInfo.RecognizedFormatLayers != null;
+ SaveWriteProtectionStatusVisible = scsiInfo.WriteProtectionStatus != null;
+
+ MmcVisible = SaveGetConfigurationVisible || SaveRecognizedFormatLayersVisible ||
+ SaveWriteProtectionStatusVisible;
+
+ if(scsiInfo.DensitySupportHeader.HasValue)
+ DensitySupport = Decoders.SCSI.SSC.DensitySupport.PrettifyDensity(scsiInfo.DensitySupportHeader);
+
+ if(scsiInfo.MediaTypeSupportHeader.HasValue)
+ MediumSupport = Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(scsiInfo.MediaTypeSupportHeader);
+
+ SaveDensitySupportVisible = scsiInfo.DensitySupport != null;
+ SaveMediumSupportVisible = scsiInfo.MediaTypeSupport != null;
+
+ SscVisible = SaveDensitySupportVisible || SaveMediumSupportVisible;
+
+ CompactDiscInfo = new CompactDiscInfoTab
+ {
+ DataContext = new CompactDiscInfoViewModel(scsiInfo.Toc, scsiInfo.Atip, scsiInfo.CompactDiscInformation,
+ scsiInfo.Session, scsiInfo.RawToc, scsiInfo.Pma,
+ scsiInfo.CdTextLeadIn, scsiInfo.DecodedToc,
+ scsiInfo.DecodedAtip, scsiInfo.DecodedSession,
+ scsiInfo.FullToc, scsiInfo.DecodedCdTextLeadIn,
+ scsiInfo.DecodedCompactDiscInformation, scsiInfo.Mcn,
+ scsiInfo.Isrcs, _view)
+ };
+
+ DvdInfo = new DvdInfoTab
+ {
+ DataContext = new DvdInfoViewModel(scsiInfo.MediaType, scsiInfo.DvdPfi, scsiInfo.DvdDmi,
+ scsiInfo.DvdCmi, scsiInfo.HddvdCopyrightInformation, scsiInfo.DvdBca,
+ scsiInfo.DvdAacs, scsiInfo.DecodedPfi, _view)
+ };
+
+ XboxInfo = new XboxInfoTab
+ {
+ DataContext = new XboxInfoViewModel(scsiInfo.XgdInfo, scsiInfo.DvdDmi, scsiInfo.XboxSecuritySector,
+ scsiInfo.DecodedXboxSecuritySector, _view)
+ };
+
+ DvdWritableInfo = new DvdWritableInfoTab
+ {
+ DataContext = new DvdWritableInfoViewModel(scsiInfo.MediaType, scsiInfo.DvdRamDds,
+ scsiInfo.DvdRamCartridgeStatus, scsiInfo.DvdRamSpareArea,
+ scsiInfo.LastBorderOutRmd, scsiInfo.DvdPreRecordedInfo,
+ scsiInfo.DvdrMediaIdentifier,
+ scsiInfo.DvdrPhysicalInformation,
+ scsiInfo.HddvdrMediumStatus, scsiInfo.HddvdrLastRmd,
+ scsiInfo.DvdrLayerCapacity, scsiInfo.DvdrDlMiddleZoneStart,
+ scsiInfo.DvdrDlJumpIntervalSize,
+ scsiInfo.DvdrDlManualLayerJumpStartLba,
+ scsiInfo.DvdrDlRemapAnchorPoint, scsiInfo.DvdPlusAdip,
+ scsiInfo.DvdPlusDcb, _view)
+ };
+
+ BlurayInfo = new BlurayInfoTab
+ {
+ DataContext = new BlurayInfoViewModel(scsiInfo.BlurayDiscInformation, scsiInfo.BlurayBurstCuttingArea,
+ scsiInfo.BlurayDds, scsiInfo.BlurayCartridgeStatus,
+ scsiInfo.BluraySpareAreaInformation, scsiInfo.BlurayPowResources,
+ scsiInfo.BlurayTrackResources, scsiInfo.BlurayRawDfl,
+ scsiInfo.BlurayPac, _view)
+ };
+ }
+
+ public ReactiveCommand SaveReadMediaSerialCommand { get; }
+ public ReactiveCommand SaveReadCapacityCommand { get; }
+ public ReactiveCommand SaveReadCapacity16Command { get; }
+ public ReactiveCommand SaveGetConfigurationCommand { get; }
+ public ReactiveCommand SaveRecognizedFormatLayersCommand { get; }
+ public ReactiveCommand SaveWriteProtectionStatusCommand { get; }
+ public ReactiveCommand SaveDensitySupportCommand { get; }
+ public ReactiveCommand SaveMediumSupportCommand { get; }
+ public ReactiveCommand DumpCommand { get; }
+ public ReactiveCommand ScanCommand { get; }
+
+ public Bitmap MediaLogo
+ {
+ get => _mediaLogo;
+ set => this.RaiseAndSetIfChanged(ref _mediaLogo, value);
+ }
+
+ public string GeneralVisible
+ {
+ get => _generalVisible;
+ set => this.RaiseAndSetIfChanged(ref _generalVisible, value);
+ }
+
+ public string MediaType
+ {
+ get => _mediaType;
+ set => this.RaiseAndSetIfChanged(ref _mediaType, value);
+ }
+
+ public string MediaSize
+ {
+ get => _mediaSize;
+ set => this.RaiseAndSetIfChanged(ref _mediaSize, value);
+ }
+
+ public string MediaSerial
+ {
+ get => _mediaSerial;
+ set => this.RaiseAndSetIfChanged(ref _mediaSerial, value);
+ }
+
+ public bool SaveReadMediaSerialVisible
+ {
+ get => _saveReadMediaSerialVisible;
+ set => this.RaiseAndSetIfChanged(ref _saveReadMediaSerialVisible, value);
+ }
+
+ public bool SaveReadCapacityVisible
+ {
+ get => _saveReadCapacityVisible;
+ set => this.RaiseAndSetIfChanged(ref _saveReadCapacityVisible, value);
+ }
+
+ public bool SaveReadCapacity16Visible
+ {
+ get => _saveReadCapacity16Visible;
+ set => this.RaiseAndSetIfChanged(ref _saveReadCapacity16Visible, value);
+ }
+
+ public bool MmcVisible
+ {
+ get => _mmcVisible;
+ set => this.RaiseAndSetIfChanged(ref _mmcVisible, value);
+ }
+
+ public bool SaveGetConfigurationVisible
+ {
+ get => _saveGetConfigurationVisible;
+ set => this.RaiseAndSetIfChanged(ref _saveGetConfigurationVisible, value);
+ }
+
+ public bool SaveRecognizedFormatLayersVisible
+ {
+ get => _saveRecognizedFormatLayersVisible;
+ set => this.RaiseAndSetIfChanged(ref _saveRecognizedFormatLayersVisible, value);
+ }
+
+ public bool SaveWriteProtectionStatusVisible
+ {
+ get => _saveWriteProtectionStatusVisible;
+ set => this.RaiseAndSetIfChanged(ref _saveWriteProtectionStatusVisible, value);
+ }
+
+ public bool SscVisible
+ {
+ get => _sscVisible;
+ set => this.RaiseAndSetIfChanged(ref _sscVisible, value);
+ }
+
+ public string DensitySupport
+ {
+ get => _densitySupport;
+ set => this.RaiseAndSetIfChanged(ref _densitySupport, value);
+ }
+
+ public string MediumSupport
+ {
+ get => _mediumSupport;
+ set => this.RaiseAndSetIfChanged(ref _mediumSupport, value);
+ }
+
+ public bool SaveDensitySupportVisible
+ {
+ get => _saveDensitySupportVisible;
+ set => this.RaiseAndSetIfChanged(ref _saveDensitySupportVisible, value);
+ }
+
+ public bool SaveMediumSupportVisible
+ {
+ get => _saveMediumSupportVisible;
+ set => this.RaiseAndSetIfChanged(ref _saveMediumSupportVisible, value);
+ }
+
+ public CompactDiscInfoTab CompactDiscInfo
+ {
+ get => _compactDiscInfo;
+ set => this.RaiseAndSetIfChanged(ref _compactDiscInfo, value);
+ }
+
+ public DvdInfoTab DvdInfo
+ {
+ get => _dvdInfo;
+ set => this.RaiseAndSetIfChanged(ref _dvdInfo, value);
+ }
+
+ public DvdWritableInfoTab DvdWritableInfo
+ {
+ get => _dvdWritableInfo;
+ set => this.RaiseAndSetIfChanged(ref _dvdWritableInfo, value);
+ }
+
+ public XboxInfoTab XboxInfo
+ {
+ get => _xboxInfo;
+ set => this.RaiseAndSetIfChanged(ref _xboxInfo, value);
+ }
+
+ public BlurayInfoTab BlurayInfo
+ {
+ get => _blurayInfo;
+ set => this.RaiseAndSetIfChanged(ref _blurayInfo, value);
+ }
+
+ async void SaveElement(byte[] data)
+ {
+ var dlgSaveBinary = new SaveFileDialog();
+
+ dlgSaveBinary.Filters.Add(new FileDialogFilter
+ {
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = "Binary"
+ });
+
+ string result = await dlgSaveBinary.ShowAsync(_view);
+
+ if(result is null)
+ return;
+
+ var saveFs = new FileStream(result, FileMode.Create);
+ saveFs.Write(data, 0, data.Length);
+
+ saveFs.Close();
+ }
+
+ void ExecuteSaveReadMediaSerialCommand() => SaveElement(_scsiInfo.MediaSerialNumber);
+
+ void ExecuteSaveReadCapacityCommand() => SaveElement(_scsiInfo.ReadCapacity);
+
+ void ExecuteSaveReadCapacity16Command() => SaveElement(_scsiInfo.ReadCapacity16);
+
+ void ExecuteSaveGetConfigurationCommand() => SaveElement(_scsiInfo.MmcConfiguration);
+
+ void ExecuteSaveRecognizedFormatLayersCommand() => SaveElement(_scsiInfo.RecognizedFormatLayers);
+
+ void ExecuteSaveWriteProtectionStatusCommand() => SaveElement(_scsiInfo.WriteProtectionStatus);
+
+ void ExecuteSaveDensitySupportCommand() => SaveElement(_scsiInfo.DensitySupport);
+
+ void ExecuteSaveMediumSupportCommand() => SaveElement(_scsiInfo.MediaTypeSupport);
+
+ void ExecuteDumpCommand()
+ {
+ /* TODO: frmDump
+ if(scsiInfo.MediaType == MediaType.GDR ||
+ scsiInfo.MediaType == MediaType.GDROM)
+ {
+ Eto.Forms.MessageBox.Show("GD-ROM dump support is not yet implemented.", MessageBoxType.Error);
+
+ return;
+ }
+
+ if((scsiInfo.MediaType == MediaType.XGD || scsiInfo.MediaType == MediaType.XGD2 ||
+ scsiInfo.MediaType == MediaType.XGD3) &&
+ scsiInfo.DeviceInfo.ScsiInquiry?.KreonPresent != true)
+ Eto.Forms.MessageBox.Show("Dumping Xbox discs require a Kreon drive.", MessageBoxType.Error);
+
+ var dumpForm = new frmDump(devicePath, scsiInfo.DeviceInfo, scsiInfo);
+ dumpForm.Show();
+ */
+ }
+
+ void ExecuteScanCommand()
+ {
+ /* TODO: frmMediaScan
+ if(scsiInfo.MediaType == MediaType.GDR ||
+ scsiInfo.MediaType == MediaType.GDROM)
+ {
+ Eto.Forms.MessageBox.Show("GD-ROM scan support is not yet implemented.", MessageBoxType.Error);
+
+ return;
+ }
+
+ if(scsiInfo.MediaType == MediaType.XGD ||
+ scsiInfo.MediaType == MediaType.XGD2 ||
+ scsiInfo.MediaType == MediaType.XGD3)
+ Eto.Forms.MessageBox.Show("Scanning Xbox discs is not yet supported.", MessageBoxType.Error);
+
+ var scanForm = new frmMediaScan(devicePath, scsiInfo.DeviceInfo, scsiInfo);
+ scanForm.Show();
+ */
+ }
+ }
+}
\ No newline at end of file