Beispiel #1
0
 def __init__(self,controller, version, plot_obj, parent=None):
     QtGui.QWidget.__init__(self,parent)
     self.proj_controller = controller
     self.controller = controller.vt_controller
     self.version = version
     self.plot = plot_obj
     self.state_changed = False
     self.plot_widget = None
     self.buttonLayout = QtGui.QHBoxLayout()
     self.buttonLayout.setMargin(5)
     self.saveButton = QDockPushButton('&Save', self)
     self.saveButton.setFixedWidth(100)
     self.saveButton.setEnabled(True)
     self.buttonLayout.addWidget(self.saveButton)
     self.resetButton = QDockPushButton('&Reset', self)
     self.resetButton.setFixedWidth(100)
     self.resetButton.setEnabled(True)
     self.buttonLayout.addWidget(self.resetButton)
     layout = QtGui.QVBoxLayout()
     self.setLayout(layout)
     self.alias_widgets = {}
     self.updateWidgets(plot_obj)
     layout.addLayout(self.buttonLayout)
     self.connect(self.saveButton, QtCore.SIGNAL('clicked(bool)'), 
                  self.saveTriggered)
     self.connect(self.resetButton, QtCore.SIGNAL('clicked(bool)'), 
                  self.resetTriggered)
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        self.timer_id = None

        self.workflowItems = {}
        self.layout = QtGui.QVBoxLayout()
#        self.layout.setContentsMargins(5, 5, 0, 0)

        buttonsLayout = QtGui.QHBoxLayout()
        #buttonsLayout.setMargin(5)
        #buttonsLayout.setSpacing(5)
        run_now = QDockPushButton("Check now")
        run_now.setToolTip("Check all jobs now")
        run_now.clicked.connect(self.timerEvent)
        buttonsLayout.addWidget(run_now)
        label = QtGui.QLabel('Refresh interval (seconds):')
        buttonsLayout.addWidget(label)

        self.interval = QtGui.QComboBox()
        for text, seconds in refresh_states:
            self.interval.addItem(text, seconds)
            self.interval.editTextChanged.connect(self.set_refresh)
        self.interval.setEditable(True)
        self.interval.setCurrentIndex(self.interval.findText('10 min'))
        self.interval.setCompleter(None)
        self.interval.setValidator(QNumberValidator())
        buttonsLayout.addWidget(self.interval)

        self.autorun = QtGui.QCheckBox("Run When Ready")
        self.autorun.setToolTip("Automatically re-execute the workflow when jobs have completed")
        buttonsLayout.addWidget(self.autorun)

        self.rerun = QtGui.QCheckBox("Run To Check")
        self.rerun.setToolTip("Automatically re-execute workflows that does not provide a status check method")
        buttonsLayout.addWidget(self.rerun)

        buttonsLayout.addStretch(1)
        self.layout.addLayout(buttonsLayout)

        self.jobView = QtGui.QTreeWidget()
        self.jobView.setContentsMargins(0, 0, 0, 0)
        self.jobView.setColumnCount(2)
        self.jobView.setHeaderLabels(['Job', 'Message'])
        self.jobView.header().setResizeMode(0, QtGui.QHeaderView.ResizeToContents)
        self.jobView.header().setResizeMode(1, QtGui.QHeaderView.Stretch)
        self.jobView.setExpandsOnDoubleClick(False)
        self.connect(self.jobView,
                     QtCore.SIGNAL('itemDoubleClicked(QTreeWidgetItem *, int)'),
                     self.item_selected)
        self.layout.addWidget(self.jobView)

        self.setLayout(self.layout)
        self.setWindowTitle('Running Jobs')
        self.resize(QtCore.QSize(800, 600))
        self.updating_now = False
Beispiel #3
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        self.timer_id = None
        self.updating_now = False
        self.widgets = {}

        self.layout = QtGui.QVBoxLayout()

        buttonsLayout = QtGui.QHBoxLayout()
        run_now = QDockPushButton("Check now")
        run_now.setToolTip("Check all jobs now")
        run_now.clicked.connect(self.timerEvent)
        buttonsLayout.addWidget(run_now)
        label = QtGui.QLabel('Refresh interval (seconds):')
        buttonsLayout.addWidget(label)

        self.interval = QtGui.QComboBox()
        for text, seconds in refresh_states:
            self.interval.addItem(text, seconds)
        self.interval.setCompleter(None)
        self.interval.setEditable(True)
        self.interval.editTextChanged.connect(self.set_refresh)
        self.interval.setValidator(QNumberValidator())
        conf = configuration.get_vistrails_configuration()
        self.interval.setEditText(str(conf.jobCheckInterval))
        buttonsLayout.addWidget(self.interval)

        self.autorun = QtGui.QCheckBox("Automatic re-execution")
        self.autorun.setToolTip("Automatically re-execute workflow when jobs "
                                "complete")
        self.connect(self.autorun, QtCore.SIGNAL('toggled(bool)'),
                     self.autorunToggled)
        self.autorun.setChecked(conf.jobAutorun)
        buttonsLayout.addWidget(self.autorun)

        buttonsLayout.addStretch(1)
        self.layout.addLayout(buttonsLayout)

        self.jobView = QJobTree()
        self.jobView.itemDoubleClicked.connect(self.item_clicked)
        self.layout.addWidget(self.jobView)

        self.setLayout(self.layout)

        self.setWindowTitle('Running Jobs')
        self.resize(QtCore.QSize(800, 600))
