3325 """<p>Remove the highlights of all editors.</p>""" |
3325 """<p>Remove the highlights of all editors.</p>""" |
3326 )) |
3326 )) |
3327 self.unhighlightAct.triggered[()].connect(self.unhighlight) |
3327 self.unhighlightAct.triggered[()].connect(self.unhighlight) |
3328 self.viewActions.append(self.unhighlightAct) |
3328 self.viewActions.append(self.unhighlightAct) |
3329 |
3329 |
|
3330 self.newDocumentViewAct = E5Action( |
|
3331 QApplication.translate('ViewManager', 'New Document View'), |
|
3332 UI.PixmapCache.getIcon("documentNewView.png"), |
|
3333 QApplication.translate('ViewManager', 'New &Document View'), |
|
3334 0, 0, self, 'vm_view_new_document_view') |
|
3335 self.newDocumentViewAct.setStatusTip(QApplication.translate( |
|
3336 'ViewManager', 'Open a new view of the current document')) |
|
3337 self.newDocumentViewAct.setWhatsThis(QApplication.translate( |
|
3338 'ViewManager', |
|
3339 """<b>New Document View</b>""" |
|
3340 """<p>Opens a new view of the current document. Both views show""" |
|
3341 """ the same document. However, the cursors may be positioned""" |
|
3342 """ independently.</p>""" |
|
3343 )) |
|
3344 self.newDocumentViewAct.triggered[()].connect(self.__newDocumentView) |
|
3345 self.viewActions.append(self.newDocumentViewAct) |
|
3346 |
|
3347 self.newDocumentSplitViewAct = E5Action( |
|
3348 QApplication.translate( |
|
3349 'ViewManager', 'New Document View (with new split)'), |
|
3350 UI.PixmapCache.getIcon("splitVertical.png"), |
|
3351 QApplication.translate( |
|
3352 'ViewManager', 'New Document View (with new split)'), |
|
3353 0, 0, self, 'vm_view_new_document_split_view') |
|
3354 self.newDocumentSplitViewAct.setStatusTip(QApplication.translate( |
|
3355 'ViewManager', |
|
3356 'Open a new view of the current document in a new split')) |
|
3357 self.newDocumentSplitViewAct.setWhatsThis(QApplication.translate( |
|
3358 'ViewManager', |
|
3359 """<b>New Document View</b>""" |
|
3360 """<p>Opens a new view of the current document in a new split.""" |
|
3361 """ Both views show the same document. However, the cursors may""" |
|
3362 """ be positioned independently.</p>""" |
|
3363 )) |
|
3364 self.newDocumentSplitViewAct.triggered[()].connect( |
|
3365 self.__newDocumentSplitView) |
|
3366 self.viewActions.append(self.newDocumentSplitViewAct) |
|
3367 |
3330 self.splitViewAct = E5Action( |
3368 self.splitViewAct = E5Action( |
3331 QApplication.translate('ViewManager', 'Split view'), |
3369 QApplication.translate('ViewManager', 'Split view'), |
3332 UI.PixmapCache.getIcon("splitVertical.png"), |
3370 UI.PixmapCache.getIcon("splitVertical.png"), |
3333 QApplication.translate('ViewManager', '&Split view'), |
3371 QApplication.translate('ViewManager', '&Split view'), |
3334 0, 0, self, 'vm_view_split_view') |
3372 0, 0, self, 'vm_view_split_view') |
3445 menu.addActions(self.viewFoldActGrp.actions()) |
3483 menu.addActions(self.viewFoldActGrp.actions()) |
3446 menu.addSeparator() |
3484 menu.addSeparator() |
3447 menu.addAction(self.previewAct) |
3485 menu.addAction(self.previewAct) |
3448 menu.addSeparator() |
3486 menu.addSeparator() |
3449 menu.addAction(self.unhighlightAct) |
3487 menu.addAction(self.unhighlightAct) |
|
3488 menu.addSeparator() |
|
3489 menu.addAction(self.newDocumentViewAct) |
3450 if self.canSplit(): |
3490 if self.canSplit(): |
|
3491 menu.addAction(self.newDocumentSplitViewAct) |
3451 menu.addSeparator() |
3492 menu.addSeparator() |
3452 menu.addAction(self.splitViewAct) |
3493 menu.addAction(self.splitViewAct) |
3453 menu.addAction(self.splitOrientationAct) |
3494 menu.addAction(self.splitOrientationAct) |
3454 menu.addAction(self.splitRemoveAct) |
3495 menu.addAction(self.splitRemoveAct) |
3455 menu.addAction(self.nextSplitAct) |
3496 menu.addAction(self.nextSplitAct) |
3471 tb.setToolTip(QApplication.translate('ViewManager', 'View')) |
3512 tb.setToolTip(QApplication.translate('ViewManager', 'View')) |
3472 |
3513 |
3473 tb.addActions(self.viewActGrp.actions()) |
3514 tb.addActions(self.viewActGrp.actions()) |
3474 tb.addSeparator() |
3515 tb.addSeparator() |
3475 tb.addAction(self.previewAct) |
3516 tb.addAction(self.previewAct) |
|
3517 tb.addSeparator() |
|
3518 tb.addAction(self.newDocumentViewAct) |
|
3519 if self.canSplit(): |
|
3520 tb.addAction(self.newDocumentSplitViewAct) |
3476 |
3521 |
3477 toolbarManager.addToolBar(tb, tb.windowTitle()) |
3522 toolbarManager.addToolBar(tb, tb.windowTitle()) |
3478 toolbarManager.addAction(self.unhighlightAct, tb.windowTitle()) |
3523 toolbarManager.addAction(self.unhighlightAct, tb.windowTitle()) |
3479 toolbarManager.addAction(self.splitViewAct, tb.windowTitle()) |
3524 toolbarManager.addAction(self.splitViewAct, tb.windowTitle()) |
3480 toolbarManager.addAction(self.splitRemoveAct, tb.windowTitle()) |
3525 toolbarManager.addAction(self.splitRemoveAct, tb.windowTitle()) |
5548 """ |
5593 """ |
5549 aw = self.activeWindow() |
5594 aw = self.activeWindow() |
5550 if aw: |
5595 if aw: |
5551 line, index = aw.getCursorPosition() |
5596 line, index = aw.getCursorPosition() |
5552 aw.foldLine(line) |
5597 aw.foldLine(line) |
|
5598 |
|
5599 def __newDocumentView(self): |
|
5600 """ |
|
5601 Private method to open a new view of the current editor. |
|
5602 """ |
|
5603 aw = self.activeWindow() |
|
5604 if aw: |
|
5605 self.newEditorView(aw.getFileName(), aw, aw.getFileType()) |
|
5606 |
|
5607 def __newDocumentSplitView(self): |
|
5608 """ |
|
5609 Private method to open a new view of the current editor in a new split. |
|
5610 """ |
|
5611 aw = self.activeWindow() |
|
5612 if aw: |
|
5613 self.addSplit() |
|
5614 self.newEditorView(aw.getFileName(), aw, aw.getFileType()) |
5553 |
5615 |
5554 def __splitView(self): |
5616 def __splitView(self): |
5555 """ |
5617 """ |
5556 Private method to handle the split view action. |
5618 Private method to handle the split view action. |
5557 """ |
5619 """ |
6043 self.searchActGrp.setEnabled(False) |
6105 self.searchActGrp.setEnabled(False) |
6044 self.quickFindtextCombo.setEnabled(False) |
6106 self.quickFindtextCombo.setEnabled(False) |
6045 self.viewActGrp.setEnabled(False) |
6107 self.viewActGrp.setEnabled(False) |
6046 self.viewFoldActGrp.setEnabled(False) |
6108 self.viewFoldActGrp.setEnabled(False) |
6047 self.unhighlightAct.setEnabled(False) |
6109 self.unhighlightAct.setEnabled(False) |
|
6110 self.newDocumentViewAct.setEnabled(False) |
|
6111 self.newDocumentSplitViewAct.setEnabled(False) |
6048 self.splitViewAct.setEnabled(False) |
6112 self.splitViewAct.setEnabled(False) |
6049 self.splitOrientationAct.setEnabled(False) |
6113 self.splitOrientationAct.setEnabled(False) |
6050 self.previewAct.setEnabled(True) |
6114 self.previewAct.setEnabled(True) |
6051 self.macroActGrp.setEnabled(False) |
6115 self.macroActGrp.setEnabled(False) |
6052 self.bookmarkActGrp.setEnabled(False) |
6116 self.bookmarkActGrp.setEnabled(False) |
6080 self.searchActGrp.setEnabled(True) |
6144 self.searchActGrp.setEnabled(True) |
6081 self.quickFindtextCombo.setEnabled(True) |
6145 self.quickFindtextCombo.setEnabled(True) |
6082 self.viewActGrp.setEnabled(True) |
6146 self.viewActGrp.setEnabled(True) |
6083 self.viewFoldActGrp.setEnabled(True) |
6147 self.viewFoldActGrp.setEnabled(True) |
6084 self.unhighlightAct.setEnabled(True) |
6148 self.unhighlightAct.setEnabled(True) |
|
6149 self.newDocumentViewAct.setEnabled(True) |
6085 if self.canSplit(): |
6150 if self.canSplit(): |
|
6151 self.newDocumentSplitViewAct.setEnabled(True) |
6086 self.splitViewAct.setEnabled(True) |
6152 self.splitViewAct.setEnabled(True) |
6087 self.splitOrientationAct.setEnabled(True) |
6153 self.splitOrientationAct.setEnabled(True) |
6088 self.macroActGrp.setEnabled(True) |
6154 self.macroActGrp.setEnabled(True) |
6089 self.bookmarkActGrp.setEnabled(True) |
6155 self.bookmarkActGrp.setEnabled(True) |
6090 self.__enableSpellingActions() |
6156 self.__enableSpellingActions() |