ViewManager/ViewManager.py

changeset 1149
ace5e56c36a1
parent 1134
9185e9dd52ef
child 1153
8fe2e1abd4ea
equal deleted inserted replaced
1148:ddc482ded355 1149:ace5e56c36a1
3933 tff = self.textForFind(False) 3933 tff = self.textForFind(False)
3934 if tff: 3934 if tff:
3935 self.quickFindtextCombo.lineEdit().setText(tff) 3935 self.quickFindtextCombo.lineEdit().setText(tff)
3936 self.quickFindtextCombo.lineEdit().setFocus() 3936 self.quickFindtextCombo.lineEdit().setFocus()
3937 self.quickFindtextCombo.lineEdit().selectAll() 3937 self.quickFindtextCombo.lineEdit().selectAll()
3938 self.__quickSearchSetEditColors(False)
3938 else: 3939 else:
3939 self.__quickSearchInEditor(True, False) 3940 self.__quickSearchInEditor(True, False)
3940 3941
3941 def __quickSearchFocusIn(self): 3942 def __quickSearchFocusIn(self):
3942 """ 3943 """
3996 tff = self.textForFind(False) 3997 tff = self.textForFind(False)
3997 if tff: 3998 if tff:
3998 self.quickFindtextCombo.lineEdit().setText(tff) 3999 self.quickFindtextCombo.lineEdit().setText(tff)
3999 self.quickFindtextCombo.lineEdit().setFocus() 4000 self.quickFindtextCombo.lineEdit().setFocus()
4000 self.quickFindtextCombo.lineEdit().selectAll() 4001 self.quickFindtextCombo.lineEdit().selectAll()
4002 self.__quickSearchSetEditColors(False)
4001 else: 4003 else:
4002 self.__quickSearchInEditor(True, True) 4004 self.__quickSearchInEditor(True, True)
4003 4005
4004 def __quickSearchMarkOccurrences(self, txt): 4006 def __quickSearchMarkOccurrences(self, txt):
4005 """ 4007 """
4036 if not aw: 4038 if not aw:
4037 return 4039 return
4038 4040
4039 text = self.quickFindtextCombo.lineEdit().text() 4041 text = self.quickFindtextCombo.lineEdit().text()
4040 if not text: 4042 if not text:
4041 text = self.quickFindtextCombo.lastSearchText 4043 if again:
4044 text = self.quickFindtextCombo.lastSearchText
4042 if not text: 4045 if not text:
4043 if Preferences.getEditor("QuickSearchMarkersEnabled"): 4046 if Preferences.getEditor("QuickSearchMarkersEnabled"):
4044 aw.clearSearchIndicators() 4047 aw.clearSearchIndicators()
4045 return 4048 return
4046 else: 4049 else:
4066 ok = aw.findFirst(text, False, False, False, True, not back, 4069 ok = aw.findFirst(text, False, False, False, True, not back,
4067 cline, cindex) 4070 cline, cindex)
4068 else: 4071 else:
4069 ok = aw.findFirst(text, False, False, False, True, not back, 4072 ok = aw.findFirst(text, False, False, False, True, not back,
4070 lineFrom, indexFrom) 4073 lineFrom, indexFrom)
4071 if not ok: 4074 self.__quickSearchSetEditColors(not ok)
4075
4076 def __quickSearchSetEditColors(self, error):
4077 """
4078 Private method to set the quick search edit colors.
4079
4080 @param error flag indicating an error (boolean)
4081 """
4082 if error:
4072 palette = self.quickFindtextCombo.lineEdit().palette() 4083 palette = self.quickFindtextCombo.lineEdit().palette()
4073 palette.setColor(QPalette.Base, QColor("red")) 4084 palette.setColor(QPalette.Base, QColor("red"))
4074 palette.setColor(QPalette.Text, QColor("white")) 4085 palette.setColor(QPalette.Text, QColor("white"))
4075 self.quickFindtextCombo.lineEdit().setPalette(palette) 4086 self.quickFindtextCombo.lineEdit().setPalette(palette)
4076 else: 4087 else:
4078 palette.setColor(QPalette.Base, 4089 palette.setColor(QPalette.Base,
4079 self.quickFindtextCombo.palette().color(QPalette.Base)) 4090 self.quickFindtextCombo.palette().color(QPalette.Base))
4080 palette.setColor(QPalette.Text, 4091 palette.setColor(QPalette.Text,
4081 self.quickFindtextCombo.palette().color(QPalette.Text)) 4092 self.quickFindtextCombo.palette().color(QPalette.Text))
4082 self.quickFindtextCombo.lineEdit().setPalette(palette) 4093 self.quickFindtextCombo.lineEdit().setPalette(palette)
4083 4094
4084 def __quickSearchExtend(self): 4095 def __quickSearchExtend(self):
4085 """ 4096 """
4086 Private method to handle the quicksearch extend action. 4097 Private method to handle the quicksearch extend action.
4087 """ 4098 """
4088 aw = self.activeWindow() 4099 aw = self.activeWindow()

eric ide

mercurial