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 })
|
||||
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 })
|
||||
{
|
||||
@@ -280,6 +281,12 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
if(errno == ErrorNumber.NoError) scsiMode = Modes.DecodeMode10(scsiModeSense10, scsiDeviceType);
|
||||
}
|
||||
|
||||
if(scsiInquiryData != null ||
|
||||
scsiInquiry != null ||
|
||||
scsiMode != null ||
|
||||
scsiModeSense6 != null ||
|
||||
scsiModeSense10 != null)
|
||||
{
|
||||
ScsiInfo = new ScsiInfo
|
||||
{
|
||||
DataContext = new ScsiInfoViewModel(scsiInquiryData,
|
||||
@@ -292,6 +299,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
null,
|
||||
view)
|
||||
};
|
||||
}
|
||||
|
||||
byte[] ataIdentify = null;
|
||||
byte[] atapiIdentify = null;
|
||||
@@ -436,6 +444,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
if(errno == ErrorNumber.NoError) mediaCatalogueNumber = Encoding.UTF8.GetString(mcn);
|
||||
}
|
||||
|
||||
if(toc != null || atip != null || fullToc != null || pma != null)
|
||||
{
|
||||
CompactDiscInfo = new CompactDiscInfo
|
||||
{
|
||||
DataContext = new CompactDiscInfoViewModel(toc,
|
||||
@@ -455,6 +465,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
null,
|
||||
view)
|
||||
};
|
||||
}
|
||||
|
||||
byte[] dvdPfi = null;
|
||||
byte[] dvdDmi = null;
|
||||
@@ -482,6 +493,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVD_BCA) == true)
|
||||
imageFormat.ReadMediaTag(MediaTagType.DVD_BCA, out dvdBca);
|
||||
|
||||
if(dvdPfi != null || dvdDmi != null || dvdCmi != null || hddvdCopyrightInformation != null || dvdBca != null)
|
||||
{
|
||||
DvdInfo = new DvdInfo
|
||||
{
|
||||
DataContext = new DvdInfoViewModel(dvdPfi,
|
||||
@@ -493,6 +506,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
decodedPfi,
|
||||
view)
|
||||
};
|
||||
}
|
||||
|
||||
byte[] dvdRamDds = null;
|
||||
byte[] dvdRamCartridgeStatus = null;
|
||||
@@ -551,6 +565,21 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DCB) == true)
|
||||
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
|
||||
{
|
||||
DataContext = new DvdWritableInfoViewModel(dvdRamDds,
|
||||
@@ -571,6 +600,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
dvdPlusDcb,
|
||||
view)
|
||||
};
|
||||
}
|
||||
|
||||
byte[] blurayBurstCuttingArea = null;
|
||||
byte[] blurayCartridgeStatus = null;
|
||||
@@ -601,6 +631,14 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.MMC_TrackResourcesInformation) == true)
|
||||
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
|
||||
{
|
||||
DataContext = new BlurayInfoViewModel(blurayDiscInformation,
|
||||
@@ -614,6 +652,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
null,
|
||||
view)
|
||||
};
|
||||
}
|
||||
|
||||
byte[] xboxDmi = null;
|
||||
byte[] xboxSecuritySector = null;
|
||||
@@ -629,10 +668,13 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
if(errno == ErrorNumber.NoError) decodedXboxSecuritySector = SS.Decode(xboxSecuritySector);
|
||||
}
|
||||
|
||||
if(xboxDmi != null || xboxSecuritySector != null)
|
||||
{
|
||||
XboxInfo = new XboxInfo
|
||||
{
|
||||
DataContext = new XboxInfoViewModel(null, xboxDmi, xboxSecuritySector, decodedXboxSecuritySector, view)
|
||||
};
|
||||
}
|
||||
|
||||
errno = ErrorNumber.NoData;
|
||||
byte[] pcmciaCis = null;
|
||||
@@ -703,19 +745,21 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
deviceType = DeviceType.MMC;
|
||||
}
|
||||
|
||||
if(cid != null || csd != null || ocr != null || extendedCsd != null || scr != null)
|
||||
{
|
||||
SdMmcInfo = new SdMmcInfo
|
||||
{
|
||||
DataContext = new SdMmcInfoViewModel(deviceType, cid, csd, ocr, extendedCsd, scr)
|
||||
};
|
||||
}
|
||||
|
||||
if(imageFormat is IOpticalMediaImage opticalMediaImage)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(opticalMediaImage.Sessions is { Count: > 0 })
|
||||
{
|
||||
foreach(Session session in opticalMediaImage.Sessions) Sessions.Add(session);
|
||||
}
|
||||
foreach(Session session in opticalMediaImage.Sessions)
|
||||
Sessions.Add(session);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
@@ -725,9 +769,8 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
if(opticalMediaImage.Tracks is { Count: > 0 })
|
||||
{
|
||||
foreach(Track track in opticalMediaImage.Tracks) Tracks.Add(track);
|
||||
}
|
||||
foreach(Track track in opticalMediaImage.Tracks)
|
||||
Tracks.Add(track);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user