Skip to content
Permalink
Browse files

Merge pull request #5757 from slarosa/pyconsole_ui_improvements

[pyqgis-console][ui] move find text tools to toolbar widget
  • Loading branch information
slarosa committed Nov 29, 2017
2 parents de3aa0c + 77f5959 commit e8213b8e41233708534d86a41c01eafe7d884a66
Showing with 15 additions and 14 deletions.
  1. +15 −14 python/console/console.py
@@ -433,20 +433,18 @@ def __init__(self, parent=None):
placeHolderTxt = QCoreApplication.translate("PythonConsole", "Enter text to find...")

self.lineEditFind.setPlaceholderText(placeHolderTxt)
self.findNextButton = QToolButton()
self.toolBarFindText = QToolBar()
self.toolBarFindText.setIconSize(icon_size)
self.findNextButton = QAction(self)
self.findNextButton.setEnabled(False)
toolTipfindNext = QCoreApplication.translate("PythonConsole", "Find Next")
self.findNextButton.setToolTip(toolTipfindNext)
self.findNextButton.setIcon(QgsApplication.getThemeIcon("console/iconSearchNextEditorConsole.png"))
self.findNextButton.setIconSize(QSize(24, 24))
self.findNextButton.setAutoRaise(True)
self.findPrevButton = QToolButton()
self.findPrevButton = QAction(self)
self.findPrevButton.setEnabled(False)
toolTipfindPrev = QCoreApplication.translate("PythonConsole", "Find Previous")
self.findPrevButton.setToolTip(toolTipfindPrev)
self.findPrevButton.setIcon(QgsApplication.getThemeIcon("console/iconSearchPrevEditorConsole.png"))
self.findPrevButton.setIconSize(QSize(24, 24))
self.findPrevButton.setAutoRaise(True)
self.caseSensitive = QCheckBox()
caseSensTr = QCoreApplication.translate("PythonConsole", "Case Sensitive")
self.caseSensitive.setText(caseSensTr)
@@ -457,12 +455,15 @@ def __init__(self, parent=None):
self.wrapAround.setChecked(True)
wrapAroundTr = QCoreApplication.translate("PythonConsole", "Wrap Around")
self.wrapAround.setText(wrapAroundTr)
self.layoutFind.addWidget(self.lineEditFind, 0, 1, 1, 1)
self.layoutFind.addWidget(self.findPrevButton, 0, 2, 1, 1)
self.layoutFind.addWidget(self.findNextButton, 0, 3, 1, 1)
self.layoutFind.addWidget(self.caseSensitive, 0, 4, 1, 1)
self.layoutFind.addWidget(self.wholeWord, 0, 5, 1, 1)
self.layoutFind.addWidget(self.wrapAround, 0, 6, 1, 1)

self.toolBarFindText.addWidget(self.lineEditFind)
self.toolBarFindText.addAction(self.findPrevButton)
self.toolBarFindText.addAction(self.findNextButton)
self.toolBarFindText.addWidget(self.caseSensitive)
self.toolBarFindText.addWidget(self.wholeWord)
self.toolBarFindText.addWidget(self.wrapAround)

self.layoutFind.addWidget(self.toolBarFindText, 0, 1, 1, 1)

# ------------ Add first Tab in Editor -------------------------------

@@ -489,8 +490,8 @@ def __init__(self, parent=None):
self.helpButton.triggered.connect(self.openHelp)
self.listClassMethod.itemClicked.connect(self.onClickGoToLine)
self.lineEditFind.returnPressed.connect(self._findNext)
self.findNextButton.clicked.connect(self._findNext)
self.findPrevButton.clicked.connect(self._findPrev)
self.findNextButton.triggered.connect(self._findNext)
self.findPrevButton.triggered.connect(self._findPrev)
self.lineEditFind.textChanged.connect(self._textFindChanged)

self.findScut = QShortcut(QKeySequence.Find, self.widgetEditor)

0 comments on commit e8213b8

Please sign in to comment.
You can’t perform that action at this time.