Beispiel #4
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        self.timer_id = None
        self.updating_now = False
        self.widgets = {}

        self.layout = QtGui.QVBoxLayout()

        buttonsLayout = QtGui.QHBoxLayout()
        run_now = QDockPushButton("Check now")
        run_now.setToolTip("Check all jobs now")
        run_now.clicked.connect(self.timerEvent)
        buttonsLayout.addWidget(run_now)
        label = QtGui.QLabel('Refresh interval (seconds):')
        buttonsLayout.addWidget(label)

        self.interval = QtGui.QComboBox()
        for text, seconds in refresh_states:
            self.interval.addItem(text, seconds)
        self.interval.setCompleter(None)
        self.interval.setEditable(True)
        self.interval.editTextChanged.connect(self.set_refresh)
        self.interval.setValidator(QNumberValidator())
        conf = configuration.get_vistrails_configuration()
        self.interval.setEditText(str(conf.jobCheckInterval))
        buttonsLayout.addWidget(self.interval)

        self.autorun = QtGui.QCheckBox("Automatic re-execution")
        self.autorun.setToolTip("Automatically re-execute workflow when jobs "
                                "complete")
        self.connect(self.autorun, QtCore.SIGNAL('toggled(bool)'),
                     self.autorunToggled)
        self.autorun.setChecked(conf.jobAutorun)
        buttonsLayout.addWidget(self.autorun)

        buttonsLayout.addStretch(1)
        self.layout.addLayout(buttonsLayout)

        self.jobView = QJobTree()
        self.jobView.itemDoubleClicked.connect(self.item_clicked)
        self.layout.addWidget(self.jobView)

        self.setLayout(self.layout)

        self.setWindowTitle('Running Jobs')
        self.resize(QtCore.QSize(800, 600))
Beispiel #5
0
    def build_widget(self):
        name_label = QtGui.QLabel("Name:")
        self.name_edit = QtGui.QLineEdit()
        self.connect(self.name_edit, QtCore.SIGNAL('editingFinished()'),
                     self.name_editing_finished)
        self.name_edit.setMinimumSize(50, 22)
        type_label = QtGui.QLabel("Type:")
        self.type_edit = QtGui.QLabel("")
        package_label = QtGui.QLabel("Package:")
        self.package_edit = QtGui.QLabel("")
        namespace_label = QtGui.QLabel("Namespace:")
        self.namespace_edit = QtGui.QLabel("")
        id = QtGui.QLabel("Id:")
        self.module_id = QtGui.QLabel("")
        self.configure_button = QDockPushButton("Configure")
        self.connect(self.configure_button, QtCore.SIGNAL('clicked()'),
                     self.configure)
        self.doc_button = QDockPushButton("Documentation")
        self.connect(self.doc_button, QtCore.SIGNAL('clicked()'),
                     self.documentation)

        layout = QtGui.QVBoxLayout()
        layout.setMargin(2)
        layout.setSpacing(4)

        def add_line(left, right):
            h_layout = QtGui.QHBoxLayout()
            h_layout.setMargin(2)
            h_layout.setSpacing(2)
            h_layout.setAlignment(QtCore.Qt.AlignLeft)
            h_layout.addWidget(left)
            h_layout.addWidget(right)
            h_widget = QtGui.QWidget()
            h_widget.setLayout(h_layout)
            h_widget.setSizePolicy(QtGui.QSizePolicy.Ignored,
                                   QtGui.QSizePolicy.Preferred)
            layout.addWidget(h_widget)

        add_line(name_label, self.name_edit)
        add_line(type_label, self.type_edit)
        add_line(package_label, self.package_edit)
        add_line(namespace_label, self.namespace_edit)
        add_line(id, self.module_id)
        h_layout = QtGui.QHBoxLayout()
        h_layout.setMargin(2)
        h_layout.setSpacing(5)
        h_layout.setAlignment(QtCore.Qt.AlignCenter)
        h_layout.addWidget(self.configure_button)
        h_layout.addWidget(self.doc_button)
        layout.addLayout(h_layout)

        self.tab_widget = QtGui.QTabWidget()
        # keep from overflowing on mac
        if systemType in ['Darwin']:
            self.tab_widget.tabBar().setStyleSheet('font-size: 12pt')
        # this causes a crash when undocking the palette in Mac OS X
        # see https://bugreports.qt-project.org/browse/QTBUG-16851
        # self.tab_widget.setDocumentMode(True)
        self.input_ports_list = PortsList('input')
        self.tab_widget.addTab(self.input_ports_list, 'Inputs')
        self.output_ports_list = PortsList('output')
        self.tab_widget.addTab(self.output_ports_list, 'Outputs')
        self.ports_lists = [self.input_ports_list, self.output_ports_list]
        self.annotations = QModuleAnnotationTable()
        self.tab_widget.addTab(self.annotations, 'Annotations')
        layout.addWidget(self.tab_widget, 1)

        layout.setAlignment(QtCore.Qt.AlignTop)
        self.setLayout(layout)
        self.setWindowTitle('Module Info')
