Exemple #1
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)

        # make a vertical layout for 'ourself'
        self.vBoxLayout = QVBoxLayout(self)

        # make a buttonBox
        self.buttonBox = QDialogButtonBox(self.buttons, parent=self)
        self.buttonBox.setObjectName('buttonBox')

        # put buttonBox below main content
        self.vBoxLayout.addWidget(self.buttonBox)

        allButtons = 'Ok Open Save Cancel Close Discard Apply Reset '\
                     'RestoreDefaults Help SaveAll Yes YesToAll No NoToAll '\
                     'Abort Retry Ignore'.split()
        for btn_name in allButtons:
            btn = self.buttonBox.button(getattr(QDialogButtonBox, btn_name))
            if btn:
                handler = getattr(self, 'on_buttonBox_%s_clicked' % btn_name,
                                  None)
                if not handler:
                    # pylint: disable=function-redefined
                    def handler(self=self, n=btn_name):
                        self.showError('on_buttonBox_%s_clicked not '
                                       'implemented!' % n)

                btn.clicked.connect(handler)
Exemple #2
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, 'panels/elog.ui')
        self.preview = QWebView(self)
        self.frame.layout().addWidget(self.preview)

        self.timer = QTimer(self,
                            singleShot=True,
                            timeout=self.on_timer_timeout)
        self.propdir = None

        self.menus = None
        self.bar = None

        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.setup.connect(self.on_client_connected)
        client.experiment.connect(self.on_client_experiment)

        self.activeGroup = QActionGroup(self)
        self.activeGroup.addAction(self.actionAddComment)
        self.activeGroup.addAction(self.actionAddRemark)
        self.activeGroup.addAction(self.actionAttachFile)
        self.activeGroup.addAction(self.actionNewSample)

        page = self.preview.page()
        if hasattr(page, 'setForwardUnsupportedContent'):  # QWebKit only
            page.setForwardUnsupportedContent(True)
            page.unsupportedContent.connect(self.on_page_unsupportedContent)
Exemple #3
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, 'panels/watchdog.ui')

        self._preconf_entries = {}
        self._preconf_enable = {}
        self._user_entries = {}

        # don't expose user defined conditions for now
        self.userWidget.hide()

        for tree in (self.preconfTree, self.userTree):
            tree.setColumnCount(11)
            tree.setHeaderLabels([
                'Enabled', 'Message', 'Condition', 'Only for setup',
                'Grace time', 'Precondition', 'Precondition time',
                'OK message', 'Script action', 'Warn action', 'OK action'
            ])

            if QT_VER == 4:
                tree.header().setResizeMode(QHeaderView.Interactive)
            else:
                tree.header().setSectionResizeMode(QHeaderView.Interactive)

        self.preconfTree.header().restoreState(self._preconf_headerstate)
        self.userTree.header().restoreState(self._user_headerstate)

        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.experiment.connect(self.on_client_experiment)
        client.setup.connect(self.on_client_setup)
Exemple #4
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, self.ui)

        pxr = decolor_logo(QPixmap("resources/nicos-logo-high.svg"), Qt.white)
        self.nicosLabel.setPixmap(pxr)

        self.runningCmdLabel.setIndent(10)
        self.idle_style = """QLabel { color: black; background: white;
        border-radius: 10px;};"""
        self.runningCmdLabel.setStyleSheet(self.idle_style)

        # if INSTRUMENT is defined add the logo/name of the instrument
        instrument = os.getenv('INSTRUMENT')
        if instrument:
            instrument = instrument.split('.')[-1]
            logo = decolor_logo(QPixmap('resources/%s-logo.svg' % instrument),
                                Qt.white)
            if logo.isNull():
                self.instrumentLabel.setText(instrument.upper())
            else:
                self.instrumentLabel.setPixmap(
                    logo.scaledToHeight(self.instrumentLabel.height(),
                                        Qt.SmoothTransformation))
        else:
            self.instrumentLabel.setText('')

        self.current_script = []
        client.processing.connect(self.on_client_processing)
        client.status.connect(self.on_client_status)
