Show sessions in image info GUI.

This commit is contained in:
2018-10-07 22:36:42 +01:00
parent d339e4774e
commit a5163a09e3
2 changed files with 47 additions and 0 deletions

View File

@@ -82,6 +82,13 @@
</GroupBox> </GroupBox>
</StackLayout> </StackLayout>
</TabPage> </TabPage>
<TabPage ID="tabSessions" Text="Sessions" Visible="False">
<StackLayout Orientation="Vertical">
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
<TreeGridView ID="treeSessions"/>
</StackLayoutItem>
</StackLayout>
</TabPage>
</TabControl> </TabControl>
</StackLayout> </StackLayout>
</Panel> </Panel>

View File

@@ -43,6 +43,7 @@ using DiscImageChef.Devices;
using DiscImageChef.Gui.Tabs; using DiscImageChef.Gui.Tabs;
using Eto.Forms; using Eto.Forms;
using Eto.Serialization.Xaml; using Eto.Serialization.Xaml;
using Session = DiscImageChef.CommonTypes.Structs.Session;
namespace DiscImageChef.Gui.Panels namespace DiscImageChef.Gui.Panels
{ {
@@ -641,6 +642,43 @@ namespace DiscImageChef.Gui.Panels
tabSdMmcInfo tabSdMmcInfo = new tabSdMmcInfo(); tabSdMmcInfo tabSdMmcInfo = new tabSdMmcInfo();
tabSdMmcInfo.LoadData(deviceType, cid, csd, ocr, extendedCsd, scr); tabSdMmcInfo.LoadData(deviceType, cid, csd, ocr, extendedCsd, scr);
tabInfos.Pages.Add(tabSdMmcInfo); tabInfos.Pages.Add(tabSdMmcInfo);
try
{
if(imageFormat.Sessions != null && imageFormat.Sessions.Count > 0)
{
TreeGridItemCollection sessionList = new TreeGridItemCollection();
treeSessions.Columns.Add(new GridColumn {HeaderText = "Session", DataCell = new TextBoxCell(0)});
treeSessions.Columns.Add(new GridColumn
{
HeaderText = "First track", DataCell = new TextBoxCell(1)
});
treeSessions.Columns.Add(new GridColumn {HeaderText = "Last track", DataCell = new TextBoxCell(2)});
treeSessions.Columns.Add(new GridColumn {HeaderText = "Start", DataCell = new TextBoxCell(3)});
treeSessions.Columns.Add(new GridColumn {HeaderText = "End", DataCell = new TextBoxCell(4)});
treeSessions.AllowMultipleSelection = false;
treeSessions.ShowHeader = true;
treeSessions.DataStore = sessionList;
foreach(Session session in imageFormat.Sessions)
sessionList.Add(new TreeGridItem
{
Values = new object[]
{
session.SessionSequence, session.StartTrack, session.EndTrack,
session.StartSector, session.EndSector
}
});
tabSessions.Visible = true;
}
}
catch
{
// ignored
}
} }
#region XAML controls #region XAML controls
@@ -680,6 +718,8 @@ namespace DiscImageChef.Gui.Panels
TreeGridView treeMediaTags; TreeGridView treeMediaTags;
GroupBox grpSectorTags; GroupBox grpSectorTags;
TreeGridView treeSectorTags; TreeGridView treeSectorTags;
TabPage tabSessions;
TreeGridView treeSessions;
#pragma warning restore 169 #pragma warning restore 169
#pragma warning restore 649 #pragma warning restore 649
#endregion #endregion