Add option to export ROMs as ZIP files.

This commit is contained in:
2020-08-24 23:27:03 +01:00
parent ec2717c73a
commit 09ca223f02
8 changed files with 722 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ namespace RomRepoMgr.ViewModels
DeleteRomSetCommand = ReactiveCommand.Create(ExecuteDeleteRomSetCommand);
EditRomSetCommand = ReactiveCommand.Create(ExecuteEditRomSetCommand);
ExportDatCommand = ReactiveCommand.Create(ExecuteExportDatCommand);
ExportRomsCommand = ReactiveCommand.Create(ExecuteExportRomsCommand);
RomSets = new ObservableCollection<RomSetModel>(romSets);
}
@@ -89,6 +90,7 @@ namespace RomRepoMgr.ViewModels
public ReactiveCommand<Unit, Unit> DeleteRomSetCommand { get; }
public ReactiveCommand<Unit, Unit> EditRomSetCommand { get; }
public ReactiveCommand<Unit, Unit> ExportDatCommand { get; }
public ReactiveCommand<Unit, Unit> ExportRomsCommand { get; }
public RomSetModel SelectedRomSet
{
@@ -262,5 +264,23 @@ namespace RomRepoMgr.ViewModels
dialog.DataContext = viewModel;
await dialog.ShowDialog(_view);
}
async void ExecuteExportRomsCommand()
{
var dlgOpen = new OpenFolderDialog
{
Title = "Export ROMs to folder..."
};
string result = await dlgOpen.ShowAsync(_view);
if(result == null)
return;
var dialog = new ExportRoms();
var viewModel = new ExportRomsViewModel(dialog, result, SelectedRomSet.Id);
dialog.DataContext = viewModel;
await dialog.ShowDialog(_view);
}
}
}