Beispiel #6
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        ui = logging.StreamHandler(debugStream(self.write))
        ui.setFormatter(
            logging.Formatter('%(levelname)s\n%(asctime)s\n%(message)s'))
        ui.setLevel(logging.DEBUG)
        vistrails.core.debug.DebugPrint.getInstance().logger.addHandler(ui)
        self.setWindowTitle('VisTrails Messages')
        layout = QtGui.QVBoxLayout()
        self.setLayout(layout)

        # top message filter buttons
        filters = QtGui.QHBoxLayout()
        layout.addLayout(filters)

        filterLabel = QtGui.QLabel('Filter:')
        filterLabel.setFixedWidth(40)
        filters.addWidget(filterLabel)

        self.levels = {}
        for i, name in enumerate(('DEBUG', 'INFO', 'WARNING', 'CRITICAL')):
            box = QtGui.QCheckBox(name, self)
            box.setCheckable(True)
            box.setChecked(name != 'DEBUG')
            box.setStyleSheet(
                'color: %s;\n'
                'background-color: %s' %
                (CurrentTheme.DEBUG_COLORS[name].name(),
                 CurrentTheme.DEBUG_FILTER_BACKGROUND_COLOR.name()))
            self.connect(box, QtCore.SIGNAL('toggled(bool)'), self.refresh)
            filters.addWidget(box)
            self.levels[name] = box

        filters.addStretch()

        # message list
        self.list = QtGui.QListWidget()
        self.connect(
            self.list,
            QtCore.SIGNAL(
                'currentItemChanged(QListWidgetItem *, QListWidgetItem *)'),
            self.showMessage)
        layout.addWidget(self.list)

        # message details field
        self.text = QtGui.QTextEdit()
        self.text.setReadOnly(True)
        self.text.hide()
        layout.addWidget(self.text)

        # bottom buttons
        buttons = QtGui.QGridLayout()
        layout.addLayout(buttons)
        leftbuttons = QtGui.QGridLayout()
        buttons.addLayout(leftbuttons, 0, 0, QtCore.Qt.AlignLeft)
        rightbuttons = QtGui.QGridLayout()
        buttons.addLayout(rightbuttons, 0, 1, QtCore.Qt.AlignRight)

        copy = QDockPushButton('Copy &Message', self)
        copy.setToolTip('Copy selected message to clipboard')
        copy.setFixedWidth(125)
        rightbuttons.addWidget(copy, 0, 0)
        self.connect(copy, QtCore.SIGNAL('clicked()'), self.copyMessage)

        copyAll = QDockPushButton('Copy &All', self)
        copyAll.setToolTip('Copy all messages to clipboard (Can be a lot)')
        copyAll.setFixedWidth(125)
        rightbuttons.addWidget(copyAll, 0, 1)
        self.connect(copyAll, QtCore.SIGNAL('clicked()'), self.copyAll)
        self.msg_box = None
        self.itemQueue = []
        self.resize(700, 400)
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        ui = logging.StreamHandler(debugStream(self.write))
        ui.setFormatter(logging.Formatter("%(levelname)s\n%(asctime)s\n%(message)s"))
        ui.setLevel(logging.DEBUG)
        vistrails.core.debug.DebugPrint.getInstance().logger.addHandler(ui)
        self.setWindowTitle("VisTrails Messages")
        layout = QtGui.QVBoxLayout()
        self.setLayout(layout)

        # top message filter buttons
        filters = QtGui.QHBoxLayout()
        layout.addLayout(filters)

        filterLabel = QtGui.QLabel("Filter:")
        filterLabel.setFixedWidth(40)
        filters.addWidget(filterLabel)

        self.levels = {}
        for i, name in enumerate(("DEBUG", "INFO", "WARNING", "CRITICAL")):
            box = QtGui.QCheckBox(name, self)
            box.setCheckable(True)
            box.setChecked(name != "DEBUG")
            box.setStyleSheet(
                "color: %s;\n"
                "background-color: %s"
                % (CurrentTheme.DEBUG_COLORS[name].name(), CurrentTheme.DEBUG_FILTER_BACKGROUND_COLOR.name())
            )
            self.connect(box, QtCore.SIGNAL("toggled(bool)"), self.refresh)
            filters.addWidget(box)
            self.levels[name] = box

        filters.addStretch()

        # message list
        self.list = QtGui.QListWidget()
        self.connect(
            self.list, QtCore.SIGNAL("currentItemChanged(QListWidgetItem *, QListWidgetItem *)"), self.showMessage
        )
        layout.addWidget(self.list)

        # message details field
        self.text = QtGui.QTextEdit()
        self.text.setReadOnly(True)
        self.text.hide()
        layout.addWidget(self.text)

        # bottom buttons
        buttons = QtGui.QGridLayout()
        layout.addLayout(buttons)
        leftbuttons = QtGui.QGridLayout()
        buttons.addLayout(leftbuttons, 0, 0, QtCore.Qt.AlignLeft)
        rightbuttons = QtGui.QGridLayout()
        buttons.addLayout(rightbuttons, 0, 1, QtCore.Qt.AlignRight)

        copy = QDockPushButton("Copy &Message", self)
        copy.setToolTip("Copy selected message to clipboard")
        copy.setFixedWidth(125)
        rightbuttons.addWidget(copy, 0, 0)
        self.connect(copy, QtCore.SIGNAL("clicked()"), self.copyMessage)

        copyAll = QDockPushButton("Copy &All", self)
        copyAll.setToolTip("Copy all messages to clipboard (Can be a lot)")
        copyAll.setFixedWidth(125)
        rightbuttons.addWidget(copyAll, 0, 1)
        self.connect(copyAll, QtCore.SIGNAL("clicked()"), self.copyAll)
        self.msg_box = None
        self.itemQueue = []
        self.resize(700, 400)
