### Copyright (C) 1996 Rasmus Ingemann Hansen
### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.
###
### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

proc foldercommunication {} {
    # Folders / Filecommunication
    Desc "Choose location of folders/files"
    ShortDesc "Filecommunication - Folders"

### STORAGE IN OUT ###
    Header head1 \
	-text "Storage for in- and outgoing messages" \
	-background gray\
	-help "A \"folder\" is a file which contains mails."

    File-Dir-Browser editorOptionsDir1 \
	-text "Where to save messages to, default file is 'received'" \
	-default "~/Mail/received"
    foreach widget { editorOptionsDir1 } {
	Help $widget "Here you can specify the file in which Elm store all messages sent to you, if you haven't saved it already into the senders folder."
    }

    File-Dir-Browser editorOptionsDir2 \
	-text "Where to save copies of outgoing mail to, default is 'sent'" \
	-default "~/Mail/sent"
    foreach widget { editorOptionsDir2 } {
	Help $widget "Here you can specify the file in which Elm store all messages you have sent."
    }

### MAIN DIR ###
    Header head2 \
	-text "Main directories" \
	-background gray\
	-help ""

    Dir-Browser editorOptionsDir3 \
	-text "Where to save mail to, default directory is \"Mail\"" \
	-default "~/Mail" \
	-exist 1
    foreach widget { editorOptionsDir3 } {
	Help $widget "Here you can specify the directory in which Elm will look for and store folders to. Normally you wouldn't choose another directory for your folders but you might group some sub directories below your ~/Mail"
    }

    Dir-Browser editorOptionsDir4 \
	-text "Where to place temporary files, default directory is \"/tmp\"" \
	-default "/tmp/" 
    foreach widget { editorOptionsDir4 } {
	Help $widget "Here you can specify the directory in which Elm will place threads, unfinished edited messages and so on. Normally you wouldn't choose another place for these, either."
    }

### CONFIRM STORAGE ###
    Header head3 \
	-text "Confirm storage" \
	-background gray\
	-help "This is used for both folders in the user's mail directory and ordinary files."

    Label label11 \
	-text "Elm should always ask you to confirm, before it" \
	-help ""

    CheckBox folderCheckBox4 \
	-text "appends messages to any existing file" \
	-help "Default is not to be asked if you want to append message to either its folder or another filename. Before Elm will append it to the (new) folder it will ask you the name of the folder and here you could cancel the operation it you choose so." \
	-default 0

    CheckBox folderCheckBox5 \
	-text "appends messages to any existing file not a folder in Mail directory" \
	-help "Default is not to be asked if you want to append the chosen message to its folder. Before Elm will append it to the folder it will ask you the name of the folder and here you could cancel the operation it you choose so." \
	-default 0

    CheckBox folderCheckBox6 \
	-text "creates any new files" \
	-help "Default is not to be asked if you want to create any new file. Elm will ask you name of new file and here you could cancel the operation it you choose so." \
	-default 0

    CheckBox folderCheckBox7 \
	-text "creates a new folder in Mail" \
	-help "Default is not to be asked if you want to create a new folder in Mail. If you on the other hand have a few folders you store grouped messages in (from different senders or a mailing list) this might give you a check that you really have entered name of folder correct so not to create a new folder with a wrong name (ie. \"linux-appp\")." \
	-default 0

  ################################ Change #################################
    Change {

    }

  ############################## Init / Save ##############################

    Init {
    }

    Save {
	print "\n# Where to save messages to, default file is 'received'"
	print "receivedmail = $editorOptionsDir1"

	print "\n# Where to save copies of outgoing mail to, default is 'sent'"
	print "sentmail = $editorOptionsDir2"

	print "\n# Where to save mail to, default directory is \"Mail\""
	print "maildir = $editorOptionsDir3"

	print "\n# Where to place temporary files, default directory is \"/tmp\""
	print "tmpdir = $editorOptionsDir4"

	print "\n# Always ask user to confirm before it appends messages to any existing file"
	if ($folderCheckBox4==0) {
		print "### confirmappend = OFF"
	} else {
		print "confirmappend = ON"
	}

	print "\n# Always ask user to confirm before it appends messages to any existing file not a folder in Mail"
	if ($folderCheckBox5==0) {
		print "### confirmfiles = OFF"
	} else {
		print "confirmfiles = ON"
	}

	print "\n# Always ask user to confirm before it creates any new files"
	if ($folderCheckBox6==0) {
		print "### confirmcreate = OFF"
	} else {
		print "confirmcreate = ON"
	}

	print "\n# Always ask user to confirm before it creates a new folder in Mail"
	if ($folderCheckBox7==0) {
		print "### confirmfolders = OFF"
	} else {
		print "confirmfolders = ON"
	}

	


    }
}



