mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[GUI] In ImageInfo view only show tabs that contain data.
This commit is contained in:
@@ -237,8 +237,9 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableMediaTags is { Count: > 0 })
|
if(imageFormat.Info.ReadableMediaTags is { Count: > 0 })
|
||||||
foreach(MediaTagType tag in imageFormat.Info.ReadableMediaTags.Order())
|
{
|
||||||
MediaTagsList.Add(tag.Humanize());
|
foreach(MediaTagType tag in imageFormat.Info.ReadableMediaTags.Order()) MediaTagsList.Add(tag.Humanize());
|
||||||
|
}
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableSectorTags is { Count: > 0 })
|
if(imageFormat.Info.ReadableSectorTags is { Count: > 0 })
|
||||||
{
|
{
|
||||||
@@ -280,6 +281,12 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
if(errno == ErrorNumber.NoError) scsiMode = Modes.DecodeMode10(scsiModeSense10, scsiDeviceType);
|
if(errno == ErrorNumber.NoError) scsiMode = Modes.DecodeMode10(scsiModeSense10, scsiDeviceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(scsiInquiryData != null ||
|
||||||
|
scsiInquiry != null ||
|
||||||
|
scsiMode != null ||
|
||||||
|
scsiModeSense6 != null ||
|
||||||
|
scsiModeSense10 != null)
|
||||||
|
{
|
||||||
ScsiInfo = new ScsiInfo
|
ScsiInfo = new ScsiInfo
|
||||||
{
|
{
|
||||||
DataContext = new ScsiInfoViewModel(scsiInquiryData,
|
DataContext = new ScsiInfoViewModel(scsiInquiryData,
|
||||||
@@ -292,6 +299,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
null,
|
null,
|
||||||
view)
|
view)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
byte[] ataIdentify = null;
|
byte[] ataIdentify = null;
|
||||||
byte[] atapiIdentify = null;
|
byte[] atapiIdentify = null;
|
||||||
@@ -436,6 +444,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
if(errno == ErrorNumber.NoError) mediaCatalogueNumber = Encoding.UTF8.GetString(mcn);
|
if(errno == ErrorNumber.NoError) mediaCatalogueNumber = Encoding.UTF8.GetString(mcn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(toc != null || atip != null || fullToc != null || pma != null)
|
||||||
|
{
|
||||||
CompactDiscInfo = new CompactDiscInfo
|
CompactDiscInfo = new CompactDiscInfo
|
||||||
{
|
{
|
||||||
DataContext = new CompactDiscInfoViewModel(toc,
|
DataContext = new CompactDiscInfoViewModel(toc,
|
||||||
@@ -455,6 +465,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
null,
|
null,
|
||||||
view)
|
view)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
byte[] dvdPfi = null;
|
byte[] dvdPfi = null;
|
||||||
byte[] dvdDmi = null;
|
byte[] dvdDmi = null;
|
||||||
@@ -482,6 +493,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVD_BCA) == true)
|
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVD_BCA) == true)
|
||||||
imageFormat.ReadMediaTag(MediaTagType.DVD_BCA, out dvdBca);
|
imageFormat.ReadMediaTag(MediaTagType.DVD_BCA, out dvdBca);
|
||||||
|
|
||||||
|
if(dvdPfi != null || dvdDmi != null || dvdCmi != null || hddvdCopyrightInformation != null || dvdBca != null)
|
||||||
|
{
|
||||||
DvdInfo = new DvdInfo
|
DvdInfo = new DvdInfo
|
||||||
{
|
{
|
||||||
DataContext = new DvdInfoViewModel(dvdPfi,
|
DataContext = new DvdInfoViewModel(dvdPfi,
|
||||||
@@ -493,6 +506,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
decodedPfi,
|
decodedPfi,
|
||||||
view)
|
view)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
byte[] dvdRamDds = null;
|
byte[] dvdRamDds = null;
|
||||||
byte[] dvdRamCartridgeStatus = null;
|
byte[] dvdRamCartridgeStatus = null;
|
||||||
@@ -551,6 +565,21 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DCB) == true)
|
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DCB) == true)
|
||||||
imageFormat.ReadMediaTag(MediaTagType.DCB, out dvdPlusDcb);
|
imageFormat.ReadMediaTag(MediaTagType.DCB, out dvdPlusDcb);
|
||||||
|
|
||||||
|
if(dvdRamDds != null ||
|
||||||
|
dvdRamCartridgeStatus != null ||
|
||||||
|
dvdRamSpareArea != null ||
|
||||||
|
lastBorderOutRmd != null ||
|
||||||
|
dvdPreRecordedInfo != null ||
|
||||||
|
dvdrMediaIdentifier != null ||
|
||||||
|
dvdrPhysicalInformation != null ||
|
||||||
|
hddvdrMediumStatus != null ||
|
||||||
|
dvdrLayerCapacity != null ||
|
||||||
|
dvdrDlMiddleZoneStart != null ||
|
||||||
|
dvdrDlJumpIntervalSize != null ||
|
||||||
|
dvdrDlManualLayerJumpStartLba != null ||
|
||||||
|
dvdPlusAdip != null ||
|
||||||
|
dvdPlusDcb != null)
|
||||||
|
{
|
||||||
DvdWritableInfo = new DvdWritableInfo
|
DvdWritableInfo = new DvdWritableInfo
|
||||||
{
|
{
|
||||||
DataContext = new DvdWritableInfoViewModel(dvdRamDds,
|
DataContext = new DvdWritableInfoViewModel(dvdRamDds,
|
||||||
@@ -571,6 +600,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
dvdPlusDcb,
|
dvdPlusDcb,
|
||||||
view)
|
view)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
byte[] blurayBurstCuttingArea = null;
|
byte[] blurayBurstCuttingArea = null;
|
||||||
byte[] blurayCartridgeStatus = null;
|
byte[] blurayCartridgeStatus = null;
|
||||||
@@ -601,6 +631,14 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.MMC_TrackResourcesInformation) == true)
|
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.MMC_TrackResourcesInformation) == true)
|
||||||
imageFormat.ReadMediaTag(MediaTagType.MMC_TrackResourcesInformation, out blurayTrackResources);
|
imageFormat.ReadMediaTag(MediaTagType.MMC_TrackResourcesInformation, out blurayTrackResources);
|
||||||
|
|
||||||
|
if(blurayDiscInformation != null ||
|
||||||
|
blurayBurstCuttingArea != null ||
|
||||||
|
blurayDds != null ||
|
||||||
|
blurayCartridgeStatus != null ||
|
||||||
|
bluraySpareAreaInformation != null ||
|
||||||
|
blurayPowResources != null ||
|
||||||
|
blurayTrackResources != null)
|
||||||
|
{
|
||||||
BlurayInfo = new BlurayInfo
|
BlurayInfo = new BlurayInfo
|
||||||
{
|
{
|
||||||
DataContext = new BlurayInfoViewModel(blurayDiscInformation,
|
DataContext = new BlurayInfoViewModel(blurayDiscInformation,
|
||||||
@@ -614,6 +652,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
null,
|
null,
|
||||||
view)
|
view)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
byte[] xboxDmi = null;
|
byte[] xboxDmi = null;
|
||||||
byte[] xboxSecuritySector = null;
|
byte[] xboxSecuritySector = null;
|
||||||
@@ -629,10 +668,13 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
if(errno == ErrorNumber.NoError) decodedXboxSecuritySector = SS.Decode(xboxSecuritySector);
|
if(errno == ErrorNumber.NoError) decodedXboxSecuritySector = SS.Decode(xboxSecuritySector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(xboxDmi != null || xboxSecuritySector != null)
|
||||||
|
{
|
||||||
XboxInfo = new XboxInfo
|
XboxInfo = new XboxInfo
|
||||||
{
|
{
|
||||||
DataContext = new XboxInfoViewModel(null, xboxDmi, xboxSecuritySector, decodedXboxSecuritySector, view)
|
DataContext = new XboxInfoViewModel(null, xboxDmi, xboxSecuritySector, decodedXboxSecuritySector, view)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
errno = ErrorNumber.NoData;
|
errno = ErrorNumber.NoData;
|
||||||
byte[] pcmciaCis = null;
|
byte[] pcmciaCis = null;
|
||||||
@@ -703,19 +745,21 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
deviceType = DeviceType.MMC;
|
deviceType = DeviceType.MMC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(cid != null || csd != null || ocr != null || extendedCsd != null || scr != null)
|
||||||
|
{
|
||||||
SdMmcInfo = new SdMmcInfo
|
SdMmcInfo = new SdMmcInfo
|
||||||
{
|
{
|
||||||
DataContext = new SdMmcInfoViewModel(deviceType, cid, csd, ocr, extendedCsd, scr)
|
DataContext = new SdMmcInfoViewModel(deviceType, cid, csd, ocr, extendedCsd, scr)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if(imageFormat is IOpticalMediaImage opticalMediaImage)
|
if(imageFormat is IOpticalMediaImage opticalMediaImage)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(opticalMediaImage.Sessions is { Count: > 0 })
|
if(opticalMediaImage.Sessions is { Count: > 0 })
|
||||||
{
|
foreach(Session session in opticalMediaImage.Sessions)
|
||||||
foreach(Session session in opticalMediaImage.Sessions) Sessions.Add(session);
|
Sessions.Add(session);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
@@ -725,9 +769,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(opticalMediaImage.Tracks is { Count: > 0 })
|
if(opticalMediaImage.Tracks is { Count: > 0 })
|
||||||
{
|
foreach(Track track in opticalMediaImage.Tracks)
|
||||||
foreach(Track track in opticalMediaImage.Tracks) Tracks.Add(track);
|
Tracks.Add(track);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user