예제 #1
0
    def currentChanged(self):
        #hide
        self.detailName.setText("")
        self.detailModule.setText("")
        self.detailDescription.setText("")
        self.detailOptions.setText("")
        self.detailColumns.setText("")
        self.detailWidget.hide()

        current = self.presetList.currentItem()
        if current and current.isSelected():
            data = current.data(0, Qt.UserRole)

            if not data.get('iscategory', False):
                self.lastSelected = os.path.join(data.get('folder', ''),
                                                 data.get('filename', ''))

                self.detailName.setText(data.get('name'))
                self.detailModule.setText(data.get('module'))
                self.detailDescription.setText(data.get('description') + "\n")
                self.detailOptions.setHtml(formatdict(data.get('options', [])))
                self.detailColumns.setText("\r\n".join(data.get('columns',
                                                                [])))
                self.detailSpeed.setText(str(data.get('speed', '')))

                self.detailWidget.show()
예제 #2
0
    def currentChanged(self):
        #hide
        self.detailName.setText("")
        self.detailModule.setText("")
        self.detailDescription.setText("")
        self.detailOptions.setText("")
        self.detailColumns.setText("")

        self.presetView.hide()
        self.categoryView.hide()

        current = self.presetList.currentItem()
        if current and current.isSelected():
            data = current.data(0, Qt.UserRole)

            # Single preset
            if not data.get('iscategory', False):
                self.lastSelected = os.path.join(data.get('folder', ''),
                                                 data.get('filename', ''))

                self.detailName.setText(data.get('name'))
                self.detailModule.setText(data.get('module'))
                self.detailDescription.setText(data.get('description') + "\n")
                self.detailOptions.setHtml(formatdict(data.get('options', [])))
                self.detailColumns.setText("\r\n".join(data.get('columns',
                                                                [])))
                self.detailSpeed.setText(str(data.get('speed', '')))
                self.detailTimeout.setText(str(data.get('timeout', '')))
                self.detailMaxsize.setText(str(data.get('maxsize', '')))

                #self.applyButton.setText("Apply")
                self.presetView.show()

            # Category
            else:
                #                self.pipelineName.setText(str(data.get('category')))

                #                 self.pipelineWidget.clear()
                #                 for i in range(current.childCount()):
                #                     presetitem = current.child(i)
                #                     preset = presetitem.data(0, Qt.UserRole)
                #
                #                     treeitem = QTreeWidgetItem(self.pipelineWidget)
                #                     treeitem.setText(0,preset.get('name'))
                #                     treeitem.setText(1, preset.get('module'))
                #                     treeitem.setText(2, getDictValue(preset,'options.basepath'))
                #                     treeitem.setText(3, getDictValue(preset,'options.resource'))
                # #                   treeitem.setText(4, preset.get('description'))
                #
                #                     self.pipelineWidget.addTopLevelItem(treeitem)

                #self.applyButton.setText("Run pipeline")
                self.categoryView.show()