summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-ui-interactive.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-28 15:10:37 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-28 15:15:58 +0100
commitd2dfddb854d66977f8b30d9fa118a704dd8dfc12 (patch)
tree35bc2b6dbbe3f30750c5547fffee27935a49fc1c /src/core/libs/lib-ui-interactive.sh
parente079b88505229fe79bd03a3c542f277ffaa4c30e (diff)
manage $EDITOR more properly
since 3cee8e663a4da69456b493acccbda27064209a35 libui-sh can manage the $EDITOR preference, so we can simplify and cleanup our code. we now also explicitly enable the user to change $EDITOR in the interactive procedure even when it is already set correctly, so there is a new menu entry for that.
Diffstat (limited to 'src/core/libs/lib-ui-interactive.sh')
-rw-r--r--src/core/libs/lib-ui-interactive.sh31
1 files changed, 4 insertions, 27 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 4412af2..c15c3a9 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -65,10 +65,7 @@ prefill_configs () {
interactive_configure_system()
{
- if [ -z "$EDITOR" ]
- then
- interactive_get_editor || return 1
- fi
+ seteditor || return 1
FILE=""
prefill_configs
@@ -1150,12 +1147,9 @@ interactive_grub_menulst () {
generate_grub_menulst
helptext=
grep -q '^/dev/mapper' $TMP_FSTAB && helptext=" /dev/mapper/ users: Pay attention to the kernel line!"
- notify "Before installing GRUB, you must review the configuration file. You will now be put into the editor. After you save your changes and exit the editor, you can install GRUB.$helptext"
- if [ -z "$EDITOR" ]
- then
- interactive_get_editor || return 1
- fi
- $EDITOR $grubmenu
+ notify "Before installing GRUB, you must review the configuration file. You will now be put into the editor. After you save your changes and exit the editor, you can install GRUB.$helptext"
+ seteditor || return 1
+ $EDITOR $grubmenu
}
interactive_grub_install () {
@@ -1261,23 +1255,6 @@ interactive_select_mirror() {
echo "Using mirror: $var_SYNC_URL" >$LOG
}
-# geteditor().
-# prompts the user to choose an editor
-# sets EDITOR global variable
-#
-interactive_get_editor() {
- unset EDITOR_OPTS
- declare -A editors=(["nano"]="nano (easier)" ["joe"]="joe (bit more powerful)" ["vi"]="vi (advanced)")
- for editor in ${!editors[@]}
- do
- which $editor &>/dev/null && EDITOR_OPTS+=($editor "${editors[$editor]}")
- done
- ask_option nano "Text editor selection" "Select a Text Editor to Use" required "${EDITOR_OPTS[@]}" || return 1
- EDITOR=nano
- check_is_in "$ANSWER_OPTION" "${!editors[@]}" && EDITOR=$ANSWER_OPTION
-}
-
-
select_source_extras_menu ()
{
while true; do