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

@@ -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()
});