Exemple #5
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self,
               findResource('nicos_ess/gui/panels/ui_files/exp_panel.ui'))

        self.old_proposal_settings = ProposalSettings()
        self.new_proposal_settings = deepcopy(self.old_proposal_settings)

        self.samples_model = SamplesModel()
        self.samples_model.data_updated.connect(self.on_samples_changed)
        self.sampleTable.setModel(self.samples_model)
        self.sampleTable.horizontalHeader().setSectionResizeMode(
            QHeaderView.Interactive)

        self.applyWarningLabel.setStyleSheet('color: red')
        self.applyWarningLabel.setVisible(False)
        self.discardButton.setVisible(False)

        self._text_controls = (self.expTitle, self.users, self.localContacts,
                               self.proposalNum, self.proposalQuery)

        self.hide_samples = options.get('hide_sample', False)
        if self.hide_samples:
            self._hide_sample_info()

        self.initialise_connection_status_listeners()
Exemple #6
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, 'panels/expinfo.ui')
        for ch in self.findChildren(NicosWidget):
            ch.setClient(client)
        client.setup.connect(self.on_client_setup)
        client.initstatus.connect(self.on_client_initstatus)

        self.detLabel.setFormatCallback(
            lambda value, strvalue: ', '.join(sorted(value)))
        self.envLabel.setFormatCallback(
            lambda value, strvalue: ', '.join(sorted(value)))

        self._sample_panel = options.get('sample_panel', GenericSamplePanel)
        self._new_exp_panel = options.get('new_exp_panel')
        self._finish_exp_panel = options.get('finish_exp_panel')
        self._timeout = options.get('popup_proposal_after', 0)
        if self._timeout:
            self._proposal_popup_timer = QTimer(interval=self._timeout *
                                                3600000)
            self._proposal_popup_timer.setSingleShot(True)
            self._proposal_popup_timer.timeout.connect(
                self.on_proposal_popup_timer_timeout)
        else:
            self._proposal_popup_timer = None
Exemple #7
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, 'panels/watch.ui')

        self.watch_items = {}
        client.watch.connect(self.on_client_watch)
        client.initstatus.connect(self.on_client_initstatus)
Exemple #8
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/kws1/gui/sampleconf.ui'))
        self.sampleGroup.setEnabled(False)
        self.frame.setLayout(QVBoxLayout())

        menu = QMenu(self)
        menu.addAction(self.actionCopyAperture)
        menu.addAction(self.actionCopyDetOffset)
        menu.addAction(self.actionCopyThickness)
        menu.addAction(self.actionCopyTimeFactor)
        menu.addSeparator()
        menu.addAction(self.actionCopyAll)
        self.copyBtn.setMenu(menu)

        menu = QMenu(self)
        menu.addAction(self.actionEmpty)
        menu.addAction(self.actionGenerate)
        self.createBtn.setMenu(menu)

        self.configs = []
        self.dirty = False
        self.filename = None
        self.holder_info = options.get('holder_info', [])
        self.instrument = options.get('instrument', 'kws1')
Exemple #9
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/kws1/gui/protocol.ui'))

        self.firstEdit.setShadowText('default: all')
        self.lastEdit.setShadowText('default: all')
        self.fontBox.setValue(self.outText.font().pointSize())
Exemple #10
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, 'panels/setup_detenv.ui')

        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.setup.connect(self.on_client_connected)
Exemple #11
0
 def __init__(self, parent, client, options):
     Panel.__init__(self, parent, client, options)
     loadUi(self, self.uiName)
     for ch in self.findChildren(NicosWidget):
         ch.setClient(self.client)
     if self.client.viewonly:
         self.buttonBox.setStandardButtons(QDialogButtonBox.Close)
     else:
         self.buttonBox.setStandardButtons(QDialogButtonBox.Apply
                                           | QDialogButtonBox.Close)
