Пример #1
0
    def __init__(self):
        dockarea.Dock.__init__(self, "Log", size=(1000, 300))

        grid = LayoutWidget()
        self.addWidget(grid)

        grid.addWidget(QtGui.QLabel("Minimum level: "), 0, 0)
        grid.layout.setColumnStretch(0, 0)
        grid.layout.setColumnStretch(1, 0)
        grid.layout.setColumnStretch(2, 1)
        self.filterbox = QtGui.QComboBox()
        for item in "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL":
            self.filterbox.addItem(item)
        self.filterbox.setToolTip("Display entries at or above this level")
        grid.addWidget(self.filterbox, 0, 1)
        self.filterbox.currentIndexChanged.connect(self.filter_changed)

        self.log = QtGui.QTableView()
        self.log.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
        self.log.horizontalHeader().setResizeMode(
            QtGui.QHeaderView.ResizeToContents)
        self.log.setHorizontalScrollMode(
            QtGui.QAbstractItemView.ScrollPerPixel)
        self.log.setShowGrid(False)
        self.log.setTextElideMode(QtCore.Qt.ElideNone)
        grid.addWidget(self.log, 1, 0, colspan=3)
        self.scroll_at_bottom = False
Пример #2
0
    def __init__(self, dialog_parent, status_bar, schedule_ctl):
        dockarea.Dock.__init__(self, "Explorer", size=(1500, 500))

        self.dialog_parent = dialog_parent
        self.status_bar = status_bar
        self.schedule_ctl = schedule_ctl

        self.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal)
        self.addWidget(self.splitter)

        grid = LayoutWidget()
        self.splitter.addWidget(grid)

        self.el = QtGui.QListView()
        self.el.selectionChanged = self._selection_changed
        self.selected_key = None
        grid.addWidget(self.el, 0, 0, colspan=4)

        self.datetime = QtGui.QDateTimeEdit()
        self.datetime.setDisplayFormat("MMM d yyyy hh:mm:ss")
        self.datetime.setDate(QtCore.QDate.currentDate())
        self.datetime.dateTimeChanged.connect(self.enable_duedate)
        self.datetime_en = QtGui.QCheckBox("Due date:")
        grid.addWidget(self.datetime_en, 1, 0, colspan=2)
        grid.addWidget(self.datetime, 1, 2, colspan=2)

        self.pipeline = QtGui.QLineEdit()
        self.pipeline.setText("main")
        grid.addWidget(QtGui.QLabel("Pipeline:"), 2, 0, colspan=2)
        grid.addWidget(self.pipeline, 2, 2, colspan=2)

        self.priority = QtGui.QSpinBox()
        self.priority.setRange(-99, 99)
        grid.addWidget(QtGui.QLabel("Priority:"), 3, 0)
        grid.addWidget(self.priority, 3, 1)

        self.flush = QtGui.QCheckBox("Flush")
        self.flush.setToolTip(
            "Flush the pipeline before starting the experiment")
        grid.addWidget(self.flush, 3, 2)

        self.log_level = QtGui.QComboBox()
        for item in "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL":
            self.log_level.addItem(item)
        self.log_level.setCurrentIndex(1)
        self.log_level.setToolTip("Minimum level for log entry production")
        grid.addWidget(self.log_level, 3, 3)

        submit = QtGui.QPushButton("Submit")
        submit.setShortcut("CTRL+RETURN")
        submit.setToolTip("Schedule the selected experiment (CTRL+ENTER)")
        grid.addWidget(submit, 4, 0, colspan=4)
        submit.clicked.connect(self.submit_clicked)

        self.argeditor = _ArgumentEditor(self.dialog_parent)
        self.splitter.addWidget(self.argeditor)
        self.splitter.setSizes([grid.minimumSizeHint().width(), 1000])
        self.state = dict()
Пример #3
0
    def __init__(self, parent, prev_name, prev_settings,
                 result_list, create_cb):
        _BaseSettings.__init__(self, parent, self._window_title,
                               prev_name, create_cb)

        self.result_widgets = dict()
        for row, (has_none, key) in enumerate(self._result_keys):
            self.grid.addWidget(QtGui.QLabel(key.capitalize() + ":"))
            w = QtGui.QComboBox()
            self.grid.addWidget(w, row + 1, 1)
            if has_none:
                w.addItem("<None>")
            w.addItems(result_list)
            w.setEditable(True)
            if key in prev_settings:
                w.setEditText(prev_settings[key])
            self.result_widgets[key] = w
        self.add_buttons()