Beispiel #1
0
    def onSelectBtnClick(self):
        selector = conf["selectors"].get(self.bone.destModule)
        if selector is None:
            selector = moduleWidgetSelector.select(self.bone.destModule,
                                                   self.bone.destInfo)
            assert selector, "No selector can be found for %r" % self.destModule

            selector = selector(self.bone.destModule, **self.bone.destInfo)

            conf["selectors"][self.bone.destModule] = selector

        # Set a context if configured so
        context = self.bone.boneStructure["params"].get("context")
        if context:
            selector.setContext(context)

        # Start widget with selector callback
        selector.setSelector(
            lambda selector, selection: self.unserialize({
                "dest":
                selection[0],
                "rel":
                _getDefaultValues(self.bone.dataStructure)
                if self.bone.dataStructure else None,
            }),
            multi=self.bone.multiple,
            allow=self.bone.selectorAllow,
        )
Beispiel #2
0
    def onAddBtnClick(self):
        selector = conf["selectors"].get(self.bone.destModule)

        if selector is None:
            selector = moduleWidgetSelector.select(self.bone.destModule,
                                                   self.bone.destInfo)
            assert selector, "No selector can be found for %r" % self.destModule

            selector = selector(self.bone.destModule, **self.bone.destInfo)

            conf["selectors"][self.bone.destModule] = selector

        # todo: set context

        # Start widget with selector callback
        selector.setSelector(self._addEntriesFromSelection,
                             multi=self.bone.multiple,
                             allow=self.bone.selectorAllow)
Beispiel #3
0
    def onAddBtnClick(self):
        selector = conf["selectors"].get(self.bone.destModule)

        if selector is None:
            selector = moduleWidgetSelector.select(self.bone.destModule,
                                                   self.bone.destInfo)
            assert selector, "No selector can be found for %r" % self.destModule

            selector = selector(self.bone.destModule, **self.bone.destInfo)

            conf["selectors"][self.bone.destModule] = selector

        # Set a context if configured so
        context = self.bone.boneStructure["params"].get("context")
        if context:
            selector.setContext(context)

        # Start widget with selector callback
        selector.setSelector(
            self._addEntriesFromSelection,
            multi=self.bone.multiple,
            allow=self.bone.selectorAllow,
        )