better default value for boolean values

This commit is contained in:
2020-07-29 16:07:18 +02:00
parent 7a62ebf294
commit cc2f7b64b1
23 changed files with 52 additions and 46 deletions

View File

@ -1110,6 +1110,12 @@ class FamilyAnnotator:
variable.frozen = True
if not variable.auto_save is True and 'force_default_on_freeze' not in vars(variable):
variable.force_default_on_freeze = True
if not has_value and variable.type == 'boolean':
new_value = self.objectspace.value()
new_value.name = True
new_value.type = 'boolean'
variable.value = [new_value]
variable.mandatory = True
def change_variable_mode(self): # pylint: disable=C0111
if not hasattr(self.objectspace.space, 'variables'):

View File

@ -20,7 +20,7 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
'string': dict(opttype="StrOption"),
'password': dict(opttype="PasswordOption"),
'mail': dict(opttype="EmailOption"),
'boolean': dict(opttype="BoolOption", initkwargs={'default': [True]}),
'boolean': dict(opttype="BoolOption"),
'symlink': dict(opttype="SymLinkOption"),
'filename': dict(opttype="FilenameOption"),
'date': dict(opttype="DateOption"),