'Return, optionally save current options
exclude_genre stores literally
Section switches store as True/False
others store as lists'

def options(self):

    opts_dict = {}
    prefix_rules_processed = False
    exclusion_rules_processed = False
    for opt in self.OPTION_FIELDS:
        (c_name, c_def, c_type) = opt
        if ((c_name == 'exclusion_rules_tw') and exclusion_rules_processed):
            continue
        if ((c_name == 'prefix_rules_tw') and prefix_rules_processed):
            continue
        if (c_type in ['check_box', 'radio_button']):
            opt_value = getattr(self, c_name).isChecked()
        elif (c_type in ['combo_box']):
            opt_value = unicode(getattr(self, c_name).currentText()).strip()
        elif (c_type in ['line_edit']):
            opt_value = unicode(getattr(self, c_name).text()).strip()
        elif (c_type in ['spin_box']):
            opt_value = unicode(getattr(self, c_name).value())
        elif (c_type in ['table_widget']):
            if (c_name == 'prefix_rules_tw'):
                opt_value = self.prefix_rules_table.get_data()
                prefix_rules_processed = True
            if (c_name == 'exclusion_rules_tw'):
                opt_value = self.exclusion_rules_table.get_data()
                exclusion_rules_processed = True
        gprefs.set(((self.name + '_') + c_name), opt_value)
        if (c_name in ['exclusion_rules_tw', 'prefix_rules_tw']):
            self.construct_tw_opts_object(c_name, opt_value, opts_dict)
        else:
            opts_dict[c_name] = opt_value
    checked = ''
    if self.merge_before.isChecked():
        checked = 'before'
    elif self.merge_after.isChecked():
        checked = 'after'
    include_hr = self.include_hr.isChecked()
    opts_dict['merge_comments_rule'] = ('%s:%s:%s' % (self.merge_source_field_name, checked, include_hr))
    opts_dict['header_note_source_field'] = self.header_note_source_field_name
    opts_dict['genre_source_field'] = self.genre_source_field_name
    if (opts_dict['exclude_genre'] == ''):
        opts_dict['exclude_genre'] = 'a^'
    try:
        opts_dict['output_profile'] = [load_defaults('page_setup')['output_profile']]
    except:
        opts_dict['output_profile'] = ['default']
    if (False and self.DEBUG):
        print 'opts_dict'
        for opt in sorted(opts_dict.keys(), key=sort_key):
            print ('    %s:    %s' % (opt, repr(opts_dict[opt])))
    return opts_dict
