Add ROM set category.

This commit is contained in:
2020-09-05 01:52:43 +01:00
parent 38b298e19d
commit 9f14a82222
17 changed files with 537 additions and 26 deletions

View File

@@ -43,5 +43,6 @@ namespace RomRepoMgr.Core.Models
public long HaveRoms { get; set; }
public long MissRoms { get; set; }
public long Id { get; set; }
public string Category { get; set; }
}
}

View File

@@ -43,14 +43,18 @@ namespace RomRepoMgr.Core.Workers
{
public sealed class DatImporter
{
readonly string _category;
readonly string _datFilesPath;
readonly string _datPath;
bool _aborted;
public DatImporter(string datPath)
public DatImporter(string datPath, string category)
{
_datPath = datPath;
_datFilesPath = Path.Combine(Settings.Settings.Current.RepositoryPath, "datfiles");
if(!string.IsNullOrWhiteSpace(category))
_category = category;
}
public void Import()
@@ -109,7 +113,8 @@ namespace RomRepoMgr.Core.Workers
Sha384 = datHash,
Version = datFile.Header.Version,
CreatedOn = DateTime.UtcNow,
UpdatedOn = DateTime.UtcNow
UpdatedOn = DateTime.UtcNow,
Category = _category
};
Context.Singleton.RomSets.Add(romSet);
@@ -747,7 +752,8 @@ namespace RomRepoMgr.Core.Workers
romSet.Machines.Sum(m => m.Medias.Count(f => f.Media.IsInRepo)),
MissRoms = romSet.Machines.Sum(m => m.Files.Count(f => !f.File.IsInRepo)) +
romSet.Machines.Sum(m => m.Disks.Count(f => !f.Disk.IsInRepo)) +
romSet.Machines.Sum(m => m.Medias.Count(f => !f.Media.IsInRepo))
romSet.Machines.Sum(m => m.Medias.Count(f => !f.Media.IsInRepo)),
Category = _category
}
});
}

View File

