mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[GUI] Add IMGBurn log viewer functionality
This commit is contained in:
@@ -114,6 +114,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
ViewImageSectorsCommand = new RelayCommand(ViewImageSectors);
|
||||
DecodeImageMediaTagsCommand = new RelayCommand(DecodeImageMediaTags);
|
||||
OpenMhddLogCommand = new AsyncRelayCommand(OpenMhddLogAsync);
|
||||
OpenIbgLogCommand = new AsyncRelayCommand(OpenIbgLogAsync);
|
||||
|
||||
_genericHddIcon =
|
||||
new Bitmap(AssetLoader.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-harddisk.png")));
|
||||
@@ -166,6 +167,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
public ICommand ViewImageSectorsCommand { get; }
|
||||
public ICommand DecodeImageMediaTagsCommand { get; }
|
||||
public ICommand OpenMhddLogCommand { get; }
|
||||
public ICommand OpenIbgLogCommand { get; }
|
||||
|
||||
public bool NativeMenuSupported
|
||||
{
|
||||
@@ -227,7 +229,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
IReadOnlyList<IStorageFile> result = await _view.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
Title = UI.Dialog_Choose_image_to_open,
|
||||
Title = UI.Choose_MHDD_log_to_open,
|
||||
AllowMultiple = false,
|
||||
FileTypeFilter = [FilePickerFileTypes.MhddLogFiles]
|
||||
});
|
||||
@@ -242,6 +244,26 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
mhddLogViewWindow.Show();
|
||||
}
|
||||
|
||||
async Task OpenIbgLogAsync()
|
||||
{
|
||||
IReadOnlyList<IStorageFile> result = await _view.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
Title = UI.Choose_IMGBurn_log_to_open,
|
||||
AllowMultiple = false,
|
||||
FileTypeFilter = [FilePickerFileTypes.IbgLogFiles]
|
||||
});
|
||||
|
||||
// Exit if user did not select exactly one file
|
||||
if(result.Count != 1) return;
|
||||
|
||||
var ibgLogViewWindow = new IbgLogView();
|
||||
|
||||
ibgLogViewWindow.DataContext = new IbgLogViewModel(ibgLogViewWindow, result[0].Path.LocalPath);
|
||||
|
||||
ibgLogViewWindow.Show();
|
||||
}
|
||||
|
||||
|
||||
async Task OpenAsync()
|
||||
{
|
||||
// Open file picker dialog to allow user to select an image file
|
||||
|
||||
Reference in New Issue
Block a user