25 from .BookmarkedFilesDialog import BookmarkedFilesDialog |
25 from .BookmarkedFilesDialog import BookmarkedFilesDialog |
26 |
26 |
27 from QScintilla.Editor import Editor |
27 from QScintilla.Editor import Editor |
28 from QScintilla.EditorAssembly import EditorAssembly |
28 from QScintilla.EditorAssembly import EditorAssembly |
29 from QScintilla.GotoDialog import GotoDialog |
29 from QScintilla.GotoDialog import GotoDialog |
30 from QScintilla.SearchReplaceWidget import SearchReplaceWidget |
30 from QScintilla.SearchReplaceWidget import SearchReplaceSlidingWidget |
31 from QScintilla.ZoomDialog import ZoomDialog |
31 from QScintilla.ZoomDialog import ZoomDialog |
32 from QScintilla.APIsManager import APIsManager |
32 from QScintilla.APIsManager import APIsManager |
33 from QScintilla.SpellChecker import SpellChecker |
33 from QScintilla.SpellChecker import SpellChecker |
34 import QScintilla.Lexers |
34 import QScintilla.Lexers |
35 import QScintilla.Exporters |
35 import QScintilla.Exporters |
173 @param dbs reference to the debug server object |
173 @param dbs reference to the debug server object |
174 """ |
174 """ |
175 self.ui = ui |
175 self.ui = ui |
176 self.dbs = dbs |
176 self.dbs = dbs |
177 |
177 |
178 self.searchDlg = SearchReplaceWidget(False, self, ui) |
178 self.__searchWidget = SearchReplaceSlidingWidget(False, self, ui) |
179 self.replaceDlg = SearchReplaceWidget(True, self, ui) |
179 self.__replaceWidget = SearchReplaceSlidingWidget(True, self, ui) |
180 |
180 |
181 self.checkActions.connect(self.searchDlg.updateSelectionCheckBox) |
181 self.checkActions.connect(self.__searchWidget.updateSelectionCheckBox) |
182 self.checkActions.connect(self.replaceDlg.updateSelectionCheckBox) |
182 self.checkActions.connect(self.__replaceWidget.updateSelectionCheckBox) |
|
183 |
|
184 def searchWidget(self): |
|
185 """ |
|
186 Public method to get a reference to the search widget. |
|
187 |
|
188 @return reference to the search widget (SearchReplaceSlidingWidget) |
|
189 """ |
|
190 return self.__searchWidget |
|
191 |
|
192 def replaceWidget(self): |
|
193 """ |
|
194 Public method to get a reference to the replace widget. |
|
195 |
|
196 @return reference to the replace widget (SearchReplaceSlidingWidget) |
|
197 """ |
|
198 return self.__replaceWidget |
183 |
199 |
184 def __loadRecent(self): |
200 def __loadRecent(self): |
185 """ |
201 """ |
186 Private method to load the recently opened filenames. |
202 Private method to load the recently opened filenames. |
187 """ |
203 """ |
2417 self.searchNextAct.setWhatsThis(QApplication.translate('ViewManager', |
2433 self.searchNextAct.setWhatsThis(QApplication.translate('ViewManager', |
2418 """<b>Search next</b>""" |
2434 """<b>Search next</b>""" |
2419 """<p>Search the next occurrence of some text in the current editor.""" |
2435 """<p>Search the next occurrence of some text in the current editor.""" |
2420 """ The previously entered searchtext and options are reused.</p>""" |
2436 """ The previously entered searchtext and options are reused.</p>""" |
2421 )) |
2437 )) |
2422 self.searchNextAct.triggered[()].connect(self.searchDlg.findNext) |
2438 self.searchNextAct.triggered[()].connect(self.__searchWidget.findNext) |
2423 self.searchActions.append(self.searchNextAct) |
2439 self.searchActions.append(self.searchNextAct) |
2424 |
2440 |
2425 self.searchPrevAct = E5Action(QApplication.translate('ViewManager', |
2441 self.searchPrevAct = E5Action(QApplication.translate('ViewManager', |
2426 'Search previous'), |
2442 'Search previous'), |
2427 UI.PixmapCache.getIcon("findPrev.png"), |
2443 UI.PixmapCache.getIcon("findPrev.png"), |
2435 self.searchPrevAct.setWhatsThis(QApplication.translate('ViewManager', |
2451 self.searchPrevAct.setWhatsThis(QApplication.translate('ViewManager', |
2436 """<b>Search previous</b>""" |
2452 """<b>Search previous</b>""" |
2437 """<p>Search the previous occurrence of some text in the current editor.""" |
2453 """<p>Search the previous occurrence of some text in the current editor.""" |
2438 """ The previously entered searchtext and options are reused.</p>""" |
2454 """ The previously entered searchtext and options are reused.</p>""" |
2439 )) |
2455 )) |
2440 self.searchPrevAct.triggered[()].connect(self.searchDlg.findPrev) |
2456 self.searchPrevAct.triggered[()].connect(self.__searchWidget.findPrev) |
2441 self.searchActions.append(self.searchPrevAct) |
2457 self.searchActions.append(self.searchPrevAct) |
2442 |
2458 |
2443 self.searchClearMarkersAct = E5Action(QApplication.translate('ViewManager', |
2459 self.searchClearMarkersAct = E5Action(QApplication.translate('ViewManager', |
2444 'Clear search markers'), |
2460 'Clear search markers'), |
2445 UI.PixmapCache.getIcon("findClear.png"), |
2461 UI.PixmapCache.getIcon("findClear.png"), |
3852 editor.taskMarkersUpdated.connect(self.__taskMarkersUpdated) |
3868 editor.taskMarkersUpdated.connect(self.__taskMarkersUpdated) |
3853 editor.changeMarkersUpdated.connect(self.__changeMarkersUpdated) |
3869 editor.changeMarkersUpdated.connect(self.__changeMarkersUpdated) |
3854 editor.languageChanged.connect(self.__editorConfigChanged) |
3870 editor.languageChanged.connect(self.__editorConfigChanged) |
3855 editor.eolChanged.connect(self.__editorConfigChanged) |
3871 editor.eolChanged.connect(self.__editorConfigChanged) |
3856 editor.encodingChanged.connect(self.__editorConfigChanged) |
3872 editor.encodingChanged.connect(self.__editorConfigChanged) |
3857 editor.selectionChanged.connect(self.searchDlg.selectionChanged) |
3873 editor.selectionChanged.connect(self.__searchWidget.selectionChanged) |
3858 editor.selectionChanged.connect(self.replaceDlg.selectionChanged) |
3874 editor.selectionChanged.connect(self.__replaceWidget.selectionChanged) |
3859 editor.lastEditPositionAvailable.connect(self.__lastEditPositionAvailable) |
3875 editor.lastEditPositionAvailable.connect(self.__lastEditPositionAvailable) |
3860 editor.zoomValueChanged.connect(self.zoomValueChanged) |
3876 editor.zoomValueChanged.connect(self.zoomValueChanged) |
3861 |
3877 |
3862 def newEditorView(self, fn, caller, filetype=""): |
3878 def newEditorView(self, fn, caller, filetype=""): |
3863 """ |
3879 """ |
4881 |
4897 |
4882 def __search(self): |
4898 def __search(self): |
4883 """ |
4899 """ |
4884 Private method to handle the search action. |
4900 Private method to handle the search action. |
4885 """ |
4901 """ |
4886 self.replaceDlg.close() |
4902 self.__replaceWidget.hide() |
4887 self.searchDlg.show(self.textForFind()) |
4903 self.__searchWidget.show() |
|
4904 self.__searchWidget.show(self.textForFind()) |
4888 |
4905 |
4889 def __replace(self): |
4906 def __replace(self): |
4890 """ |
4907 """ |
4891 Private method to handle the replace action. |
4908 Private method to handle the replace action. |
4892 """ |
4909 """ |
4893 self.searchDlg.close() |
4910 self.__searchWidget.hide() |
4894 self.replaceDlg.show(self.textForFind()) |
4911 self.__replaceWidget.show(self.textForFind()) |
4895 |
4912 |
4896 def __findNextWord(self): |
4913 def __findNextWord(self): |
4897 """ |
4914 """ |
4898 Private slot to find the next occurrence of the current word of the current |
4915 Private slot to find the next occurrence of the current word of the current |
4899 editor. |
4916 editor. |