@@ -120,6 +120,8 @@ namespace RomRepoMgr.Database
entity.HasIndex(e => e.Filename);
entity.HasIndex(e => e.Sha384);
entity.HasIndex(e => e.Category);
});
modelBuilder.Entity<Machine>(entity =>

View File

@@ -0,0 +1,417 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RomRepoMgr.Database;
namespace RomRepoMgr.Database.Migrations
{
[DbContext(typeof(Context))]
[Migration("20200904212924_AddRomSetCategory")]
partial class AddRomSetCategory
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.7");
modelBuilder.Entity("RomRepoMgr.Database.Models.DbDisk", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<bool>("IsInRepo")
.HasColumnType("INTEGER");
b.Property<string>("Md5")
.HasColumnType("TEXT")
.HasMaxLength(32);
b.Property<string>("OriginalFileName")
.HasColumnType("TEXT");
b.Property<string>("Sha1")
.HasColumnType("TEXT")
.HasMaxLength(40);
b.Property<ulong?>("Size")
.HasColumnType("INTEGER");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("IsInRepo");
b.HasIndex("Md5");
b.HasIndex("Sha1");
b.HasIndex("Size");
b.ToTable("Disks");
});
modelBuilder.Entity("RomRepoMgr.Database.Models.DbFile", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Crc32")
.HasColumnType("TEXT")
.HasMaxLength(8);
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<bool>("IsInRepo")
.HasColumnType("INTEGER");
b.Property<string>("Md5")
.HasColumnType("TEXT")
.HasMaxLength(32);
b.Property<string>("OriginalFileName")
.HasColumnType("TEXT");
b.Property<string>("Sha1")
.HasColumnType("TEXT")
.HasMaxLength(40);
b.Property<string>("Sha256")
.HasColumnType("TEXT")
.HasMaxLength(64);
b.Property<string>("Sha384")
.HasColumnType("TEXT")
.HasMaxLength(96);
b.Property<string>("Sha512")
.HasColumnType("TEXT")
.HasMaxLength(128);
b.Property<ulong>("Size")
.HasColumnType("INTEGER");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Crc32");
b.HasIndex("IsInRepo");
b.HasIndex("Md5");
b.HasIndex("Sha1");
b.HasIndex("Sha256");
b.HasIndex("Sha384");
b.HasIndex("Sha512");
b.HasIndex("Size");
b.ToTable("Files");
});
modelBuilder.Entity("RomRepoMgr.Database.Models.DbMedia", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<bool>("IsInRepo")
.HasColumnType("INTEGER");
b.Property<string>("Md5")
.HasColumnType("TEXT")
.HasMaxLength(32);
b.Property<string>("OriginalFileName")
.HasColumnType("TEXT");
b.Property<string>("Sha1")
.HasColumnType("TEXT")
.HasMaxLength(40);
b.Property<string>("Sha256")
.HasColumnType("TEXT")
.HasMaxLength(64);
b.Property<ulong?>("Size")
.HasColumnType("INTEGER");
b.Property<string>("SpamSum")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("IsInRepo");
b.HasIndex("Md5");
b.HasIndex("Sha1");
b.HasIndex("Sha256");
b.HasIndex("Size");
b.HasIndex("SpamSum");
b.ToTable("Medias");
});
modelBuilder.Entity("RomRepoMgr.Database.Models.DiskByMachine", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<ulong>("DiskId")
.HasColumnType("INTEGER");
b.Property<ulong>("MachineId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("DiskId");
b.HasIndex("MachineId");
b.HasIndex("Name");
b.ToTable("DisksByMachines");
});
modelBuilder.Entity("RomRepoMgr.Database.Models.FileByMachine", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<ulong>("FileId")
.HasColumnType("INTEGER");
b.Property<ulong>("MachineId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("FileId");
b.HasIndex("MachineId");
b.HasIndex("Name");
b.ToTable("FilesByMachines");
});
modelBuilder.Entity("RomRepoMgr.Database.Models.Machine", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<long>("RomSetId")
.HasColumnType("INTEGER");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name");
b.HasIndex("RomSetId");
b.ToTable("Machines");
});
modelBuilder.Entity("RomRepoMgr.Database.Models.MediaByMachine", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<ulong>("MachineId")
.HasColumnType("INTEGER");
b.Property<ulong>("MediaId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("MachineId");
b.HasIndex("MediaId");
b.HasIndex("Name");
b.ToTable("MediasByMachines");
});
modelBuilder.Entity("RomRepoMgr.Database.Models.RomSet", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Author")
.HasColumnType("TEXT");
b.Property<string>("Category")
.HasColumnType("TEXT");
b.Property<string>("Comment")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Date")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("Filename")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Homepage")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Sha384")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(96);
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("Version")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Author");
b.HasIndex("Category");
b.HasIndex("Comment");
b.HasIndex("Date");
b.HasIndex("Description");
b.HasIndex("Filename");
b.HasIndex("Homepage");
b.HasIndex("Name");
b.HasIndex("Sha384");
b.HasIndex("Version");
b.ToTable("RomSets");
});
modelBuilder.Entity("RomRepoMgr.Database.Models.DiskByMachine", b =>
{
b.HasOne("RomRepoMgr.Database.Models.DbDisk", "Disk")
.WithMany("Machines")
.HasForeignKey("DiskId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RomRepoMgr.Database.Models.Machine", "Machine")
.WithMany("Disks")
.HasForeignKey("MachineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RomRepoMgr.Database.Models.FileByMachine", b =>
{
b.HasOne("RomRepoMgr.Database.Models.DbFile", "File")
.WithMany("Machines")
.HasForeignKey("FileId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RomRepoMgr.Database.Models.Machine", "Machine")
.WithMany("Files")
.HasForeignKey("MachineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RomRepoMgr.Database.Models.Machine", b =>
{
b.HasOne("RomRepoMgr.Database.Models.RomSet", "RomSet")
.WithMany("Machines")
.HasForeignKey("RomSetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RomRepoMgr.Database.Models.MediaByMachine", b =>
{
b.HasOne("RomRepoMgr.Database.Models.Machine", "Machine")
.WithMany("Medias")
.HasForeignKey("MachineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RomRepoMgr.Database.Models.DbMedia", "Media")
.WithMany("Machines")
.HasForeignKey("MediaId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace RomRepoMgr.Database.Migrations
{
public partial class AddRomSetCategory : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>("Category", "RomSets", nullable: true);
migrationBuilder.CreateIndex("IX_RomSets_Category", "RomSets", "Category");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex("IX_RomSets_Category", "RomSets");
migrationBuilder.DropColumn("Category", "RomSets");
}
}
}

View File

@@ -221,6 +221,8 @@ namespace RomRepoMgr.Database.Migrations
b.Property<string>("Author").HasColumnType("TEXT");
b.Property<string>("Category").HasColumnType("TEXT");
b.Property<string>("Comment").HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn").HasColumnType("TEXT");
@@ -245,6 +247,8 @@ namespace RomRepoMgr.Database.Migrations
b.HasIndex("Author");
b.HasIndex("Category");
b.HasIndex("Comment");
b.HasIndex("Date");

View File

@@ -40,7 +40,8 @@ namespace RomRepoMgr.Database.Models
[Required]
public string Filename { get; set; }
[Required, StringLength(96, MinimumLength = 96)]
public string Sha384 { get; set; }
public string Sha384 { get; set; }
public string Category { get; set; }
public virtual ICollection<Machine> Machines { get; set; }
}

View File

@@ -704,5 +704,11 @@ namespace RomRepoMgr.Resources {
return ResourceManager.GetString("FilesystemMenuUmountText", resourceCulture);
}
}
internal static string RomSetCategoryLabel {
get {
return ResourceManager.GetString("RomSetCategoryLabel", resourceCulture);
}
}
}
}

View File

@@ -349,4 +349,7 @@ Do you want to delete the file?</value>
<data name="FilesystemMenuUmountText" xml:space="preserve">
<value>_Umount</value>
</data>
<data name="RomSetCategoryLabel" xml:space="preserve">
<value>Category</value>
</data>
</root>

View File

@@ -40,6 +40,7 @@ namespace RomRepoMgr.ViewModels
readonly RomSetModel _romSet;
readonly EditDat _view;
string _author;
string _category;
string _comment;
string _date;
string _description;
@@ -56,6 +57,7 @@ namespace RomRepoMgr.ViewModels
_version = romSet.Version;
_author = romSet.Author;
_comment = romSet.Comment;
_category = romSet.Category;
_date = romSet.Date;
_description = romSet.Description;
_homepage = romSet.Homepage;
@@ -67,6 +69,7 @@ namespace RomRepoMgr.ViewModels
public string NameLabel => Localization.RomSetNameLabel;
public string VersionLabel => Localization.RomSetVersionLabel;
public string AuthorLabel => Localization.RomSetAuthorLabel;
public string CategoryLabel => Localization.RomSetCategoryLabel;
public string CommentLabel => Localization.RomSetCommentLabel;
public string DateLabel => Localization.RomSetDateLabel;
public string DescriptionLabel => Localization.RomSetDescriptionLabel;
@@ -146,6 +149,18 @@ namespace RomRepoMgr.ViewModels
}
}
public string Category
{
get => _category;
set
{
if(value != _category)
Modified = true;
this.RaiseAndSetIfChanged(ref _category, value);
}
}
public string Date
{
get => _date;
@@ -195,6 +210,7 @@ namespace RomRepoMgr.ViewModels
romSetDb.Author = Author;
romSetDb.Comment = Comment;
romSetDb.Category = Category;
romSetDb.Date = Date;
romSetDb.Description = Description;
romSetDb.Homepage = Homepage;
@@ -210,6 +226,7 @@ namespace RomRepoMgr.ViewModels
{
Author = Author,
Comment = Comment,
Category = Category,
Date = Date,
Description = Description,
Homepage = Homepage,

View File

@@ -46,6 +46,7 @@ namespace RomRepoMgr.ViewModels
bool _allFilesChecked;
bool _canClose;
bool _canStart;
string _category;
string[] _datFiles;
bool _isImporting;
bool _isReady;
@@ -76,6 +77,7 @@ namespace RomRepoMgr.ViewModels
}
public string PathLabel => Localization.PathLabel;
public string CategoryLabel => Localization.RomSetCategoryLabel;
public string FolderPath { get; }
public string AllFilesLabel => Localization.AllFilesLabel;
public string RecursiveLabel => Localization.RecursiveLabel;
@@ -184,6 +186,12 @@ namespace RomRepoMgr.ViewModels
set => this.RaiseAndSetIfChanged(ref _isImporting, value);
}
public string Category
{
get => _category;
set => this.RaiseAndSetIfChanged(ref _category, value);
}
[NotNull]
public string Title => Localization.ImportDatFolderTitle;
@@ -286,7 +294,7 @@ namespace RomRepoMgr.ViewModels
StatusMessage = string.Format(Localization.ImportingItem, Path.GetFileName(_datFiles[_listPosition]));
ProgressValue = _listPosition;
var _worker = new DatImporter(_datFiles[_listPosition]);
var _worker = new DatImporter(_datFiles[_listPosition], Category);
_worker.ErrorOccurred += OnWorkerOnErrorOccurred;
_worker.SetIndeterminateProgress += OnWorkerOnSetIndeterminateProgress;
_worker.SetMessage += OnWorkerOnSetMessage;

View File

@@ -57,7 +57,7 @@ namespace RomRepoMgr.ViewModels
IndeterminateProgress = true;
ProgressVisible = false;
ErrorVisible = false;
_worker = new DatImporter(datPath);
_worker = new DatImporter(datPath, null);
_worker.ErrorOccurred += OnWorkerOnErrorOccurred;
_worker.SetIndeterminateProgress += OnWorkerOnSetIndeterminateProgress;
_worker.SetMessage += OnWorkerOnSetMessage;

View File

@@ -73,6 +73,7 @@ namespace RomRepoMgr.ViewModels
public string RomSetNameLabel => Localization.RomSetNameLabel;
public string RomSetVersionLabel => Localization.RomSetVersionLabel;
public string RomSetAuthorLabel => Localization.RomSetAuthorLabel;
public string RomSetCategoryLabel => Localization.RomSetCategoryLabel;
public string RomSetDateLabel => Localization.RomSetDateLabel;
public string RomSetDescriptionLabel => Localization.RomSetDescriptionLabel;
public string RomSetCommentLabel => Localization.RomSetCommentLabel;

View File

@@ -352,7 +352,8 @@ namespace RomRepoMgr.ViewModels
r.Machines.Sum(m => m.Medias.Count(f => f.Media.IsInRepo)),
MissRoms = r.Machines.Sum(m => m.Files.Count(f => !f.File.IsInRepo)) +
r.Machines.Sum(m => m.Disks.Count(f => !f.Disk.IsInRepo)) +
r.Machines.Sum(m => m.Medias.Count(f => !f.Media.IsInRepo))
r.Machines.Sum(m => m.Medias.Count(f => !f.Media.IsInRepo)),
Category = r.Category
}).ToList()
});

