ViewManager/ViewManager.py

changeset 2162
4627e6ea7b6b
parent 2138
6fa3cda67d42
child 2211
86bdcfac4a4a
equal deleted inserted replaced
2160:1874d4410904 2162:4627e6ea7b6b
3328 """<p>Go to previous line of the current editor having a task.</p>""" 3328 """<p>Go to previous line of the current editor having a task.</p>"""
3329 )) 3329 ))
3330 self.taskPreviousAct.triggered[()].connect(self.__previousTask) 3330 self.taskPreviousAct.triggered[()].connect(self.__previousTask)
3331 self.bookmarkActions.append(self.taskPreviousAct) 3331 self.bookmarkActions.append(self.taskPreviousAct)
3332 3332
3333 self.changeNextAct = E5Action(QApplication.translate('ViewManager',
3334 'Next Change'),
3335 UI.PixmapCache.getIcon("changeNext.png"),
3336 QApplication.translate('ViewManager', '&Next Change'),
3337 0, 0,
3338 self.bookmarkActGrp, 'vm_change_next')
3339 self.changeNextAct.setStatusTip(QApplication.translate('ViewManager',
3340 'Next Change'))
3341 self.changeNextAct.setWhatsThis(QApplication.translate('ViewManager',
3342 """<b>Next Change</b>"""
3343 """<p>Go to next line of the current editor having a change marker.</p>"""
3344 ))
3345 self.changeNextAct.triggered[()].connect(self.__nextChange)
3346 self.bookmarkActions.append(self.changeNextAct)
3347
3348 self.changePreviousAct = E5Action(QApplication.translate('ViewManager',
3349 'Previous Change'),
3350 UI.PixmapCache.getIcon("changePrev.png"),
3351 QApplication.translate('ViewManager',
3352 '&Previous Change'),
3353 0, 0,
3354 self.bookmarkActGrp, 'vm_change_previous')
3355 self.changePreviousAct.setStatusTip(QApplication.translate('ViewManager',
3356 'Previous Change'))
3357 self.changePreviousAct.setWhatsThis(QApplication.translate('ViewManager',
3358 """<b>Previous Change</b>"""
3359 """<p>Go to previous line of the current editor having"""
3360 """ a change marker.</p>"""
3361 ))
3362 self.changePreviousAct.triggered[()].connect(self.__previousChange)
3363 self.bookmarkActions.append(self.changePreviousAct)
3364
3333 self.bookmarkActGrp.setEnabled(False) 3365 self.bookmarkActGrp.setEnabled(False)
3334 3366
3335 def initBookmarkMenu(self): 3367 def initBookmarkMenu(self):
3336 """ 3368 """
3337 Public method to create the Bookmark menu 3369 Public method to create the Bookmark menu
3360 menu.addAction(self.notcoveredNextAct) 3392 menu.addAction(self.notcoveredNextAct)
3361 menu.addAction(self.notcoveredPreviousAct) 3393 menu.addAction(self.notcoveredPreviousAct)
3362 menu.addSeparator() 3394 menu.addSeparator()
3363 menu.addAction(self.taskNextAct) 3395 menu.addAction(self.taskNextAct)
3364 menu.addAction(self.taskPreviousAct) 3396 menu.addAction(self.taskPreviousAct)
3397 menu.addSeparator()
3398 menu.addAction(self.changeNextAct)
3399 menu.addAction(self.changePreviousAct)
3365 3400
3366 self.bookmarksMenu.aboutToShow.connect(self.__showBookmarksMenu) 3401 self.bookmarksMenu.aboutToShow.connect(self.__showBookmarksMenu)
3367 self.bookmarksMenu.triggered.connect(self.__bookmarkSelected) 3402 self.bookmarksMenu.triggered.connect(self.__bookmarkSelected)
3368 menu.aboutToShow.connect(self.__showBookmarkMenu) 3403 menu.aboutToShow.connect(self.__showBookmarkMenu)
3369 3404
3390 tb.addAction(self.warningsNextAct) 3425 tb.addAction(self.warningsNextAct)
3391 tb.addAction(self.warningsPreviousAct) 3426 tb.addAction(self.warningsPreviousAct)
3392 tb.addSeparator() 3427 tb.addSeparator()
3393 tb.addAction(self.taskNextAct) 3428 tb.addAction(self.taskNextAct)
3394 tb.addAction(self.taskPreviousAct) 3429 tb.addAction(self.taskPreviousAct)
3430 tb.addSeparator()
3431 tb.addAction(self.changeNextAct)
3432 tb.addAction(self.changePreviousAct)
3395 3433
3396 toolbarManager.addToolBar(tb, tb.windowTitle()) 3434 toolbarManager.addToolBar(tb, tb.windowTitle())
3397 toolbarManager.addAction(self.notcoveredNextAct, tb.windowTitle()) 3435 toolbarManager.addAction(self.notcoveredNextAct, tb.windowTitle())
3398 toolbarManager.addAction(self.notcoveredPreviousAct, tb.windowTitle()) 3436 toolbarManager.addAction(self.notcoveredPreviousAct, tb.windowTitle())
3399 3437
3705 editor.autoCompletionAPIsAvailable.connect( 3743 editor.autoCompletionAPIsAvailable.connect(
3706 self.__editorAutoCompletionAPIsAvailable) 3744 self.__editorAutoCompletionAPIsAvailable)
3707 editor.undoAvailable.connect(self.undoAct.setEnabled) 3745 editor.undoAvailable.connect(self.undoAct.setEnabled)
3708 editor.redoAvailable.connect(self.redoAct.setEnabled) 3746 editor.redoAvailable.connect(self.redoAct.setEnabled)
3709 editor.taskMarkersUpdated.connect(self.__taskMarkersUpdated) 3747 editor.taskMarkersUpdated.connect(self.__taskMarkersUpdated)
3748 editor.changeMarkersUpdated.connect(self.__changeMarkersUpdated)
3710 editor.languageChanged.connect(self.__editorConfigChanged) 3749 editor.languageChanged.connect(self.__editorConfigChanged)
3711 editor.eolChanged.connect(self.__editorConfigChanged) 3750 editor.eolChanged.connect(self.__editorConfigChanged)
3712 editor.encodingChanged.connect(self.__editorConfigChanged) 3751 editor.encodingChanged.connect(self.__editorConfigChanged)
3713 editor.selectionChanged.connect(self.searchDlg.selectionChanged) 3752 editor.selectionChanged.connect(self.searchDlg.selectionChanged)
3714 editor.selectionChanged.connect(self.replaceDlg.selectionChanged) 3753 editor.selectionChanged.connect(self.replaceDlg.selectionChanged)
5096 self.notcoveredNextAct.setEnabled(False) 5135 self.notcoveredNextAct.setEnabled(False)
5097 self.notcoveredPreviousAct.setEnabled(False) 5136 self.notcoveredPreviousAct.setEnabled(False)
5098 5137
5099 def __taskMarkersUpdated(self, editor): 5138 def __taskMarkersUpdated(self, editor):
5100 """ 5139 """
5101 Protected slot to handle the taskMarkersUpdated signal. 5140 Private slot to handle the taskMarkersUpdated signal.
5102 5141
5103 @param editor editor that sent the signal 5142 @param editor editor that sent the signal
5104 """ 5143 """
5105 if editor.hasTaskMarkers(): 5144 if editor.hasTaskMarkers():
5106 self.taskNextAct.setEnabled(True) 5145 self.taskNextAct.setEnabled(True)
5118 def __previousTask(self): 5157 def __previousTask(self):
5119 """ 5158 """
5120 Private method to handle the previous task action. 5159 Private method to handle the previous task action.
5121 """ 5160 """
5122 self.activeWindow().previousTask() 5161 self.activeWindow().previousTask()
5162
5163 def __changeMarkersUpdated(self, editor):
5164 """
5165 Private slot to handle the changeMarkersUpdated signal.
5166
5167 @param editor editor that sent the signal
5168 """
5169 if editor.hasChangeMarkers():
5170 self.changeNextAct.setEnabled(True)
5171 self.changePreviousAct.setEnabled(True)
5172 else:
5173 self.changeNextAct.setEnabled(False)
5174 self.changePreviousAct.setEnabled(False)
5175
5176 def __nextChange(self):
5177 """
5178 Private method to handle the next change action.
5179 """
5180 self.activeWindow().nextChange()
5181
5182 def __previousChange(self):
5183 """
5184 Private method to handle the previous change action.
5185 """
5186 self.activeWindow().previousChange()
5123 5187
5124 ################################################################## 5188 ##################################################################
5125 ## Below are the action methods for the spell checking functions 5189 ## Below are the action methods for the spell checking functions
5126 ################################################################## 5190 ##################################################################
5127 5191
5332 self.taskPreviousAct.setEnabled(True) 5396 self.taskPreviousAct.setEnabled(True)
5333 else: 5397 else:
5334 self.taskNextAct.setEnabled(False) 5398 self.taskNextAct.setEnabled(False)
5335 self.taskPreviousAct.setEnabled(False) 5399 self.taskPreviousAct.setEnabled(False)
5336 5400
5401 if editor.hasChangeMarkers():
5402 self.changeNextAct.setEnabled(True)
5403 self.changePreviousAct.setEnabled(True)
5404 else:
5405 self.changeNextAct.setEnabled(False)
5406 self.changePreviousAct.setEnabled(False)
5407
5337 if editor.canAutoCompleteFromAPIs(): 5408 if editor.canAutoCompleteFromAPIs():
5338 self.autoCompleteFromAPIsAct.setEnabled(True) 5409 self.autoCompleteFromAPIsAct.setEnabled(True)
5339 else: 5410 else:
5340 self.autoCompleteFromAPIsAct.setEnabled(False) 5411 self.autoCompleteFromAPIsAct.setEnabled(False)
5341 5412

eric ide

mercurial