class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(505, 355)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.edit_filter = PromptLineEdit(Form)
        self.edit_filter.setObjectName("edit_filter")
        self.verticalLayout.addWidget(self.edit_filter)
        self.table = QtWidgets.QTableWidget(Form)
        self.table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.table.setObjectName("table")
        self.table.setColumnCount(2)
        self.table.setRowCount(0)
        item = QtWidgets.QTableWidgetItem()
        self.table.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table.setHorizontalHeaderItem(1, item)
        self.table.horizontalHeader().setCascadingSectionResizes(False)
        self.table.verticalHeader().setVisible(False)
        self.verticalLayout.addWidget(self.table)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.edit_filter.setToolTip(_translate("Form", "Filter actions by name or by shortcut"))
        self.table.setToolTip(_translate("Form", "The list of application shortcuts"))
        item = self.table.horizontalHeaderItem(0)
        item.setText(_translate("Form", "Action"))
        item = self.table.horizontalHeaderItem(1)
        item.setText(_translate("Form", "Shortcut"))
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.console = InteractiveConsole(Form)
        self.console.setObjectName("console")
        self.verticalLayout.addWidget(self.console)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.edit_command = PromptLineEdit(Form)
        self.edit_command.setObjectName("edit_command")
        self.horizontalLayout.addWidget(self.edit_command)
        self.bt_run = QtWidgets.QToolButton(Form)
        self.bt_run.setText("")
        icon = QtGui.QIcon.fromTheme("system-run")
        self.bt_run.setIcon(icon)
        self.bt_run.setObjectName("bt_run")
        self.horizontalLayout.addWidget(self.bt_run)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.console.setToolTip(_translate("Form", "Command output"))
        self.edit_command.setToolTip(_translate("Form", "Type a command to execute"))
        self.bt_run.setToolTip(_translate("Form", "Run command (keep pressed to access the terminal history)"))
Example #3
0
    def activate(self):
        self._widget = QtWidgets.QWidget()
        self._outline = OutlineTreeWidget(self.main_window)
        self._outline.setMinimumWidth(200)
        self._outline.sync_with_editor_changed.connect(self._on_sync_changed)
        self._edit_filter = PromptLineEdit(self._widget, 'Filter by name')
        self._edit_filter.textChanged.connect(self._on_filter_text_changed)
        self._edit_filter.button.setIcon(QtGui.QIcon.fromTheme('edit-clear'))
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self._outline)

        self._widget_controls = QtWidgets.QWidget(self._widget)
        controls_layout = QtWidgets.QHBoxLayout()
        controls_layout.addWidget(self._edit_filter)
        controls_layout.setContentsMargins(0, 0, 0, 0)

        self.bt_lock = QtWidgets.QToolButton(self._widget)
        self.bt_lock.setCheckable(True)
        self.bt_lock.setChecked(not self._outline.sync_with_editor)
        self.bt_lock.setToolTip(_('Lock view'))
        self.bt_lock.toggled.connect(self._on_sync_toggled)
        self.bt_lock.setIcon(api.special_icons.object_locked())
        controls_layout.addWidget(self.bt_lock)

        self._widget_controls.setLayout(controls_layout)
        layout.addWidget(self._widget_controls)
        layout.setContentsMargins(3, 3, 3, 3)
        self._widget.setLayout(layout)
        dock = api.window.add_dock_widget(self._widget, _('Outline'),
                                          special_icons.class_icon(),
                                          QtCore.Qt.RightDockWidgetArea)
        dock.hide()
        self.main_window.current_tab_changed.connect(
            self._on_current_tab_changed)
        self._outline.set_editor(None)
Example #4
0
class Ui_Frame(object):
    def setupUi(self, Frame):
        Frame.setObjectName("Frame")
        Frame.resize(698, 274)
        Frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        Frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.verticalLayout = QtWidgets.QVBoxLayout(Frame)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setContentsMargins(-1, 0, -1, -1)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.bt_infos = QtWidgets.QToolButton(Frame)
        icon = QtGui.QIcon.fromTheme("dialog-information")
        self.bt_infos.setIcon(icon)
        self.bt_infos.setObjectName("bt_infos")
        self.horizontalLayout.addWidget(self.bt_infos)
        self.lineEdit = PromptLineEdit(Frame)
        self.lineEdit.setMinimumSize(QtCore.QSize(400, 0))
        self.lineEdit.setObjectName("lineEdit")
        self.horizontalLayout.addWidget(self.lineEdit)
        self.bt_close = QtWidgets.QToolButton(Frame)
        icon = QtGui.QIcon.fromTheme("window-close")
        self.bt_close.setIcon(icon)
        self.bt_close.setObjectName("bt_close")
        self.horizontalLayout.addWidget(self.bt_close)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.treeWidget = QtWidgets.QTreeWidget(Frame)
        self.treeWidget.setMaximumSize(QtCore.QSize(16777215, 500))
        self.treeWidget.setHeaderHidden(True)
        self.treeWidget.setObjectName("treeWidget")
        self.treeWidget.headerItem().setText(0, "1")
        self.verticalLayout.addWidget(self.treeWidget)
        self.cb_non_project_files = QtWidgets.QCheckBox(Frame)
        self.cb_non_project_files.setObjectName("cb_non_project_files")
        self.verticalLayout.addWidget(self.cb_non_project_files)

        self.retranslateUi(Frame)
        QtCore.QMetaObject.connectSlotsByName(Frame)

    def retranslateUi(self, Frame):
        _translate = QtCore.QCoreApplication.translate
        Frame.setWindowTitle(_translate("Frame", "Frame"))
        self.bt_infos.setToolTip(_translate("Frame", "Help"))
        self.bt_infos.setText(_translate("Frame", "..."))
        self.bt_close.setToolTip(_translate("Frame", "Close"))
        self.bt_close.setText(_translate("Frame", "..."))
        self.cb_non_project_files.setText(
            _translate("Frame", "Include non-project files (Shift+Enter)"))
