1253 |
${p}._${l}.$e config -state $state |
${p}._${l}.$e config -state $state |
1254 |
return |
return |
1255 |
} |
} |
1256 |
error "no such window for $l" |
#error "no such window for $l" |
1257 |
} |
} |
1258 |
|
|
1259 |
proc textget {l {p ""} {e text}} { |
proc textget {l {p ""} {e text}} { |
1375 |
-relief sunken -borderwidth 2 -background $TkGnats(EditFieldBackground)] |
-relief sunken -borderwidth 2 -background $TkGnats(EditFieldBackground)] |
1376 |
set_focus_style $ew |
set_focus_style $ew |
1377 |
$ew insert end $t |
$ew insert end $t |
1378 |
|
|
1379 |
bind $ew <3> "clipboard_post $ew %X %Y" |
bind $ew <3> "clipboard_post $ew %X %Y" |
1380 |
if {[check_suppressed_field [string trimleft $l >]] == 2} { |
if {[check_suppressed_field [string trimleft $l >]] == 2} { |
1381 |
$ew configure -state disabled -background $TkGnats(ReadOnlyBackground) -highlightcolor grey85 |
$ew configure -state disabled -background $TkGnats(ReadOnlyBackground) -highlightcolor grey85 |
1715 |
} |
} |
1716 |
} |
} |
1717 |
|
|
|
# |
|
|
# Do a little post processing on the fields before we leave |
|
|
# |
|
|
if {![info exists fields(X-GNATS-Notify)]} { |
|
|
lappend fldtags X-GNATS-Notify |
|
|
if {[info exists fields(Reply-To)]} { |
|
|
# Copy Reply-To to X-GNATS-Notify |
|
|
set fields(X-GNATS-Notify) [fix_email_addresses [string trim $fields(Reply-To)]] |
|
|
# Remove Reply-To from _prefix_, fldtags and field. |
|
|
set lines [split $fields(_prefix_) \n] |
|
|
set idx [lsearch -regexp $lines "^Reply-To:"] |
|
|
set lines [lreplace $lines $idx [expr $idx + $fields(_prefix_len_Reply-To) - 1]] |
|
|
set fields(_prefix_) [join $lines \n] |
|
|
set idx [lsearch $fldtags "Reply-To"] |
|
|
set fldtags [lreplace $fldtags $idx $idx] |
|
|
unset fields(Reply-To) |
|
|
unset fields(_prefix_len_Reply-To) |
|
|
} { |
|
|
set fields(X-GNATS-Notify) "\n" |
|
|
} |
|
|
set fields(_prefix_len_X-GNATS-Notify) 1 |
|
|
set fields(_prefix_) "[string trim $fields(_prefix_)]\nX-GNATS-Notify: $fields(X-GNATS-Notify)\n" |
|
|
} { |
|
|
set fields(X-GNATS-Notify) [fix_email_addresses [string trim $fields(X-GNATS-Notify)]] |
|
|
} |
|
|
if {![info exists fields(Reply-To)]} { |
|
|
lappend fldtags Reply-To |
|
|
if {[info exists fields(Sender)]} { |
|
|
set fields(Reply-To) $fields(Sender) |
|
|
} { |
|
|
if {[info exists fields(From)]} { |
|
|
set fields(Reply-To) $fields(From) |
|
|
} { |
|
|
set fields(Reply-To) "_unknown_" |
|
|
} |
|
|
} |
|
|
set fields(Reply-To) [fix_email_addresses [string trim $fields(Reply-To)]] |
|
|
set fields(_prefix_len_Reply-To) 1 |
|
|
set lines [split $fields(_prefix_) \n] |
|
|
set idx [lsearch -regexp $lines "^To:"] |
|
|
set lines [linsert $lines $idx "Reply-To: $fields(Reply-To)"] |
|
|
set fields(_prefix_) [join $lines \n] |
|
|
} { |
|
|
set fields(Reply-To) [fix_email_addresses [string trim $fields(Reply-To)]] |
|
|
} |
|
1718 |
return $fldtags |
return $fldtags |
1719 |
} |
} |
1720 |
|
|
1919 |
} |
} |
1920 |
} |
} |
1921 |
|
|
1922 |
proc flush_singletext {lst} { |
proc flush_singletext {lst {p ""}} { |
1923 |
global frm |
global frm |
1924 |
#set frm($tag) [string trim [textget $tag] "\t\n "] |
#set frm($tag) [string trim [textget $tag] "\t\n "] |
1925 |
foreach tag $lst { |
foreach tag $lst { |
1926 |
if {[catch {string trim [textget $tag] "\t\n "} frm($tag)]} { |
if {[catch {string trim [textget $tag $p] "\t\n "} frm($tag)]} { |
1927 |
set frm($tag) "" |
set frm($tag) "" |
1928 |
} |
} |
1929 |
} |
} |