slitaz-tools rev 268

desktopbox logout: add tazusb support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Oct 12 11:46:22 2008 +0000 (2008-10-12)
parents d6cd1cfc7fe1
children 77c872f708ab
files tinyutils/desktopbox
line diff
     1.1 --- a/tinyutils/desktopbox	Wed Sep 03 08:55:00 2008 +0000
     1.2 +++ b/tinyutils/desktopbox	Sun Oct 12 11:46:22 2008 +0000
     1.3 @@ -22,6 +22,7 @@
     1.4  		NEW_FILE_LABEL="Create a new file on the desktop:"
     1.5  		FILE_ENTRY_MSG="filename"
     1.6  		ADD_ICON_LABEL="Add some desktop icons"
     1.7 +		DESKTOP_DIALOG_TAZUSB="Save filesystem using compression"
     1.8  		DESKTOP_DIALOG_LABEL="Session logout, system shutdown or reboot"  ;;
     1.9  	fr*)
    1.10  		lang="fr"
    1.11 @@ -30,6 +31,7 @@
    1.12  		NEW_FILE_LABEL="Créer un nouveau fichier sur le bureau:"
    1.13  		FILE_ENTRY_MSG="fichier"
    1.14  		ADD_ICON_LABEL="Ajouter des icons de bureau"
    1.15 +		DESKTOP_DIALOG_TAZUSB="Enregistrer le système avec la compression"
    1.16  		DESKTOP_DIALOG_LABEL="Déconnexion, arrêt ou redémarrage du système" ;;
    1.17  	*)
    1.18  		lang=""
    1.19 @@ -38,6 +40,7 @@
    1.20  		NEW_FILE_LABEL="Create a new file on the desktop:"
    1.21  		FILE_ENTRY_MSG="filename"
    1.22  		ADD_ICON_LABEL="Add some desktop icons"
    1.23 +		DESKTOP_DIALOG_TAZUSB="Save filesystem using compression"
    1.24  		DESKTOP_DIALOG_LABEL="Session logout, system shutdown or reboot" ;;
    1.25  esac
    1.26  
    1.27 @@ -201,35 +204,57 @@
    1.28  			</label>
    1.29  		</text>
    1.30  	</hbox>"
    1.31 +		TAZUSB_DIALOG="
    1.32 +	<hbox>
    1.33 +		<checkbox>
    1.34 +			<label>$DESKTOP_DIALOG_TAZUSB</label>
    1.35 +			<variable>TAZUSB_WRITE</variable>
    1.36 +			<default>false</default>
    1.37 +		</checkbox>
    1.38 +		<radiobutton>
    1.39 +			<label>lzma</label>
    1.40 +			<variable>LZMA</variable>
    1.41 +		</radiobutton>
    1.42 +		<radiobutton active=\"true\">
    1.43 +			<label>gzip</label>
    1.44 +			<variable>GZIP</variable>
    1.45 +		</radiobutton>
    1.46 +		<radiobutton>
    1.47 +			<label>none</label>
    1.48 +			<variable>NONE</variable>
    1.49 +		</radiobutton>
    1.50 +	</hbox>"
    1.51 +		EXTRA="COMP=none; [ '\$LZMA' = 'true' ] && COMP=lzma; [ '\$GZIP' = 'true' ] && COMP=gzip; [ '\$TAZUSB_WRITE' = 'true' ] && subox 'xterm -e \"tazusb writefs \$COMP\"';"
    1.52 +		#[ -f /home/boot/rootfs.gz ] || { TAZUSB_DIALOG=""; EXTRA=""; }
    1.53  		# Logout for Openbox or JWM and system shutdown or reboot.
    1.54 -		ACTIONS='
    1.55 +		ACTIONS="
    1.56  	<hbox>
    1.57  		<button>
    1.58  			<label>Logout X session</label>
    1.59 -			<input file icon="video-display"></input>
    1.60 -			<action>openbox --exit || jwm -exit</action>
    1.61 -			<action type="exit">Exit</action>
    1.62 +			<input file icon=\"video-display\"></input>
    1.63 +			<action>$EXTRA; openbox --exit || jwm -exit</action>
    1.64 +			<action type=\"exit\">Exit</action>
    1.65  		</button>
    1.66  		<button>
    1.67  			<label>Shutdown computer</label>
    1.68 -			<input file icon="system-shutdown"></input>
    1.69 -			<action>poweroff</action>
    1.70 -			<action type="exit">Exit</action>
    1.71 +			<input file icon=\"system-shutdown\"></input>
    1.72 +			<action>$EXTRA; poweroff</action>
    1.73 +			<action type=\"exit\">Exit</action>
    1.74  		</button>
    1.75  		<button>
    1.76  			<label>Reboot system</label>
    1.77 -			<input file icon="reload"></input>
    1.78 -			<action>reboot</action>
    1.79 -			<action type="exit">Exit</action>
    1.80 +			<input file icon=\"reload\"></input>
    1.81 +			<action>$EXTRA; reboot</action>
    1.82 +			<action type=\"exit\">Exit</action>
    1.83  		</button>
    1.84  		<button cancel>
    1.85 -			<action type="exit">Exit</action>
    1.86 +			<action type=\"exit\">Exit</action>
    1.87  		</button>
    1.88  	</hbox>
    1.89  
    1.90  </vbox>
    1.91 -</window>'
    1.92 -		export DESKTOP_DIALOG=${DESKTOP_DIALOG}${ACTIONS} ;;
    1.93 +</window>"
    1.94 +		export DESKTOP_DIALOG=${DESKTOP_DIALOG}${TAZUSB_DIALOG}${ACTIONS} ;;
    1.95  	*)
    1.96  		# Usage if executed from cmdline.
    1.97  		#