def __init__(self): Panel.__init__(self, dynamic=True) self.job_runner = DelayJobRunner(delay=500) Ui_SearchPanel.__init__(self) self.setupUi(self) self.toolButtonClose.clicked.connect(self.on_close) self.actionSearch.triggered.connect(self.on_search) self.actionActionSearchAndReplace.triggered.connect( self.on_search_and_replace) self.lineEditReplace.prompt_text = _(' Replace') #: Occurrences counter self.cpt_occurences = 0 self._previous_stylesheet = "" self._separator = None self._decorations = [] self._occurrences = [] self._current_occurrence_index = 0 self._bg = None self._fg = None self._update_buttons(txt="") self.lineEditSearch.installEventFilter(self) self.lineEditReplace.installEventFilter(self) self._init_actions() self._init_style() self.checkBoxRegex.stateChanged.connect( self.checkBoxWholeWords.setDisabled)
def __init__(self): Panel.__init__(self) self._markers = [] self._icons = {} self._previous_line = -1 self.scrollable = True self._job_runner = DelayJobRunner(delay=100) self.setMouseTracking(True) self._to_remove = []
def __init__(self, worker, delay=500, show_tooltip=True): """ :param worker: The process function or class to call remotely. :param delay: The delay used before running the analysis process when trigger is set to :class:pyqode.core.modes.CheckerTriggers` :param show_tooltip: Specify if a tooltip must be displayed when the mouse is over a checker message decoration. """ Mode.__init__(self) QtCore.QObject.__init__(self) # max number of messages to keep good performances self.limit = 200 self._job_runner = DelayJobRunner(delay=delay) self._messages = [] self._worker = worker self._mutex = QtCore.QMutex() self._show_tooltip = show_tooltip self._pending_msg = [] self._finished = True
def __init__(self): Panel.__init__(self) self.job_runner = DelayJobRunner(delay=500) Ui_SearchPanel.__init__(self) self.setupUi(self) self.lineEditReplace.prompt_text = ' Replace' #: Occurrences counter self.cpt_occurences = 0 self._previous_stylesheet = "" self._separator = None self._decorations = [] self._occurrences = [] self._current_occurrence_index = -1 self._bg = None self._fg = None self._update_buttons(txt="") self.lineEditSearch.installEventFilter(self) self.lineEditReplace.installEventFilter(self) self._init_actions() self._init_style() self.checkBoxRegex.stateChanged.connect( self.checkBoxWholeWords.setDisabled)
def __init__(self): Mode.__init__(self) QtCore.QObject.__init__(self) self._current_completion = "" # use to display a waiting cursor if completion provider takes too much # time self._job_runner = DelayJobRunner(delay=1000) self._tooltips = {} self._cursor_line = -1 self._cancel_next = False self._request_cnt = 0 self._last_completion_prefix = "" self._trigger_key = None self._trigger_len = None self._trigger_symbols = None self._show_tooltips = None self._case_sensitive = None self._data = None self._completer = None self._col = 0 self._skip_next_backspace_released = False self._init_settings()
def __init__(self, parent=None, create_default_actions=True): """ :param parent: Parent widget :param create_default_actions: True to create the default context menu actions (copy, paste, edit) """ super(CodeEdit, self).__init__(parent) self.clones = [] self._default_font_size = 10 self._backend = BackendManager(self) self._file = FileManager(self) self._modes = ModesManager(self) self._panels = PanelsManager(self) self._decorations = TextDecorationsManager(self) self.document().modificationChanged.connect(self._emit_dirty_changed) self._word_separators = [ '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '+', '{', '}', '|', ':', '"', "'", "<", ">", "?", ",", ".", "/", ";", '[', ']', '\\', '\n', '\t', '=', '-', ' ' ] self._save_on_focus_out = False self._use_spaces_instead_of_tabs = True self._whitespaces_foreground = None self._sel_background = None self._show_whitespaces = False self._foreground = None self._sel_foreground = None self._tab_length = 4 self._zoom_level = 0 self._font_size = 10 self._background = None QtGui.QFontDatabase.addApplicationFont( ':/fonts/rc/SourceCodePro-Regular.ttf') QtGui.QFontDatabase.addApplicationFont( ':/fonts/rc/SourceCodePro-Bold.ttf') self._font_family = self._DEFAULT_FONT self._mimetypes = [] # Flags/Working variables self._last_mouse_pos = QtCore.QPoint(0, 0) self._modified_lines = set() self._cleaning = False self._visible_blocks = [] self._tooltips_runner = DelayJobRunner(delay=700) self._prev_tooltip_block_nbr = -1 self._original_text = "" self._dirty = False # setup context menu self._actions = [] self._menus = [] if create_default_actions: self._init_actions() self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.customContextMenuRequested.connect(self._show_context_menu) self._mnu = None # bug with PySide (github #63) # init settings and styles from global settings/style modules self._init_settings() self._init_style() # connect slots self.textChanged.connect(self._on_text_changed) self.blockCountChanged.connect(self.update) self.cursorPositionChanged.connect(self.update) self.selectionChanged.connect(self.update) self.setMouseTracking(True) self.setCenterOnScroll(True) self.setLineWrapMode(self.NoWrap)