### 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 editingheaders {} {
    # Editing / Headers
    Desc "Headers for the outbound (new) mail"
    ShortDesc "Headers for (new) messages"

####### precedences ###########
    Header head1 \
	-text "Precedence and Priority header to the mail transporter" \
	-help "Some mail transports look at a Precedence header in outbound mail messages to determine how to deliver the message. Use this to select the list." \
	-background gray

    CheckBox headerCheckBox1 \
	-text "Have a Precedence/priority header to determine how to deliver your message" \
	-help "Select this if you want to have a mixed Precedence/Priority header; Precedence tells the mail system how to handle the message and Priority tells the receiver the importance of the message. This is only used if you haven't assigned a priority to your message (and offcause you can change it in the Header menu before you send the message). Deselect this and you will allow any precedences. Default is to leave it unselected."

    Entry editorOptionsEntry11 \
	-text "Precedences:" \
	-packFrame:expand 1 -packFrame:fill x -packEntry:fill x -packEntry:expand 1 \
	-help "An example could be:\n" \
	      "\"special-delivery:urgent air-mail:urgent first-class bulk junk\""

####### elmheaders ###########
    Header head54 \
	-text "Include headers in your outbound messages" \
	-background gray

    CheckBox editorOptionsCheckBox29 \
	-text "Include headers when messages are copied into the outbound buffer" \
	-help "Default is NOT to include headers so let this unselected." \
	-default 0

####### elmheader file #########
    Header head3 \
	-text "The \"elmheaders\" file appended to the header of outbound mail"

    TextBox headersTextBox1 \
	-text "This is how your \"elmheaders\" file look(ed) like:" \
	-height 5

    foreach widget { head3 headersTextBox1 } {
	Help $widget "This is your \"~/.elm/elmheaders\" file when you started the current dotfile application. (In case of no such file this textbox isn't active). This file is for placing lines for a predefined header and therefore should be used with care. You could use this file for entering MIME related like \"Content-...\" and you could evaluate commands within the header lines (beware ;-)). Examples:\n          \"Reply-To: SYSOP\"\n          \"X-URL: http://www.imada.sdu.dk/\""
    }
    
  ################################ Change #################################
    Change {
    }

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

    Init {
        ### Read default values from shell ###
##      if {[info exists [exec cat [glob ~]/.elm/elmheaders]}
	if {[file exists [glob ~]/.elm/elmheaders]} {
		set headersTextBox1 [exec cat [glob ~]/.elm/elmheaders]
		set elmheaders 1
        } {
		set elmheaders 0
	}
    }

    Save {
	print "\n# list of delivery precedences allowed, or empty to allow anything\n# precedence may be followed by optional \":priority\" specification"
	if {$headerCheckBox1==0 || $editorOptionsEntry11==""} {
		print "### precedences = "
	} else {
		print "precedences = $editorOptionsEntry11"
	}

	print "\n# when messages are copied into the outbound buffer, don't include headers?"
	if {$editorOptionsCheckBox29==0} {
		print "noheader = ON"
	} else {
		print "noheader = OFF"
	}
    }
}



