Package: ssft
Version: 0.9.11
Severity: wishlist
Tags: patch
All dialog frontents supported by SSFT support showing a directory selection
prompt, but SSFT itself does not. This is a low-hanging fruit, and the new
function is logically mostly a copy of ssft_file_selection, changing the
frontend arguments where appropriate.
-- System Information:
Debian Release: 5.0
APT prefers jaunty-updates
APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 'jaunty')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.28-13-generic (SMP w/4 CPU cores)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
ssft depends on no packages.
Versions of packages ssft recommends:
ii dialog 1.1-20080819-1 Displays user-friendly dialog boxe
ii gettext-base 0.17-6ubuntu2 GNU Internationalization utilities
ii kdebase-bin 4:4.2.2-0ubuntu4 core binaries for the KDE 4 base m
ii zenity 2.26.0-0ubuntu2 Display graphical dialog boxes fro
ssft suggests no packages.
-- no debconf information
# Function: ssft_directory_selection TITLE
#
# Description: Read a path from the user and store the value on the
# variable SSFT_RESULT. The function returns 0 if some value was set by the
# user and != 0 if it wasn't.
ssft_directory_selection() {
# MENU strings
ssft_set_textdomain
_l_FNAME_STR="`gettext "Directory"`"
ssft_reset_textdomain
# Local variables
_l_title="";
_l_fpath="";
# Check arguments
if [ "$#" -lt 1 ]; then
return 255
fi
# Set _l_variables
_l_title="$1";
# Read values
case "$SSFT_FRONTEND" in
zenity)
_l_fpath=$( zenity --title "$_l_title" --file-selection --directory );
;;
kdialog)
_l_fpath=$( kdialog --title "$_l_title" --getexistingdirectory "`pwd`" 2>
/dev/null);
;;
dialog)
_l_fpath=$( dialog --stdout --title "$_l_title" --dselect "`pwd`" 0 0 );
;;
text)
ssft_print_text_title "$_l_title"
printf "%s: " "$_l_FNAME_STR"
read _l_fpath
echo ""
;;
*)
_l_fpath=""
;;
esac
SSFT_RESULT="$_l_fpath"
test -n "$_l_fpath"
return $?
}