Simplify the WKClone source/dest selection

Only show confirmation #2 if using advanced partition selection.
This commit is contained in:
2Shirt 2022-02-22 13:07:54 -07:00
parent 80f9bb6d75
commit 16d47a12a6
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -740,10 +740,17 @@ class State():
self.update_top_panes()
# Confirmation #1
self.confirm_selections(
prompt='Are these selections correct?',
source_parts=source_parts,
)
advanced_selection = False
try:
self.confirm_selections(
prompt='Are these selections correct? (use "No" for advanced selection)',
source_parts=source_parts,
)
except std.GenericAbort:
if std.ask('Proceed to advanced partition selection?'):
advanced_selection = True
else:
raise
# Update panes
self.update_progress_pane('Idle')
@ -762,11 +769,18 @@ class State():
clean_working_dir(self)
# Add block pairs
if self.mode == 'Clone':
source_parts = self.add_clone_block_pairs()
if advanced_selection:
if self.mode == 'Clone':
source_parts = self.add_clone_block_pairs()
else:
source_parts = select_disk_parts(self.mode, self.source)
self.add_image_block_pairs(source_parts)
else:
source_parts = select_disk_parts(self.mode, self.source)
self.add_image_block_pairs(source_parts)
if self.mode == 'Clone':
self._add_block_pair(
hw_obj.Disk(self.source.path),
pathlib.Path(self.destination.path),
)
# Safety Checks #1
if self.mode == 'Clone':
@ -775,7 +789,8 @@ class State():
# Confirmation #2
self.update_progress_pane('Idle')
self.confirm_selections('Start recovery?')
if advanced_selection:
self.confirm_selections('Start recovery?')
# Unmount source and/or destination under macOS
if PLATFORM == 'Darwin':