Made the quick search backward work the same way forward does. 5_1_x

Tue, 21 Jun 2011 18:38:38 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 21 Jun 2011 18:38:38 +0200
branch
5_1_x
changeset 1135
ad5f054e2b2c
parent 1129
e97a9a2e445e
child 1138
3104df9e1fd0

Made the quick search backward work the same way forward does.
(transplanted from 9185e9dd52ef2fe2bf9eafa837ce4762f7260d58)

ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
--- a/ViewManager/ViewManager.py	Sun Jun 19 17:24:22 2011 +0200
+++ b/ViewManager/ViewManager.py	Tue Jun 21 18:38:38 2011 +0200
@@ -3976,7 +3976,26 @@
         """
         Private slot to handle the quickFindPrev toolbutton action.
         """
-        self.__quickSearchInEditor(True, True)
+        # first we have to check if quick search is active
+        # and try to activate it if not
+        if self.__quickSearchToolbarVisibility is None:
+            self.__quickSearchToolbarVisibility = self.__quickSearchToolbar.isVisible()
+        if not self.__quickSearchToolbar.isVisible():
+            self.__quickSearchToolbar.show()
+        if not self.quickFindtextCombo.lineEdit().hasFocus():
+            aw = self.activeWindow()
+            self.quickFindtextCombo.lastActive = aw
+            if aw:
+                self.quickFindtextCombo.lastCursorPos = aw.getCursorPosition()
+            else:
+                self.quickFindtextCombo.lastCursorPos = None
+            tff = self.textForFind(False)
+            if tff:
+                self.quickFindtextCombo.lineEdit().setText(tff)
+            self.quickFindtextCombo.lineEdit().setFocus()
+            self.quickFindtextCombo.lineEdit().selectAll()
+        else:
+            self.__quickSearchInEditor(True, True)
         
     def __quickSearchMarkOccurrences(self, txt):
         """

eric ide

mercurial