slitaz-tools diff tazbox/tazbox @ rev 807

Rewrite "desktopbox tazapps" using Yad (now "tazbox tazapps"), update pot and po; validate and normalize desktop files.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Jul 16 18:31:59 2013 +0300 (2013-07-16)
parents 066dd36cc2cc
children 8e208c31ad8e
line diff
     1.1 --- a/tazbox/tazbox	Tue Jan 08 11:09:03 2013 -0500
     1.2 +++ b/tazbox/tazbox	Tue Jul 16 18:31:59 2013 +0300
     1.3 @@ -47,6 +47,7 @@
     1.4    new-file   $(gettext "Create a new file or folder on the desktop")
     1.5    all-apps   $(gettext "Display icons of all installed applications")
     1.6    notify     $(gettext "Notify user with a desktop centered box")
     1.7 +  tazapps    $(gettext "Configure SliTaz default applications")
     1.8  
     1.9  EOT
    1.10  }
    1.11 @@ -120,9 +121,9 @@
    1.12      timezone=$(find $zi -type f | sed s,$zi,,g | tr "\n" "!")
    1.13      yad --width=500 --height=380 \
    1.14  		--image=$icon --title="$title" --form --text="$message" \
    1.15 -		--field "Locale:CB" \
    1.16 -		--field "Keymap:CB" \
    1.17 -		--field "Timezone:CB" \
    1.18 +		--field "$(gettext 'Locale'):CB" \
    1.19 +		--field "$(gettext 'Keymap'):CB" \
    1.20 +		--field "$(gettext 'Timezone'):CB" \
    1.21  		$locale \ $keymap \ $timezone
    1.22  }
    1.23  
    1.24 @@ -347,6 +348,40 @@
    1.25  			--center --on-top --image=$icon --image-on-top \
    1.26  			--timeout=$time --skip-taskbar --no-buttons \
    1.27  			--borders=12 --undecorated ;;
    1.28 +	tazapps)
    1.29 +		# Default applications configuration script. System wide config file
    1.30 +		# is /etc/slitaz/applications.conf and each user can have personal
    1.31 +		# settings. System wide for root and personal config for user.
    1.32 +		export CONFIG="$HOME/.config/slitaz/applications.conf"
    1.33 +		if [ ! -f $CONFIG ]; then
    1.34 +			mkdir -p $HOME/.config/slitaz
    1.35 +			cp /etc/slitaz/applications.conf $CONFIG
    1.36 +		fi
    1.37 +		. $CONFIG
    1.38 +		eval $(yad --title="$(gettext 'SliTaz default applications')" \
    1.39 +			--window-icon=preferences-desktop --image=preferences-desktop \
    1.40 +			--text="<b>$(gettext 'SliTaz default applications configuration')</b>" \
    1.41 +			--form \
    1.42 +			--field="$(gettext 'File manager:')" \
    1.43 +			--field="$(gettext 'Web browser:')" \
    1.44 +			--field="$(gettext 'Text editor:')" \
    1.45 +			--field="$(gettext 'Terminal:')" \
    1.46 +			--field="$(gettext 'Window manager:')" \
    1.47 +			"$FILE_MANAGER" "$BROWSER" "$EDITOR" "$TERMINAL" "$WINDOW_MANAGER" | \
    1.48 +			awk -F'|' '{printf "FILE_MANAGER=\"%s\"\nBROWSER=\"%s\"\nEDITOR=\"%s\"\
    1.49 +TERMINAL=\"%s\"\nWINDOW_MANAGER=\"%s\"\n", $1, $2, $3, $4, $5}')
    1.50 +		sed '/FILE_MANAGER=/s|"\([^"]*\)"|"'$FILE_MANAGER'"|; \
    1.51 +			/BROWSER=/s|"\([^"]*\)"|"'$BROWSER'"|; \
    1.52 +			/EDITOR=/s|"\([^"]*\)"|"'$EDITOR'"|; \
    1.53 +			/TERMINAL=/s|"\([^"]*\)"|"'$TERMINAL'"|; \
    1.54 +			/WINDOW_MANAGER=/s|"\([^"]*\)"|"'$WINDOW_MANAGER'"|' \
    1.55 +			-i $CONFIG
    1.56 +		;;
    1.57 +	gpl)
    1.58 +		yad --text-info --title="GNU General Public License" \
    1.59 +		--window-icon=text-x-generic --geometry="560x500+0-24" \
    1.60 +		--button "OK" < /usr/share/licenses/gpl.txt
    1.61 +		;;
    1.62  	*)
    1.63  		usage ;;
    1.64  esac