From owner-svn-src-head@FreeBSD.ORG Fri Dec 21 20:29:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6CDDC45; Fri, 21 Dec 2012 20:29:29 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 713F88FC16; Fri, 21 Dec 2012 20:29:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBLKTT41032652; Fri, 21 Dec 2012 20:29:29 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBLKTT8P032650; Fri, 21 Dec 2012 20:29:29 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201212212029.qBLKTT8P032650@svn.freebsd.org> From: Devin Teske Date: Fri, 21 Dec 2012 20:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244555 - in head/usr.sbin/bsdconfig: networking/share share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2012 20:29:29 -0000 Author: dteske Date: Fri Dec 21 20:29:28 2012 New Revision: 244555 URL: http://svnweb.freebsd.org/changeset/base/244555 Log: New f_show_info() function for dialog(1) --infobox using printf(1) syntax. Modified: head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Dec 21 20:11:41 2012 (r244554) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Dec 21 20:29:28 2012 (r244555) @@ -436,8 +436,7 @@ f_dialog_menu_netdev_edit() "$options" != "$options_orig" -o \ "$dhcp" != "$dhcp_orig" ] then - f_dialog_info "$( printf "$msg_saving_network_interface" \ - "$interface" )" + f_show_info "$msg_saving_network_interface" "$interface" local value= if [ "$dhcp" ]; then @@ -458,8 +457,7 @@ f_dialog_menu_netdev_edit() f_dialog_yesno "Would you like to bring the $interface" \ "interface up right now?" if [ $? -eq $SUCCESS ]; then - f_dialog_info "$( printf "$msg_bring_interface_up" \ - "$interface" )" + f_show_info "$msg_bring_interface_up" "$interface" local dr="$( f_sysrc_get defaultrouter )" err if [ "$dr" = "NO" -o ! "$dr" ]; then Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Dec 21 20:11:41 2012 (r244554) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Dec 21 20:29:28 2012 (r244555) @@ -136,6 +136,27 @@ f_interrupt() f_die } +# f_show_info $fmt [ $opts ... ] +# +# Display a message in a dialog infobox using printf(1) syntax. +# +f_show_info() +{ + local msg + msg=$( printf "$@" ) + + # + # Use f_dialog_infobox from dialog.subr if possible, otherwise fall + # back to dialog(1) (without options, making it obvious when using + # un-aided system dialog). + # + if f_have f_dialog_info; then + f_dialog_info "$msg" + else + dialog --infobox "$msg" 0 0 + fi +} + # f_show_msg $fmt [ $opts ... ] # # Display a message in a dialog box using printf(1) syntax.