mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Implement abortion in image convertion process.
This commit is contained in:
@@ -227,6 +227,8 @@ public partial class Convert
|
||||
|
||||
foreach(TapeFile tapeFile in inputTape.Files)
|
||||
{
|
||||
if(_aborted) break;
|
||||
|
||||
UpdateProgress?.Invoke(string.Format(UI.Converting_file_0_of_partition_1,
|
||||
tapeFile.File,
|
||||
tapeFile.Partition),
|
||||
@@ -244,6 +246,8 @@ public partial class Convert
|
||||
|
||||
foreach(TapePartition tapePartition in inputTape.TapePartitions)
|
||||
{
|
||||
if(_aborted) break;
|
||||
|
||||
UpdateProgress?.Invoke(string.Format(UI.Converting_tape_partition_0, tapePartition.Number),
|
||||
currentPartition + 1,
|
||||
inputTape.TapePartitions.Count);
|
||||
@@ -270,7 +274,7 @@ public partial class Convert
|
||||
if(errno != ErrorNumber.NoError) return errno;
|
||||
}
|
||||
|
||||
if(_resume != null || dumpHardware != null)
|
||||
if((_resume != null || dumpHardware != null) && !_aborted)
|
||||
{
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -287,7 +291,7 @@ public partial class Convert
|
||||
|
||||
ret = false;
|
||||
|
||||
if(_sidecar != null || metadata != null)
|
||||
if((_sidecar != null || metadata != null) && !_aborted)
|
||||
{
|
||||
InitProgress?.Invoke();
|
||||
PulseProgress?.Invoke(UI.Writing_metadata);
|
||||
@@ -301,6 +305,13 @@ public partial class Convert
|
||||
EndProgress?.Invoke();
|
||||
}
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
UpdateStatus?.Invoke(UI.Operation_canceled_the_output_file_is_not_correct);
|
||||
|
||||
return ErrorNumber.Canceled;
|
||||
}
|
||||
|
||||
var closed = false;
|
||||
|
||||
InitProgress?.Invoke();
|
||||
|
||||
Reference in New Issue
Block a user