ViewManager/ViewManager.py

branch
5_1_x
changeset 1151
b64cf188c5d7
parent 1135
ad5f054e2b2c
child 1154
efa4ce3d50d2
--- a/ViewManager/ViewManager.py	Wed Jun 29 13:51:58 2011 +0200
+++ b/ViewManager/ViewManager.py	Thu Jun 30 08:07:32 2011 +0200
@@ -3931,6 +3931,7 @@
                 self.quickFindtextCombo.lineEdit().setText(tff)
             self.quickFindtextCombo.lineEdit().setFocus()
             self.quickFindtextCombo.lineEdit().selectAll()
+            self.__quickSearchSetEditColors(False)
         else:
             self.__quickSearchInEditor(True, False)
         
@@ -3994,6 +3995,7 @@
                 self.quickFindtextCombo.lineEdit().setText(tff)
             self.quickFindtextCombo.lineEdit().setFocus()
             self.quickFindtextCombo.lineEdit().selectAll()
+            self.__quickSearchSetEditColors(False)
         else:
             self.__quickSearchInEditor(True, True)
         
@@ -4034,7 +4036,8 @@
         
         text = self.quickFindtextCombo.lineEdit().text()
         if not text:
-            text = self.quickFindtextCombo.lastSearchText
+            if again:
+                text = self.quickFindtextCombo.lastSearchText
         if not text:
             if Preferences.getEditor("QuickSearchMarkersEnabled"):
                 aw.clearSearchIndicators()
@@ -4064,7 +4067,15 @@
         else:
             ok = aw.findFirst(text, False, False, False, True, not back, 
                               lineFrom, indexFrom)
-        if not ok:
+        self.__quickSearchSetEditColors(not ok)
+    
+    def __quickSearchSetEditColors(self, error):
+        """
+        Private method to set the quick search edit colors.
+        
+        @param error flag indicating an error (boolean)
+        """
+        if error:
             palette = self.quickFindtextCombo.lineEdit().palette()
             palette.setColor(QPalette.Base, QColor("red"))
             palette.setColor(QPalette.Text, QColor("white"))
@@ -4076,7 +4087,7 @@
             palette.setColor(QPalette.Text, 
                              self.quickFindtextCombo.palette().color(QPalette.Text))
             self.quickFindtextCombo.lineEdit().setPalette(palette)
-        
+    
     def __quickSearchExtend(self):
         """
         Private method to handle the quicksearch extend action.

eric ide

mercurial