/[gnats]/gnats/contrib/tkgnats/tkpr_library.tcl
ViewVC logotype

Diff of /gnats/contrib/tkgnats/tkpr_library.tcl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by mcr, Tue Apr 1 02:48:28 2003 UTC revision 1.11 by mcr, Wed Apr 2 04:52:47 2003 UTC
# Line 1253  proc textset {l t {p ""} {e text}} { Line 1253  proc textset {l t {p ""} {e text}} {
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}} {
# Line 1375  proc singletext {parent l w {t ""} {labw Line 1375  proc singletext {parent l w {t ""} {labw
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
# Line 1714  proc parsepr_txt {txt varname} { Line 1715  proc parsepr_txt {txt varname} {
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    
# Line 1963  proc flush_multitext {} { Line 1919  proc flush_multitext {} {
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      }      }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26