Beispiel #8
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        vistrails.core.debug.DebugPrint.getInstance().set_stream(debugStream(self.write)) 
        self.setWindowTitle('VisTrails Messages')
        layout = QtGui.QVBoxLayout()
        self.setLayout(layout)

        # top message filter buttons
        filterHolder = QtGui.QGridLayout()
        layout.addLayout(filterHolder)
        filter = QtGui.QGridLayout()
        filterHolder.addLayout(filter, 0, 0, QtCore.Qt.AlignLeft)

        filterLabel = QtGui.QLabel('Filter:')
        filterLabel.setFixedWidth(40)
        filter.addWidget(filterLabel, 0, 0)

        self.infoFilter = QtGui.QCheckBox('Info', self)
        self.infoFilter.setCheckable(True)
        self.infoFilter.setChecked(True)
        self.infoFilter.setStyleSheet('color:' +
                                    CurrentTheme.DEBUG_INFO_COLOR.name() +
                                    ';background-color:' +
                                    CurrentTheme.DEBUG_FILTER_BACKGROUND_COLOR.name())
        self.connect(self.infoFilter, QtCore.SIGNAL('stateChanged(int)'),
                     self.toggleInfo)
        filter.addWidget(self.infoFilter, 0, 1)

        self.warningFilter = QtGui.QCheckBox('Warning', self)
        self.warningFilter.setCheckable(True)
        self.warningFilter.setChecked(True)
        self.warningFilter.setStyleSheet('color:' +
                                    CurrentTheme.DEBUG_WARNING_COLOR.name() +
                                    ';background-color:' +
                                    CurrentTheme.DEBUG_FILTER_BACKGROUND_COLOR.name())
        self.connect(self.warningFilter, QtCore.SIGNAL('stateChanged(int)'),
                     self.toggleWarning)
        filter.addWidget(self.warningFilter, 0, 2)

        self.criticalFilter = QtGui.QCheckBox('Critical', self)
        self.criticalFilter.setCheckable(True)
        self.criticalFilter.setChecked(True)
        self.criticalFilter.setStyleSheet('color:' +
                                    CurrentTheme.DEBUG_CRITICAL_COLOR.name() +
                                    ';background-color:' +
                                    CurrentTheme.DEBUG_FILTER_BACKGROUND_COLOR.name())
        self.connect(self.criticalFilter, QtCore.SIGNAL('stateChanged(int)'),
                     self.toggleCritical)
        filter.addWidget(self.criticalFilter, 0, 3)

        # message list
        self.list = QtGui.QListWidget()
        self.connect(self.list,
                     QtCore.SIGNAL('currentItemChanged(QListWidgetItem *, QListWidgetItem *)'),
                     self.showMessage)
        layout.addWidget(self.list)

        # message details field
        self.text = QtGui.QTextEdit()
        self.text.setReadOnly(True)
        self.text.hide()
        layout.addWidget(self.text)

        # bottom buttons
        buttons = QtGui.QGridLayout()
        layout.addLayout(buttons)
        leftbuttons = QtGui.QGridLayout()
        buttons.addLayout(leftbuttons, 0, 0, QtCore.Qt.AlignLeft)
        rightbuttons = QtGui.QGridLayout()
        buttons.addLayout(rightbuttons, 0, 1, QtCore.Qt.AlignRight)

        copy = QDockPushButton('Copy &Message', self)
        copy.setToolTip('Copy selected message to clipboard')
        copy.setFixedWidth(125)
        rightbuttons.addWidget(copy, 0, 0)
        self.connect(copy, QtCore.SIGNAL('clicked()'),
                     self.copyMessage)

        copyAll = QDockPushButton('Copy &All', self)
        copyAll.setToolTip('Copy all messages to clipboard (Can be a lot)')
        copyAll.setFixedWidth(125)
        rightbuttons.addWidget(copyAll, 0, 1)
        self.connect(copyAll, QtCore.SIGNAL('clicked()'),
                     self.copyAll)
        self.msg_box = None
        self.itemQueue = []
        self.resize(700, 400)
