예제 #1
0
    def __init__(self, parent = None, *args, **kwargs):
        super().__init__(parent = parent, *args, **kwargs)

        self._container_id = None
        self._container = None
        self._i18n_catalog = None

        self._root_key = ""
        self._root = None

        self._definition_list = []
        self._row_index_list = []

        self._expanded = set()
        self._visible = set()
        self._exclude = set()

        self._show_all = False
        self._show_ancestors = False
        self._visibility_handler = None

        self._filter_dict = {}

        self._role_names = {
            self.KeyRole: b"key",
            self.DepthRole: b"depth",
            self.VisibleRole: b"visible",
            self.ExpandedRole: b"expanded",
        }
        index = self.ExpandedRole + 1
        for name in SettingDefinition.getPropertyNames():
            self._role_names[index] = name.encode()
            index += 1
예제 #2
0
    def __init__(self, parent=None, *args, **kwargs):
        super().__init__(parent=parent, *args, **kwargs)

        self._container_id = None
        self._container = None

        self._role_names = {self.KeyRole: b"key"}
        index = self.KeyRole + 1
        for name in SettingDefinition.getPropertyNames():
            self._role_names[index] = name.encode()
            index += 1
예제 #3
0
    def __init__(self, parent = None, *args, **kwargs):
        super().__init__(parent = parent, *args, **kwargs)

        self._container_id = None
        self._container = None

        self._role_names = {
            self.KeyRole: b"key"
        }
        index = self.KeyRole + 1
        for name in SettingDefinition.getPropertyNames():
            self._role_names[index] = name.encode()
            index += 1
예제 #4
0
    def __init__(self, parent: Optional[QObject] = None, *args, **kwargs):
        super().__init__(parent=parent)

        self._container_id: Optional[str] = None
        self._container: Optional[DefinitionContainerInterface] = None
        self._i18n_catalog = None

        self._root_key: str = ""
        self._root: Optional[SettingDefinition] = None

        self._definition_list: List[SettingDefinition] = []
        self._index_cache: Dict[SettingDefinition, int] = {}
        self._row_index_list: List[int] = []

        self._expanded: Set[str] = set()
        self._visible: Set[str] = set()
        self._exclude: Set[str] = set()

        self._show_all: bool = False
        self._show_ancestors: bool = False
        self._visibility_handler: Optional[
            SettingPreferenceVisibilityHandler] = None

        self._update_visible_row_scheduled: bool = False
        self._destroyed: bool = False

        self._filter_dict: Dict[str, Any] = {}

        self._role_names: Dict[int, bytes] = {
            self.KeyRole: b"key",
            self.DepthRole: b"depth",
            self.VisibleRole: b"visible",
            self.ExpandedRole: b"expanded",
        }
        index = self.ExpandedRole + 1
        for name in SettingDefinition.getPropertyNames():
            self._role_names[index] = name.encode()
            index += 1

        self.destroyed.connect(self._onDestroyed)

        self.expandedChanged.connect(self._onExpandedChanged)
예제 #5
0
    def __init__(self, parent = None, *args, **kwargs):
        super().__init__(parent = parent)

        self._container_id = None  # type: Optional[str]
        self._container = None  # type: Optional[DefinitionContainerInterface]
        self._i18n_catalog = None

        self._root_key = ""  # type: str
        self._root = None  # type: Optional[SettingDefinition]

        self._definition_list = []  # type: List[SettingDefinition]
        self._index_cache = {} # type: Dict[SettingDefinition, int]
        self._row_index_list = []  # type: List[int]

        self._expanded = set()  # type: Set[str]
        self._visible = set()  # type: Set[str]
        self._exclude = set()  # type: Set[str]

        self._show_all = False  # type: bool
        self._show_ancestors = False  # type: bool
        self._visibility_handler = None  # type: Optional[SettingPreferenceVisibilityHandler]

        self._update_visible_row_scheduled = False  # type: bool
        self._destroyed = False  # type: bool

        self._filter_dict = {}  # type: Dict[str, str]

        self._role_names = {
            self.KeyRole: b"key",
            self.DepthRole: b"depth",
            self.VisibleRole: b"visible",
            self.ExpandedRole: b"expanded",
        }  # type: Dict[int, bytes]
        index = self.ExpandedRole + 1
        for name in SettingDefinition.getPropertyNames():
            self._role_names[index] = name.encode()
            index += 1

        self.destroyed.connect(self._onDestroyed)

        self.expandedChanged.connect(self._onExpandedChanged)
예제 #6
0
    def __init__(self, parent = None, *args, **kwargs):
        super().__init__(parent = parent)

        self._container_id = None
        self._container = None
        self._i18n_catalog = None

        self._root_key = ""
        self._root = None

        self._definition_list = []
        self._row_index_list = []

        self._expanded = set()
        self._visible = set()
        self._exclude = set()

        self._show_all = False  # type: bool
        self._show_ancestors = False  # type: bool
        self._visibility_handler = None

        self._update_visible_row_scheduled = False  # type: bool
        self._destroyed = False  # type: bool

        self._filter_dict = {}

        self._role_names = {
            self.KeyRole: b"key",
            self.DepthRole: b"depth",
            self.VisibleRole: b"visible",
            self.ExpandedRole: b"expanded",
        }
        index = self.ExpandedRole + 1
        for name in SettingDefinition.getPropertyNames():
            self._role_names[index] = name.encode()
            index += 1

        self.destroyed.connect(self._onDestroyed)

        self.expandedChanged.connect(self.onExpandedChanged)
예제 #7
0
        html += formatKeyValueTableRow("read only",
                                       safeCall(def_container.isReadOnly),
                                       extra_class="metadata")
        html += formatKeyValueTableRow("path",
                                       safeCall(def_container.getPath),
                                       extra_class="metadata")
        html += formatKeyValueTableRow("metadata",
                                       safeCall(def_container.getMetaData),
                                       extra_class="metadata")
    except:
        pass

    return html


setting_prop_names = SettingDefinition.getPropertyNames()


def formatSettingValue(container, key, properties=None):
    if properties is None:
        properties = setting_prop_names

    value = "<ul class=\"property_list\">\n"
    comma = ""
    properties.sort()
    for prop_name in properties:
        prop_value = container.getProperty(key, prop_name)
        if prop_value is not None:
            value += "  <li>\n"
            value += "    <span class='prop_name'>" + encode(
                prop_name) + ":</span> " + encode(repr(prop_value))
예제 #8
0
    def _updateRelations(self, definition: SettingDefinition):
        for property in SettingDefinition.getPropertyNames(DefinitionPropertyType.Function):
            self._processFunction(definition, property)

        for child in definition.children:
            self._updateRelations(child)
예제 #9
0
    def _updateRelations(self, definition: SettingDefinition):
        for property in SettingDefinition.getPropertyNames(DefinitionPropertyType.Function):
            self._processFunction(definition, property)

        for child in definition.children:
            self._updateRelations(child)