Skip to content
Permalink
Browse files

[pyqgis-console] some fix for find text in editor

- changes tabs to north
  • Loading branch information
slarosa committed May 4, 2013
1 parent 6e4a5c7 commit 6c27d163090845241e3ab7f6a24ffbbbe08dc07c
Showing with 7 additions and 11 deletions.
  1. +4 −8 python/console/console.py
  2. +3 −3 python/console/console_editor.py
@@ -473,8 +473,8 @@ def __init__(self, parent=None):
self.layoutEditor.setMargin(0)
self.layoutEditor.setSpacing(0)
self.layoutEditor.addWidget(self.widgetButtonEditor, 0, 0, 2, 1)
self.layoutEditor.addWidget(self.tabEditorWidget, 1, 1, 1, 1)
self.layoutEditor.addWidget(self.widgetFind, 0, 1, 1, 1)
self.layoutEditor.addWidget(self.tabEditorWidget, 0, 1, 1, 1)
self.layoutEditor.addWidget(self.widgetFind, 1, 1, 1, 1)

self.toolBarLayout = QGridLayout(self.widgetButton)
self.toolBarLayout.setMargin(0)
@@ -523,15 +523,11 @@ def _findText(self):
self.tabEditorWidget.currentWidget().newEditor.findText()

def _findNext(self, fromPrev=False):
if not fromPrev:
self._findText()
self.tabEditorWidget.currentWidget().newEditor.findNext()
else:
self.tabEditorWidget.currentWidget().newEditor.findNext()
self.tabEditorWidget.currentWidget().newEditor.findText()

def _findPrev(self):
self.tabEditorWidget.currentWidget().newEditor.findText(True)
self._findNext(True)
self.tabEditorWidget.currentWidget().newEditor.findNext()

def _textFindChanged(self):
if not self.lineEditFind.text().isEmpty():
@@ -344,11 +344,11 @@ def contextMenuEvent(self, e):
if QApplication.clipboard().text() != "":
pasteAction.setEnabled(True)
action = menu.exec_(self.mapToGlobal(e.pos()))

def findText(self, direction=False):
line, index = self.getCursorPosition()
text = self.parent.pc.lineEditFind.text()
if text:
if not text.isEmpty():
if direction:
self.findFirst(text, 1, 0, line, index, forward=False)
else:
@@ -730,7 +730,7 @@ def __init__(self, parent):

self.setMovable(True)
#self.setTabsClosable(True)
self.setTabPosition(QTabWidget.South)
self.setTabPosition(QTabWidget.North)

# Menu button list tabs
self.fileTabMenu = QMenu(self)

0 comments on commit 6c27d16

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