Beispiel #9
0
    def __init__(self, parent=None, f=QtCore.Qt.WindowFlags()):
        QtGui.QWidget.__init__(self, parent, f)
        
        self.set_title("Export To LaTeX")

        # add button to select tex source
        # listview to select figure 
        # thumbnail display
        # set figure specific options (show workflow, show execution, show
        # set includegraphics options
        source_label = QtGui.QLabel("LaTeX Source:")
        self.source_edit = QtGui.QLineEdit()
        source_selector = QDockPushButton("Select...")
        # source_selector = QtGui.QToolButton()
        # source_selector.setIcon(QtGui.QIcon(
        #         self.style().standardPixmap(QtGui.QStyle.SP_DirOpenIcon)))
        # source_selector.setIconSize(QtCore.QSize(12,12))
        source_selector.setToolTip("Open a file chooser")
        # source_selector.setAutoRaise(True)
        self.connect(source_selector,
                     QtCore.SIGNAL('clicked()'),
                     self.selectSource)

        source_group = QtGui.QGroupBox("LaTeX Source")
        s_layout = QtGui.QHBoxLayout()
        s_layout.addWidget(source_label)
        s_layout.addWidget(self.source_edit)
        s_layout.addWidget(source_selector)
        s_layout.setStretch(1,1)
        source_group.setLayout(s_layout)

        self.figure_list = QtGui.QListWidget()
        self.figure_list.setSelectionMode(self.figure_list.SingleSelection)
        self.preview_image = QtGui.QLabel()
        self.preview_image.setScaledContents(False)
        self.preview_image.setMinimumSize(240, 240)
        add_figure = QDockPushButton("Add Figure")
        delete_figure = QDockPushButton("Delete Figure")
        
        self.connect(add_figure,
                     QtCore.SIGNAL("clicked()"),
                     self.addFigure)
        self.connect(delete_figure,
                     QtCore.SIGNAL("clicked()"),
                     self.deleteFigure)
        self.connect(self.figure_list,
                     QtCore.SIGNAL("itemSelectionChanged()"),
                     self.figureSelected)
        
        figure_group = QtGui.QGroupBox("Figures")
        figure_layout = QtGui.QGridLayout()
        figure_layout.addWidget(self.figure_list,0,0,1,2)
        figure_layout.addWidget(self.preview_image,0,2)
        figure_layout.addWidget(add_figure,1,0,QtCore.Qt.AlignRight)
        figure_layout.addWidget(delete_figure,1,1,QtCore.Qt.AlignRight)
        figure_group.setLayout(figure_layout)
        
        # figure type, vistrail reference (vt_locator), version (smart tag)
        # use current version
        self.figure_type = QtGui.QComboBox()
        self.figure_type.setEditable(False)
        # items = []
        # items << "Workflow Results" << "Workflow Graph" << "History Tree Graph";
        self.figure_type.addItems(["Workflow Results", "Workflow Graph",
                                   "Version Tree"])
        self.figure_ref = QtGui.QLineEdit()
        version_label = QtGui.QLabel("Version:")
        self.figure_version = QtGui.QLineEdit()
        tag_label = QtGui.QLabel("Tag:")
        self.figure_tag = QtGui.QComboBox()
        self.figure_tag.setEditable(True)
        self.figure_smart = QtGui.QCheckBox("Smart Tag")
        current_button = QDockPushButton("Use Current")
        
        self.connect(current_button, QtCore.SIGNAL("clicked()"),
                     self.useCurrent)

        graphicx_label = QtGui.QLabel("Arguments for includegraphics:")
        self.graphicx_edit = QtGui.QLineEdit()

        self.def_group = QtGui.QGroupBox("Figure Definition")
        def_layout = QtGui.QVBoxLayout()
        def_h_layout = QtGui.QHBoxLayout()
        def_h_layout.addWidget(self.figure_ref)
        def_h_layout.addWidget(self.figure_type)
        def_h_layout.setStretch(0,1)
        def_layout.addLayout(def_h_layout)
        def_h_layout = QtGui.QHBoxLayout()        
        def_h_layout.addWidget(version_label)
        def_h_layout.addWidget(self.figure_version)
        def_h_layout.addWidget(tag_label)
        def_h_layout.addWidget(self.figure_tag)
        def_h_layout.addWidget(self.figure_smart)
        def_h_layout.addWidget(current_button)
        def_h_layout.setStretch(3,1)
        def_layout.addLayout(def_h_layout)
        def_h_layout = QtGui.QHBoxLayout()
        def_h_layout.addWidget(graphicx_label)
        def_h_layout.addWidget(self.graphicx_edit)
        def_h_layout.setStretch(1,1)
        def_layout.addLayout(def_h_layout)
        self.def_group.setLayout(def_layout)

        self.chbPdf = QtGui.QCheckBox("As PDF")
        self.chbCache = QtGui.QCheckBox("Cache Images")
        self.chbLatexVTL = QtGui.QCheckBox("Include .vtl")

        self.chbWorkflow = QtGui.QCheckBox("Include Workflow")
        self.chbFullTree = QtGui.QCheckBox("Include Full Tree")
        self.chbFullTree.setEnabled(False)
        self.chbExecute = QtGui.QCheckBox("Execute Workflow")
        self.chbSpreadsheet = QtGui.QCheckBox("Show Spreadsheet Only")

        self.gbEmbedOpt = QtGui.QGroupBox("Embed Options")
        gblayout = QtGui.QGridLayout()
        gblayout.addWidget(self.chbPdf, 0, 0)
        gblayout.addWidget(self.chbCache, 0, 1)
        gblayout.addWidget(self.chbLatexVTL, 1, 0)
        self.gbEmbedOpt.setLayout(gblayout)

        self.gbDownOpt = QtGui.QGroupBox("Download Options")
        gblayout = QtGui.QGridLayout()
        gblayout.addWidget(self.chbWorkflow, 0, 0)
        gblayout.addWidget(self.chbFullTree, 0, 1)
        gblayout.addWidget(self.chbExecute, 1, 0)
        gblayout.addWidget(self.chbSpreadsheet, 1, 1)
        self.gbDownOpt.setLayout(gblayout)

        revert_button = QDockPushButton("Revert...")
        save_button = QDockPushButton("Save...")
        save_button.setAutoDefault(True)

        self.connect(save_button, QtCore.SIGNAL("clicked()"),
                     self.saveLatex)
        
        main_layout = QtGui.QVBoxLayout()
        main_layout.addWidget(source_group)
        main_layout.addWidget(figure_group)
        main_layout.addWidget(self.def_group)
        main_h_layout = QtGui.QHBoxLayout()
        main_h_layout.addWidget(self.gbEmbedOpt)
        main_h_layout.addWidget(self.gbDownOpt)
        main_layout.addLayout(main_h_layout)
        main_h_layout = QtGui.QHBoxLayout()
        main_h_layout.setAlignment(QtCore.Qt.AlignRight)
        main_h_layout.addWidget(revert_button)
        main_h_layout.addWidget(save_button)
        main_layout.addLayout(main_h_layout)
        
        self.setLayout(main_layout)

        self.texts = None
        self.selected_item = None
