# HG changeset patch # User Christophe Lincoln # Date 1264244755 -3600 # Node ID 1cc96a18d59428256df50c176d5a4701efa96e5c # Parent a15b3d5a3ab66b5bb0abc88d0da81bacebd1b456 tazlitobox: GTK box for flavors list, xterm use default colors and clean-up UI diff -r a15b3d5a3ab6 -r 1cc96a18d594 tazlitobox --- a/tazlitobox Fri Jan 22 23:28:53 2010 +0100 +++ b/tazlitobox Sat Jan 23 12:05:55 2010 +0100 @@ -2,7 +2,9 @@ # # Gtkdialog box for Tazlito - SliTaz Live Tool. # -VERSION=2.0 +VERSION=2.2 + +export BIN=$0 # Check if user is root. check_root() @@ -22,18 +24,46 @@ cd /home/slitaz } +# We need to parse flavors.list for GTK tree. +list_flavors() +{ + tazlito list-flavors | grep ^[a-z] | while read line + do + info=`echo -n $line | awk '{print $1 " " $2 " " $3}'` + printinfo=`echo -n $line | awk '{print $1 "|" $2 "|" $3}'` + echo "$printinfo|`echo $line | sed s/\"$info\"//`" + done +} + +recharge_list() +{ + xterm -geometry 90x14 \ + -title "list-flavors --recharge" \ + -e "tazlito list-flavors --recharge | grep ^[a-z] && sleep 2" +} + +# When using gen-liveflavor, gen-flavor or gen-distro, user can put some +# addfiles copied into the rootfs. +addfiles_action() +{ + cd /home/slitaz + mkdir -p distro/addfiles/rootfs + mkdir -p distro/addfiles/rootcd + file-manager distro/addfiles & +} + export HELP=' - - - + + + + + + + + ' -# Execute tazlito commands in a XTerm. -# tab-pos="GTK_POS_LEFT" -export MAIN_DIALOG=' +# List all flavors on the mirror. +export LIST_FLAVORS_BOX=' + + + + 500200 + COMMUNITY_FLAVOR + + $BIN list_flavors + + + + + + +' + +# Execute tazlito commands in a XTerm. Notebook: tab-pos="GTK_POS_LEFT" +export TAZLITO_BOX=' @@ -111,19 +166,10 @@ - - - - - slitaz - WRITEISO_NAME - - - @@ -134,7 +180,8 @@ " Gen Live flavor will create a LiveCD based on all the currently installed packages. To build the rootfs and ISO image it will use -original SliTaz packages. +original SliTaz packages. Some addfiles can be copied before gen +distro. " @@ -151,17 +198,22 @@ + @@ -185,18 +237,10 @@ core COMMUNITY_FLAVOR - - - - @@ -204,17 +248,17 @@ @@ -225,7 +269,7 @@ @@ -241,9 +285,14 @@ + @@ -267,7 +316,7 @@ @@ -281,7 +330,7 @@ @@ -305,9 +354,15 @@ ' -# Tazlitobox action -check_root -cd_flavors -gtkdialog --center --program=MAIN_DIALOG +case $1 in + *_*) + # Exec all function called by args (must have an underscore). + $1 ;; + *) + # Tazlitobox action + check_root + cd_flavors + gtkdialog --center --program=TAZLITO_BOX ;; +esac exit 0