make it clear that consistency is needed
This commit is contained in:
		@@ -59,7 +59,7 @@ from gramps.gen.plug.report import (CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK,
 | 
			
		||||
                                    CATEGORY_GRAPHVIZ, CATEGORY_CODE,
 | 
			
		||||
                                    ReportOptions, append_styles)
 | 
			
		||||
from gramps.gen.plug.report._paper import paper_sizes
 | 
			
		||||
from gramps.gen.const import USER_HOME
 | 
			
		||||
from gramps.gen.const import USER_HOME, DOCGEN_OPTIONS
 | 
			
		||||
from gramps.gen.dbstate import DbState
 | 
			
		||||
from ..grampscli import CLIManager
 | 
			
		||||
from ..user import User
 | 
			
		||||
@@ -576,15 +576,15 @@ class CommandLineReport:
 | 
			
		||||
        self.doc_options.load_previous_values()
 | 
			
		||||
        docgen_menu = self.doc_options.menu
 | 
			
		||||
        report_menu = self.option_class.menu # "help" checks the option type
 | 
			
		||||
        for oname in docgen_menu.get_option_names('Document Options'):
 | 
			
		||||
            docgen_opt = docgen_menu.get_option('Document Options', oname)
 | 
			
		||||
        for oname in docgen_menu.get_option_names(DOCGEN_OPTIONS):
 | 
			
		||||
            docgen_opt = docgen_menu.get_option(DOCGEN_OPTIONS, oname)
 | 
			
		||||
            if oname in self.options_str_dict and oname in doc_options_dict:
 | 
			
		||||
                doc_options_dict[oname] = _convert_str_to_match_type(
 | 
			
		||||
                    self.options_str_dict[oname], doc_options_dict[oname])
 | 
			
		||||
                self.options_str_dict.pop(oname)
 | 
			
		||||
            if oname in doc_options_dict:
 | 
			
		||||
                docgen_opt.set_value(doc_options_dict[oname])
 | 
			
		||||
            report_menu.add_option('Document Options', oname, docgen_opt)
 | 
			
		||||
            report_menu.add_option(DOCGEN_OPTIONS, oname, docgen_opt)
 | 
			
		||||
        for oname in doc_options_dict: # enable "help"
 | 
			
		||||
            self.options_dict[oname] = doc_options_dict[oname]
 | 
			
		||||
            self.options_help[oname] = self.doc_options.options_help[oname][:3]
 | 
			
		||||
 
 | 
			
		||||
@@ -252,6 +252,7 @@ NO_SURNAME = "(%s)" % _("surname|none")
 | 
			
		||||
NO_GIVEN = "(%s)" % _("given-name|none")
 | 
			
		||||
ARABIC_COMMA = "،"
 | 
			
		||||
ARABIC_SEMICOLON = "؛"
 | 
			
		||||
DOCGEN_OPTIONS = 'Docgen Options'
 | 
			
		||||
 | 
			
		||||
#-------------------------------------------------------------------------
 | 
			
		||||
#
 | 
			
		||||
 
 | 
			
		||||
@@ -45,9 +45,8 @@ from gi.repository import Gtk
 | 
			
		||||
# Gramps modules
 | 
			
		||||
#
 | 
			
		||||
#-------------------------------------------------------------------------
 | 
			
		||||
from gramps.gen.const import GRAMPS_LOCALE as glocale, URL_MANUAL_PAGE
 | 
			
		||||
_ = glocale.translation.gettext
 | 
			
		||||
from gramps.gen.config import config
 | 
			
		||||
from gramps.gen.const import URL_MANUAL_PAGE, DOCGEN_OPTIONS
 | 
			
		||||
from gramps.gen.errors import (DatabaseError, FilterError, ReportError,
 | 
			
		||||
                               WindowActiveError)
 | 
			
		||||
from ...utils import open_file_with_default_application
 | 
			
		||||
@@ -62,6 +61,8 @@ from ...managedwindow import ManagedWindow
 | 
			
		||||
from ._stylecombobox import StyleComboBox
 | 
			
		||||