Beispiel #10
0
    def __init__(self, controller=None, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.controller = controller
        self.versionNumber = -1
        vLayout = QtGui.QVBoxLayout()
        vLayout.setMargin(0)
        vLayout.setSpacing(5)
        self.setLayout(vLayout)
        gLayout = QtGui.QGridLayout()
        gLayout.setMargin(0)
        gLayout.setSpacing(5)
        gLayout.setColumnMinimumWidth(1, 5)
        gLayout.setRowMinimumHeight(0, 24)
        gLayout.setRowMinimumHeight(1, 24)
        gLayout.setRowMinimumHeight(2, 24)
        gLayout.setRowMinimumHeight(3, 24)
        vLayout.addLayout(gLayout)

        #vtVersionLabel = QtGui.QLabel('Workflow:', self)
        #gLayout.addWidget(vtVersionLabel, 0, 0, 1, 1)

        #self.vtVersionEdit = QtGui.QLabel('', self)
        #gLayout.addWidget(self.vtVersionEdit, 0, 2, 1, 1)

        tagLabel = QtGui.QLabel('Mashup Tag:', self)
        gLayout.addWidget(tagLabel, 0, 0, 1, 1)

        editLayout = QtGui.QHBoxLayout()
        editLayout.setMargin(0)
        editLayout.setSpacing(2)
        self.tagEdit = QtGui.QLineEdit()
        tagLabel.setBuddy(self.tagEdit)
        editLayout.addWidget(self.tagEdit)
        self.tagEdit.setEnabled(False)

        self.tagReset = QtGui.QToolButton(self)
        self.tagReset.setIcon(
            QtGui.QIcon(self.style().standardPixmap(
                QtGui.QStyle.SP_DialogCloseButton)))
        self.tagReset.setIconSize(QtCore.QSize(12, 12))
        self.tagReset.setAutoRaise(True)
        self.tagReset.setEnabled(False)
        editLayout.addWidget(self.tagReset)

        gLayout.addLayout(editLayout, 0, 2, 1, 1)

        userLabel = QtGui.QLabel('User:'******'', self)
        gLayout.addWidget(self.userEdit, 1, 2, 1, 1)

        dateLabel = QtGui.QLabel('Date:', self)
        gLayout.addWidget(dateLabel, 2, 0, 1, 1)

        self.dateEdit = QtGui.QLabel('', self)
        gLayout.addWidget(self.dateEdit, 2, 2, 1, 1)

        self.btnExport = QDockPushButton("Export...")
        gLayout.addWidget(self.btnExport, 3, 0, 1, 3, QtCore.Qt.AlignHCenter)

        vLayout.addStretch()

        self.connect(self.tagEdit, QtCore.SIGNAL('editingFinished()'),
                     self.tagFinished)
        self.connect(self.tagEdit, QtCore.SIGNAL('textChanged(QString)'),
                     self.tagChanged)
        self.connect(self.tagReset, QtCore.SIGNAL('clicked()'),
                     self.tagCleared)
        self.connect(self.btnExport, QtCore.SIGNAL("clicked()"),
                     self.exportMashupGUI)
Beispiel #11
0
class AliasesPlotWidget(QtGui.QWidget):
    def __init__(self,controller, version, plot_obj, parent=None):
        QtGui.QWidget.__init__(self,parent)
        self.proj_controller = controller
        self.controller = controller.vt_controller
        self.version = version
        self.plot = plot_obj
        self.state_changed = False
        self.plot_widget = None
        self.buttonLayout = QtGui.QHBoxLayout()
        self.buttonLayout.setMargin(5)
        self.saveButton = QDockPushButton('&Save', self)
        self.saveButton.setFixedWidth(100)
        self.saveButton.setEnabled(True)
        self.buttonLayout.addWidget(self.saveButton)
        self.resetButton = QDockPushButton('&Reset', self)
        self.resetButton.setFixedWidth(100)
        self.resetButton.setEnabled(True)
        self.buttonLayout.addWidget(self.resetButton)
        layout = QtGui.QVBoxLayout()
        self.setLayout(layout)
        self.alias_widgets = {}
        self.updateWidgets(plot_obj)
        layout.addLayout(self.buttonLayout)
        self.connect(self.saveButton, QtCore.SIGNAL('clicked(bool)'), 
                     self.saveTriggered)
        self.connect(self.resetButton, QtCore.SIGNAL('clicked(bool)'), 
                     self.resetTriggered)
        
    def updateWidgets(self, plot_obj=None):
        self.plot = plot_obj
        if self.plot_widget is not None:
            self.layout().removeWidget(self.plot_widget)
            self.plot_widget.deleteLater()
            self.plot_widget = None
        if self.plot:
            pipeline = self.controller.vistrail.getPipeline(self.version)
            self.plot_widget = self.loadWidget(pipeline)
            self.layout().insertWidget(0,self.plot_widget)
        self.adjustSize()
                
    def updateVistrail(self):
        aliases = {}
        pipeline = self.controller.vistrail.getPipeline(self.version)
        for name in pipeline.aliases:
            aliases[name] = pipeline.get_alias_str_value(name)
        for a,w in self.alias_widgets.iteritems():
            aliases[a] = w.contents()
            print a, aliases[a]
        action = self.applyChanges(pipeline, aliases)
        
        return action
    
    def applyChanges(self, pipeline, aliases):
        print " @@ Pipeline aliases: ", str( pipeline.aliases )
        self.plot.addMergedAliases( aliases, pipeline )
        action = self.plot.addParameterChangesFromAliasesAction(pipeline, 
                                        self.controller, 
                                        self.controller.vistrail, 
                                        self.version, aliases)
        return action
    
    def saveTriggered(self, checked):
        action = self.updateVistrail()
        self.emit(QtCore.SIGNAL('plotDoneConfigure'), action)
        
    def resetTriggered(self, checked):
        self.updateWidgets(self.plot)
        self.emit(QtCore.SIGNAL("stateChanged"))
        
    def loadWidget( self, pipeline):
        from PyQt4 import QtGui
        aliases = pipeline.aliases
        widget = QtGui.QWidget()
        layout = QtGui.QVBoxLayout()
        hidden_aliases = self.plot.computeHiddenAliases()
        for name, (type, oId, parentType, parentId, mId) in aliases.iteritems():
            if name not in hidden_aliases:
                p = pipeline.db_get_object(type, oId)
                if p.identifier == '':
                    idn = 'edu.utah.sci.vistrails.basic'
                else:
                    idn = p.identifier
                reg = get_module_registry()
                p_module = reg.get_module_by_name(idn, p.type, p.namespace)
                if p_module is not None:
                    widget_type = get_widget_class(p_module)
                else:
                    widget_type = StandardConstantWidget
                p_widget = widget_type(p, None)
                a_layout = QtGui.QHBoxLayout()
                label = QtGui.QLabel(name)
                a_layout.addWidget(label)
                a_layout.addWidget(p_widget)
                
                layout.addLayout(a_layout)
                self.alias_widgets[name] = p_widget
                
        widget.setLayout(layout)
        return widget
Beispiel #12
0
    def __init__(self, parent=None, f=QtCore.Qt.WindowFlags()):
        QtGui.QWidget.__init__(self, parent, f)
        
        self.set_title("Export To LaTeX")

        # add button to select tex source
        # listview to select figure 
        # thumbnail display
        # set figure specific options (show workflow, show execution, show
        # set includegraphics options
        source_label = QtGui.QLabel("LaTeX Source:")
        self.source_edit = QtGui.QLineEdit()
        source_selector = QDockPushButton("Select...")
        # source_selector = QtGui.QToolButton()
        # source_selector.setIcon(QtGui.QIcon(
        #         self.style().standardPixmap(QtGui.QStyle.SP_DirOpenIcon)))
        # source_selector.setIconSize(QtCore.QSize(12,12))
        source_selector.setToolTip("Open a file chooser")
        # source_selector.setAutoRaise(True)
        self.connect(source_selector,
                     QtCore.SIGNAL('clicked()'),
                     self.selectSource)

        source_group = QtGui.QGroupBox("LaTeX Source")
        s_layout = QtGui.QHBoxLayout()
        s_layout.addWidget(source_label)
        s_layout.addWidget(self.source_edit)
        s_layout.addWidget(source_selector)
        s_layout.setStretch(1,1)
        source_group.setLayout(s_layout)

        self.figure_list = QtGui.QListWidget()
        self.figure_list.setSelectionMode(self.figure_list.SingleSelection)
        self.preview_image = QtGui.QLabel()
        self.preview_image.setScaledContents(False)
        self.preview_image.setMinimumSize(240, 240)
        add_figure = QDockPushButton("Add Figure")
        delete_figure = QDockPushButton("Delete Figure")
        
        self.connect(add_figure,
                     QtCore.SIGNAL("clicked()"),
                     self.addFigure)
        self.connect(delete_figure,
                     QtCore.SIGNAL("clicked()"),
                     self.deleteFigure)
        self.connect(self.figure_list,
                     QtCore.SIGNAL("itemSelectionChanged()"),
                     self.figureSelected)
        
        figure_group = QtGui.QGroupBox("Figures")
        figure_layout = QtGui.QGridLayout()
        figure_layout.addWidget(self.figure_list,0,0,1,2)
        figure_layout.addWidget(self.preview_image,0,2)
        figure_layout.addWidget(add_figure,1,0,QtCore.Qt.AlignRight)
        figure_layout.addWidget(delete_figure,1,1,QtCore.Qt.AlignRight)
        figure_group.setLayout(figure_layout)
        
        # figure type, vistrail reference (vt_locator), version (smart tag)
        # use current version
        self.figure_type = QtGui.QComboBox()
        self.figure_type.setEditable(False)
        # items = []
        # items << "Workflow Results" << "Workflow Graph" << "History Tree Graph";
        self.figure_type.addItems(["Workflow Results", "Workflow Graph",
                                   "Version Tree"])
        self.figure_ref = QtGui.QLineEdit()
        version_label = QtGui.QLabel("Version:")
        self.figure_version = QtGui.QLineEdit()
        tag_label = QtGui.QLabel("Tag:")
        self.figure_tag = QtGui.QComboBox()
        self.figure_tag.setEditable(True)
        self.figure_smart = QtGui.QCheckBox("Smart Tag")
        current_button = QDockPushButton("Use Current")
        
        self.connect(current_button, QtCore.SIGNAL("clicked()"),
                     self.useCurrent)

        graphicx_label = QtGui.QLabel("Arguments for includegraphics:")
        self.graphicx_edit = QtGui.QLineEdit()

        self.def_group = QtGui.QGroupBox("Figure Definition")
        def_layout = QtGui.QVBoxLayout()
        def_h_layout = QtGui.QHBoxLayout()
        def_h_layout.addWidget(self.figure_ref)
        def_h_layout.addWidget(self.figure_type)
        def_h_layout.setStretch(0,1)
        def_layout.addLayout(def_h_layout)
        def_h_layout = QtGui.QHBoxLayout()        
        def_h_layout.addWidget(version_label)
        def_h_layout.addWidget(self.figure_version)
        def_h_layout.addWidget(tag_label)
        def_h_layout.addWidget(self.figure_tag)
        def_h_layout.addWidget(self.figure_smart)
        def_h_layout.addWidget(current_button)
        def_h_layout.setStretch(3,1)
        def_layout.addLayout(def_h_layout)
        def_h_layout = QtGui.QHBoxLayout()
        def_h_layout.addWidget(graphicx_label)
        def_h_layout.addWidget(self.graphicx_edit)
        def_h_layout.setStretch(1,1)
        def_layout.addLayout(def_h_layout)
        self.def_group.setLayout(def_layout)

        self.chbPdf = QtGui.QCheckBox("As PDF")
        self.chbCache = QtGui.QCheckBox("Cache Images")
        self.chbLatexVTL = QtGui.QCheckBox("Include .vtl")

        self.chbWorkflow = QtGui.QCheckBox("Include Workflow")
        self.chbFullTree = QtGui.QCheckBox("Include Full Tree")
        self.chbFullTree.setEnabled(False)
        self.chbExecute = QtGui.QCheckBox("Execute Workflow")
        self.chbSpreadsheet = QtGui.QCheckBox("Show Spreadsheet Only")

        self.gbEmbedOpt = QtGui.QGroupBox("Embed Options")
        gblayout = QtGui.QGridLayout()
        gblayout.addWidget(self.chbPdf, 0, 0)
        gblayout.addWidget(self.chbCache, 0, 1)
        gblayout.addWidget(self.chbLatexVTL, 1, 0)
        self.gbEmbedOpt.setLayout(gblayout)

        self.gbDownOpt = QtGui.QGroupBox("Download Options")
        gblayout = QtGui.QGridLayout()
        gblayout.addWidget(self.chbWorkflow, 0, 0)
        gblayout.addWidget(self.chbFullTree, 0, 1)
        gblayout.addWidget(self.chbExecute, 1, 0)
        gblayout.addWidget(self.chbSpreadsheet, 1, 1)
        self.gbDownOpt.setLayout(gblayout)

        revert_button = QDockPushButton("Revert...")
        save_button = QDockPushButton("Save...")
        save_button.setAutoDefault(True)

        self.connect(save_button, QtCore.SIGNAL("clicked()"),
                     self.saveLatex)
        
        main_layout = QtGui.QVBoxLayout()
        main_layout.addWidget(source_group)
        main_layout.addWidget(figure_group)
        main_layout.addWidget(self.def_group)
        main_h_layout = QtGui.QHBoxLayout()
        main_h_layout.addWidget(self.gbEmbedOpt)
        main_h_layout.addWidget(self.gbDownOpt)
        main_layout.addLayout(main_h_layout)
        main_h_layout = QtGui.QHBoxLayout()
        main_h_layout.setAlignment(QtCore.Qt.AlignRight)
        main_h_layout.addWidget(revert_button)
        main_h_layout.addWidget(save_button)
        main_layout.addLayout(main_h_layout)
        
        self.setLayout(main_layout)

        self.texts = None
        self.selected_item = None