Example #5
0
class Ui_Frame(object):
    def setupUi(self, Frame):
        Frame.setObjectName("Frame")
        Frame.resize(698, 274)
        Frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        Frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.verticalLayout = QtWidgets.QVBoxLayout(Frame)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setContentsMargins(-1, 0, -1, -1)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.bt_infos = QtWidgets.QToolButton(Frame)
        icon = QtGui.QIcon.fromTheme("dialog-information")
        self.bt_infos.setIcon(icon)
        self.bt_infos.setObjectName("bt_infos")
        self.horizontalLayout.addWidget(self.bt_infos)
        self.lineEdit = PromptLineEdit(Frame)
        self.lineEdit.setMinimumSize(QtCore.QSize(400, 0))
        self.lineEdit.setObjectName("lineEdit")
        self.horizontalLayout.addWidget(self.lineEdit)
        self.bt_close = QtWidgets.QToolButton(Frame)
        icon = QtGui.QIcon.fromTheme("window-close")
        self.bt_close.setIcon(icon)
        self.bt_close.setObjectName("bt_close")
        self.horizontalLayout.addWidget(self.bt_close)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.treeWidget = QtWidgets.QTreeWidget(Frame)
        self.treeWidget.setMaximumSize(QtCore.QSize(16777215, 500))
        self.treeWidget.setHeaderHidden(True)
        self.treeWidget.setObjectName("treeWidget")
        self.treeWidget.headerItem().setText(0, "1")
        self.verticalLayout.addWidget(self.treeWidget)
        self.cb_non_project_files = QtWidgets.QCheckBox(Frame)
        self.cb_non_project_files.setObjectName("cb_non_project_files")
        self.verticalLayout.addWidget(self.cb_non_project_files)

        self.retranslateUi(Frame)
        QtCore.QMetaObject.connectSlotsByName(Frame)

    def retranslateUi(self, Frame):
        _translate = QtCore.QCoreApplication.translate
        Frame.setWindowTitle(_translate("Frame", "Frame"))
        self.bt_infos.setToolTip(_translate("Frame", "Help"))
        self.bt_infos.setText(_translate("Frame", "..."))
        self.bt_close.setToolTip(_translate("Frame", "Close"))
        self.bt_close.setText(_translate("Frame", "..."))
        self.cb_non_project_files.setText(_translate("Frame", "Include non-project files (Shift+Enter)"))
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.console = InteractiveConsole(Form)
        self.console.setObjectName("console")
        self.verticalLayout.addWidget(self.console)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.edit_command = PromptLineEdit(Form)
        self.edit_command.setObjectName("edit_command")
        self.horizontalLayout.addWidget(self.edit_command)
        self.bt_run = QtWidgets.QToolButton(Form)
        self.bt_run.setText("")
        icon = QtGui.QIcon.fromTheme("system-run")
        self.bt_run.setIcon(icon)
        self.bt_run.setObjectName("bt_run")
        self.horizontalLayout.addWidget(self.bt_run)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
Example #7
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(505, 355)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.edit_filter = PromptLineEdit(Form)
        self.edit_filter.setObjectName("edit_filter")
        self.verticalLayout.addWidget(self.edit_filter)
        self.table = QtWidgets.QTableWidget(Form)
        self.table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.table.setObjectName("table")
        self.table.setColumnCount(2)
        self.table.setRowCount(0)
        item = QtWidgets.QTableWidgetItem()
        self.table.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table.setHorizontalHeaderItem(1, item)
        self.table.horizontalHeader().setCascadingSectionResizes(False)
        self.table.verticalHeader().setVisible(False)
        self.verticalLayout.addWidget(self.table)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.edit_filter.setToolTip(
            _translate("Form", "Filter actions by name or by shortcut"))
        self.table.setToolTip(
            _translate("Form", "The list of application shortcuts"))
        item = self.table.horizontalHeaderItem(0)
        item.setText(_translate("Form", "Action"))
        item = self.table.horizontalHeaderItem(1)
        item.setText(_translate("Form", "Shortcut"))
Example #8
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(505, 355)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.edit_filter = PromptLineEdit(Form)
        self.edit_filter.setObjectName("edit_filter")
        self.verticalLayout.addWidget(self.edit_filter)
        self.table = QtWidgets.QTableWidget(Form)
        self.table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.table.setObjectName("table")
        self.table.setColumnCount(2)
        self.table.setRowCount(0)
        item = QtWidgets.QTableWidgetItem()
        self.table.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table.setHorizontalHeaderItem(1, item)
        self.table.horizontalHeader().setCascadingSectionResizes(False)
        self.table.verticalHeader().setVisible(False)
        self.verticalLayout.addWidget(self.table)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(505, 355)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.edit_filter = PromptLineEdit(Form)
        self.edit_filter.setObjectName("edit_filter")
        self.verticalLayout.addWidget(self.edit_filter)
        self.table = QtWidgets.QTableWidget(Form)
        self.table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.table.setObjectName("table")
        self.table.setColumnCount(2)
        self.table.setRowCount(0)
        item = QtWidgets.QTableWidgetItem()
        self.table.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table.setHorizontalHeaderItem(1, item)
        self.table.horizontalHeader().setCascadingSectionResizes(False)
        self.table.verticalHeader().setVisible(False)
        self.verticalLayout.addWidget(self.table)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