from ._styleeditor import StyleListDisplay
 | 
			
		||||
from ._fileentry import FileEntry
 | 
			
		||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
 | 
			
		||||
_ = glocale.translation.gettext
 | 
			
		||||
#-------------------------------------------------------------------------
 | 
			
		||||
#
 | 
			
		||||
# Private Constants
 | 
			
		||||
@@ -606,8 +607,8 @@ class ReportDialog(ManagedWindow):
 | 
			
		||||
 | 
			
		||||
        self.init_doc_options(self.doc_option_class)
 | 
			
		||||
        menu = self.doc_options.menu
 | 
			
		||||
        for name in menu.get_option_names('Document Options'):
 | 
			
		||||
            option = menu.get_option('Document Options', name)
 | 
			
		||||
        for name in menu.get_option_names(DOCGEN_OPTIONS):
 | 
			
		||||
            option = menu.get_option(DOCGEN_OPTIONS, name)
 | 
			
		||||
            # override option default with xml-saved value:
 | 
			
		||||
            if name in self.doc_options.options_dict:
 | 
			
		||||
                option.set_value(self.doc_options.options_dict[name])
 | 
			
		||||
 
 | 
			
		||||
@@ -32,9 +32,10 @@ ACSII document generator.
 | 
			
		||||
# Gramps modules
 | 
			
		||||
#
 | 
			
		||||
#------------------------------------------------------------------------
 | 
			
		||||
from gramps.gen.const import DOCGEN_OPTIONS
 | 
			
		||||
from gramps.gen.errors import ReportError
 | 
			
		||||
from gramps.gen.plug.docgen import (BaseDoc, TextDoc,
 | 
			
		||||
                                    PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER)
 | 
			
		||||
from gramps.gen.errors import ReportError
 | 
			
		||||
from gramps.gen.plug.menu import NumberOption
 | 
			
		||||
from gramps.gen.plug.report import DocOptions
 | 
			
		||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
 | 
			
		||||
@@ -457,8 +458,7 @@ class AsciiDocOptions(DocOptions):
 | 
			
		||||
        Add options to the document menu for the AsciiDoc docgen.
 | 
			
		||||
        """
 | 
			
		||||
 | 
			
		||||
        # next line for internal use only, never will be in UI: don't translate
 | 
			
		||||
        category_name = 'Document Options'
 | 
			
		||||
        category_name = DOCGEN_OPTIONS
 | 
			
		||||
 | 
			
		||||
        linechars = NumberOption(_('Characters per line'), 72, 20, 9999)
 | 
			
		||||
        linechars.set_help(_("The number of characters per line"))
 | 
			
		||||
 
 | 
			
		||||
@@ -37,8 +37,9 @@ from io import StringIO
 | 
			
		||||
# Gramps modules
 | 
			
		||||
#
 | 
			
		||||
#-------------------------------------------------------------------------
 | 
			
		||||
from gramps.gen.plug.docgen import BaseDoc, DrawDoc, SOLID, FONT_SANS_SERIF
 | 
			
		||||
from gramps.gen.const import DOCGEN_OPTIONS
 | 
			
		||||
from gramps.gen.errors import ReportError
 | 
			
		||||
from gramps.gen.plug.docgen import BaseDoc, DrawDoc, SOLID, FONT_SANS_SERIF
 | 
			
		||||
from gramps.gen.plug.menu import EnumeratedListOption
 | 
			
		||||
from gramps.gen.plug.report import DocOptions
 | 
			
		||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
 | 
			
		||||
@@ -335,8 +336,7 @@ class SvgDrawDocOptions(DocOptions):
 | 
			
		||||
        Add options to the document menu for the docgen.
 | 
			
		||||
        """
 | 
			
		||||
 | 
			
		||||
        # next line for internal use only, never will be in UI: don't translate
 | 
			
		||||
        category_name = 'Document Options'
 | 
			
		||||
        category_name = DOCGEN_OPTIONS
 | 
			
		||||
 | 
			
		||||
        background = EnumeratedListOption(_('SVG background color'),
 | 
			
		||||
                                          'transparent')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user