Import old XML statistics to the database.

This commit is contained in:
2018-12-21 16:52:25 +00:00
parent b503d1ae97
commit 3a25f54e55
2 changed files with 350 additions and 48 deletions

View File

@@ -42,6 +42,7 @@ using DiscImageChef.CommonTypes.Structs;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Core.Media.Info;
using DiscImageChef.Database;
using DiscImageChef.Decoders.SCSI;
using DiscImageChef.Devices;
using DiscImageChef.Gui.Dialogs;
@@ -596,7 +597,10 @@ namespace DiscImageChef.Gui.Forms
protected void OnMenuStatistics(object sender, EventArgs e)
{
if(Statistics.AllStats == null)
DicContext ctx = new DicContext();
if(!ctx.Commands.Any() && !ctx.Filesystems.Any() && !ctx.Filters.Any() && !ctx.MediaFormats.Any() &&
!ctx.Medias.Any() && !ctx.Partitions.Any() && !ctx.SeenDevices.Any())
{
MessageBox.Show("There are no statistics.");
return;