Example #10
0
    def setupUi(self, SearchPanel):
        SearchPanel.setObjectName("SearchPanel")
        SearchPanel.resize(884, 90)
        SearchPanel.setStyleSheet("")
        self.verticalLayout = QtWidgets.QVBoxLayout(SearchPanel)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.frame = QtWidgets.QFrame(SearchPanel)
        self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame)
        self.verticalLayout_2.setContentsMargins(9, 9, 9, 9)
        self.verticalLayout_2.setSpacing(9)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.widgetSearch = QtWidgets.QWidget(self.frame)
        self.widgetSearch.setObjectName("widgetSearch")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.widgetSearch)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.labelSearch = QtWidgets.QLabel(self.widgetSearch)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.labelSearch.sizePolicy().hasHeightForWidth())
        self.labelSearch.setSizePolicy(sizePolicy)
        self.labelSearch.setMinimumSize(QtCore.QSize(0, 0))
        self.labelSearch.setMaximumSize(QtCore.QSize(18, 18))
        self.labelSearch.setText("")
        self.labelSearch.setPixmap(
            QtGui.QPixmap(":/pycode-icons/rc/edit-find.png"))
        self.labelSearch.setScaledContents(True)
        self.labelSearch.setObjectName("labelSearch")
        self.horizontalLayout.addWidget(self.labelSearch)
        self.lineEditSearch = PromptLineEdit(self.widgetSearch)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.lineEditSearch.sizePolicy().hasHeightForWidth())
        self.lineEditSearch.setSizePolicy(sizePolicy)
        self.lineEditSearch.setMinimumSize(QtCore.QSize(200, 0))
        self.lineEditSearch.setObjectName("lineEditSearch")
        self.horizontalLayout.addWidget(self.lineEditSearch)
        self.toolButtonPrevious = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonPrevious.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/pyqode_icons/rc/go-up.png"),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonPrevious.setIcon(icon)
        self.toolButtonPrevious.setObjectName("toolButtonPrevious")
        self.horizontalLayout.addWidget(self.toolButtonPrevious)
        self.toolButtonNext = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonNext.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/pycode-icons/rc/go-down.png"),
                        QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonNext.setIcon(icon1)
        self.toolButtonNext.setObjectName("toolButtonNext")
        self.horizontalLayout.addWidget(self.toolButtonNext)
        self.checkBoxRegex = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxRegex.setObjectName("checkBoxRegex")
        self.horizontalLayout.addWidget(self.checkBoxRegex)
        self.checkBoxCase = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxCase.setStyleSheet("")
        self.checkBoxCase.setObjectName("checkBoxCase")
        self.horizontalLayout.addWidget(self.checkBoxCase)
        self.checkBoxWholeWords = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxWholeWords.setObjectName("checkBoxWholeWords")
        self.horizontalLayout.addWidget(self.checkBoxWholeWords)
        self.checkBoxInSelection = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxInSelection.setObjectName("checkBoxInSelection")
        self.horizontalLayout.addWidget(self.checkBoxInSelection)
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.labelMatches = QtWidgets.QLabel(self.widgetSearch)
        self.labelMatches.setObjectName("labelMatches")
        self.horizontalLayout.addWidget(self.labelMatches)
        self.toolButtonClose = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonClose.setText("")
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(":/pycode-icons/rc/close.png"),
                        QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonClose.setIcon(icon2)
        self.toolButtonClose.setObjectName("toolButtonClose")
        self.horizontalLayout.addWidget(self.toolButtonClose)
        self.verticalLayout_2.addWidget(self.widgetSearch)
        self.widgetReplace = QtWidgets.QWidget(self.frame)
        self.widgetReplace.setObjectName("widgetReplace")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widgetReplace)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.labelReplace = QtWidgets.QLabel(self.widgetReplace)
        self.labelReplace.setMaximumSize(QtCore.QSize(18, 18))
        self.labelReplace.setText("")
        self.labelReplace.setPixmap(
            QtGui.QPixmap(":/pycode-icons/rc/edit-find-replace.png"))
        self.labelReplace.setScaledContents(True)
        self.labelReplace.setObjectName("labelReplace")
        self.horizontalLayout_2.addWidget(self.labelReplace)
        self.lineEditReplace = PromptLineEdit(self.widgetReplace)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.lineEditReplace.sizePolicy().hasHeightForWidth())
        self.lineEditReplace.setSizePolicy(sizePolicy)
        self.lineEditReplace.setMinimumSize(QtCore.QSize(200, 0))
        self.lineEditReplace.setObjectName("lineEditReplace")
        self.horizontalLayout_2.addWidget(self.lineEditReplace)
        self.toolButtonReplace = QtWidgets.QToolButton(self.widgetReplace)
        self.toolButtonReplace.setObjectName("toolButtonReplace")
        self.horizontalLayout_2.addWidget(self.toolButtonReplace)
        self.toolButtonReplaceAll = QtWidgets.QToolButton(self.widgetReplace)
        self.toolButtonReplaceAll.setObjectName("toolButtonReplaceAll")
        self.horizontalLayout_2.addWidget(self.toolButtonReplaceAll)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.lineEditReplace.raise_()
        self.toolButtonReplace.raise_()
        self.toolButtonReplaceAll.raise_()
        self.labelReplace.raise_()
        self.verticalLayout_2.addWidget(self.widgetReplace)
        self.verticalLayout.addWidget(self.frame)
        self.actionSearch = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("edit-find")
        self.actionSearch.setIcon(icon)
        self.actionSearch.setIconVisibleInMenu(True)
        self.actionSearch.setObjectName("actionSearch")
        self.actionActionSearchAndReplace = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("edit-find-replace")
        self.actionActionSearchAndReplace.setIcon(icon)
        self.actionActionSearchAndReplace.setIconVisibleInMenu(True)
        self.actionActionSearchAndReplace.setObjectName(
            "actionActionSearchAndReplace")
        self.actionFindNext = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("go-down")
        self.actionFindNext.setIcon(icon)
        self.actionFindNext.setIconVisibleInMenu(True)
        self.actionFindNext.setObjectName("actionFindNext")
        self.actionFindPrevious = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("go-up")
        self.actionFindPrevious.setIcon(icon)
        self.actionFindPrevious.setIconVisibleInMenu(True)
        self.actionFindPrevious.setObjectName("actionFindPrevious")

        self.retranslateUi(SearchPanel)
        QtCore.QMetaObject.connectSlotsByName(SearchPanel)
        SearchPanel.setTabOrder(self.lineEditSearch, self.lineEditReplace)
        SearchPanel.setTabOrder(self.lineEditReplace, self.toolButtonPrevious)
        SearchPanel.setTabOrder(self.toolButtonPrevious, self.toolButtonNext)
        SearchPanel.setTabOrder(self.toolButtonNext, self.checkBoxCase)
        SearchPanel.setTabOrder(self.checkBoxCase, self.checkBoxWholeWords)
        SearchPanel.setTabOrder(self.checkBoxWholeWords,
                                self.toolButtonReplace)
        SearchPanel.setTabOrder(self.toolButtonReplace,
                                self.toolButtonReplaceAll)
        SearchPanel.setTabOrder(self.toolButtonReplaceAll,
                                self.toolButtonClose)
    def setupUi(self, SearchPanel):
        SearchPanel.setObjectName("SearchPanel")
        SearchPanel.resize(884, 90)
        SearchPanel.setStyleSheet("")
        self.verticalLayout = QtWidgets.QVBoxLayout(SearchPanel)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.frame = QtWidgets.QFrame(SearchPanel)
        self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame)
        self.verticalLayout_2.setContentsMargins(9, 9, 9, 9)
        self.verticalLayout_2.setSpacing(9)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.widgetSearch = QtWidgets.QWidget(self.frame)
        self.widgetSearch.setObjectName("widgetSearch")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.widgetSearch)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.labelSearch = QtWidgets.QLabel(self.widgetSearch)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.labelSearch.sizePolicy().hasHeightForWidth())
        self.labelSearch.setSizePolicy(sizePolicy)
        self.labelSearch.setMinimumSize(QtCore.QSize(0, 0))
        self.labelSearch.setMaximumSize(QtCore.QSize(18, 18))
        self.labelSearch.setText("")
        self.labelSearch.setPixmap(QtGui.QPixmap(":/pycode-icons/rc/edit-find.png"))
        self.labelSearch.setScaledContents(True)
        self.labelSearch.setObjectName("labelSearch")
        self.horizontalLayout.addWidget(self.labelSearch)
        self.lineEditSearch = PromptLineEdit(self.widgetSearch)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.lineEditSearch.sizePolicy().hasHeightForWidth())
        self.lineEditSearch.setSizePolicy(sizePolicy)
        self.lineEditSearch.setMinimumSize(QtCore.QSize(200, 0))
        self.lineEditSearch.setObjectName("lineEditSearch")
        self.horizontalLayout.addWidget(self.lineEditSearch)
        self.toolButtonPrevious = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonPrevious.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/pyqode_icons/rc/go-up.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonPrevious.setIcon(icon)
        self.toolButtonPrevious.setObjectName("toolButtonPrevious")
        self.horizontalLayout.addWidget(self.toolButtonPrevious)
        self.toolButtonNext = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonNext.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/pycode-icons/rc/go-down.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonNext.setIcon(icon1)
        self.toolButtonNext.setObjectName("toolButtonNext")
        self.horizontalLayout.addWidget(self.toolButtonNext)
        self.checkBoxRegex = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxRegex.setObjectName("checkBoxRegex")
        self.horizontalLayout.addWidget(self.checkBoxRegex)
        self.checkBoxCase = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxCase.setStyleSheet("")
        self.checkBoxCase.setObjectName("checkBoxCase")
        self.horizontalLayout.addWidget(self.checkBoxCase)
        self.checkBoxWholeWords = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxWholeWords.setObjectName("checkBoxWholeWords")
        self.horizontalLayout.addWidget(self.checkBoxWholeWords)
        self.checkBoxInSelection = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxInSelection.setObjectName("checkBoxInSelection")
        self.horizontalLayout.addWidget(self.checkBoxInSelection)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.labelMatches = QtWidgets.QLabel(self.widgetSearch)
        self.labelMatches.setObjectName("labelMatches")
        self.horizontalLayout.addWidget(self.labelMatches)
        self.toolButtonClose = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonClose.setText("")
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(":/pycode-icons/rc/close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonClose.setIcon(icon2)
        self.toolButtonClose.setObjectName("toolButtonClose")
        self.horizontalLayout.addWidget(self.toolButtonClose)
        self.verticalLayout_2.addWidget(self.widgetSearch)
        self.widgetReplace = QtWidgets.QWidget(self.frame)
        self.widgetReplace.setObjectName("widgetReplace")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widgetReplace)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.labelReplace = QtWidgets.QLabel(self.widgetReplace)
        self.labelReplace.setMaximumSize(QtCore.QSize(18, 18))
        self.labelReplace.setText("")
        self.labelReplace.setPixmap(QtGui.QPixmap(":/pycode-icons/rc/edit-find-replace.png"))
        self.labelReplace.setScaledContents(True)
        self.labelReplace.setObjectName("labelReplace")
        self.horizontalLayout_2.addWidget(self.labelReplace)
        self.lineEditReplace = PromptLineEdit(self.widgetReplace)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.lineEditReplace.sizePolicy().hasHeightForWidth())
        self.lineEditReplace.setSizePolicy(sizePolicy)
        self.lineEditReplace.setMinimumSize(QtCore.QSize(200, 0))
        self.lineEditReplace.setObjectName("lineEditReplace")
        self.horizontalLayout_2.addWidget(self.lineEditReplace)
        self.toolButtonReplace = QtWidgets.QToolButton(self.widgetReplace)
        self.toolButtonReplace.setObjectName("toolButtonReplace")
        self.horizontalLayout_2.addWidget(self.toolButtonReplace)
        self.toolButtonReplaceAll = QtWidgets.QToolButton(self.widgetReplace)
        self.toolButtonReplaceAll.setObjectName("toolButtonReplaceAll")
        self.horizontalLayout_2.addWidget(self.toolButtonReplaceAll)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.lineEditReplace.raise_()
        self.toolButtonReplace.raise_()
        self.toolButtonReplaceAll.raise_()
        self.labelReplace.raise_()
        self.verticalLayout_2.addWidget(self.widgetReplace)
        self.verticalLayout.addWidget(self.frame)
        self.actionSearch = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("edit-find")
        self.actionSearch.setIcon(icon)
        self.actionSearch.setIconVisibleInMenu(True)
        self.actionSearch.setObjectName("actionSearch")
        self.actionActionSearchAndReplace = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("edit-find-replace")
        self.actionActionSearchAndReplace.setIcon(icon)
        self.actionActionSearchAndReplace.setIconVisibleInMenu(True)
        self.actionActionSearchAndReplace.setObjectName("actionActionSearchAndReplace")
        self.actionFindNext = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("go-down")
        self.actionFindNext.setIcon(icon)
        self.actionFindNext.setIconVisibleInMenu(True)
        self.actionFindNext.setObjectName("actionFindNext")
        self.actionFindPrevious = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("go-up")
        self.actionFindPrevious.setIcon(icon)
        self.actionFindPrevious.setIconVisibleInMenu(True)
        self.actionFindPrevious.setObjectName("actionFindPrevious")

        self.retranslateUi(SearchPanel)
        QtCore.QMetaObject.connectSlotsByName(SearchPanel)
        SearchPanel.setTabOrder(self.lineEditSearch, self.lineEditReplace)
        SearchPanel.setTabOrder(self.lineEditReplace, self.toolButtonPrevious)
        SearchPanel.setTabOrder(self.toolButtonPrevious, self.toolButtonNext)
        SearchPanel.setTabOrder(self.toolButtonNext, self.checkBoxCase)
        SearchPanel.setTabOrder(self.checkBoxCase, self.checkBoxWholeWords)
        SearchPanel.setTabOrder(self.checkBoxWholeWords, self.toolButtonReplace)
        SearchPanel.setTabOrder(self.toolButtonReplace, self.toolButtonReplaceAll)
        SearchPanel.setTabOrder(self.toolButtonReplaceAll, self.toolButtonClose)