Exemple #12
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, 'panels/commandline.ui')

        self.commandInput.history = self.cmdhistory
        self.commandInput.completion_callback = self.completeInput

        client.initstatus.connect(self.on_client_initstatus)
        client.mode.connect(self.on_client_mode)
        client.experiment.connect(self.on_client_experiment)
Exemple #13
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)

        self._logPath = 'log'

        loadUi(self, 'panels/logviewer.ui')

        # initialize date/time range to display logs from yesterday
        # (same time) to now
        self.dateTimeEditFrom.setDateTime(
            QDateTime.currentDateTime().addDays(-1))
        self.dateTimeEditTo.setDateTime(QDateTime.currentDateTime())
Exemple #14
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/pgaa/gui/panels/tomography.ui'))

        self.current_status = None
        self.run_color = QColor('#ffdddd')
        self.idle_color = parent.user_color

        client.connected.connect(self.on_client_connected)
        client.message.connect(self.on_client_message)
        client.status.connect(self.on_client_initstatus)
        client.mode.connect(self.on_client_mode)
Exemple #15
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, self.ui)
        self._finish_exp_panel = None

        # Additional dialog panel to pop up after FinishExperiment().
        self._finish_exp_panel = options.get('finish_exp_panel')

        self.finishButton.setEnabled(False)
        client.connected.connect(self.on_client_connected)
        client.disconnected.connect(self.on_client_disconnected)
        client.experiment.connect(self.on_experiment_changed)
Exemple #16
0
 def __init__(self, parent, client, options):
     Panel.__init__(self, parent, client, options)
     self._error_window = None
     if 'uifile' not in options:
         raise ConfigurationError('GenericPanels require at least an'
                                  ' `uifile` option.')
     loadUi(self, findResource(options['uifile']))
     if options.get('showmsg'):
         self.client.message.connect(self.on_client_message)
     if client.isconnected:
         self.on_client_connected()
     client.connected.connect(self.on_client_connected)
Exemple #17
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, 'panels/errpanel.ui')
        self.outView.setFullTimestamps(True)

        self.buttonBox.addButton('Clear', QDialogButtonBox.ResetRole)

        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.message.connect(self.on_client_message)
        client.experiment.connect(self.on_client_experiment)
Exemple #18
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/toftof/gui/safety.ui'))

        self.table.horizontalHeader().restoreState(self._headerstate)
        self.clear()

        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.setup.connect(self.on_client_connected)
        client.disconnected.connect(self.on_client_disconnected)
        client.cache.connect(self.on_client_cache)
Exemple #19
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/gui/plcpanel.ui'))
        self._curdev = None
        self._changed_pars = {}
        self._in_reread = False

        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.device.connect(self.on_client_device)

        self.controlBox.setEnabled(False)