View File

@@ -40,7 +40,7 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
@@ -70,6 +70,15 @@
Text="{Binding Author}" Padding="5" />
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center"
Text="{Binding CategoryLabel}" FontWeight="Bold" Padding="5" />
<TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center"
Text="{Binding Category}" Padding="5" />
</Grid>
<Grid Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -78,7 +87,7 @@
<TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center"
Text="{Binding Comment}" Padding="5" />
</Grid>
<Grid Grid.Row="4">
<Grid Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -87,7 +96,7 @@
<TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Text="{Binding Date}"
Padding="5" />
</Grid>
<Grid Grid.Row="5">
<Grid Grid.Row="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -96,7 +105,7 @@
<TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center"
Text="{Binding Description}" Padding="5" />
</Grid>
<Grid Grid.Row="6">
<Grid Grid.Row="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -105,7 +114,7 @@
<TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center"
Text="{Binding Homepage}" Padding="5" />
</Grid>
<Grid Grid.Row="7">
<Grid Grid.Row="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -114,7 +123,7 @@
<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center"
Text="{Binding TotalMachines}" Padding="5" />
</Grid>
<Grid Grid.Row="8">
<Grid Grid.Row="9">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -123,7 +132,7 @@
<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center"
Text="{Binding CompleteMachines}" Padding="5" />
</Grid>
<Grid Grid.Row="9">
<Grid Grid.Row="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -132,7 +141,7 @@
<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center"
Text="{Binding IncompleteMachines}" Padding="5" />
</Grid>
<Grid Grid.Row="10">
<Grid Grid.Row="11">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -141,7 +150,7 @@
<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center"
Text="{Binding TotalRoms}" Padding="5" />
</Grid>
<Grid Grid.Row="11">
<Grid Grid.Row="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -150,7 +159,7 @@
<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center"
Text="{Binding HaveRoms}" Padding="5" />
</Grid>
<Grid Grid.Row="12">
<Grid Grid.Row="13">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
@@ -159,7 +168,7 @@
<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center"
Text="{Binding MissRoms}" Padding="5" />
</Grid>
<StackPanel Grid.Row="13" Orientation="Horizontal" HorizontalAlignment="Right">
<StackPanel Grid.Row="14" Orientation="Horizontal" HorizontalAlignment="Right">
<Button HorizontalAlignment="Right" VerticalAlignment="Center" Command="{Binding SaveCommand}"
IsVisible="{Binding Modified}">
<TextBlock Text="{Binding SaveLabel}" />