Example #12
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(678, 390)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.groupBox = QtWidgets.QGroupBox(Form)
        self.groupBox.setObjectName("groupBox")
        self.gridLayout = QtWidgets.QGridLayout(self.groupBox)
        self.gridLayout.setSizeConstraint(
            QtWidgets.QLayout.SetDefaultConstraint)
        self.gridLayout.setObjectName("gridLayout")
        self.table_mimes = QtWidgets.QTableWidget(self.groupBox)
        self.table_mimes.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.table_mimes.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.table_mimes.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.table_mimes.setShowGrid(True)
        self.table_mimes.setCornerButtonEnabled(False)
        self.table_mimes.setObjectName("table_mimes")
        self.table_mimes.setColumnCount(2)
        self.table_mimes.setRowCount(1)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setVerticalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setHorizontalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setItem(0, 0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setItem(0, 1, item)
        self.table_mimes.horizontalHeader().setVisible(True)
        self.table_mimes.horizontalHeader().setCascadingSectionResizes(True)
        self.table_mimes.horizontalHeader().setDefaultSectionSize(200)
        self.table_mimes.horizontalHeader().setHighlightSections(False)
        self.table_mimes.horizontalHeader().setStretchLastSection(True)
        self.table_mimes.verticalHeader().setVisible(False)
        self.table_mimes.verticalHeader().setHighlightSections(False)
        self.gridLayout.addWidget(self.table_mimes, 1, 0, 1, 1)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.label = QtWidgets.QLabel(self.groupBox)
        self.label.setObjectName("label")
        self.horizontalLayout_2.addWidget(self.label)
        self.edit_mime_extensions = QtWidgets.QLineEdit(self.groupBox)
        self.edit_mime_extensions.setObjectName("edit_mime_extensions")
        self.horizontalLayout_2.addWidget(self.edit_mime_extensions)
        self.gridLayout.addLayout(self.horizontalLayout_2, 2, 0, 1, 1)
        self.edit_filter = PromptLineEdit(self.groupBox)
        self.edit_filter.setObjectName("edit_filter")
        self.gridLayout.addWidget(self.edit_filter, 0, 0, 1, 1)
        self.verticalLayout.addWidget(self.groupBox)
        self.groupBox_2 = QtWidgets.QGroupBox(Form)
        self.groupBox_2.setObjectName("groupBox_2")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_2)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.edit_ignored = QtWidgets.QLineEdit(self.groupBox_2)
        self.edit_ignored.setObjectName("edit_ignored")
        self.gridLayout_2.addWidget(self.edit_ignored, 0, 0, 1, 1)
        self.verticalLayout.addWidget(self.groupBox_2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
Example #13
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(678, 390)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.groupBox = QtWidgets.QGroupBox(Form)
        self.groupBox.setObjectName("groupBox")
        self.gridLayout = QtWidgets.QGridLayout(self.groupBox)
        self.gridLayout.setSizeConstraint(
            QtWidgets.QLayout.SetDefaultConstraint)
        self.gridLayout.setObjectName("gridLayout")
        self.table_mimes = QtWidgets.QTableWidget(self.groupBox)
        self.table_mimes.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.table_mimes.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.table_mimes.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.table_mimes.setShowGrid(True)
        self.table_mimes.setCornerButtonEnabled(False)
        self.table_mimes.setObjectName("table_mimes")
        self.table_mimes.setColumnCount(2)
        self.table_mimes.setRowCount(1)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setVerticalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setHorizontalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setItem(0, 0, item)
        item = QtWidgets.QTableWidgetItem()
        self.table_mimes.setItem(0, 1, item)
        self.table_mimes.horizontalHeader().setVisible(True)
        self.table_mimes.horizontalHeader().setCascadingSectionResizes(True)
        self.table_mimes.horizontalHeader().setDefaultSectionSize(200)
        self.table_mimes.horizontalHeader().setHighlightSections(False)
        self.table_mimes.horizontalHeader().setStretchLastSection(True)
        self.table_mimes.verticalHeader().setVisible(False)
        self.table_mimes.verticalHeader().setHighlightSections(False)
        self.gridLayout.addWidget(self.table_mimes, 1, 0, 1, 1)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.label = QtWidgets.QLabel(self.groupBox)
        self.label.setObjectName("label")
        self.horizontalLayout_2.addWidget(self.label)
        self.edit_mime_extensions = QtWidgets.QLineEdit(self.groupBox)
        self.edit_mime_extensions.setObjectName("edit_mime_extensions")
        self.horizontalLayout_2.addWidget(self.edit_mime_extensions)
        self.gridLayout.addLayout(self.horizontalLayout_2, 2, 0, 1, 1)
        self.edit_filter = PromptLineEdit(self.groupBox)
        self.edit_filter.setObjectName("edit_filter")
        self.gridLayout.addWidget(self.edit_filter, 0, 0, 1, 1)
        self.verticalLayout.addWidget(self.groupBox)
        self.groupBox_2 = QtWidgets.QGroupBox(Form)
        self.groupBox_2.setObjectName("groupBox_2")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_2)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.edit_ignored = QtWidgets.QLineEdit(self.groupBox_2)
        self.edit_ignored.setObjectName("edit_ignored")
        self.gridLayout_2.addWidget(self.edit_ignored, 0, 0, 1, 1)
        self.verticalLayout.addWidget(self.groupBox_2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.groupBox.setTitle(_translate("Form", "Recognized mimetypes"))
        self.table_mimes.setToolTip(
            _translate("Form", "The list of mimetypes and their handler"))
        item = self.table_mimes.verticalHeaderItem(0)
        item.setText(_translate("Form", "0"))
        item = self.table_mimes.horizontalHeaderItem(0)
        item.setText(_translate("Form", "Mimetype"))
        item = self.table_mimes.horizontalHeaderItem(1)
        item.setText(_translate("Form", "Handler"))
        __sortingEnabled = self.table_mimes.isSortingEnabled()
        self.table_mimes.setSortingEnabled(False)
        item = self.table_mimes.item(0, 0)
        item.setText(_translate("Form", "text/x-python"))
        item = self.table_mimes.item(0, 1)
        item.setText(_translate("Form", "PyCodeEdit"))
        self.table_mimes.setSortingEnabled(__sortingEnabled)
        self.label.setText(_translate("Form", "Patterns:"))
        self.edit_mime_extensions.setToolTip(
            _translate("Form", "Mimetype patterns (separated by ;)"))
        self.groupBox_2.setTitle(
            _translate("Form", "Ignored files and directories"))
        self.edit_ignored.setToolTip(
            _translate(
                "Form",
                "<html><head/><body><p>The list of ignore patterns (each pattern must be separated by a semi-colon ;)</p></body></html>"
            ))
Example #14
0
class Ui_SearchPanel(object):
    def setupUi(self, SearchPanel):
        SearchPanel.setObjectName("SearchPanel")
        SearchPanel.resize(884, 90)
        SearchPanel.setStyleSheet("")
        self.verticalLayout = QtWidgets.QVBoxLayout(SearchPanel)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.frame = QtWidgets.QFrame(SearchPanel)
        self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame)
        self.verticalLayout_2.setContentsMargins(9, 9, 9, 9)
        self.verticalLayout_2.setSpacing(9)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.widgetSearch = QtWidgets.QWidget(self.frame)
        self.widgetSearch.setObjectName("widgetSearch")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.widgetSearch)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.labelSearch = QtWidgets.QLabel(self.widgetSearch)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.labelSearch.sizePolicy().hasHeightForWidth())
        self.labelSearch.setSizePolicy(sizePolicy)
        self.labelSearch.setMinimumSize(QtCore.QSize(0, 0))
        self.labelSearch.setMaximumSize(QtCore.QSize(18, 18))
        self.labelSearch.setText("")
        self.labelSearch.setPixmap(QtGui.QPixmap(":/pycode-icons/rc/edit-find.png"))
        self.labelSearch.setScaledContents(True)
        self.labelSearch.setObjectName("labelSearch")
        self.horizontalLayout.addWidget(self.labelSearch)
        self.lineEditSearch = PromptLineEdit(self.widgetSearch)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.lineEditSearch.sizePolicy().hasHeightForWidth())
        self.lineEditSearch.setSizePolicy(sizePolicy)
        self.lineEditSearch.setMinimumSize(QtCore.QSize(200, 0))
        self.lineEditSearch.setObjectName("lineEditSearch")
        self.horizontalLayout.addWidget(self.lineEditSearch)
        self.toolButtonPrevious = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonPrevious.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/pyqode_icons/rc/go-up.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonPrevious.setIcon(icon)
        self.toolButtonPrevious.setObjectName("toolButtonPrevious")
        self.horizontalLayout.addWidget(self.toolButtonPrevious)
        self.toolButtonNext = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonNext.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/pycode-icons/rc/go-down.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonNext.setIcon(icon1)
        self.toolButtonNext.setObjectName("toolButtonNext")
        self.horizontalLayout.addWidget(self.toolButtonNext)
        self.checkBoxRegex = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxRegex.setObjectName("checkBoxRegex")
        self.horizontalLayout.addWidget(self.checkBoxRegex)
        self.checkBoxCase = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxCase.setStyleSheet("")
        self.checkBoxCase.setObjectName("checkBoxCase")
        self.horizontalLayout.addWidget(self.checkBoxCase)
        self.checkBoxWholeWords = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxWholeWords.setObjectName("checkBoxWholeWords")
        self.horizontalLayout.addWidget(self.checkBoxWholeWords)
        self.checkBoxInSelection = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxInSelection.setObjectName("checkBoxInSelection")
        self.horizontalLayout.addWidget(self.checkBoxInSelection)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.labelMatches = QtWidgets.QLabel(self.widgetSearch)
        self.labelMatches.setObjectName("labelMatches")
        self.horizontalLayout.addWidget(self.labelMatches)
        self.toolButtonClose = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonClose.setText("")
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(":/pycode-icons/rc/close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonClose.setIcon(icon2)
        self.toolButtonClose.setObjectName("toolButtonClose")
        self.horizontalLayout.addWidget(self.toolButtonClose)
        self.verticalLayout_2.addWidget(self.widgetSearch)
        self.widgetReplace = QtWidgets.QWidget(self.frame)
        self.widgetReplace.setObjectName("widgetReplace")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widgetReplace)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.labelReplace = QtWidgets.QLabel(self.widgetReplace)
        self.labelReplace.setMaximumSize(QtCore.QSize(18, 18))
        self.labelReplace.setText("")
        self.labelReplace.setPixmap(QtGui.QPixmap(":/pycode-icons/rc/edit-find-replace.png"))
        self.labelReplace.setScaledContents(True)
        self.labelReplace.setObjectName("labelReplace")
        self.horizontalLayout_2.addWidget(self.labelReplace)
        self.lineEditReplace = PromptLineEdit(self.widgetReplace)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.lineEditReplace.sizePolicy().hasHeightForWidth())
        self.lineEditReplace.setSizePolicy(sizePolicy)
        self.lineEditReplace.setMinimumSize(QtCore.QSize(200, 0))
        self.lineEditReplace.setObjectName("lineEditReplace")
        self.horizontalLayout_2.addWidget(self.lineEditReplace)
        self.toolButtonReplace = QtWidgets.QToolButton(self.widgetReplace)
        self.toolButtonReplace.setObjectName("toolButtonReplace")
        self.horizontalLayout_2.addWidget(self.toolButtonReplace)
        self.toolButtonReplaceAll = QtWidgets.QToolButton(self.widgetReplace)
        self.toolButtonReplaceAll.setObjectName("toolButtonReplaceAll")
        self.horizontalLayout_2.addWidget(self.toolButtonReplaceAll)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.lineEditReplace.raise_()
        self.toolButtonReplace.raise_()
        self.toolButtonReplaceAll.raise_()
        self.labelReplace.raise_()
        self.verticalLayout_2.addWidget(self.widgetReplace)
        self.verticalLayout.addWidget(self.frame)
        self.actionSearch = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("edit-find")
        self.actionSearch.setIcon(icon)
        self.actionSearch.setIconVisibleInMenu(True)
        self.actionSearch.setObjectName("actionSearch")
        self.actionActionSearchAndReplace = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("edit-find-replace")
        self.actionActionSearchAndReplace.setIcon(icon)
        self.actionActionSearchAndReplace.setIconVisibleInMenu(True)
        self.actionActionSearchAndReplace.setObjectName("actionActionSearchAndReplace")
        self.actionFindNext = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("go-down")
        self.actionFindNext.setIcon(icon)
        self.actionFindNext.setIconVisibleInMenu(True)
        self.actionFindNext.setObjectName("actionFindNext")
        self.actionFindPrevious = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("go-up")
        self.actionFindPrevious.setIcon(icon)
        self.actionFindPrevious.setIconVisibleInMenu(True)
        self.actionFindPrevious.setObjectName("actionFindPrevious")

        self.retranslateUi(SearchPanel)
        QtCore.QMetaObject.connectSlotsByName(SearchPanel)
        SearchPanel.setTabOrder(self.lineEditSearch, self.lineEditReplace)
        SearchPanel.setTabOrder(self.lineEditReplace, self.toolButtonPrevious)
        SearchPanel.setTabOrder(self.toolButtonPrevious, self.toolButtonNext)
        SearchPanel.setTabOrder(self.toolButtonNext, self.checkBoxCase)
        SearchPanel.setTabOrder(self.checkBoxCase, self.checkBoxWholeWords)
        SearchPanel.setTabOrder(self.checkBoxWholeWords, self.toolButtonReplace)
        SearchPanel.setTabOrder(self.toolButtonReplace, self.toolButtonReplaceAll)
        SearchPanel.setTabOrder(self.toolButtonReplaceAll, self.toolButtonClose)

    def retranslateUi(self, SearchPanel):
        _translate = QtCore.QCoreApplication.translate
        SearchPanel.setWindowTitle(_translate("SearchPanel", "Form"))
        self.lineEditSearch.setToolTip(_translate("SearchPanel", "Search term"))
        self.toolButtonPrevious.setToolTip(_translate("SearchPanel", "Select previous occurence"))
        self.toolButtonNext.setToolTip(_translate("SearchPanel", "Select next occurence"))
        self.checkBoxRegex.setToolTip(_translate("SearchPanel", "Use a regular expression for search occurences"))
        self.checkBoxRegex.setText(_translate("SearchPanel", "Regex"))
        self.checkBoxCase.setToolTip(_translate("SearchPanel", "Enable case sensitive search"))
        self.checkBoxCase.setText(_translate("SearchPanel", "Match case"))
        self.checkBoxWholeWords.setToolTip(_translate("SearchPanel", "Search for whole words only"))
        self.checkBoxWholeWords.setText(_translate("SearchPanel", "Whole words"))
        self.checkBoxInSelection.setText(_translate("SearchPanel", "In Selection"))
        self.labelMatches.setText(_translate("SearchPanel", "0 matches"))
        self.lineEditReplace.setToolTip(_translate("SearchPanel", "Replacement text"))
        self.toolButtonReplace.setToolTip(_translate("SearchPanel", "Replace current occurence"))
        self.toolButtonReplace.setText(_translate("SearchPanel", "Replace"))
        self.toolButtonReplaceAll.setToolTip(_translate("SearchPanel", "Replace all occurences"))
        self.toolButtonReplaceAll.setText(_translate("SearchPanel", "Replace All"))
        self.actionSearch.setText(_translate("SearchPanel", "Search"))
        self.actionSearch.setToolTip(_translate("SearchPanel", "Show the search panel"))
        self.actionSearch.setShortcut(_translate("SearchPanel", "Ctrl+F"))
        self.actionActionSearchAndReplace.setText(_translate("SearchPanel", "Search and replace"))
        self.actionActionSearchAndReplace.setToolTip(_translate("SearchPanel", "Show the search and replace panel"))
        self.actionActionSearchAndReplace.setShortcut(_translate("SearchPanel", "Ctrl+R"))
        self.actionFindNext.setText(_translate("SearchPanel", "Find next"))
        self.actionFindNext.setToolTip(_translate("SearchPanel", "Find the next occurrence (downward)"))
        self.actionFindNext.setShortcut(_translate("SearchPanel", "F3"))
        self.actionFindPrevious.setText(_translate("SearchPanel", "Find previous"))
        self.actionFindPrevious.setToolTip(_translate("SearchPanel", "Find previous occurrence (upward)"))
        self.actionFindPrevious.setShortcut(_translate("SearchPanel", "Shift+F3"))