Exemple #20
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/mira/gui/live.ui'))

        self._format = None
        self._runtime = 0
        self._no_direct_display = False
        self._range_active = False

        self.statusBar = QStatusBar(self)
        policy = self.statusBar.sizePolicy()
        policy.setVerticalPolicy(QSizePolicy.Fixed)
        self.statusBar.setSizePolicy(policy)
        self.statusBar.setSizeGripEnabled(False)
        self.layout().addWidget(self.statusBar)

        if CascadeWidget:
            self.widget = CascadeWidget(self)
            self.widget.setContextMenuPolicy(Qt.CustomContextMenu)
            self.widgetLayout.addWidget(self.widget)
        else:
            raise RuntimeError('The Cascade live widget is not available')

        self.rangeFrom = QDoubleSpinBox(self)
        self.rangeTo = QDoubleSpinBox(self)
        for ctrl in [self.rangeFrom, self.rangeTo]:
            ctrl.setRange(0, 100000000)
            ctrl.setEnabled(False)
            ctrl.setMaximumWidth(90)
            ctrl.setSizePolicy(
                QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
            ctrl.valueChanged.connect(self.on_rangeChanged)

        self.liveitem = QListWidgetItem('<Live>', self.fileList)
        self.liveitem.setData(32, '')
        self.liveitem.setData(33, '')

        self.splitter.setSizes([20, 80])
        self.splitter.restoreState(self.splitterstate)

        client.livedata.connect(self.on_client_livedata)
        client.liveparams.connect(self.on_client_liveparams)
        if client.isconnected:
            self.on_client_connected()
        client.connected.connect(self.on_client_connected)
        client.setup.connect(self.on_client_connected)

        self.actionLogScale.toggled.connect(self.widget.SetLog10)
        self.actionSelectChannels.triggered.connect(self.widget.showSumDlg)
        self.widget.customContextMenuRequested.connect(
            self.on_widget_customContextMenuRequested)
Exemple #21
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/gui/tunewavetable.ui'))

        self._dev = options.get('tabledev')
        measuremode = options.get('measuremode', 'nrse')
        if measuremode not in ['nrse', 'mieze']:
            measuremode = 'nrse'
        for i in range(self.measModeComboBox.count()):
            if measuremode == self.measModeComboBox.itemText(i):
                self.measModeComboBox.setCurrentIndex(i)
                break
        # access to the echotime device
        if not self._dev:
            raise ConfigurationError('TuneWaveTable panel: At least `tabledev`'
                                     ' is required.')

        self._header_labels = []
        self._available_tables = {}
        self._edit = None
        self._blocked_while_edit = [
            self.measModeComboBox, self.wavelengthComboBox,
            self.restorePushButton, self.savePushButton,
            self.refreshPushButton, self.deletePushButton
        ]

        self.tableWidget.installEventFilter(self)

        self.tableWidget.verticalHeader().setContextMenuPolicy(
            Qt.CustomContextMenu)

        self.measModeComboBox.currentIndexChanged.connect(self._fill_table)
        self.measModeComboBox.currentIndexChanged.connect(
            self._update_combo_boxes)
        self.wavelengthComboBox.currentIndexChanged.connect(self._fill_table)
        self.savePushButton.clicked.connect(self._save_current_table)
        self.refreshPushButton.clicked.connect(self._update_available_tables)
        self.tableWidget.verticalHeader()\
            .customContextMenuRequested.connect(
            self.on_tableWidget_customContextMenuRequested)
        self.tableWidget.cellActivated.connect(self._edit_cell)
        self.tableWidget.verticalHeader().sectionClicked.connect(
            self._stop_edit)
        self.tableWidget.horizontalHeader().sectionPressed.connect(
            self._stop_edit)
        self.tableWidget.setAlternatingRowColors(True)

        client.connected.connect(self.on_client_connected)
        client.device.connect(self.on_client_device)
        self._dev_available = False
Exemple #22
0
 def __init__(self, parent, client, options):
     Panel.__init__(self, parent, client, options)
     loadUi(self, findResource('nicos_mlz/reseda/gui/mieze_display.ui'))
     self.mywidgets = []
     self.foils = options.get('foils', [7, 6, 5, 0, 1, 2])
     self.columns = options.get('columns', 3)
     self.rows = options.get('rows', 2)
     for foil, x, y in zip(
             self.foils, self.rows * list(range(self.columns)),
             sum([self.columns * [i] for i in range(self.rows)], [])):
         foilwidget = FoilWidget(name='Foil %d' % foil, parent=self)
         self.mywidgets.append(foilwidget)
         self.gridLayout.addWidget(foilwidget, y, x)
     self.client.cache.connect(self.on_client_cache)
     self.client.connected.connect(self.on_client_connected)
Exemple #23
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, self.ui)
        self.propdbInfo.setVisible(False)
        self._orig_proposal = None
        self._new_exp_panel = None
        self._finish_exp_panel = None

        # Additional dialog panels to pop up after NewExperiment() and before
        # FinishExperiment() respectively.
        self._new_exp_panel = options.get('new_exp_panel')
        self._finish_exp_panel = options.get('finish_exp_panel')

        client.connected.connect(self.on_client_connected)
        client.setup.connect(self.on_client_connected)
        client.experiment.connect(self.on_client_experiment)
