def on_install(self, editor): super().on_install(editor) self.action = QAction(editor) self.action.setText(_("Calculate PIC offsets")) self.action.setIcon(QIcon.fromTheme('accessories-calculator')) self.action.setShortcut('Ctrl+Shift+O') self.action.setToolTip(_('Compute the PIC offset of the fields in the ' 'selected text')) editor.add_action(self.action, sub_menu='COBOL') self.action.triggered.connect(self._compute_offsets)
def __init__(self): QObject.__init__(self) Mode.__init__(self) self._previous_cursor_start = -1 self._previous_cursor_end = -1 self._definition = None self._deco = None self._pending = False self.action_goto = QAction(_("Go to assignments"), self) self.action_goto.setShortcut('F7') self.action_goto.triggered.connect(self.request_goto) self.word_clicked.connect(self.request_goto) self._timer = DelayJobRunner(delay=200)
def __init__(self, parent=None): super(InteractiveConsole, self).__init__(parent) self.panels = PanelsManager(self) self.decorations = TextDecorationsManager(self) from pyqode.core.panels import SearchAndReplacePanel self.panels.append(SearchAndReplacePanel(), SearchAndReplacePanel.Position.TOP) self._stdout_col = QColor("#404040") self._app_msg_col = QColor("#4040FF") self._stdin_col = QColor("#22AA22") self._stderr_col = QColor("#FF0000") self._write_app_messages = True self._process_name = '' self.process = None self._args = None self._usr_buffer = "" self._clear_on_start = True self._merge_outputs = False self._running = False self._writer = self.write self._user_stop = False font = "monospace" if sys.platform == "win32": font = "Consolas" elif sys.platform == "darwin": font = 'Monaco' self._font_family = font self.setFont(QFont(font, 10)) self.setReadOnly(True) self._mask_user_input = False action = QAction('Copy', self) action.setShortcut(QKeySequence.Copy) action.triggered.connect(self.copy) self.add_action(action) action = QAction('Paste', self) action.setShortcut(QKeySequence.Paste) action.triggered.connect(self.paste) self.add_action(action)