Example #15
0
class Ui_SearchPanel(object):
    def setupUi(self, SearchPanel):
        SearchPanel.setObjectName("SearchPanel")
        SearchPanel.resize(884, 90)
        SearchPanel.setStyleSheet("")
        self.verticalLayout = QtWidgets.QVBoxLayout(SearchPanel)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.frame = QtWidgets.QFrame(SearchPanel)
        self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame)
        self.verticalLayout_2.setContentsMargins(9, 9, 9, 9)
        self.verticalLayout_2.setSpacing(9)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.widgetSearch = QtWidgets.QWidget(self.frame)
        self.widgetSearch.setObjectName("widgetSearch")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.widgetSearch)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.labelSearch = QtWidgets.QLabel(self.widgetSearch)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.labelSearch.sizePolicy().hasHeightForWidth())
        self.labelSearch.setSizePolicy(sizePolicy)
        self.labelSearch.setMinimumSize(QtCore.QSize(0, 0))
        self.labelSearch.setMaximumSize(QtCore.QSize(18, 18))
        self.labelSearch.setText("")
        self.labelSearch.setPixmap(
            QtGui.QPixmap(":/pycode-icons/rc/edit-find.png"))
        self.labelSearch.setScaledContents(True)
        self.labelSearch.setObjectName("labelSearch")
        self.horizontalLayout.addWidget(self.labelSearch)
        self.lineEditSearch = PromptLineEdit(self.widgetSearch)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.lineEditSearch.sizePolicy().hasHeightForWidth())
        self.lineEditSearch.setSizePolicy(sizePolicy)
        self.lineEditSearch.setMinimumSize(QtCore.QSize(200, 0))
        self.lineEditSearch.setObjectName("lineEditSearch")
        self.horizontalLayout.addWidget(self.lineEditSearch)
        self.toolButtonPrevious = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonPrevious.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/pyqode_icons/rc/go-up.png"),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonPrevious.setIcon(icon)
        self.toolButtonPrevious.setObjectName("toolButtonPrevious")
        self.horizontalLayout.addWidget(self.toolButtonPrevious)
        self.toolButtonNext = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonNext.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/pycode-icons/rc/go-down.png"),
                        QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonNext.setIcon(icon1)
        self.toolButtonNext.setObjectName("toolButtonNext")
        self.horizontalLayout.addWidget(self.toolButtonNext)
        self.checkBoxRegex = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxRegex.setObjectName("checkBoxRegex")
        self.horizontalLayout.addWidget(self.checkBoxRegex)
        self.checkBoxCase = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxCase.setStyleSheet("")
        self.checkBoxCase.setObjectName("checkBoxCase")
        self.horizontalLayout.addWidget(self.checkBoxCase)
        self.checkBoxWholeWords = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxWholeWords.setObjectName("checkBoxWholeWords")
        self.horizontalLayout.addWidget(self.checkBoxWholeWords)
        self.checkBoxInSelection = QtWidgets.QCheckBox(self.widgetSearch)
        self.checkBoxInSelection.setObjectName("checkBoxInSelection")
        self.horizontalLayout.addWidget(self.checkBoxInSelection)
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.labelMatches = QtWidgets.QLabel(self.widgetSearch)
        self.labelMatches.setObjectName("labelMatches")
        self.horizontalLayout.addWidget(self.labelMatches)
        self.toolButtonClose = QtWidgets.QToolButton(self.widgetSearch)
        self.toolButtonClose.setText("")
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(":/pycode-icons/rc/close.png"),
                        QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButtonClose.setIcon(icon2)
        self.toolButtonClose.setObjectName("toolButtonClose")
        self.horizontalLayout.addWidget(self.toolButtonClose)
        self.verticalLayout_2.addWidget(self.widgetSearch)
        self.widgetReplace = QtWidgets.QWidget(self.frame)
        self.widgetReplace.setObjectName("widgetReplace")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widgetReplace)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.labelReplace = QtWidgets.QLabel(self.widgetReplace)
        self.labelReplace.setMaximumSize(QtCore.QSize(18, 18))
        self.labelReplace.setText("")
        self.labelReplace.setPixmap(
            QtGui.QPixmap(":/pycode-icons/rc/edit-find-replace.png"))
        self.labelReplace.setScaledContents(True)
        self.labelReplace.setObjectName("labelReplace")
        self.horizontalLayout_2.addWidget(self.labelReplace)
        self.lineEditReplace = PromptLineEdit(self.widgetReplace)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.lineEditReplace.sizePolicy().hasHeightForWidth())
        self.lineEditReplace.setSizePolicy(sizePolicy)
        self.lineEditReplace.setMinimumSize(QtCore.QSize(200, 0))
        self.lineEditReplace.setObjectName("lineEditReplace")
        self.horizontalLayout_2.addWidget(self.lineEditReplace)
        self.toolButtonReplace = QtWidgets.QToolButton(self.widgetReplace)
        self.toolButtonReplace.setObjectName("toolButtonReplace")
        self.horizontalLayout_2.addWidget(self.toolButtonReplace)
        self.toolButtonReplaceAll = QtWidgets.QToolButton(self.widgetReplace)
        self.toolButtonReplaceAll.setObjectName("toolButtonReplaceAll")
        self.horizontalLayout_2.addWidget(self.toolButtonReplaceAll)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.lineEditReplace.raise_()
        self.toolButtonReplace.raise_()
        self.toolButtonReplaceAll.raise_()
        self.labelReplace.raise_()
        self.verticalLayout_2.addWidget(self.widgetReplace)
        self.verticalLayout.addWidget(self.frame)
        self.actionSearch = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("edit-find")
        self.actionSearch.setIcon(icon)
        self.actionSearch.setIconVisibleInMenu(True)
        self.actionSearch.setObjectName("actionSearch")
        self.actionActionSearchAndReplace = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("edit-find-replace")
        self.actionActionSearchAndReplace.setIcon(icon)
        self.actionActionSearchAndReplace.setIconVisibleInMenu(True)
        self.actionActionSearchAndReplace.setObjectName(
            "actionActionSearchAndReplace")
        self.actionFindNext = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("go-down")
        self.actionFindNext.setIcon(icon)
        self.actionFindNext.setIconVisibleInMenu(True)
        self.actionFindNext.setObjectName("actionFindNext")
        self.actionFindPrevious = QtWidgets.QAction(SearchPanel)
        icon = QtGui.QIcon.fromTheme("go-up")
        self.actionFindPrevious.setIcon(icon)
        self.actionFindPrevious.setIconVisibleInMenu(True)
        self.actionFindPrevious.setObjectName("actionFindPrevious")

        self.retranslateUi(SearchPanel)
        QtCore.QMetaObject.connectSlotsByName(SearchPanel)
        SearchPanel.setTabOrder(self.lineEditSearch, self.lineEditReplace)
        SearchPanel.setTabOrder(self.lineEditReplace, self.toolButtonPrevious)
        SearchPanel.setTabOrder(self.toolButtonPrevious, self.toolButtonNext)
        SearchPanel.setTabOrder(self.toolButtonNext, self.checkBoxCase)
        SearchPanel.setTabOrder(self.checkBoxCase, self.checkBoxWholeWords)
        SearchPanel.setTabOrder(self.checkBoxWholeWords,
                                self.toolButtonReplace)
        SearchPanel.setTabOrder(self.toolButtonReplace,
                                self.toolButtonReplaceAll)
        SearchPanel.setTabOrder(self.toolButtonReplaceAll,
                                self.toolButtonClose)

    def retranslateUi(self, SearchPanel):
        _translate = QtCore.QCoreApplication.translate
        SearchPanel.setWindowTitle(_translate("SearchPanel", "Form"))
        self.lineEditSearch.setToolTip(_translate("SearchPanel",
                                                  "Search term"))
        self.toolButtonPrevious.setToolTip(
            _translate("SearchPanel", "Select previous occurence"))
        self.toolButtonNext.setToolTip(
            _translate("SearchPanel", "Select next occurence"))
        self.checkBoxRegex.setToolTip(
            _translate("SearchPanel",
                       "Use a regular expression for search occurences"))
        self.checkBoxRegex.setText(_translate("SearchPanel", "Regex"))
        self.checkBoxCase.setToolTip(
            _translate("SearchPanel", "Enable case sensitive search"))
        self.checkBoxCase.setText(_translate("SearchPanel", "Match case"))
        self.checkBoxWholeWords.setToolTip(
            _translate("SearchPanel", "Search for whole words only"))
        self.checkBoxWholeWords.setText(
            _translate("SearchPanel", "Whole words"))
        self.checkBoxInSelection.setText(
            _translate("SearchPanel", "In Selection"))
        self.labelMatches.setText(_translate("SearchPanel", "0 matches"))
        self.lineEditReplace.setToolTip(
            _translate("SearchPanel", "Replacement text"))
        self.toolButtonReplace.setToolTip(
            _translate("SearchPanel", "Replace current occurence"))
        self.toolButtonReplace.setText(_translate("SearchPanel", "Replace"))
        self.toolButtonReplaceAll.setToolTip(
            _translate("SearchPanel", "Replace all occurences"))
        self.toolButtonReplaceAll.setText(
            _translate("SearchPanel", "Replace All"))
        self.actionSearch.setText(_translate("SearchPanel", "Search"))
        self.actionSearch.setToolTip(
            _translate("SearchPanel", "Show the search panel"))
        self.actionSearch.setShortcut(_translate("SearchPanel", "Ctrl+F"))
        self.actionActionSearchAndReplace.setText(
            _translate("SearchPanel", "Search and replace"))
        self.actionActionSearchAndReplace.setToolTip(
            _translate("SearchPanel", "Show the search and replace panel"))
        self.actionActionSearchAndReplace.setShortcut(
            _translate("SearchPanel", "Ctrl+R"))
        self.actionFindNext.setText(_translate("SearchPanel", "Find next"))
        self.actionFindNext.setToolTip(
            _translate("SearchPanel", "Find the next occurrence (downward)"))
        self.actionFindNext.setShortcut(_translate("SearchPanel", "F3"))
        self.actionFindPrevious.setText(
            _translate("SearchPanel", "Find previous"))
        self.actionFindPrevious.setToolTip(
            _translate("SearchPanel", "Find previous occurrence (upward)"))
        self.actionFindPrevious.setShortcut(
            _translate("SearchPanel", "Shift+F3"))