Exemple #24
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)

        if not simpleapi or not mpy:
            raise RuntimeError('Mantid modules could not be imported. '
                               'Ensure Mantid is installed and PYTHONPATH is '
                               'set to contain the Mantid /bin directory.')

        hbox = QHBoxLayout(self)
        hbox.setContentsMargins(0, 0, 0, 0)
        self.setLayout(hbox)

        self._watcher = MantidDeviceWatcher(self)
        self._widget = None
        self._workspace = None
        self._current_idf = None
Exemple #25
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, findResource('nicos_mlz/pgaa/gui/panels/pgai.ui'))
        w = self.widget.widget
        self.pointAdded.connect(w.pointAdded)
        self.pointTable.cellActivated.connect(w.positionActivated)
        self.pointTable.cellClicked.connect(w.positionActivated)
        self.pointTable.cellEntered.connect(w.positionActivated)
        self.pointTable.cellPressed.connect(w.positionActivated)
        self.pointTable.verticalHeader().sectionClicked.connect(
            lambda row: w.positionActivated(row, 0))
        self.newPointButton.clicked.connect(self.newPoint)
        self.buttonBox.button(QDialogButtonBox.SaveAll).setText('Run')
        self.pointTable.itemChanged.connect(self.modifyPoint)
        self.pointModified.connect(w.pointModified)
        self.pointTable.setItemDelegate(PositionDelegate())
        self.pointTable.pointRemove.connect(w.pointRemove)
        self.buttonBox.accepted.connect(self.runScript)
        self.pointTable.valueChanged.connect(self.cellValueModified)
        self.sampleShape.currentIndexChanged[str].connect(w.sampleShapeChanged)
        self.sampleShape.currentIndexChanged[str].connect(
            self.sampleShapeChanged)
        self.dimValue1.valueChanged.connect(w.dim1Changed)
        self.dimValue2.valueChanged.connect(w.dim2Changed)
        self.dimValue3.valueChanged.connect(w.dim3Changed)

        self.dimValue1.valueChanged.connect(self.sampleSizeChanged)
        self.dimValue2.valueChanged.connect(self.sampleSizeChanged)
        self.dimValue3.valueChanged.connect(self.sampleSizeChanged)

        self.volumeSize.valueChanged.connect(self.sampleSizeChanged)
        self.volumeSize.valueChanged.connect(w.cubeSizeChanged)
        self.volumeDistance.valueChanged.connect(self.sampleSizeChanged)
        self.pointTable.horizontalHeader().sectionClicked.connect(
            self.sortOrderChanged)

        w.dim1Changed(self.dimValue1.value())
        w.dim2Changed(self.dimValue2.value())
        w.dim3Changed(self.dimValue3.value())

        self.fileName.hide()
        self.fileNameSelect.hide()
        self.fileName.editingFinished.connect(self.loadPointsFromFile)
        self.fileNameSelect.clicked.connect(self.selectFileName)

        self.sampleShapeChanged(self.sampleShape.currentText())
Exemple #26
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        self.setClient(client)
        NicosWidget.__init__(self)
        client.connected.connect(self.on_client_connected)
        self.destroyed.connect(self.on_destroyed)
        if parent:
            self.buttonBox.rejected.connect(parent.close)
        else:
            self.buttonBox.rejected.connect(self.close)

        self.speed.valueChanged['int'].connect(self.recalculate)
        self.waveLength.valueChanged['double'].connect(self.recalculate)
        self.ratio.valueChanged['int'].connect(self.recalculate)
        self.slits.currentIndexChanged.connect(self.recalculate)
        self.buttonBox.clicked.connect(self.createScript)
        self.slits.setDisabled(self.client.user_level != ADMIN)
Exemple #27
0
 def eventFilter(self, receiver, event):
     """Event filter for the table widget to stop cell editing on enter
     and return keys."""
     if receiver is self.tableWidget and self._edit is not None \
         and event.type() in [QEvent.KeyPress] \
             and event.key() in [Qt.Key_Enter, Qt.Key_Return]:
         self._stop_edit()
         return True
     return Panel.eventFilter(self, receiver, event)
