ViewManager/ViewManager.py

changeset 3039
8dd0165d805d
parent 3034
7ce719013078
child 3060
5883ce99ee12
child 3062
9de9373da5bb
equal deleted inserted replaced
3038:7fe9a53280bd 3039:8dd0165d805d
824 824
825 self.revertAct = E5Action( 825 self.revertAct = E5Action(
826 QApplication.translate( 826 QApplication.translate(
827 'ViewManager', 'Revert to last saved state'), 827 'ViewManager', 'Revert to last saved state'),
828 QApplication.translate( 828 QApplication.translate(
829 'ViewManager', 'Re&vert to last saved state'), 829 'ViewManager', 'Re&vert to last saved state'),
830 QKeySequence(QApplication.translate( 830 QKeySequence(QApplication.translate(
831 'ViewManager', "Ctrl+Y", "Edit|Revert")), 831 'ViewManager', "Ctrl+Y", "Edit|Revert")),
832 0, 832 0,
833 self.editActGrp, 'vm_edit_revert') 833 self.editActGrp, 'vm_edit_revert')
834 self.revertAct.setStatusTip(QApplication.translate( 834 self.revertAct.setStatusTip(QApplication.translate(
1041 QKeySequence(QApplication.translate( 1041 QKeySequence(QApplication.translate(
1042 'ViewManager', "Ctrl+Shift+M", "Edit|Toggle Comment")), 1042 'ViewManager', "Ctrl+Shift+M", "Edit|Toggle Comment")),
1043 0, 1043 0,
1044 self.editActGrp, 'vm_edit_toggle_comment') 1044 self.editActGrp, 'vm_edit_toggle_comment')
1045 self.toggleCommentAct.setStatusTip(QApplication.translate( 1045 self.toggleCommentAct.setStatusTip(QApplication.translate(
1046 'ViewManager', 1046 'ViewManager',
1047 'Toggle the comment of the current line, selection or' 1047 'Toggle the comment of the current line, selection or'
1048 ' comment block')) 1048 ' comment block'))
1049 self.toggleCommentAct.setWhatsThis(QApplication.translate( 1049 self.toggleCommentAct.setWhatsThis(QApplication.translate(
1050 'ViewManager', 1050 'ViewManager',
1051 """<b>Toggle Comment</b>""" 1051 """<b>Toggle Comment</b>"""
1052 """<p>If the current line does not start with a block comment,""" 1052 """<p>If the current line does not start with a block comment,"""
1053 """ the current line or selection is commented. If it is already""" 1053 """ the current line or selection is commented. If it is already"""
3193 'ViewManager', 'Zoom in on the text')) 3193 'ViewManager', 'Zoom in on the text'))
3194 self.zoomInAct.setWhatsThis(QApplication.translate( 3194 self.zoomInAct.setWhatsThis(QApplication.translate(
3195 'ViewManager', 3195 'ViewManager',
3196 """<b>Zoom in</b>""" 3196 """<b>Zoom in</b>"""
3197 """<p>Zoom in on the text. This makes the text bigger.</p>""" 3197 """<p>Zoom in on the text. This makes the text bigger.</p>"""
3198 )) 3198 ))
3199 self.zoomInAct.triggered[()].connect(self.__zoomIn) 3199 self.zoomInAct.triggered[()].connect(self.__zoomIn)
3200 self.viewActions.append(self.zoomInAct) 3200 self.viewActions.append(self.zoomInAct)
3201 3201
3202 self.zoomOutAct = E5Action( 3202 self.zoomOutAct = E5Action(
3203 QApplication.translate('ViewManager', 'Zoom out'), 3203 QApplication.translate('ViewManager', 'Zoom out'),
3212 'ViewManager', 'Zoom out on the text')) 3212 'ViewManager', 'Zoom out on the text'))
3213 self.zoomOutAct.setWhatsThis(QApplication.translate( 3213 self.zoomOutAct.setWhatsThis(QApplication.translate(
3214 'ViewManager', 3214 'ViewManager',
3215 """<b>Zoom out</b>""" 3215 """<b>Zoom out</b>"""
3216 """<p>Zoom out on the text. This makes the text smaller.</p>""" 3216 """<p>Zoom out on the text. This makes the text smaller.</p>"""
3217 )) 3217 ))
3218 self.zoomOutAct.triggered[()].connect(self.__zoomOut) 3218 self.zoomOutAct.triggered[()].connect(self.__zoomOut)
3219 self.viewActions.append(self.zoomOutAct) 3219 self.viewActions.append(self.zoomOutAct)
3220 3220
3221 self.zoomResetAct = E5Action( 3221 self.zoomResetAct = E5Action(
3222 QApplication.translate('ViewManager', 'Zoom reset'), 3222 QApplication.translate('ViewManager', 'Zoom reset'),
3231 self.zoomResetAct.setWhatsThis(QApplication.translate( 3231 self.zoomResetAct.setWhatsThis(QApplication.translate(
3232 'ViewManager', 3232 'ViewManager',
3233 """<b>Zoom reset</b>""" 3233 """<b>Zoom reset</b>"""
3234 """<p>Reset the zoom of the text. """ 3234 """<p>Reset the zoom of the text. """
3235 """This sets the zoom factor to 100%.</p>""" 3235 """This sets the zoom factor to 100%.</p>"""
3236 )) 3236 ))
3237 self.zoomResetAct.triggered[()].connect(self.__zoomReset) 3237 self.zoomResetAct.triggered[()].connect(self.__zoomReset)
3238 self.viewActions.append(self.zoomResetAct) 3238 self.viewActions.append(self.zoomResetAct)
3239 3239
3240 self.zoomToAct = E5Action( 3240 self.zoomToAct = E5Action(
3241 QApplication.translate('ViewManager', 'Zoom'), 3241 QApplication.translate('ViewManager', 'Zoom'),
3250 self.zoomToAct.setWhatsThis(QApplication.translate( 3250 self.zoomToAct.setWhatsThis(QApplication.translate(
3251 'ViewManager', 3251 'ViewManager',
3252 """<b>Zoom</b>""" 3252 """<b>Zoom</b>"""
3253 """<p>Zoom the text. This opens a dialog where the""" 3253 """<p>Zoom the text. This opens a dialog where the"""
3254 """ desired size can be entered.</p>""" 3254 """ desired size can be entered.</p>"""
3255 )) 3255 ))
3256 self.zoomToAct.triggered[()].connect(self.__zoom) 3256 self.zoomToAct.triggered[()].connect(self.__zoom)
3257 self.viewActions.append(self.zoomToAct) 3257 self.viewActions.append(self.zoomToAct)
3258 3258
3259 self.toggleAllAct = E5Action( 3259 self.toggleAllAct = E5Action(
3260 QApplication.translate('ViewManager', 'Toggle all folds'), 3260 QApplication.translate('ViewManager', 'Toggle all folds'),
3264 'ViewManager', 'Toggle all folds')) 3264 'ViewManager', 'Toggle all folds'))
3265 self.toggleAllAct.setWhatsThis(QApplication.translate( 3265 self.toggleAllAct.setWhatsThis(QApplication.translate(
3266 'ViewManager', 3266 'ViewManager',
3267 """<b>Toggle all folds</b>""" 3267 """<b>Toggle all folds</b>"""
3268 """<p>Toggle all folds of the current editor.</p>""" 3268 """<p>Toggle all folds of the current editor.</p>"""
3269 )) 3269 ))
3270 self.toggleAllAct.triggered[()].connect(self.__toggleAll) 3270 self.toggleAllAct.triggered[()].connect(self.__toggleAll)
3271 self.viewActions.append(self.toggleAllAct) 3271 self.viewActions.append(self.toggleAllAct)
3272 3272
3273 self.toggleAllChildrenAct = E5Action( 3273 self.toggleAllChildrenAct = E5Action(
3274 QApplication.translate( 3274 QApplication.translate(
3281 self.toggleAllChildrenAct.setWhatsThis(QApplication.translate( 3281 self.toggleAllChildrenAct.setWhatsThis(QApplication.translate(
3282 'ViewManager', 3282 'ViewManager',
3283 """<b>Toggle all folds (including children)</b>""" 3283 """<b>Toggle all folds (including children)</b>"""
3284 """<p>Toggle all folds of the current editor including""" 3284 """<p>Toggle all folds of the current editor including"""
3285 """ all children.</p>""" 3285 """ all children.</p>"""
3286 )) 3286 ))
3287 self.toggleAllChildrenAct.triggered[()].connect( 3287 self.toggleAllChildrenAct.triggered[()].connect(
3288 self.__toggleAllChildren) 3288 self.__toggleAllChildren)
3289 self.viewActions.append(self.toggleAllChildrenAct) 3289 self.viewActions.append(self.toggleAllChildrenAct)
3290 3290
3291 self.toggleCurrentAct = E5Action( 3291 self.toggleCurrentAct = E5Action(
3297 self.toggleCurrentAct.setWhatsThis(QApplication.translate( 3297 self.toggleCurrentAct.setWhatsThis(QApplication.translate(
3298 'ViewManager', 3298 'ViewManager',
3299 """<b>Toggle current fold</b>""" 3299 """<b>Toggle current fold</b>"""
3300 """<p>Toggle the folds of the current line of the current""" 3300 """<p>Toggle the folds of the current line of the current"""
3301 """ editor.</p>""" 3301 """ editor.</p>"""
3302 )) 3302 ))
3303 self.toggleCurrentAct.triggered[()].connect(self.__toggleCurrent) 3303 self.toggleCurrentAct.triggered[()].connect(self.__toggleCurrent)
3304 self.viewActions.append(self.toggleCurrentAct) 3304 self.viewActions.append(self.toggleCurrentAct)
3305 3305
3306 self.unhighlightAct = E5Action( 3306 self.unhighlightAct = E5Action(
3307 QApplication.translate('ViewManager', 'Remove all highlights'), 3307 QApplication.translate('ViewManager', 'Remove all highlights'),
3313 'ViewManager', 'Remove all highlights')) 3313 'ViewManager', 'Remove all highlights'))
3314 self.unhighlightAct.setWhatsThis(QApplication.translate( 3314 self.unhighlightAct.setWhatsThis(QApplication.translate(
3315 'ViewManager', 3315 'ViewManager',
3316 """<b>Remove all highlights</b>""" 3316 """<b>Remove all highlights</b>"""
3317 """<p>Remove the highlights of all editors.</p>""" 3317 """<p>Remove the highlights of all editors.</p>"""
3318 )) 3318 ))
3319 self.unhighlightAct.triggered[()].connect(self.unhighlight) 3319 self.unhighlightAct.triggered[()].connect(self.unhighlight)
3320 self.viewActions.append(self.unhighlightAct) 3320 self.viewActions.append(self.unhighlightAct)
3321 3321
3322 self.splitViewAct = E5Action( 3322 self.splitViewAct = E5Action(
3323 QApplication.translate('ViewManager', 'Split view'), 3323 QApplication.translate('ViewManager', 'Split view'),
3328 'ViewManager', 'Add a split to the view')) 3328 'ViewManager', 'Add a split to the view'))
3329 self.splitViewAct.setWhatsThis(QApplication.translate( 3329 self.splitViewAct.setWhatsThis(QApplication.translate(
3330 'ViewManager', 3330 'ViewManager',
3331 """<b>Split view</b>""" 3331 """<b>Split view</b>"""
3332 """<p>Add a split to the view.</p>""" 3332 """<p>Add a split to the view.</p>"""
3333 )) 3333 ))
3334 self.splitViewAct.triggered[()].connect(self.__splitView) 3334 self.splitViewAct.triggered[()].connect(self.__splitView)
3335 self.viewActions.append(self.splitViewAct) 3335 self.viewActions.append(self.splitViewAct)
3336 3336
3337 self.splitOrientationAct = E5Action( 3337 self.splitOrientationAct = E5Action(
3338 QApplication.translate('ViewManager', 'Arrange horizontally'), 3338 QApplication.translate('ViewManager', 'Arrange horizontally'),
3342 'ViewManager', 'Arrange the splitted views horizontally')) 3342 'ViewManager', 'Arrange the splitted views horizontally'))
3343 self.splitOrientationAct.setWhatsThis(QApplication.translate( 3343 self.splitOrientationAct.setWhatsThis(QApplication.translate(
3344 'ViewManager', 3344 'ViewManager',
3345 """<b>Arrange horizontally</b>""" 3345 """<b>Arrange horizontally</b>"""
3346 """<p>Arrange the splitted views horizontally.</p>""" 3346 """<p>Arrange the splitted views horizontally.</p>"""
3347 )) 3347 ))
3348 self.splitOrientationAct.setChecked(False) 3348 self.splitOrientationAct.setChecked(False)
3349 self.splitOrientationAct.toggled[bool].connect(self.__splitOrientation) 3349 self.splitOrientationAct.toggled[bool].connect(self.__splitOrientation)
3350 self.viewActions.append(self.splitOrientationAct) 3350 self.viewActions.append(self.splitOrientationAct)
3351 3351
3352 self.splitRemoveAct = E5Action( 3352 self.splitRemoveAct = E5Action(
3358 'ViewManager', 'Remove the current split')) 3358 'ViewManager', 'Remove the current split'))
3359 self.splitRemoveAct.setWhatsThis(QApplication.translate( 3359 self.splitRemoveAct.setWhatsThis(QApplication.translate(
3360 'ViewManager', 3360 'ViewManager',
3361 """<b>Remove split</b>""" 3361 """<b>Remove split</b>"""
3362 """<p>Remove the current split.</p>""" 3362 """<p>Remove the current split.</p>"""
3363 )) 3363 ))
3364 self.splitRemoveAct.triggered[()].connect(self.removeSplit) 3364 self.splitRemoveAct.triggered[()].connect(self.removeSplit)
3365 self.viewActions.append(self.splitRemoveAct) 3365 self.viewActions.append(self.splitRemoveAct)
3366 3366
3367 self.nextSplitAct = E5Action( 3367 self.nextSplitAct = E5Action(
3368 QApplication.translate('ViewManager', 'Next split'), 3368 QApplication.translate('ViewManager', 'Next split'),
3375 'ViewManager', 'Move to the next split')) 3375 'ViewManager', 'Move to the next split'))
3376 self.nextSplitAct.setWhatsThis(QApplication.translate( 3376 self.nextSplitAct.setWhatsThis(QApplication.translate(
3377 'ViewManager', 3377 'ViewManager',
3378 """<b>Next split</b>""" 3378 """<b>Next split</b>"""
3379 """<p>Move to the next split.</p>""" 3379 """<p>Move to the next split.</p>"""
3380 )) 3380 ))
3381 self.nextSplitAct.triggered[()].connect(self.nextSplit) 3381 self.nextSplitAct.triggered[()].connect(self.nextSplit)
3382 self.viewActions.append(self.nextSplitAct) 3382 self.viewActions.append(self.nextSplitAct)
3383 3383
3384 self.prevSplitAct = E5Action( 3384 self.prevSplitAct = E5Action(
3385 QApplication.translate('ViewManager', 'Previous split'), 3385 QApplication.translate('ViewManager', 'Previous split'),
3391 'ViewManager', 'Move to the previous split')) 3391 'ViewManager', 'Move to the previous split'))
3392 self.prevSplitAct.setWhatsThis(QApplication.translate( 3392 self.prevSplitAct.setWhatsThis(QApplication.translate(
3393 'ViewManager', 3393 'ViewManager',
3394 """<b>Previous split</b>""" 3394 """<b>Previous split</b>"""
3395 """<p>Move to the previous split.</p>""" 3395 """<p>Move to the previous split.</p>"""
3396 )) 3396 ))
3397 self.prevSplitAct.triggered[()].connect(self.prevSplit) 3397 self.prevSplitAct.triggered[()].connect(self.prevSplit)
3398 self.viewActions.append(self.prevSplitAct) 3398 self.viewActions.append(self.prevSplitAct)
3399 3399
3400 self.previewAct = E5Action( 3400 self.previewAct = E5Action(
3401 QApplication.translate('ViewManager', 'Preview'), 3401 QApplication.translate('ViewManager', 'Preview'),
3407 self.previewAct.setWhatsThis(QApplication.translate( 3407 self.previewAct.setWhatsThis(QApplication.translate(
3408 'ViewManager', 3408 'ViewManager',
3409 """<b>Preview</b>""" 3409 """<b>Preview</b>"""
3410 """<p>This opens the web browser with a preview of""" 3410 """<p>This opens the web browser with a preview of"""
3411 """ the current file.</p>""" 3411 """ the current file.</p>"""
3412 )) 3412 ))
3413 self.previewAct.setChecked(Preferences.getUI("ShowFilePreview")) 3413 self.previewAct.setChecked(Preferences.getUI("ShowFilePreview"))
3414 self.previewAct.toggled[bool].connect(self.__previewEditor) 3414 self.previewAct.toggled[bool].connect(self.__previewEditor)
3415 self.viewActions.append(self.previewAct) 3415 self.viewActions.append(self.previewAct)
3416 3416
3417 self.viewActGrp.setEnabled(False) 3417 self.viewActGrp.setEnabled(False)
3492 'ViewManager', 'Start Macro Recording')) 3492 'ViewManager', 'Start Macro Recording'))
3493 self.macroStartRecAct.setWhatsThis(QApplication.translate( 3493 self.macroStartRecAct.setWhatsThis(QApplication.translate(
3494 'ViewManager', 3494 'ViewManager',
3495 """<b>Start Macro Recording</b>""" 3495 """<b>Start Macro Recording</b>"""
3496 """<p>Start recording editor commands into a new macro.</p>""" 3496 """<p>Start recording editor commands into a new macro.</p>"""
3497 )) 3497 ))
3498 self.macroStartRecAct.triggered[()].connect(self.__macroStartRecording) 3498 self.macroStartRecAct.triggered[()].connect(self.__macroStartRecording)
3499 self.macroActions.append(self.macroStartRecAct) 3499 self.macroActions.append(self.macroStartRecAct)
3500 3500
3501 self.macroStopRecAct = E5Action( 3501 self.macroStopRecAct = E5Action(
3502 QApplication.translate('ViewManager', 'Stop Macro Recording'), 3502 QApplication.translate('ViewManager', 'Stop Macro Recording'),
3506 'ViewManager', 'Stop Macro Recording')) 3506 'ViewManager', 'Stop Macro Recording'))
3507 self.macroStopRecAct.setWhatsThis(QApplication.translate( 3507 self.macroStopRecAct.setWhatsThis(QApplication.translate(
3508 'ViewManager', 3508 'ViewManager',
3509 """<b>Stop Macro Recording</b>""" 3509 """<b>Stop Macro Recording</b>"""
3510 """<p>Stop recording editor commands into a new macro.</p>""" 3510 """<p>Stop recording editor commands into a new macro.</p>"""
3511 )) 3511 ))
3512 self.macroStopRecAct.triggered[()].connect(self.__macroStopRecording) 3512 self.macroStopRecAct.triggered[()].connect(self.__macroStopRecording)
3513 self.macroActions.append(self.macroStopRecAct) 3513 self.macroActions.append(self.macroStopRecAct)
3514 3514
3515 self.macroRunAct = E5Action( 3515 self.macroRunAct = E5Action(
3516 QApplication.translate('ViewManager', 'Run Macro'), 3516 QApplication.translate('ViewManager', 'Run Macro'),
3520 'ViewManager', 'Run Macro')) 3520 'ViewManager', 'Run Macro'))
3521 self.macroRunAct.setWhatsThis(QApplication.translate( 3521 self.macroRunAct.setWhatsThis(QApplication.translate(
3522 'ViewManager', 3522 'ViewManager',
3523 """<b>Run Macro</b>""" 3523 """<b>Run Macro</b>"""
3524 """<p>Run a previously recorded editor macro.</p>""" 3524 """<p>Run a previously recorded editor macro.</p>"""
3525 )) 3525 ))
3526 self.macroRunAct.triggered[()].connect(self.__macroRun) 3526 self.macroRunAct.triggered[()].connect(self.__macroRun)
3527 self.macroActions.append(self.macroRunAct) 3527 self.macroActions.append(self.macroRunAct)
3528 3528
3529 self.macroDeleteAct = E5Action( 3529 self.macroDeleteAct = E5Action(
3530 QApplication.translate('ViewManager', 'Delete Macro'), 3530 QApplication.translate('ViewManager', 'Delete Macro'),
3534 'ViewManager', 'Delete Macro')) 3534 'ViewManager', 'Delete Macro'))
3535 self.macroDeleteAct.setWhatsThis(QApplication.translate( 3535 self.macroDeleteAct.setWhatsThis(QApplication.translate(
3536 'ViewManager', 3536 'ViewManager',
3537 """<b>Delete Macro</b>""" 3537 """<b>Delete Macro</b>"""
3538 """<p>Delete a previously recorded editor macro.</p>""" 3538 """<p>Delete a previously recorded editor macro.</p>"""
3539 )) 3539 ))
3540 self.macroDeleteAct.triggered[()].connect(self.__macroDelete) 3540 self.macroDeleteAct.triggered[()].connect(self.__macroDelete)
3541 self.macroActions.append(self.macroDeleteAct) 3541 self.macroActions.append(self.macroDeleteAct)
3542 3542
3543 self.macroLoadAct = E5Action( 3543 self.macroLoadAct = E5Action(
3544 QApplication.translate('ViewManager', 'Load Macro'), 3544 QApplication.translate('ViewManager', 'Load Macro'),
3548 'ViewManager', 'Load Macro')) 3548 'ViewManager', 'Load Macro'))
3549 self.macroLoadAct.setWhatsThis(QApplication.translate( 3549 self.macroLoadAct.setWhatsThis(QApplication.translate(
3550 'ViewManager', 3550 'ViewManager',
3551 """<b>Load Macro</b>""" 3551 """<b>Load Macro</b>"""
3552 """<p>Load an editor macro from a file.</p>""" 3552 """<p>Load an editor macro from a file.</p>"""
3553 )) 3553 ))
3554 self.macroLoadAct.triggered[()].connect(self.__macroLoad) 3554 self.macroLoadAct.triggered[()].connect(self.__macroLoad)
3555 self.macroActions.append(self.macroLoadAct) 3555 self.macroActions.append(self.macroLoadAct)
3556 3556
3557 self.macroSaveAct = E5Action( 3557 self.macroSaveAct = E5Action(
3558 QApplication.translate('ViewManager', 'Save Macro'), 3558 QApplication.translate('ViewManager', 'Save Macro'),
3562 'ViewManager', 'Save Macro')) 3562 'ViewManager', 'Save Macro'))
3563 self.macroSaveAct.setWhatsThis(QApplication.translate( 3563 self.macroSaveAct.setWhatsThis(QApplication.translate(
3564 'ViewManager', 3564 'ViewManager',
3565 """<b>Save Macro</b>""" 3565 """<b>Save Macro</b>"""
3566 """<p>Save a previously recorded editor macro to a file.</p>""" 3566 """<p>Save a previously recorded editor macro to a file.</p>"""
3567 )) 3567 ))
3568 self.macroSaveAct.triggered[()].connect(self.__macroSave) 3568 self.macroSaveAct.triggered[()].connect(self.__macroSave)
3569 self.macroActions.append(self.macroSaveAct) 3569 self.macroActions.append(self.macroSaveAct)
3570 3570
3571 self.macroActGrp.setEnabled(False) 3571 self.macroActGrp.setEnabled(False)
3572 3572
3606 self.bookmarkToggleAct.setWhatsThis(QApplication.translate( 3606 self.bookmarkToggleAct.setWhatsThis(QApplication.translate(
3607 'ViewManager', 3607 'ViewManager',
3608 """<b>Toggle Bookmark</b>""" 3608 """<b>Toggle Bookmark</b>"""
3609 """<p>Toggle a bookmark at the current line of the current""" 3609 """<p>Toggle a bookmark at the current line of the current"""
3610 """ editor.</p>""" 3610 """ editor.</p>"""
3611 )) 3611 ))
3612 self.bookmarkToggleAct.triggered[()].connect(self.__toggleBookmark) 3612 self.bookmarkToggleAct.triggered[()].connect(self.__toggleBookmark)
3613 self.bookmarkActions.append(self.bookmarkToggleAct) 3613 self.bookmarkActions.append(self.bookmarkToggleAct)
3614 3614
3615 self.bookmarkNextAct = E5Action( 3615 self.bookmarkNextAct = E5Action(
3616 QApplication.translate('ViewManager', 'Next Bookmark'), 3616 QApplication.translate('ViewManager', 'Next Bookmark'),
3624 'ViewManager', 'Next Bookmark')) 3624 'ViewManager', 'Next Bookmark'))
3625 self.bookmarkNextAct.setWhatsThis(QApplication.translate( 3625 self.bookmarkNextAct.setWhatsThis(QApplication.translate(
3626 'ViewManager', 3626 'ViewManager',
3627 """<b>Next Bookmark</b>""" 3627 """<b>Next Bookmark</b>"""
3628 """<p>Go to next bookmark of the current editor.</p>""" 3628 """<p>Go to next bookmark of the current editor.</p>"""
3629 )) 3629 ))
3630 self.bookmarkNextAct.triggered[()].connect(self.__nextBookmark) 3630 self.bookmarkNextAct.triggered[()].connect(self.__nextBookmark)
3631 self.bookmarkActions.append(self.bookmarkNextAct) 3631 self.bookmarkActions.append(self.bookmarkNextAct)
3632 3632
3633 self.bookmarkPreviousAct = E5Action( 3633 self.bookmarkPreviousAct = E5Action(
3634 QApplication.translate('ViewManager', 'Previous Bookmark'), 3634 QApplication.translate('ViewManager', 'Previous Bookmark'),
3642 'ViewManager', 'Previous Bookmark')) 3642 'ViewManager', 'Previous Bookmark'))
3643 self.bookmarkPreviousAct.setWhatsThis(QApplication.translate( 3643 self.bookmarkPreviousAct.setWhatsThis(QApplication.translate(
3644 'ViewManager', 3644 'ViewManager',
3645 """<b>Previous Bookmark</b>""" 3645 """<b>Previous Bookmark</b>"""
3646 """<p>Go to previous bookmark of the current editor.</p>""" 3646 """<p>Go to previous bookmark of the current editor.</p>"""
3647 )) 3647 ))
3648 self.bookmarkPreviousAct.triggered[()].connect(self.__previousBookmark) 3648 self.bookmarkPreviousAct.triggered[()].connect(self.__previousBookmark)
3649 self.bookmarkActions.append(self.bookmarkPreviousAct) 3649 self.bookmarkActions.append(self.bookmarkPreviousAct)
3650 3650
3651 self.bookmarkClearAct = E5Action( 3651 self.bookmarkClearAct = E5Action(
3652 QApplication.translate('ViewManager', 'Clear Bookmarks'), 3652 QApplication.translate('ViewManager', 'Clear Bookmarks'),
3659 'ViewManager', 'Clear Bookmarks')) 3659 'ViewManager', 'Clear Bookmarks'))
3660 self.bookmarkClearAct.setWhatsThis(QApplication.translate( 3660 self.bookmarkClearAct.setWhatsThis(QApplication.translate(
3661 'ViewManager', 3661 'ViewManager',
3662 """<b>Clear Bookmarks</b>""" 3662 """<b>Clear Bookmarks</b>"""
3663 """<p>Clear bookmarks of all editors.</p>""" 3663 """<p>Clear bookmarks of all editors.</p>"""
3664 )) 3664 ))
3665 self.bookmarkClearAct.triggered[()].connect(self.__clearAllBookmarks) 3665 self.bookmarkClearAct.triggered[()].connect(self.__clearAllBookmarks)
3666 self.bookmarkActions.append(self.bookmarkClearAct) 3666 self.bookmarkActions.append(self.bookmarkClearAct)
3667 3667
3668 self.syntaxErrorGotoAct = E5Action( 3668 self.syntaxErrorGotoAct = E5Action(
3669 QApplication.translate('ViewManager', 'Goto Syntax Error'), 3669 QApplication.translate('ViewManager', 'Goto Syntax Error'),
3675 'ViewManager', 'Goto Syntax Error')) 3675 'ViewManager', 'Goto Syntax Error'))
3676 self.syntaxErrorGotoAct.setWhatsThis(QApplication.translate( 3676 self.syntaxErrorGotoAct.setWhatsThis(QApplication.translate(
3677 'ViewManager', 3677 'ViewManager',
3678 """<b>Goto Syntax Error</b>""" 3678 """<b>Goto Syntax Error</b>"""
3679 """<p>Go to next syntax error of the current editor.</p>""" 3679 """<p>Go to next syntax error of the current editor.</p>"""
3680 )) 3680 ))
3681 self.syntaxErrorGotoAct.triggered[()].connect(self.__gotoSyntaxError) 3681 self.syntaxErrorGotoAct.triggered[()].connect(self.__gotoSyntaxError)
3682 self.bookmarkActions.append(self.syntaxErrorGotoAct) 3682 self.bookmarkActions.append(self.syntaxErrorGotoAct)
3683 3683
3684 self.syntaxErrorClearAct = E5Action( 3684 self.syntaxErrorClearAct = E5Action(
3685 QApplication.translate('ViewManager', 'Clear Syntax Errors'), 3685 QApplication.translate('ViewManager', 'Clear Syntax Errors'),
3690 'ViewManager', 'Clear Syntax Errors')) 3690 'ViewManager', 'Clear Syntax Errors'))
3691 self.syntaxErrorClearAct.setWhatsThis(QApplication.translate( 3691 self.syntaxErrorClearAct.setWhatsThis(QApplication.translate(
3692 'ViewManager', 3692 'ViewManager',
3693 """<b>Clear Syntax Errors</b>""" 3693 """<b>Clear Syntax Errors</b>"""
3694 """<p>Clear syntax errors of all editors.</p>""" 3694 """<p>Clear syntax errors of all editors.</p>"""
3695 )) 3695 ))
3696 self.syntaxErrorClearAct.triggered[()].connect( 3696 self.syntaxErrorClearAct.triggered[()].connect(
3697 self.__clearAllSyntaxErrors) 3697 self.__clearAllSyntaxErrors)
3698 self.bookmarkActions.append(self.syntaxErrorClearAct) 3698 self.bookmarkActions.append(self.syntaxErrorClearAct)
3699 3699
3700 self.warningsNextAct = E5Action( 3700 self.warningsNextAct = E5Action(
3708 self.warningsNextAct.setWhatsThis(QApplication.translate( 3708 self.warningsNextAct.setWhatsThis(QApplication.translate(
3709 'ViewManager', 3709 'ViewManager',
3710 """<b>Next warning message</b>""" 3710 """<b>Next warning message</b>"""
3711 """<p>Go to next line of the current editor""" 3711 """<p>Go to next line of the current editor"""
3712 """ having a py3flakes warning.</p>""" 3712 """ having a py3flakes warning.</p>"""
3713 )) 3713 ))
3714 self.warningsNextAct.triggered[()].connect(self.__nextWarning) 3714 self.warningsNextAct.triggered[()].connect(self.__nextWarning)
3715 self.bookmarkActions.append(self.warningsNextAct) 3715 self.bookmarkActions.append(self.warningsNextAct)
3716 3716
3717 self.warningsPreviousAct = E5Action( 3717 self.warningsPreviousAct = E5Action(
3718 QApplication.translate('ViewManager', 'Previous warning message'), 3718 QApplication.translate('ViewManager', 'Previous warning message'),
3726 self.warningsPreviousAct.setWhatsThis(QApplication.translate( 3726 self.warningsPreviousAct.setWhatsThis(QApplication.translate(
3727 'ViewManager', 3727 'ViewManager',
3728 """<b>Previous warning message</b>""" 3728 """<b>Previous warning message</b>"""
3729 """<p>Go to previous line of the current editor""" 3729 """<p>Go to previous line of the current editor"""
3730 """ having a py3flakes warning.</p>""" 3730 """ having a py3flakes warning.</p>"""
3731 )) 3731 ))
3732 self.warningsPreviousAct.triggered[()].connect(self.__previousWarning) 3732 self.warningsPreviousAct.triggered[()].connect(self.__previousWarning)
3733 self.bookmarkActions.append(self.warningsPreviousAct) 3733 self.bookmarkActions.append(self.warningsPreviousAct)
3734 3734
3735 self.warningsClearAct = E5Action( 3735 self.warningsClearAct = E5Action(
3736 QApplication.translate('ViewManager', 'Clear Warning Messages'), 3736 QApplication.translate('ViewManager', 'Clear Warning Messages'),
3741 'ViewManager', 'Clear Warning Messages')) 3741 'ViewManager', 'Clear Warning Messages'))
3742 self.warningsClearAct.setWhatsThis(QApplication.translate( 3742 self.warningsClearAct.setWhatsThis(QApplication.translate(
3743 'ViewManager', 3743 'ViewManager',
3744 """<b>Clear Warning Messages</b>""" 3744 """<b>Clear Warning Messages</b>"""
3745 """<p>Clear py3flakes warning messages of all editors.</p>""" 3745 """<p>Clear py3flakes warning messages of all editors.</p>"""
3746 )) 3746 ))
3747 self.warningsClearAct.triggered[()].connect(self.__clearAllWarnings) 3747 self.warningsClearAct.triggered[()].connect(self.__clearAllWarnings)
3748 self.bookmarkActions.append(self.warningsClearAct) 3748 self.bookmarkActions.append(self.warningsClearAct)
3749 3749
3750 self.notcoveredNextAct = E5Action( 3750 self.notcoveredNextAct = E5Action(
3751 QApplication.translate('ViewManager', 'Next uncovered line'), 3751 QApplication.translate('ViewManager', 'Next uncovered line'),
3758 self.notcoveredNextAct.setWhatsThis(QApplication.translate( 3758 self.notcoveredNextAct.setWhatsThis(QApplication.translate(
3759 'ViewManager', 3759 'ViewManager',
3760 """<b>Next uncovered line</b>""" 3760 """<b>Next uncovered line</b>"""
3761 """<p>Go to next line of the current editor marked as not""" 3761 """<p>Go to next line of the current editor marked as not"""
3762 """ covered.</p>""" 3762 """ covered.</p>"""
3763 )) 3763 ))
3764 self.notcoveredNextAct.triggered[()].connect(self.__nextUncovered) 3764 self.notcoveredNextAct.triggered[()].connect(self.__nextUncovered)
3765 self.bookmarkActions.append(self.notcoveredNextAct) 3765 self.bookmarkActions.append(self.notcoveredNextAct)
3766 3766
3767 self.notcoveredPreviousAct = E5Action( 3767 self.notcoveredPreviousAct = E5Action(
3768 QApplication.translate('ViewManager', 'Previous uncovered line'), 3768 QApplication.translate('ViewManager', 'Previous uncovered line'),
3776 self.notcoveredPreviousAct.setWhatsThis(QApplication.translate( 3776 self.notcoveredPreviousAct.setWhatsThis(QApplication.translate(
3777 'ViewManager', 3777 'ViewManager',
3778 """<b>Previous uncovered line</b>""" 3778 """<b>Previous uncovered line</b>"""
3779 """<p>Go to previous line of the current editor marked""" 3779 """<p>Go to previous line of the current editor marked"""
3780 """ as not covered.</p>""" 3780 """ as not covered.</p>"""
3781 )) 3781 ))
3782 self.notcoveredPreviousAct.triggered[()].connect( 3782 self.notcoveredPreviousAct.triggered[()].connect(
3783 self.__previousUncovered) 3783 self.__previousUncovered)
3784 self.bookmarkActions.append(self.notcoveredPreviousAct) 3784 self.bookmarkActions.append(self.notcoveredPreviousAct)
3785 3785
3786 self.taskNextAct = E5Action( 3786 self.taskNextAct = E5Action(
3793 'ViewManager', 'Next Task')) 3793 'ViewManager', 'Next Task'))
3794 self.taskNextAct.setWhatsThis(QApplication.translate( 3794 self.taskNextAct.setWhatsThis(QApplication.translate(
3795 'ViewManager', 3795 'ViewManager',
3796 """<b>Next Task</b>""" 3796 """<b>Next Task</b>"""
3797 """<p>Go to next line of the current editor having a task.</p>""" 3797 """<p>Go to next line of the current editor having a task.</p>"""
3798 )) 3798 ))
3799 self.taskNextAct.triggered[()].connect(self.__nextTask) 3799 self.taskNextAct.triggered[()].connect(self.__nextTask)
3800 self.bookmarkActions.append(self.taskNextAct) 3800 self.bookmarkActions.append(self.taskNextAct)
3801 3801
3802 self.taskPreviousAct = E5Action( 3802 self.taskPreviousAct = E5Action(
3803 QApplication.translate('ViewManager', 'Previous Task'), 3803 QApplication.translate('ViewManager', 'Previous Task'),
3811 self.taskPreviousAct.setWhatsThis(QApplication.translate( 3811 self.taskPreviousAct.setWhatsThis(QApplication.translate(
3812 'ViewManager', 3812 'ViewManager',
3813 """<b>Previous Task</b>""" 3813 """<b>Previous Task</b>"""
3814 """<p>Go to previous line of the current editor having a""" 3814 """<p>Go to previous line of the current editor having a"""
3815 """ task.</p>""" 3815 """ task.</p>"""
3816 )) 3816 ))
3817 self.taskPreviousAct.triggered[()].connect(self.__previousTask) 3817 self.taskPreviousAct.triggered[()].connect(self.__previousTask)
3818 self.bookmarkActions.append(self.taskPreviousAct) 3818 self.bookmarkActions.append(self.taskPreviousAct)
3819 3819
3820 self.changeNextAct = E5Action( 3820 self.changeNextAct = E5Action(
3821 QApplication.translate('ViewManager', 'Next Change'), 3821 QApplication.translate('ViewManager', 'Next Change'),
3828 self.changeNextAct.setWhatsThis(QApplication.translate( 3828 self.changeNextAct.setWhatsThis(QApplication.translate(
3829 'ViewManager', 3829 'ViewManager',
3830 """<b>Next Change</b>""" 3830 """<b>Next Change</b>"""
3831 """<p>Go to next line of the current editor having a change""" 3831 """<p>Go to next line of the current editor having a change"""
3832 """ marker.</p>""" 3832 """ marker.</p>"""
3833 )) 3833 ))
3834 self.changeNextAct.triggered[()].connect(self.__nextChange) 3834 self.changeNextAct.triggered[()].connect(self.__nextChange)
3835 self.bookmarkActions.append(self.changeNextAct) 3835 self.bookmarkActions.append(self.changeNextAct)
3836 3836
3837 self.changePreviousAct = E5Action( 3837 self.changePreviousAct = E5Action(
3838 QApplication.translate('ViewManager', 'Previous Change'), 3838 QApplication.translate('ViewManager', 'Previous Change'),
3846 self.changePreviousAct.setWhatsThis(QApplication.translate( 3846 self.changePreviousAct.setWhatsThis(QApplication.translate(
3847 'ViewManager', 3847 'ViewManager',
3848 """<b>Previous Change</b>""" 3848 """<b>Previous Change</b>"""
3849 """<p>Go to previous line of the current editor having""" 3849 """<p>Go to previous line of the current editor having"""
3850 """ a change marker.</p>""" 3850 """ a change marker.</p>"""
3851 )) 3851 ))
3852 self.changePreviousAct.triggered[()].connect(self.__previousChange) 3852 self.changePreviousAct.triggered[()].connect(self.__previousChange)
3853 self.bookmarkActions.append(self.changePreviousAct) 3853 self.bookmarkActions.append(self.changePreviousAct)
3854 3854
3855 self.bookmarkActGrp.setEnabled(False) 3855 self.bookmarkActGrp.setEnabled(False)
3856 3856
3954 'ViewManager', 'Perform spell check of current editor')) 3954 'ViewManager', 'Perform spell check of current editor'))
3955 self.spellCheckAct.setWhatsThis(QApplication.translate( 3955 self.spellCheckAct.setWhatsThis(QApplication.translate(
3956 'ViewManager', 3956 'ViewManager',
3957 """<b>Check spelling</b>""" 3957 """<b>Check spelling</b>"""
3958 """<p>Perform a spell check of the current editor.</p>""" 3958 """<p>Perform a spell check of the current editor.</p>"""
3959 )) 3959 ))
3960 self.spellCheckAct.triggered[()].connect(self.__spellCheck) 3960 self.spellCheckAct.triggered[()].connect(self.__spellCheck)
3961 self.spellingActions.append(self.spellCheckAct) 3961 self.spellingActions.append(self.spellCheckAct)
3962 3962
3963 self.autoSpellCheckAct = E5Action( 3963 self.autoSpellCheckAct = E5Action(
3964 QApplication.translate('ViewManager', 'Automatic spell checking'), 3964 QApplication.translate('ViewManager', 'Automatic spell checking'),
3972 self.autoSpellCheckAct.setWhatsThis(QApplication.translate( 3972 self.autoSpellCheckAct.setWhatsThis(QApplication.translate(
3973 'ViewManager', 3973 'ViewManager',
3974 """<b>Automatic spell checking</b>""" 3974 """<b>Automatic spell checking</b>"""
3975 """<p>Activate or deactivate the automatic spell checking""" 3975 """<p>Activate or deactivate the automatic spell checking"""
3976 """ function of all editors.</p>""" 3976 """ function of all editors.</p>"""
3977 )) 3977 ))
3978 self.autoSpellCheckAct.setChecked( 3978 self.autoSpellCheckAct.setChecked(
3979 Preferences.getEditor("AutoSpellCheckingEnabled")) 3979 Preferences.getEditor("AutoSpellCheckingEnabled"))
3980 self.autoSpellCheckAct.triggered[()].connect( 3980 self.autoSpellCheckAct.triggered[()].connect(
3981 self.__setAutoSpellChecking) 3981 self.__setAutoSpellChecking)
3982 self.spellingActions.append(self.autoSpellCheckAct) 3982 self.spellingActions.append(self.autoSpellCheckAct)
4102 self.ui, 4102 self.ui,
4103 QApplication.translate('ViewManager', "File Modified"), 4103 QApplication.translate('ViewManager', "File Modified"),
4104 QApplication.translate( 4104 QApplication.translate(
4105 'ViewManager', 4105 'ViewManager',
4106 """<p>The file <b>{0}</b> has unsaved changes.</p>""") 4106 """<p>The file <b>{0}</b> has unsaved changes.</p>""")
4107 .format(fn), 4107 .format(fn),
4108 editor.saveFile) 4108 editor.saveFile)
4109 if res: 4109 if res:
4110 self.setEditorName(editor, editor.getFileName()) 4110 self.setEditorName(editor, editor.getFileName())
4111 return res 4111 return res
4112 4112
4430 self.sbLang.setToolTip("") 4430 self.sbLang.setToolTip("")
4431 else: 4431 else:
4432 self.sbLang.setText("") 4432 self.sbLang.setText("")
4433 self.sbLang.setToolTip( 4433 self.sbLang.setToolTip(
4434 QApplication.translate('ViewManager', 'Language: {0}') 4434 QApplication.translate('ViewManager', 'Language: {0}')
4435 .format(language)) 4435 .format(language))
4436 4436
4437 if eol is None: 4437 if eol is None:
4438 eol = '' 4438 eol = ''
4439 self.sbEol.setPixmap(self.__eolPixmap(eol)) 4439 self.sbEol.setPixmap(self.__eolPixmap(eol))
4440 self.sbEol.setToolTip( 4440 self.sbEol.setToolTip(
5925 """ not be read.</p><p>Reason: {1}</p>""").format( 5925 """ not be read.</p><p>Reason: {1}</p>""").format(
5926 dictionaryFile, str(err))) 5926 dictionaryFile, str(err)))
5927 return 5927 return
5928 5928
5929 fileInfo = dictionaryFile if len(dictionaryFile) < 40 \ 5929 fileInfo = dictionaryFile if len(dictionaryFile) < 40 \
5930 else "...{0}".format(dictionaryFile[-40:]) 5930 else "...{0}".format(dictionaryFile[-40:])
5931 from QScintilla.SpellingDictionaryEditDialog import \ 5931 from QScintilla.SpellingDictionaryEditDialog import \
5932 SpellingDictionaryEditDialog 5932 SpellingDictionaryEditDialog
5933 dlg = SpellingDictionaryEditDialog( 5933 dlg = SpellingDictionaryEditDialog(
5934 data, 5934 data,
5935 QApplication.translate('ViewManager', "Editing {0}") 5935 QApplication.translate('ViewManager', "Editing {0}")
5936 .format(fileInfo), 5936 .format(fileInfo),
5937 self.ui) 5937 self.ui)
5938 if dlg.exec_() == QDialog.Accepted: 5938 if dlg.exec_() == QDialog.Accepted:
5939 data = dlg.getData() 5939 data = dlg.getData()
5940 try: 5940 try:
5941 f = open(dictionaryFile, "w", encoding="utf-8") 5941 f = open(dictionaryFile, "w", encoding="utf-8")
6230 if len(self.editors): 6230 if len(self.editors):
6231 if self.autosaveTimer.isActive() and \ 6231 if self.autosaveTimer.isActive() and \
6232 self.autosaveInterval == 0: 6232 self.autosaveInterval == 0:
6233 self.autosaveTimer.stop() 6233 self.autosaveTimer.stop()
6234 elif not self.autosaveTimer.isActive() and \ 6234 elif not self.autosaveTimer.isActive() and \
6235 self.autosaveInterval > 0: 6235 self.autosaveInterval > 0:
6236 self.autosaveTimer.start(self.autosaveInterval * 60000) 6236 self.autosaveTimer.start(self.autosaveInterval * 60000)
6237 6237
6238 self.__enableSpellingActions() 6238 self.__enableSpellingActions()
6239 6239
6240 def __editorSaved(self, fn): 6240 def __editorSaved(self, fn):

eric ide

mercurial