mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Add window to import ROMs from folder.
This commit is contained in:
@@ -49,6 +49,7 @@ namespace RomRepoMgr.ViewModels
|
||||
AboutCommand = ReactiveCommand.Create(ExecuteAboutCommand);
|
||||
ImportDatCommand = ReactiveCommand.Create(ExecuteImportDatCommand);
|
||||
ImportDatFolderCommand = ReactiveCommand.Create(ExecuteImportDatFolderCommand);
|
||||
ImportRomFolderCommand = ReactiveCommand.Create(ExecuteImportRomFolderCommand);
|
||||
RomSets = new ObservableCollection<RomSetModel>(romSets);
|
||||
}
|
||||
|
||||
@@ -72,6 +73,7 @@ namespace RomRepoMgr.ViewModels
|
||||
public ReactiveCommand<Unit, Unit> SettingsCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> ImportDatCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> ImportDatFolderCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> ImportRomFolderCommand { get; }
|
||||
|
||||
internal async void ExecuteSettingsCommand()
|
||||
{
|
||||
@@ -152,5 +154,23 @@ namespace RomRepoMgr.ViewModels
|
||||
dialog.DataContext = importDatFolderViewModel;
|
||||
await dialog.ShowDialog(_view);
|
||||
}
|
||||
|
||||
internal async void ExecuteImportRomFolderCommand()
|
||||
{
|
||||
var dlgOpen = new OpenFolderDialog
|
||||
{
|
||||
Title = "Import ROMs from folder..."
|
||||
};
|
||||
|
||||
string result = await dlgOpen.ShowAsync(_view);
|
||||
|
||||
if(result == null)
|
||||
return;
|
||||
|
||||
var dialog = new ImportRomFolder();
|
||||
var importRomFolderViewModel = new ImportRomFolderViewModel(dialog, result);
|
||||
dialog.DataContext = importRomFolderViewModel;
|
||||
await dialog.ShowDialog(_view);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user