Example #1
0
    def __init__(self, module, controller, available_tree, parent=None):
        StandardModuleConfigurationWidget.__init__(self, module, controller, 
                                                   parent)

        # set title
        if module.has_annotation_with_key('__desc__'):
            label = module.get_annotation_by_key('__desc__').value.strip()
            title = '%s (%s) Module Configuration' % (label, module.name)
        else:
            title = '%s Module Configuration' % module.name
        self.setWindowTitle(title)
        self.build_gui(available_tree)
    def __init__(self, module, controller, parent=None, is_input=None, path_type=None):
        StandardModuleConfigurationWidget.__init__(self, module, controller, parent)

        # set title
        if module.has_annotation_with_key("__desc__"):
            label = module.get_annotation_by_key("__desc__").value.strip()
            title = "%s (%s) Module Configuration" % (label, module.name)
        else:
            title = "%s Module Configuration" % module.name
        self.setWindowTitle(title)

        self.build_gui(is_input, path_type)
        self.set_values()
    def __init__(self, module, controller, parent=None):
        """ MplPlotConfigurationWidget(module: Module,
                                       controller: VistrailController,
                                       parent: QWidget)
                                       -> MplPlotConfigurationWidget                                       
        Let StandardModuleConfigurationWidget constructor store the
        controller/module object from the builder and set up the
        configuration widget.        
        After StandardModuleConfigurationWidget constructor, all of
        these will be available:
        self.module : the Module object int the pipeline        
        self.module_descriptor: the descriptor for the type registered in the registry,
                          i.e. Tuple
        self.controller: the current vistrail controller
                                       
        """
        StandardModuleConfigurationWidget.__init__(self, module,
                                                   controller, parent)

        # Give it a nice window title
        self.setWindowTitle('Tuple Configuration')

        # Add an empty vertical layout
        centralLayout = QtGui.QVBoxLayout()
        centralLayout.setMargin(0)
        centralLayout.setSpacing(0)
        self.setLayout(centralLayout)
        
        # Then add a PortTable to our configuration widget
        self.portTable = PortTable(self)
        self.portTable.setHorizontalHeaderLabels(
            QtCore.QStringList() << 'Input Port Name' << 'Type')
        
        # We know that the Tuple module initially doesn't have any
        # input port, we just use the local registry to see what ports
        # it has at the time of configuration.
        if self.module.registry:
            iPorts = self.module.registry.destination_ports_from_descriptor(self.module_descriptor)
            self.portTable.initializePorts(iPorts)
        else:
            self.portTable.fixGeometry()
        centralLayout.addWidget(self.portTable)

        # We need a padded widget to take all vertical white space away
        paddedWidget = QtGui.QWidget(self)
        paddedWidget.setSizePolicy(QtGui.QSizePolicy.Ignored,
                                   QtGui.QSizePolicy.Expanding)
        centralLayout.addWidget(paddedWidget, 1)

        # Then we definitely need an Ok & Cancel button
        self.createButtons()
Example #4
0
 def __init__(self, module, controller, parent=None):
     """ HandlerConfigurationWidget(module: Module,
                                    controller: VistrailController,
                                    parent: QWidget)
                                    -> HandlerConfigurationWidget
     Setup the dialog to have a single python source editor and 2
     buttons
     
     """
     StandardModuleConfigurationWidget.__init__(self, module,
                                                controller, parent)
     self.setWindowTitle('Handler Python Script Editor')
     self.setLayout(QtGui.QVBoxLayout())
     self.layout().setMargin(0)
     self.layout().setSpacing(0)
     self.createEditor()
     self.createButtonLayout()