--- burncdda-1.8.2.old/setup.func +++ burncdda-1.8.2/setup.func @@ -26,7 +26,7 @@ while [ $MENULEVEL -ge 3 ]; do $DIALOG --backtitle "$BACKTITLE" --title "Setup - Expert - Pathes" \ --menu "THIS DOES NOT WORK YET" 20 60 13 \ - "S Save settings to" "/etc/burncdda.conf" \ + "S Save settings to" "$HOME/.burncdda" \ "------------------" "------------------" \ "1 cdrecord" "$CDRECORD" \ "2 cdrdao" "$CDRDAO" \ @@ -112,21 +112,22 @@ done } -# save settings to /etc/burncdda.conf +# Save settings to $HOME/.burncdda function savesettings() { clear -echo "Saving /etc/burncdda.conf" -echo "Please enter your root password..." -$SU -c "$SED -i \ +DOTFILE=$HOME/.burncdda +echo Saving $DOTFILE +$SED -i \ -e "s°^COLORS=.*°COLORS=\"$COLORS\"°" \ -e "s°^WRITESPEED=.*°WRITESPEED=\"$WRITESPEED\"°" \ -e "s°^DEVICE=.*°DEVICE=\"$DEVICE\"°" \ -e "s°^NORMAMP=.*°NORMAMP=\"$NORMAMP\"°" \ -e "s°^CDRECORD=.*°CDRECORD=\"$CDRECORD\"°" \ - /etc/burncdda.conf" + -e "s°^IMGDIR=.*°IMGDIR=\"$IMGDIR\"°" \ + $DOTFILE if [ $? != "0" ]; then - echo -e "\n${RED}Error:${NOCOLOR} Failed to save '/etc/burncdda.conf'!\n" + echo -e "\n${RED}Error:${NOCOLOR} Failed to save $DOTFILE\n" else CONFCHANGED="0" readconfig @@ -146,15 +147,15 @@ CONFCHANGED="0" while [ $MENULEVEL -ge 1 ]; do $DIALOG --backtitle "$BACKTITLE" --title "Setup" --menu "What do you want to edit?" 16 60 9 \ - "S Save settings to" "/etc/burncdda.conf" \ + "S Save settings to" "$HOME/.burncdda" \ "----------------------" "----------------------" \ "1 Console colors" "$COLORS" \ "2 CD writing speed" "$WRITESPEED" \ "3 CD writer device" "$DEVICE" \ "4 Normalize amplitude" "$NORMAMP" \ "5 cdrecord executable" "$CDRECORD" \ - "----------------------" "----------------------" \ - "V View" "/etc/burncdda.conf" 2> $TEMPFILE + "6 Scratch directory" "$IMGDIR" \ + 2> $TEMPFILE # if cancel exit menu if [ $? = "1" ]; then @@ -197,6 +198,9 @@ fi # get new value and test if it has changed TEMPVAR=`$CAT $TEMPFILE` + if [ "x$TEMPVAR" == "x" ]; then + TEMPVAR="$COLORS" + fi if [ "$TEMPVAR" != "$COLORS" ]; then COLORS="$TEMPVAR" CONFCHANGED="1" @@ -228,6 +232,9 @@ TEMPVAR="-1" fi # test if it has changed + if [ "x$TEMPVAR" == "x" ]; then + TEMPVAR="$WRITESPEED" + fi if [ "$TEMPVAR" != "$WRITESPEED" ]; then WRITESPEED="$TEMPVAR" CONFCHANGED="1" @@ -242,6 +249,9 @@ fi # get new value and test if it has changed TEMPVAR=`$CAT $TEMPFILE | $SED -e 's°^ *°°' -e 's° *$°°'` + if [ "x$TEMPVAR" == "x" ]; then + TEMPVAR="$DEVICE" + fi if [ "$TEMPVAR" != "$DEVICE" ]; then DEVICE="$TEMPVAR" CONFCHANGED="1" @@ -264,6 +274,9 @@ fi # get new value and test if it has changed TEMPVAR=`$CAT $TEMPFILE` + if [ "x$TEMPVAR" == "x" ]; then + TEMPVAR="$NORMAMP" + fi if [ "$TEMPVAR" != "$NORMAMP" ]; then NORMAMP="$TEMPVAR" CONFCHANGED="1" @@ -278,15 +291,30 @@ fi # get new value and test if it has changed TEMPVAR=`$CAT $TEMPFILE | $SED -e 's°^ *°°' -e 's° *$°°'` + if [ "x$TEMPVAR" == "x" ]; then + TEMPVAR="$CDRECORD" + fi if [ "$TEMPVAR" != "$CDRECORD" ]; then CDRECORD="$TEMPVAR" CONFCHANGED="1" fi ;; - "V View") - $DIALOG --backtitle "$BACKTITLE" --title "Setup -> View /etc/burncdda.conf" \ - --textbox /etc/burncdda.conf 20 75 + "6 Scratch directory") + $DIALOG --backtitle "$BACKTITLE" --title "Setup -> Scratch directory" \ + --inputbox "Specify a directory with at least one GB of free disk space" 11 60 $IMGDIR 2> $TEMPFILE + if [ $? = "1" ]; then + continue + fi + # get new value and test if it has changed + TEMPVAR=`$CAT $TEMPFILE | $SED -e 's°^ *°°' -e 's° *$°°'` + if [ "x$TEMPVAR" == "x" ]; then + TEMPVAR="$IMGDIR" + fi + if [ "$TEMPVAR" != "$IMGDIR" ]; then + IMGDIR="$TEMPVAR" + CONFCHANGED="1" + fi ;; *)