Force selecting at least one partition/device
This commit is contained in:
parent
59ef06f402
commit
0f0c47bbe4
1 changed files with 6 additions and 2 deletions
|
|
@ -138,6 +138,8 @@ class State():
|
||||||
if not self.source:
|
if not self.source:
|
||||||
self.source = select_disk('Source')
|
self.source = select_disk('Source')
|
||||||
source_parts = select_disk_parts(mode, self.source)
|
source_parts = select_disk_parts(mode, self.source)
|
||||||
|
self.update_top_panes()
|
||||||
|
std.pause()
|
||||||
|
|
||||||
# Select destination
|
# Select destination
|
||||||
self.destination = get_object(docopt_args['<destination>'])
|
self.destination = get_object(docopt_args['<destination>'])
|
||||||
|
|
@ -146,6 +148,7 @@ class State():
|
||||||
self.destination = select_disk('Destination', self.source)
|
self.destination = select_disk('Destination', self.source)
|
||||||
elif mode == 'Image':
|
elif mode == 'Image':
|
||||||
self.destination = select_path('Destination')
|
self.destination = select_path('Destination')
|
||||||
|
self.update_top_panes()
|
||||||
|
|
||||||
# Update panes
|
# Update panes
|
||||||
self.panes['Progress'] = tmux.split_window(
|
self.panes['Progress'] = tmux.split_window(
|
||||||
|
|
@ -153,7 +156,6 @@ class State():
|
||||||
watch_file=f'{self.log_dir}/progress.out',
|
watch_file=f'{self.log_dir}/progress.out',
|
||||||
)
|
)
|
||||||
self.update_progress_pane()
|
self.update_progress_pane()
|
||||||
self.update_top_panes()
|
|
||||||
|
|
||||||
def init_tmux(self):
|
def init_tmux(self):
|
||||||
"""Initialize tmux layout."""
|
"""Initialize tmux layout."""
|
||||||
|
|
@ -585,7 +587,9 @@ def select_disk_parts(prompt, disk):
|
||||||
for option in menu.options.values():
|
for option in menu.options.values():
|
||||||
option['Selected'] = False
|
option['Selected'] = False
|
||||||
elif 'Proceed' in selection:
|
elif 'Proceed' in selection:
|
||||||
break
|
if any([option['Selected'] for option in menu.options.values()]):
|
||||||
|
# At least one partition/device selected/device selected
|
||||||
|
break
|
||||||
elif 'Quit' in selection:
|
elif 'Quit' in selection:
|
||||||
raise std.GenericAbort()
|
raise std.GenericAbort()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue