mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Emit message on successful dat import.
This commit is contained in:
@@ -386,5 +386,11 @@ namespace RomRepoMgr.Core.Resources {
|
|||||||
return ResourceManager.GetString("NotAnAaruFormatFile", resourceCulture);
|
return ResourceManager.GetString("NotAnAaruFormatFile", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static string DatImportSuccess {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("DatImportSuccess", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,4 +187,7 @@
|
|||||||
<data name="NotAnAaruFormatFile" xml:space="preserve">
|
<data name="NotAnAaruFormatFile" xml:space="preserve">
|
||||||
<value>Not an AaruFormat file.</value>
|
<value>Not an AaruFormat file.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="DatImportSuccess" xml:space="preserve">
|
||||||
|
<value>Imported {0} machines with {1} ROMs.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1118,7 +1118,10 @@ namespace RomRepoMgr.Core.Workers
|
|||||||
|
|
||||||
ctx.SaveChanges();
|
ctx.SaveChanges();
|
||||||
|
|
||||||
WorkFinished?.Invoke(this, System.EventArgs.Empty);
|
WorkFinished?.Invoke(this, new MessageEventArgs
|
||||||
|
{
|
||||||
|
Message = string.Format(Localization.DatImportSuccess, stats.TotalMachines, stats.TotalRoms)
|
||||||
|
});
|
||||||
|
|
||||||
RomSetAdded?.Invoke(this, new RomSetEventArgs
|
RomSetAdded?.Invoke(this, new RomSetEventArgs
|
||||||
{
|
{
|
||||||
@@ -1160,7 +1163,7 @@ namespace RomRepoMgr.Core.Workers
|
|||||||
public void Abort() => _aborted = true;
|
public void Abort() => _aborted = true;
|
||||||
|
|
||||||
public event EventHandler SetIndeterminateProgress;
|
public event EventHandler SetIndeterminateProgress;
|
||||||
public event EventHandler WorkFinished;
|
public event EventHandler<MessageEventArgs> WorkFinished;
|
||||||
public event EventHandler<ErrorEventArgs> ErrorOccurred;
|
public event EventHandler<ErrorEventArgs> ErrorOccurred;
|
||||||
public event EventHandler<ProgressBoundsEventArgs> SetProgressBounds;
|
public event EventHandler<ProgressBoundsEventArgs> SetProgressBounds;
|
||||||
public event EventHandler<ProgressEventArgs> SetProgress;
|
public event EventHandler<ProgressEventArgs> SetProgress;
|
||||||
|
|||||||
@@ -305,12 +305,12 @@ namespace RomRepoMgr.ViewModels
|
|||||||
Task.Run(_worker.Import);
|
Task.Run(_worker.Import);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnWorkerOnWorkFinished(object sender, EventArgs args) => Dispatcher.UIThread.Post(() =>
|
void OnWorkerOnWorkFinished(object sender, MessageEventArgs args) => Dispatcher.UIThread.Post(() =>
|
||||||
{
|
{
|
||||||
ImportResults.Add(new ImportDatFolderItem
|
ImportResults.Add(new ImportDatFolderItem
|
||||||
{
|
{
|
||||||
Filename = Path.GetFileName(_datFiles[_listPosition]),
|
Filename = Path.GetFileName(_datFiles[_listPosition]),
|
||||||
Status = Localization.OK
|
Status = args.Message
|
||||||
});
|
});
|
||||||
|
|
||||||
_listPosition++;
|
_listPosition++;
|
||||||
|
|||||||
@@ -126,9 +126,9 @@ namespace RomRepoMgr.ViewModels
|
|||||||
public string CloseLabel => Localization.CloseLabel;
|
public string CloseLabel => Localization.CloseLabel;
|
||||||
public ReactiveCommand<Unit, Unit> CloseCommand { get; }
|
public ReactiveCommand<Unit, Unit> CloseCommand { get; }
|
||||||
|
|
||||||
void OnWorkerOnWorkFinished(object sender, EventArgs args) => Dispatcher.UIThread.Post(() =>
|
void OnWorkerOnWorkFinished(object sender, MessageEventArgs args) => Dispatcher.UIThread.Post(() =>
|
||||||
{
|
{
|
||||||
StatusMessage = Localization.Finished;
|
StatusMessage = args.Message;
|
||||||
ProgressVisible = false;
|
ProgressVisible = false;
|
||||||
CanClose = true;
|
CanClose = true;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user