diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-12 18:11:39 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-12 18:47:13 +0100 |
commit | 180fc3f5ac6952725e3be153f3f6b2dcc6f2ea3a (patch) | |
tree | 73abad758b1e3e1a180bfe9d6f90126dcce44f89 /src/core/libs/lib-ui-interactive.sh | |
parent | 71f1288b0641740b6f6c6cc6b2cf8e5308caf51c (diff) |
clean up disk selection dialogs
instead of first showing a nice overview with disk sizes, and then
making the user select a disk from a dry list, we now do both at once
Diffstat (limited to 'src/core/libs/lib-ui-interactive.sh')
-rw-r--r-- | src/core/libs/lib-ui-interactive.sh | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index eae4029..6f79b33 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -247,20 +247,17 @@ interactive_prepare_disks () interactive_autoprepare() { - DISCS=$(finddisks) - if [ $(echo $DISCS | wc -w) -gt 1 ] + listblockfriendly + if [ $(echo $BLOCKFRIENDLY | wc -w) -gt 1 ] then - notify "Available Disks:\n\n$(_getavaildisks)\n" - ask_option no 'Harddrive selection' "Select the hard drive to use" required $(finddisks 1 _) || return 1 + ask_option no 'Harddrive selection' "Select the hard drive to use" required $BLOCKFRIENDLY || return 1 DISC=$ANSWER_OPTION - elif [ -z "$DISCS" ]; then - ask_string "Could not find disk. Please enter path of devicefile manually" "" || return 1 - DISC=$ANSWER_STRING + elif [ -z "$BLOCKFRIENDLY" ]; then + ask_string "Could not find disk. Please enter path of devicefile manually" "" || return 1 + DISC=${ANSWER_STRING// /} # TODO : some checks if $DISC is really a blockdevice is probably a good idea else - DISC=$DISCS + DISC=$(echo $BLOCKFRIENDLY | cut -d ' ' -f 1) fi - # TODO : some checks if $DISC is really a blockdevice is probably a good idea - DISC=${DISC// /} # strip all whitespace. we need this for some reason.TODO: find out why get_blockdevice_size $DISC MiB FSOPTS=() @@ -334,10 +331,9 @@ interactive_partition() { fi # Select disk to partition - DISCS=$(finddisks 1 _) - DISCS="$DISCS OTHER - DONE +" - notify "Available Disks:\n\n$(_getavaildisks)\n" - DISC="" + listblockfriendly + DISCS="$BLOCKFRIENDLY OTHER OTHER DONE DONE" + DISC= while true; do # Prompt the user with a list of known disks ask_option no 'Disc selection' "$question_text (select DONE when finished)" required $DISCS || return 1 |