opnsense-src/usr.sbin/bsdinstall/scripts/finalconfig
Jessica Clarke 97350075fe bsdinstall: Switched back to amended single-button finalconfig
Commit ac78e3e9c5 ("bsdinstall: Add "Finish" button to finalconfig")
removed the Exit entry from the menu, renamed OK to Select and added a
Finish in place of the old Exit entry. On the surface this seemed like a
good idea, as at a glance OK wasn't clear that it was selecting an entry
rather than just closing the box, Exit isn't the most obvious term
to use for proceeding through the installer without doing anything, and
it separated out the different cases of "do something extra" and
"continue". However, because bsddialog (and dialog) keep a menu entry
highlighted even when the Cancel (in this case, Finish) button is
selected, this now looks even more confusing, with users easily
believing that they are about to select the Add User option (being
either surprised when it doesn't actually do that, or being confused
about how to not select it).

Instead, go back to the old scheme that fits more with bsddialog's
supported functionality but tweak it to try and improve on the confusing
UI/UX from the past. Specifically, the UI changes compared with the
original version are as follows:

1. The OK button is renamed to Select, as in the current UI
2. The Exit entry is renamed to Finish, mirroring the label of the
   button in the current UI that it replaces

This partially reverts commit ac78e3e9c5.

Reviewed by:	khorben_defora.org
Differential Revision:	https://reviews.freebsd.org/D47229
2025-02-04 17:27:00 +00:00

90 lines
2.8 KiB
Bash
Executable file

#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
# Copyright (c) 2013-2018 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD$
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
: ${BSDDIALOG_OK=0}
while true; do
exec 5>&1
REVISIT=$(bsddialog --backtitle "$OSNAME Installer" \
--title "Final Configuration" --ok-label "Select" \
--no-cancel --menu \
"Setup of your $OSNAME system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \
"Finish" "Apply configuration and exit installer" \
"Add User" "Add a user to the system" \
"Root Password" "Change root password" \
"Hostname" "Set system hostname" \
"Network" "Networking configuration" \
"Services" "Set daemons to run on startup" \
"System Hardening" "Set security options" \
"Time Zone" "Set system timezone" \
"Firmware" "Install Firmware (requires network)" \
"Handbook" "Install $OSNAME Handbook (requires network)" 2>&1 1>&5)
retval=$?
exec 5>&-
if [ $retval -ne $BSDDIALOG_OK ]; then
break
fi
case "$REVISIT" in
"Finish")
break
;;
"Add User")
bsdinstall adduser
;;
"Root Password")
bsdinstall rootpass
;;
"Hostname")
bsdinstall hostname
;;
"Network")
bsdinstall netconfig
;;
"Services")
bsdinstall services
;;
"System Hardening")
bsdinstall hardening
;;
"Time Zone")
bsdinstall time
;;
"Firmware")
bsdinstall firmware
;;
"Handbook")
bsdinstall docsinstall
;;
esac
done