*** D:\Documents and Settings\tameyer.MASSEY\Local Settings\Temp\TCV1ae9.tmp\UserInterface.1.46.4.2.py	Sun Jan 02 17:02:46 2005
--- C:\spambayes_release_1_0-branch\spambayes\UserInterface.py	Mon May 23 11:59:21 2005
***************
*** 678,685 ****
                  continue
              html_key = sect + '_' + opt
  
              # Populate the rows with the details and add them to the table.
!             if type(options.valid_input(sect, opt)) in types.StringTypes:
                  # we provide a text input
                  newConfigRow1 = configTextRow1.clone()
                  newConfigRow1.label = options.display_name(sect, opt)
--- 678,699 ----
                  continue
              html_key = sect + '_' + opt
  
+             # Annoyingly, we have a special case.  The notate_to and
+             # notate_subject allowed values have to be set to the same
+             # values as the header_x_ options. See also sf #944109.
+             # This code was originally in Options.py, after loading in the
+             # options.  But that doesn't work, because if we are setting
+             # both in a config file, we need it done immediately.
+             # We now need the hack here, *and* in OptionsClass.py
+             if sect == "Headers" and opt in ("notate_to", "notate_subject"):
+                 valid_input = (options["Headers", "header_ham_string"],
+                                options["Headers", "header_spam_string"],
+                                options["Headers", "header_unsure_string"])
+             else:
+                 valid_input = options.valid_input(sect, opt)
+ 
              # Populate the rows with the details and add them to the table.
!             if isinstance(valid_input, types.StringTypes):
                  # we provide a text input
                  newConfigRow1 = configTextRow1.clone()
                  newConfigRow1.label = options.display_name(sect, opt)
***************
*** 692,698 ****
                  blankOption = newConfigRow1.input.clone()
                  firstOpt = True
                  i = 0
!                 for val in options.valid_input(sect, opt):
                      newOption = blankOption.clone()
                      if options.multiple_values_allowed(sect, opt):
                          if val in options[sect, opt]:
--- 706,712 ----
                  blankOption = newConfigRow1.input.clone()
                  firstOpt = True
                  i = 0
!                 for val in valid_input:
                      newOption = blankOption.clone()
                      if options.multiple_values_allowed(sect, opt):
                          if val in options[sect, opt]:
***************
*** 842,847 ****
--- 856,876 ----
              if opt is None:
                  nice_section_name = sect
                  continue
+ 
+             # Annoyingly, we have a special case.  The notate_to and
+             # notate_subject allowed values have to be set to the same
+             # values as the header_x_ options. See also sf #944109.
+             # This code was originally in Options.py, after loading in the
+             # options.  But that doesn't work, because if we are setting
+             # both in a config file, we need it done immediately.
+             # We now need the hack here, *and* in OptionsClass.py
+             if sect == "Headers" and opt in ("notate_to", "notate_subject"):
+                 valid_input = (options["Headers", "header_ham_string"],
+                                options["Headers", "header_spam_string"],
+                                options["Headers", "header_unsure_string"])
+             else:
+                 valid_input = options.valid_input(sect, opt)
+ 
              html_key = sect + '_' + opt
              if not parms.has_key(html_key):
                  # This is a set of checkboxes where none are selected
***************
*** 864,872 ****
                  errmsg += '<li>\'%s\' is not a value valid for [%s] %s' % \
                            (entered_value, nice_section_name,
                             options.display_name(sect, opt))
!                 if type(options.valid_input(sect, opt)) == type((0,1)):
                      errmsg += '. Valid values are: '
!                     for valid in options.valid_input(sect, opt):
                          errmsg += str(valid) + ','
                      errmsg = errmsg[:-1] # cut last ','
                  errmsg += '</li>'
--- 893,901 ----
                  errmsg += '<li>\'%s\' is not a value valid for [%s] %s' % \
                            (entered_value, nice_section_name,
                             options.display_name(sect, opt))
!                 if isinstance(valid_input, types.TupleType):
                      errmsg += '. Valid values are: '
!                     for valid in valid_input:
                          errmsg += str(valid) + ','
                      errmsg = errmsg[:-1] # cut last ','
                  errmsg += '</li>'
