Beispiel #1
0
    def __init__(self,
                 app,
                 taxonomy,
                 attribute_group,
                 node,
                 modifier_value,
                 allow_blank=True):
        """ constructor """
        super(DialogEditAttributes, self).__init__()
        self.ui = Ui_editAttributesDialog()
        self.ui.setupUi(self)
        self.app = app
        self.allow_blank = allow_blank

        self.ui.buttonBox.accepted.connect(self.accept)
        self.ui.buttonBox.rejected.connect(self.reject)

        self.taxonomy = taxonomy
        self.separator = str(
            self.taxonomy.get_separator(self.taxonomy.Separators.Attribute))
        self.attribute_group = attribute_group
        self.node = node

        self.code_widgets = []
        self.code_attribute = {}
        for idx, attribute in enumerate(attribute_group.attributes):
            widget = WidgetSelectAttribute(self.ui.boxAttributes,
                                           attribute.name, {}, "")
            if idx > 0:
                widget.setEnabled(False)
            self.code_widgets.append(widget)
            self.code_attribute[attribute.name] = idx
        self.fill_attribute_input(self.code_widgets[0],
                                  self.code_widgets[0].attribute_name, '',
                                  None)

        for widget in self.code_widgets:
            widget.codeUpdated.connect(self.updateAttributeValue)

        self.ui.txt_attribute_name.setText(attribute_group.name)
        self.set_modifier_value(modifier_value)