Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Dec 2016 02:22:21 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309983 - head/usr.sbin/bsdinstall/scripts
Message-ID:  <201612130222.uBD2ML4O061927@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Tue Dec 13 02:22:21 2016
New Revision: 309983
URL: https://svnweb.freebsd.org/changeset/base/309983

Log:
  Relying on dialog auto-sizing (width/height/rows = 0) is a mistake
  Use the provided API for calculating the appropriate size of menus

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:16:00 2016	(r309982)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Tue Dec 13 02:22:21 2016	(r309983)
@@ -239,14 +239,16 @@ while :; do
 	fi
 
 	f_dialog_title "Network Selection"
-	NETWORK=$( sh -c "$DIALOG \
-		--title \"$DIALOG_TITLE\" \
-		--backtitle \"$DIALOG_BACKTITLE\" \
+	prompt="Select a wireless network to connect to."
+	menu_list=$( echo $NETWORKS | tr '\n' ' ' )
+	NETWORK=$( eval $DIALOG \
+		--title \"\$DIALOG_TITLE\" \
+		--backtitle \"\$DIALOG_BACKTITLE\" \
 		--extra-button \
 		--extra-label \"Rescan\" \
-		--menu \"Select a wireless network to connect to.\" \
-		0 0 0 \
-		$( echo $NETWORKS | tr '\n' ' ' )" \
+		--menu \"\$prompt\" \
+		$height $width $rows \
+		$menu_list \
 		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 	)
 	retval=$?
@@ -258,15 +260,21 @@ while :; do
 		f_dialog_title "Network Selection"
 		f_yesno "Do you want to select the network manually?" || exit 1
 		f_dialog_input NETWORK "Enter SSID" || exit 1
-		ENCRYPTION=$( $DIALOG \
-			--title "$DIALOG_TITLE" \
-			--backtitle "$DIALOG_BACKTITLE" \
-			--menu "Select encryption type" \
-			0 0 0 \
-			"1 WPA/WPA2 PSK" "" \
-			"2 WPA/WPA2 EAP" "" \
-			"3 WEP" "" \
-			"0 None" "" \
+		prompt="Select encryption type"
+		menu_list="
+			'1 WPA/WPA2 PSK' ''
+			'2 WPA/WPA2 EAP' ''
+			'3 WEP' ''
+			'0 None' ''
+		" # END-QUOTE
+		eval f_dialog_menu_size height width rows \"\$DIALOG_TITLE\" \
+			\"\$DIALOG_BACKTITLE\" \"\$prompt\" \"\" $menu_list
+		ENCRYPTION=$( eval $DIALOG \
+			--title \"\$DIALOG_TITLE\" \
+			--backtitle \"\$DIALOG_BACKTITLE\" \
+			--menu \"\$prompt\" \
+			$height $width $rows \
+			$menu_list \
 			2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
 		) || exit 1
 		SCANSSID=1



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612130222.uBD2ML4O061927>