Exemple #28
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, self.ui)

        self.window = parent
        self.mapping = {}
        self.current_cmdlet = None
        self.expertmode = self.mainwindow.expertmode

        # collect values of all cmdlets that have been added
        # so that the common fields carry over to the next cmdlet
        self.value_collection = {}

        self.commandInput.history = self.cmdhistory
        self.commandInput.completion_callback = self.completeInput
        self.console = None

        client.initstatus.connect(self.on_client_initstatus)
        client.mode.connect(self.on_client_mode)
        client.simresult.connect(self.on_client_simresult)

        modules = options.get('modules', [])
        for module in modules:
            importString(module)  # should register cmdlets

        for cmdlet in all_cmdlets:
            action = QAction(cmdlet.name, self)

            def callback(on, cmdlet=cmdlet):
                self.selectCmdlet(cmdlet)

            action.triggered.connect(callback)
            self.mapping.setdefault(cmdlet.category, []).append(action)

        for category in all_categories[::-1]:
            if category not in self.mapping:
                continue
            toolbtn = QToolButton(self)
            toolbtn.setText(category)
            toolbtn.setPopupMode(QToolButton.InstantPopup)
            menu = QMenu(self)
            menu.addActions(self.mapping[category])
            toolbtn.setMenu(menu)
            self.btnLayout.insertWidget(1, toolbtn)
Exemple #29
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        loadUi(self, self.ui)

        self.commandInput.scrollWidget = self.outView
        self.grepPanel.hide()
        self.grepText.scrollWidget = self.outView
        self.actionLabel.hide()
        self.outView.setActionLabel(self.actionLabel)
        self.commandInput.history = self.cmdhistory
        self.commandInput.completion_callback = self.completeInput
        self.grepNoMatch.setVisible(False)
        self.actionAllowLineWrap.setChecked(self.mainwindow.allowoutputlinewrap)

        client.connected.connect(self.on_client_connected)
        client.message.connect(self.on_client_message)
        client.simmessage.connect(self.on_client_simmessage)
        client.initstatus.connect(self.on_client_initstatus)
        client.mode.connect(self.on_client_mode)
        client.experiment.connect(self.on_client_experiment)

        self.outView.setContextMenuPolicy(Qt.CustomContextMenu)

        self.menu = QMenu('&Output', self)
        self.menu.addAction(self.actionCopy)
        self.menu.addAction(self.actionGrep)
        self.menu.addSeparator()
        self.menu.addAction(self.actionSave)
        self.menu.addAction(self.actionPrint)
        self.menu.addSeparator()
        self.menu.addAction(self.actionAllowLineWrap)
        self.on_actionAllowLineWrap_triggered(
            self.mainwindow.allowoutputlinewrap)

        self.hasinput = bool(options.get('hasinput', True))
        self.inputFrame.setVisible(self.hasinput)
        self.hasmenu = bool(options.get('hasmenu', True))
        if options.get('fulltime', False):
            self.outView.setFullTimestamps(True)
        watermark = options.get('watermark', '')
        if watermark:
            watermark = findResource(watermark)
            if path.isfile(watermark):
                self.outView.setBackgroundImage(watermark)
Exemple #30
0
    def __init__(self, parent, client, options):
        Panel.__init__(self, parent, client, options)
        BaseHistoryWindow.__init__(self)

        self.actionClose.setVisible(False)

        self.statusBar = QStatusBar(self)
        policy = self.statusBar.sizePolicy()
        policy.setVerticalPolicy(QSizePolicy.Fixed)
        self.statusBar.setSizePolicy(policy)
        self.statusBar.setSizeGripEnabled(False)
        self.layout().addWidget(self.statusBar)

        self._disconnected_since = 0

        self.splitter.setSizes([20, 80])
        self.splitter.restoreState(self.splitterstate)
        self.client.cache.connect(self.newvalue_callback)
        self.client.disconnected.connect(self.on_client_disconnected)
        self.client.connected.connect(self.on_client_connected)