View File

@@ -38,31 +38,40 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="*" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
<TextBlock Text="{Binding PathLabel}" FontWeight="Bold" /> <TextBlock Text="{Binding FolderPath}" />
</StackPanel>
<CheckBox Grid.Row="1" IsChecked="{Binding AllFilesChecked}" IsEnabled="{Binding IsReady}">
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center"
Text="{Binding CategoryLabel}" FontWeight="Bold" Padding="5" />
<TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center"
Text="{Binding Category}" Padding="5" />
</Grid>
<CheckBox Grid.Row="2" IsChecked="{Binding AllFilesChecked}" IsEnabled="{Binding IsReady}">
<CheckBox.Content>
<TextBlock Text="{Binding AllFilesLabel}" />
</CheckBox.Content>
</CheckBox>
<CheckBox Grid.Row="2" IsChecked="{Binding RecursiveChecked}" IsEnabled="{Binding IsReady}">
<CheckBox Grid.Row="3" IsChecked="{Binding RecursiveChecked}" IsEnabled="{Binding IsReady}">
<CheckBox.Content>
<TextBlock Text="{Binding RecursiveLabel}" />
</CheckBox.Content>
</CheckBox>
<TextBlock Grid.Row="3" Text="{Binding StatusMessage}" FontWeight="Bold" HorizontalAlignment="Center" />
<ProgressBar Grid.Row="4" Minimum="{Binding ProgressMinimum}" Maximum="{Binding ProgressMaximum}"
<TextBlock Grid.Row="4" Text="{Binding StatusMessage}" FontWeight="Bold" HorizontalAlignment="Center" />
<ProgressBar Grid.Row="5" Minimum="{Binding ProgressMinimum}" Maximum="{Binding ProgressMaximum}"
Value="{Binding ProgressValue}" IsIndeterminate="{Binding ProgressIsIndeterminate}"
IsVisible="{Binding ProgressVisible}" />
<StackPanel Grid.Row="5" IsVisible="{Binding Progress2Visible}">
<StackPanel Grid.Row="6" IsVisible="{Binding Progress2Visible}">
<TextBlock Text="{Binding Status2Message}" />
<ProgressBar Minimum="{Binding Progress2Minimum}" Maximum="{Binding Progress2Maximum}"
Value="{Binding Progress2Value}" IsIndeterminate="{Binding Progress2IsIndeterminate}" />
</StackPanel>
<DataGrid Grid.Row="6" Items="{Binding ImportResults}" HorizontalScrollBarVisibility="Visible"
<DataGrid Grid.Row="7" Items="{Binding ImportResults}" HorizontalScrollBarVisibility="Visible"
IsVisible="{Binding IsImporting}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Filename}" Width="Auto" IsReadOnly="True">
@@ -77,7 +86,7 @@
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Row="7" Orientation="Horizontal" IsVisible="{Binding IsReady}" HorizontalAlignment="Right">
<StackPanel Grid.Row="8" Orientation="Horizontal" IsVisible="{Binding IsReady}" HorizontalAlignment="Right">
<Button HorizontalAlignment="Right" VerticalAlignment="Center" IsEnabled="{Binding CanClose}"
Command="{Binding CloseCommand}">
<TextBlock Text="{Binding CloseLabel}" />

View File

@@ -69,6 +69,11 @@
<TextBlock Text="{Binding RomSetAuthorLabel}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Category}" Width="Auto" IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding RomSetCategoryLabel}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Date}" Width="Auto" IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding RomSetDateLabel}" />