Example #16
0
class DocumentOutline(plugins.WorkspacePlugin):
    """
    Shows the outline of the current editor
    """
    preferred_position = 1

    def activate(self):
        self._widget = QtWidgets.QWidget()
        self._outline = OutlineTreeWidget(self.main_window)
        self._outline.setMinimumWidth(200)
        self._outline.sync_with_editor_changed.connect(self._on_sync_changed)
        self._edit_filter = PromptLineEdit(self._widget, 'Filter by name')
        self._edit_filter.textChanged.connect(self._on_filter_text_changed)
        self._edit_filter.button.setIcon(QtGui.QIcon.fromTheme('edit-clear'))
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self._outline)

        self._widget_controls = QtWidgets.QWidget(self._widget)
        controls_layout = QtWidgets.QHBoxLayout()
        controls_layout.addWidget(self._edit_filter)
        controls_layout.setContentsMargins(0, 0, 0, 0)

        self.bt_lock = QtWidgets.QToolButton(self._widget)
        self.bt_lock.setCheckable(True)
        self.bt_lock.setChecked(not self._outline.sync_with_editor)
        self.bt_lock.setToolTip(_('Lock view'))
        self.bt_lock.toggled.connect(self._on_sync_toggled)
        self.bt_lock.setIcon(api.special_icons.object_locked())
        controls_layout.addWidget(self.bt_lock)

        self._widget_controls.setLayout(controls_layout)
        layout.addWidget(self._widget_controls)
        layout.setContentsMargins(3, 3, 3, 3)
        self._widget.setLayout(layout)
        dock = api.window.add_dock_widget(self._widget, _('Outline'),
                                          special_icons.class_icon(),
                                          QtCore.Qt.RightDockWidgetArea)
        dock.hide()
        self.main_window.current_tab_changed.connect(
            self._on_current_tab_changed)
        self._outline.set_editor(None)

    def _on_current_tab_changed(self, tab):
        if isinstance(tab, CodeEdit):
            self._outline.set_editor(tab)
        else:
            self._outline.set_editor(None)

    def _on_filter_text_changed(self):
        text = self._edit_filter.text()
        items = self._outline.findItems(
            text, QtCore.Qt.MatchContains | QtCore.Qt.MatchRecursive)
        for i in range(self._outline.topLevelItemCount()):
            self._hide_recursively(self._outline.topLevelItem(i), text != '')

        for item in items:
            item.setHidden(False)
            parent = item.parent()
            while parent:
                parent.setHidden(False)
                parent = parent.parent()

    def _hide_recursively(self, top, hide):
        top.setHidden(hide)
        for i in range(top.childCount()):
            child = top.child(i)
            self._hide_recursively(child, hide)

    def _on_sync_changed(self, sync):
        self.bt_lock.setChecked(not sync)

    def _on_sync_toggled(self, toggled):
        with api.utils.block_signals(self.bt_lock):
            self.bt_lock.setIcon(api.special_icons.object_unlocked(
            ) if toggled else api.special_icons.object_locked())
            self._outline.sync_with_editor = not toggled
            self.bt_lock.setToolTip(
                _('Unlock view') if toggled else _('Lock view'))