diff --git a/config/config.py b/config/config.py index a5a0b34..9d90093 100644 --- a/config/config.py +++ b/config/config.py @@ -66,7 +66,7 @@ class {{ name }}{% if base_classes %}({% for inh in base_classes %}{{ inh.baseTy settings.beginGroup("{% if settings_group_name %}{{ settings_group_name }}{% else %}{{ name }}{% endif %}") {% for member in members %} - self.{{ member.name }} = {{ member.type }}(settings.value("{{ member.name }}", self.{{ member.name }})) + self.{{ member.name }} = {% if member.type == "bool" %}self._{% endif %}{{ member.type }}(settings.value("{{ member.name }}", self.{{ member.name }})) {% endfor %} settings.endGroup() @@ -118,3 +118,11 @@ class {{ name }}{% if base_classes %}({% for inh in base_classes %}{{ inh.baseTy self.{{ member.name }}Changed.emit({{ member.name }}) {% endfor %} + + + {% if include_load_save %} + + def _bool(self, value): + return value == "true" + + {% endif %}