QScintilla/SearchReplaceWidget.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
20 20
21 import Preferences 21 import Preferences
22 22
23 import UI.PixmapCache 23 import UI.PixmapCache
24 24
25
25 class SearchReplaceWidget(QWidget): 26 class SearchReplaceWidget(QWidget):
26 """ 27 """
27 Class implementing the search and replace widget. 28 Class implementing the search and replace widget.
28 29
29 @signal searchListChanged() emitted to indicate a change of the search list 30 @signal searchListChanged() emitted to indicate a change of the search list
30 """ 31 """
31 searchListChanged = pyqtSignal() 32 searchListChanged = pyqtSignal()
32 33
33 def __init__(self, replace, vm, parent = None): 34 def __init__(self, replace, vm, parent=None):
34 """ 35 """
35 Constructor 36 Constructor
36 37
37 @param replace flag indicating a replace widget is called 38 @param replace flag indicating a replace widget is called
38 @param vm reference to the viewmanager object 39 @param vm reference to the viewmanager object
47 if replace: 48 if replace:
48 self.replaceHistory = vm.getSRHistory('replace') 49 self.replaceHistory = vm.getSRHistory('replace')
49 self.ui = Ui_ReplaceWidget() 50 self.ui = Ui_ReplaceWidget()
50 whatsThis = self.trUtf8(r""" 51 whatsThis = self.trUtf8(r"""
51 <b>Find and Replace</b> 52 <b>Find and Replace</b>
52 <p>This dialog is used to find some text and replace it with another text. 53 <p>This dialog is used to find some text and replace it with another text.
53 By checking the various checkboxes, the search can be made more specific. The search 54 By checking the various checkboxes, the search can be made more specific. The search
54 string might be a regular expression. In a regular expression, special characters 55 string might be a regular expression. In a regular expression, special characters
55 interpreted are:</p> 56 interpreted are:</p>
56 """ 57 """
57 ) 58 )
58 else: 59 else:
59 self.ui = Ui_SearchWidget() 60 self.ui = Ui_SearchWidget()
60 whatsThis = self.trUtf8(r""" 61 whatsThis = self.trUtf8(r"""
61 <b>Find</b> 62 <b>Find</b>
62 <p>This dialog is used to find some text. By checking the various checkboxes, the search 63 <p>This dialog is used to find some text. By checking the various checkboxes, the search
63 can be made more specific. The search string might be a regular expression. In a regular 64 can be made more specific. The search string might be a regular expression. In a regular
64 expression, special characters interpreted are:</p> 65 expression, special characters interpreted are:</p>
65 """ 66 """
66 ) 67 )
67 self.ui.setupUi(self) 68 self.ui.setupUi(self)
68 if not replace: 69 if not replace:
381 382
382 self.__finding = False 383 self.__finding = False
383 384
384 return ok 385 return ok
385 386
386 def __showFind(self, text = ''): 387 def __showFind(self, text=''):
387 """ 388 """
388 Private method to display this widget in find mode. 389 Private method to display this widget in find mode.
389 390
390 @param text text to be shown in the findtext edit (string) 391 @param text text to be shown in the findtext edit (string)
391 """ 392 """
596 self.findPrevAct.setShortcut(self.viewmanager.searchPrevAct.shortcut()) 597 self.findPrevAct.setShortcut(self.viewmanager.searchPrevAct.shortcut())
597 self.findPrevAct.setAlternateShortcut( 598 self.findPrevAct.setAlternateShortcut(
598 self.viewmanager.searchPrevAct.alternateShortcut()) 599 self.viewmanager.searchPrevAct.alternateShortcut())
599 self.findPrevAct.setShortcutContext(Qt.WidgetShortcut) 600 self.findPrevAct.setShortcutContext(Qt.WidgetShortcut)
600 601
601 def show(self, text = ''): 602 def show(self, text=''):
602 """ 603 """
603 Overridden slot from QWidget. 604 Overridden slot from QWidget.
604 605
605 @param text text to be shown in the findtext edit (string) 606 @param text text to be shown in the findtext edit (string)
606 """ 607 """

eric ide

mercurial