3456:96232974dcdb | 3484:645c12de6b0c |
---|---|
9 | 9 |
10 from __future__ import unicode_literals | 10 from __future__ import unicode_literals |
11 | 11 |
12 import os | 12 import os |
13 | 13 |
14 from PyQt4.QtCore import QSignalMapper, QTimer, QFileInfo, pyqtSignal, \ | 14 from PyQt4.QtCore import pyqtSignal, QSignalMapper, QTimer, \ |
15 QRegExp, QObject, Qt | 15 QFileInfo, QRegExp, QObject, Qt |
16 from PyQt4.QtGui import QColor, QKeySequence, QLineEdit, QToolBar, \ | 16 from PyQt4.QtGui import QColor, QKeySequence, QLineEdit, QToolBar, \ |
17 QWidgetAction, QDialog, QApplication, QMenu, QPalette, QComboBox, QPixmap | 17 QWidgetAction, QDialog, QApplication, QMenu, QPalette, QComboBox, QPixmap |
18 from PyQt4.Qsci import QsciScintilla | 18 from PyQt4.Qsci import QsciScintilla |
19 | 19 |
20 from E5Gui.E5Application import e5App | 20 from E5Gui.E5Application import e5App |
264 self.sbWritable = sbWritable | 264 self.sbWritable = sbWritable |
265 self.sbEnc = sbEncoding | 265 self.sbEnc = sbEncoding |
266 self.sbLang = sbLanguage | 266 self.sbLang = sbLanguage |
267 self.sbEol = sbEol | 267 self.sbEol = sbEol |
268 self.sbZoom = sbZoom | 268 self.sbZoom = sbZoom |
269 self.sbZoom.valueChanged.connect(self.__zoom) | 269 self.sbZoom.valueChanged.connect(self.__zoomTo) |
270 self.__setSbFile(zoom=0) | 270 self.__setSbFile(zoom=0) |
271 | |
272 self.sbLang.clicked.connect(self.__showLanguagesMenu) | |
273 self.sbEol.clicked.connect(self.__showEolMenu) | |
274 self.sbEnc.clicked.connect(self.__showEncodingsMenu) | |
275 | |
276 ################################################################## | |
277 ## Below are menu handling methods for status bar labels | |
278 ################################################################## | |
279 | |
280 def __showLanguagesMenu(self, pos): | |
281 """ | |
282 Private slot to show the Languages menu of the current editor. | |
283 | |
284 @param pos position the menu should be shown at (QPoint) | |
285 """ | |
286 aw = self.activeWindow() | |
287 if aw is not None: | |
288 menu = aw.getMenu("Languages") | |
289 if menu is not None: | |
290 menu.exec_(pos) | |
291 | |
292 def __showEolMenu(self, pos): | |
293 """ | |
294 Private slot to show the EOL menu of the current editor. | |
295 | |
296 @param pos position the menu should be shown at (QPoint) | |
297 """ | |
298 aw = self.activeWindow() | |
299 if aw is not None: | |
300 menu = aw.getMenu("Eol") | |
301 if menu is not None: | |
302 menu.exec_(pos) | |
303 | |
304 def __showEncodingsMenu(self, pos): | |
305 """ | |
306 Private slot to show the Encodings menu of the current editor. | |
307 | |
308 @param pos position the menu should be shown at (QPoint) | |
309 """ | |
310 aw = self.activeWindow() | |
311 if aw is not None: | |
312 menu = aw.getMenu("Encodings") | |
313 if menu is not None: | |
314 menu.exec_(pos) | |
271 | 315 |
272 ########################################################################### | 316 ########################################################################### |
273 ## methods below need to be implemented by a subclass | 317 ## methods below need to be implemented by a subclass |
274 ########################################################################### | 318 ########################################################################### |
275 | 319 |
531 self.newAct.setWhatsThis(QApplication.translate( | 575 self.newAct.setWhatsThis(QApplication.translate( |
532 'ViewManager', | 576 'ViewManager', |
533 """<b>New</b>""" | 577 """<b>New</b>""" |
534 """<p>An empty editor window will be created.</p>""" | 578 """<p>An empty editor window will be created.</p>""" |
535 )) | 579 )) |
536 self.newAct.triggered[()].connect(self.newEditor) | 580 self.newAct.triggered.connect(self.newEditor) |
537 self.fileActions.append(self.newAct) | 581 self.fileActions.append(self.newAct) |
538 | 582 |
539 self.openAct = E5Action( | 583 self.openAct = E5Action( |
540 QApplication.translate('ViewManager', 'Open'), | 584 QApplication.translate('ViewManager', 'Open'), |
541 UI.PixmapCache.getIcon("open.png"), | 585 UI.PixmapCache.getIcon("open.png"), |
549 'ViewManager', | 593 'ViewManager', |
550 """<b>Open a file</b>""" | 594 """<b>Open a file</b>""" |
551 """<p>You will be asked for the name of a file to be opened""" | 595 """<p>You will be asked for the name of a file to be opened""" |
552 """ in an editor window.</p>""" | 596 """ in an editor window.</p>""" |
553 )) | 597 )) |
554 self.openAct.triggered[()].connect(self.openFiles) | 598 self.openAct.triggered.connect(self.__openFiles) |
555 self.fileActions.append(self.openAct) | 599 self.fileActions.append(self.openAct) |
556 | 600 |
557 self.closeActGrp = createActionGroup(self) | 601 self.closeActGrp = createActionGroup(self) |
558 | 602 |
559 self.closeAct = E5Action( | 603 self.closeAct = E5Action( |
568 self.closeAct.setWhatsThis(QApplication.translate( | 612 self.closeAct.setWhatsThis(QApplication.translate( |
569 'ViewManager', | 613 'ViewManager', |
570 """<b>Close Window</b>""" | 614 """<b>Close Window</b>""" |
571 """<p>Close the current window.</p>""" | 615 """<p>Close the current window.</p>""" |
572 )) | 616 )) |
573 self.closeAct.triggered[()].connect(self.closeCurrentWindow) | 617 self.closeAct.triggered.connect(self.closeCurrentWindow) |
574 self.fileActions.append(self.closeAct) | 618 self.fileActions.append(self.closeAct) |
575 | 619 |
576 self.closeAllAct = E5Action( | 620 self.closeAllAct = E5Action( |
577 QApplication.translate('ViewManager', 'Close All'), | 621 QApplication.translate('ViewManager', 'Close All'), |
578 QApplication.translate('ViewManager', 'Clos&e All'), | 622 QApplication.translate('ViewManager', 'Clos&e All'), |
582 self.closeAllAct.setWhatsThis(QApplication.translate( | 626 self.closeAllAct.setWhatsThis(QApplication.translate( |
583 'ViewManager', | 627 'ViewManager', |
584 """<b>Close All Windows</b>""" | 628 """<b>Close All Windows</b>""" |
585 """<p>Close all editor windows.</p>""" | 629 """<p>Close all editor windows.</p>""" |
586 )) | 630 )) |
587 self.closeAllAct.triggered[()].connect(self.closeAllWindows) | 631 self.closeAllAct.triggered.connect(self.closeAllWindows) |
588 self.fileActions.append(self.closeAllAct) | 632 self.fileActions.append(self.closeAllAct) |
589 | 633 |
590 self.closeActGrp.setEnabled(False) | 634 self.closeActGrp.setEnabled(False) |
591 | 635 |
592 self.saveActGrp = createActionGroup(self) | 636 self.saveActGrp = createActionGroup(self) |
603 self.saveAct.setWhatsThis(QApplication.translate( | 647 self.saveAct.setWhatsThis(QApplication.translate( |
604 'ViewManager', | 648 'ViewManager', |
605 """<b>Save File</b>""" | 649 """<b>Save File</b>""" |
606 """<p>Save the contents of current editor window.</p>""" | 650 """<p>Save the contents of current editor window.</p>""" |
607 )) | 651 )) |
608 self.saveAct.triggered[()].connect(self.saveCurrentEditor) | 652 self.saveAct.triggered.connect(self.saveCurrentEditor) |
609 self.fileActions.append(self.saveAct) | 653 self.fileActions.append(self.saveAct) |
610 | 654 |
611 self.saveAsAct = E5Action( | 655 self.saveAsAct = E5Action( |
612 QApplication.translate('ViewManager', 'Save as'), | 656 QApplication.translate('ViewManager', 'Save as'), |
613 UI.PixmapCache.getIcon("fileSaveAs.png"), | 657 UI.PixmapCache.getIcon("fileSaveAs.png"), |
621 'ViewManager', | 665 'ViewManager', |
622 """<b>Save File as</b>""" | 666 """<b>Save File as</b>""" |
623 """<p>Save the contents of current editor window to a new file.""" | 667 """<p>Save the contents of current editor window to a new file.""" |
624 """ The file can be entered in a file selection dialog.</p>""" | 668 """ The file can be entered in a file selection dialog.</p>""" |
625 )) | 669 )) |
626 self.saveAsAct.triggered[()].connect(self.saveAsCurrentEditor) | 670 self.saveAsAct.triggered.connect(self.saveAsCurrentEditor) |
627 self.fileActions.append(self.saveAsAct) | 671 self.fileActions.append(self.saveAsAct) |
628 | 672 |
629 self.saveAllAct = E5Action( | 673 self.saveAllAct = E5Action( |
630 QApplication.translate('ViewManager', 'Save all'), | 674 QApplication.translate('ViewManager', 'Save all'), |
631 UI.PixmapCache.getIcon("fileSaveAll.png"), | 675 UI.PixmapCache.getIcon("fileSaveAll.png"), |
636 self.saveAllAct.setWhatsThis(QApplication.translate( | 680 self.saveAllAct.setWhatsThis(QApplication.translate( |
637 'ViewManager', | 681 'ViewManager', |
638 """<b>Save All Files</b>""" | 682 """<b>Save All Files</b>""" |
639 """<p>Save the contents of all editor windows.</p>""" | 683 """<p>Save the contents of all editor windows.</p>""" |
640 )) | 684 )) |
641 self.saveAllAct.triggered[()].connect(self.saveAllEditors) | 685 self.saveAllAct.triggered.connect(self.saveAllEditors) |
642 self.fileActions.append(self.saveAllAct) | 686 self.fileActions.append(self.saveAllAct) |
643 | 687 |
644 self.saveActGrp.setEnabled(False) | 688 self.saveActGrp.setEnabled(False) |
645 | 689 |
646 self.printAct = E5Action( | 690 self.printAct = E5Action( |
655 self.printAct.setWhatsThis(QApplication.translate( | 699 self.printAct.setWhatsThis(QApplication.translate( |
656 'ViewManager', | 700 'ViewManager', |
657 """<b>Print File</b>""" | 701 """<b>Print File</b>""" |
658 """<p>Print the contents of current editor window.</p>""" | 702 """<p>Print the contents of current editor window.</p>""" |
659 )) | 703 )) |
660 self.printAct.triggered[()].connect(self.printCurrentEditor) | 704 self.printAct.triggered.connect(self.printCurrentEditor) |
661 self.printAct.setEnabled(False) | 705 self.printAct.setEnabled(False) |
662 self.fileActions.append(self.printAct) | 706 self.fileActions.append(self.printAct) |
663 | 707 |
664 self.printPreviewAct = E5Action( | 708 self.printPreviewAct = E5Action( |
665 QApplication.translate('ViewManager', 'Print Preview'), | 709 QApplication.translate('ViewManager', 'Print Preview'), |
671 self.printPreviewAct.setWhatsThis(QApplication.translate( | 715 self.printPreviewAct.setWhatsThis(QApplication.translate( |
672 'ViewManager', | 716 'ViewManager', |
673 """<b>Print Preview</b>""" | 717 """<b>Print Preview</b>""" |
674 """<p>Print preview of the current editor window.</p>""" | 718 """<p>Print preview of the current editor window.</p>""" |
675 )) | 719 )) |
676 self.printPreviewAct.triggered[()].connect( | 720 self.printPreviewAct.triggered.connect( |
677 self.printPreviewCurrentEditor) | 721 self.printPreviewCurrentEditor) |
678 self.printPreviewAct.setEnabled(False) | 722 self.printPreviewAct.setEnabled(False) |
679 self.fileActions.append(self.printPreviewAct) | 723 self.fileActions.append(self.printPreviewAct) |
680 | 724 |
681 self.findFileNameAct = E5Action( | 725 self.findFileNameAct = E5Action( |
689 self.findFileNameAct.setWhatsThis(QApplication.translate( | 733 self.findFileNameAct.setWhatsThis(QApplication.translate( |
690 'ViewManager', | 734 'ViewManager', |
691 """<b>Search File</b>""" | 735 """<b>Search File</b>""" |
692 """<p>Search for a file.</p>""" | 736 """<p>Search for a file.</p>""" |
693 )) | 737 )) |
694 self.findFileNameAct.triggered[()].connect(self.__findFileName) | 738 self.findFileNameAct.triggered.connect(self.__findFileName) |
695 self.fileActions.append(self.findFileNameAct) | 739 self.fileActions.append(self.findFileNameAct) |
696 | 740 |
697 def initFileMenu(self): | 741 def initFileMenu(self): |
698 """ | 742 """ |
699 Public method to create the File menu. | 743 Public method to create the File menu. |
809 self.undoAct.setWhatsThis(QApplication.translate( | 853 self.undoAct.setWhatsThis(QApplication.translate( |
810 'ViewManager', | 854 'ViewManager', |
811 """<b>Undo</b>""" | 855 """<b>Undo</b>""" |
812 """<p>Undo the last change done in the current editor.</p>""" | 856 """<p>Undo the last change done in the current editor.</p>""" |
813 )) | 857 )) |
814 self.undoAct.triggered[()].connect(self.__editUndo) | 858 self.undoAct.triggered.connect(self.__editUndo) |
815 self.editActions.append(self.undoAct) | 859 self.editActions.append(self.undoAct) |
816 | 860 |
817 self.redoAct = E5Action( | 861 self.redoAct = E5Action( |
818 QApplication.translate('ViewManager', 'Redo'), | 862 QApplication.translate('ViewManager', 'Redo'), |
819 UI.PixmapCache.getIcon("editRedo.png"), | 863 UI.PixmapCache.getIcon("editRedo.png"), |
827 self.redoAct.setWhatsThis(QApplication.translate( | 871 self.redoAct.setWhatsThis(QApplication.translate( |
828 'ViewManager', | 872 'ViewManager', |
829 """<b>Redo</b>""" | 873 """<b>Redo</b>""" |
830 """<p>Redo the last change done in the current editor.</p>""" | 874 """<p>Redo the last change done in the current editor.</p>""" |
831 )) | 875 )) |
832 self.redoAct.triggered[()].connect(self.__editRedo) | 876 self.redoAct.triggered.connect(self.__editRedo) |
833 self.editActions.append(self.redoAct) | 877 self.editActions.append(self.redoAct) |
834 | 878 |
835 self.revertAct = E5Action( | 879 self.revertAct = E5Action( |
836 QApplication.translate( | 880 QApplication.translate( |
837 'ViewManager', 'Revert to last saved state'), | 881 'ViewManager', 'Revert to last saved state'), |
847 'ViewManager', | 891 'ViewManager', |
848 """<b>Revert to last saved state</b>""" | 892 """<b>Revert to last saved state</b>""" |
849 """<p>Undo all changes up to the last saved state""" | 893 """<p>Undo all changes up to the last saved state""" |
850 """ of the current editor.</p>""" | 894 """ of the current editor.</p>""" |
851 )) | 895 )) |
852 self.revertAct.triggered[()].connect(self.__editRevert) | 896 self.revertAct.triggered.connect(self.__editRevert) |
853 self.editActions.append(self.revertAct) | 897 self.editActions.append(self.revertAct) |
854 | 898 |
855 self.copyActGrp = createActionGroup(self.editActGrp) | 899 self.copyActGrp = createActionGroup(self.editActGrp) |
856 | 900 |
857 self.cutAct = E5Action( | 901 self.cutAct = E5Action( |
869 'ViewManager', | 913 'ViewManager', |
870 """<b>Cut</b>""" | 914 """<b>Cut</b>""" |
871 """<p>Cut the selected text of the current editor to the""" | 915 """<p>Cut the selected text of the current editor to the""" |
872 """ clipboard.</p>""" | 916 """ clipboard.</p>""" |
873 )) | 917 )) |
874 self.cutAct.triggered[()].connect(self.__editCut) | 918 self.cutAct.triggered.connect(self.__editCut) |
875 self.editActions.append(self.cutAct) | 919 self.editActions.append(self.cutAct) |
876 | 920 |
877 self.copyAct = E5Action( | 921 self.copyAct = E5Action( |
878 QApplication.translate('ViewManager', 'Copy'), | 922 QApplication.translate('ViewManager', 'Copy'), |
879 UI.PixmapCache.getIcon("editCopy.png"), | 923 UI.PixmapCache.getIcon("editCopy.png"), |
889 'ViewManager', | 933 'ViewManager', |
890 """<b>Copy</b>""" | 934 """<b>Copy</b>""" |
891 """<p>Copy the selected text of the current editor to the""" | 935 """<p>Copy the selected text of the current editor to the""" |
892 """ clipboard.</p>""" | 936 """ clipboard.</p>""" |
893 )) | 937 )) |
894 self.copyAct.triggered[()].connect(self.__editCopy) | 938 self.copyAct.triggered.connect(self.__editCopy) |
895 self.editActions.append(self.copyAct) | 939 self.editActions.append(self.copyAct) |
896 | 940 |
897 self.pasteAct = E5Action( | 941 self.pasteAct = E5Action( |
898 QApplication.translate('ViewManager', 'Paste'), | 942 QApplication.translate('ViewManager', 'Paste'), |
899 UI.PixmapCache.getIcon("editPaste.png"), | 943 UI.PixmapCache.getIcon("editPaste.png"), |
909 'ViewManager', | 953 'ViewManager', |
910 """<b>Paste</b>""" | 954 """<b>Paste</b>""" |
911 """<p>Paste the last cut/copied text from the clipboard to""" | 955 """<p>Paste the last cut/copied text from the clipboard to""" |
912 """ the current editor.</p>""" | 956 """ the current editor.</p>""" |
913 )) | 957 )) |
914 self.pasteAct.triggered[()].connect(self.__editPaste) | 958 self.pasteAct.triggered.connect(self.__editPaste) |
915 self.editActions.append(self.pasteAct) | 959 self.editActions.append(self.pasteAct) |
916 | 960 |
917 self.deleteAct = E5Action( | 961 self.deleteAct = E5Action( |
918 QApplication.translate('ViewManager', 'Clear'), | 962 QApplication.translate('ViewManager', 'Clear'), |
919 UI.PixmapCache.getIcon("editDelete.png"), | 963 UI.PixmapCache.getIcon("editDelete.png"), |
927 self.deleteAct.setWhatsThis(QApplication.translate( | 971 self.deleteAct.setWhatsThis(QApplication.translate( |
928 'ViewManager', | 972 'ViewManager', |
929 """<b>Clear</b>""" | 973 """<b>Clear</b>""" |
930 """<p>Delete all text of the current editor.</p>""" | 974 """<p>Delete all text of the current editor.</p>""" |
931 )) | 975 )) |
932 self.deleteAct.triggered[()].connect(self.__editDelete) | 976 self.deleteAct.triggered.connect(self.__editDelete) |
933 self.editActions.append(self.deleteAct) | 977 self.editActions.append(self.deleteAct) |
934 | 978 |
935 self.joinAct = E5Action( | 979 self.joinAct = E5Action( |
936 QApplication.translate('ViewManager', 'Join Lines'), | 980 QApplication.translate('ViewManager', 'Join Lines'), |
937 QApplication.translate('ViewManager', 'Join Lines'), | 981 QApplication.translate('ViewManager', 'Join Lines'), |
944 self.joinAct.setWhatsThis(QApplication.translate( | 988 self.joinAct.setWhatsThis(QApplication.translate( |
945 'ViewManager', | 989 'ViewManager', |
946 """<b>Join Lines</b>""" | 990 """<b>Join Lines</b>""" |
947 """<p>Join the current and the next lines.</p>""" | 991 """<p>Join the current and the next lines.</p>""" |
948 )) | 992 )) |
949 self.joinAct.triggered[()].connect(self.__editJoin) | 993 self.joinAct.triggered.connect(self.__editJoin) |
950 self.editActions.append(self.joinAct) | 994 self.editActions.append(self.joinAct) |
951 | 995 |
952 self.indentAct = E5Action( | 996 self.indentAct = E5Action( |
953 QApplication.translate('ViewManager', 'Indent'), | 997 QApplication.translate('ViewManager', 'Indent'), |
954 UI.PixmapCache.getIcon("editIndent.png"), | 998 UI.PixmapCache.getIcon("editIndent.png"), |
963 'ViewManager', | 1007 'ViewManager', |
964 """<b>Indent</b>""" | 1008 """<b>Indent</b>""" |
965 """<p>Indents the current line or the lines of the""" | 1009 """<p>Indents the current line or the lines of the""" |
966 """ selection by one level.</p>""" | 1010 """ selection by one level.</p>""" |
967 )) | 1011 )) |
968 self.indentAct.triggered[()].connect(self.__editIndent) | 1012 self.indentAct.triggered.connect(self.__editIndent) |
969 self.editActions.append(self.indentAct) | 1013 self.editActions.append(self.indentAct) |
970 | 1014 |
971 self.unindentAct = E5Action( | 1015 self.unindentAct = E5Action( |
972 QApplication.translate('ViewManager', 'Unindent'), | 1016 QApplication.translate('ViewManager', 'Unindent'), |
973 UI.PixmapCache.getIcon("editUnindent.png"), | 1017 UI.PixmapCache.getIcon("editUnindent.png"), |
982 'ViewManager', | 1026 'ViewManager', |
983 """<b>Unindent</b>""" | 1027 """<b>Unindent</b>""" |
984 """<p>Unindents the current line or the lines of the""" | 1028 """<p>Unindents the current line or the lines of the""" |
985 """ selection by one level.</p>""" | 1029 """ selection by one level.</p>""" |
986 )) | 1030 )) |
987 self.unindentAct.triggered[()].connect(self.__editUnindent) | 1031 self.unindentAct.triggered.connect(self.__editUnindent) |
988 self.editActions.append(self.unindentAct) | 1032 self.editActions.append(self.unindentAct) |
989 | 1033 |
990 self.smartIndentAct = E5Action( | 1034 self.smartIndentAct = E5Action( |
991 QApplication.translate('ViewManager', 'Smart indent'), | 1035 QApplication.translate('ViewManager', 'Smart indent'), |
992 UI.PixmapCache.getIcon("editSmartIndent.png"), | 1036 UI.PixmapCache.getIcon("editSmartIndent.png"), |
1001 'ViewManager', | 1045 'ViewManager', |
1002 """<b>Smart indent</b>""" | 1046 """<b>Smart indent</b>""" |
1003 """<p>Indents the current line or the lines of the""" | 1047 """<p>Indents the current line or the lines of the""" |
1004 """ current selection smartly.</p>""" | 1048 """ current selection smartly.</p>""" |
1005 )) | 1049 )) |
1006 self.smartIndentAct.triggered[()].connect(self.__editSmartIndent) | 1050 self.smartIndentAct.triggered.connect(self.__editSmartIndent) |
1007 self.editActions.append(self.smartIndentAct) | 1051 self.editActions.append(self.smartIndentAct) |
1008 | 1052 |
1009 self.commentAct = E5Action( | 1053 self.commentAct = E5Action( |
1010 QApplication.translate('ViewManager', 'Comment'), | 1054 QApplication.translate('ViewManager', 'Comment'), |
1011 UI.PixmapCache.getIcon("editComment.png"), | 1055 UI.PixmapCache.getIcon("editComment.png"), |
1020 'ViewManager', | 1064 'ViewManager', |
1021 """<b>Comment</b>""" | 1065 """<b>Comment</b>""" |
1022 """<p>Comments the current line or the lines of the""" | 1066 """<p>Comments the current line or the lines of the""" |
1023 """ current selection.</p>""" | 1067 """ current selection.</p>""" |
1024 )) | 1068 )) |
1025 self.commentAct.triggered[()].connect(self.__editComment) | 1069 self.commentAct.triggered.connect(self.__editComment) |
1026 self.editActions.append(self.commentAct) | 1070 self.editActions.append(self.commentAct) |
1027 | 1071 |
1028 self.uncommentAct = E5Action( | 1072 self.uncommentAct = E5Action( |
1029 QApplication.translate('ViewManager', 'Uncomment'), | 1073 QApplication.translate('ViewManager', 'Uncomment'), |
1030 UI.PixmapCache.getIcon("editUncomment.png"), | 1074 UI.PixmapCache.getIcon("editUncomment.png"), |
1039 'ViewManager', | 1083 'ViewManager', |
1040 """<b>Uncomment</b>""" | 1084 """<b>Uncomment</b>""" |
1041 """<p>Uncomments the current line or the lines of the""" | 1085 """<p>Uncomments the current line or the lines of the""" |
1042 """ current selection.</p>""" | 1086 """ current selection.</p>""" |
1043 )) | 1087 )) |
1044 self.uncommentAct.triggered[()].connect(self.__editUncomment) | 1088 self.uncommentAct.triggered.connect(self.__editUncomment) |
1045 self.editActions.append(self.uncommentAct) | 1089 self.editActions.append(self.uncommentAct) |
1046 | 1090 |
1047 self.toggleCommentAct = E5Action( | 1091 self.toggleCommentAct = E5Action( |
1048 QApplication.translate('ViewManager', 'Toggle Comment'), | 1092 QApplication.translate('ViewManager', 'Toggle Comment'), |
1049 UI.PixmapCache.getIcon("editToggleComment.png"), | 1093 UI.PixmapCache.getIcon("editToggleComment.png"), |
1061 """<b>Toggle Comment</b>""" | 1105 """<b>Toggle Comment</b>""" |
1062 """<p>If the current line does not start with a block comment,""" | 1106 """<p>If the current line does not start with a block comment,""" |
1063 """ the current line or selection is commented. If it is already""" | 1107 """ the current line or selection is commented. If it is already""" |
1064 """ commented, this comment block is uncommented. </p>""" | 1108 """ commented, this comment block is uncommented. </p>""" |
1065 )) | 1109 )) |
1066 self.toggleCommentAct.triggered[()].connect(self.__editToggleComment) | 1110 self.toggleCommentAct.triggered.connect(self.__editToggleComment) |
1067 self.editActions.append(self.toggleCommentAct) | 1111 self.editActions.append(self.toggleCommentAct) |
1068 | 1112 |
1069 self.streamCommentAct = E5Action( | 1113 self.streamCommentAct = E5Action( |
1070 QApplication.translate('ViewManager', 'Stream Comment'), | 1114 QApplication.translate('ViewManager', 'Stream Comment'), |
1071 QApplication.translate('ViewManager', 'Stream Comment'), | 1115 QApplication.translate('ViewManager', 'Stream Comment'), |
1078 'ViewManager', | 1122 'ViewManager', |
1079 """<b>Stream Comment</b>""" | 1123 """<b>Stream Comment</b>""" |
1080 """<p>Stream comments the current line or the current""" | 1124 """<p>Stream comments the current line or the current""" |
1081 """ selection.</p>""" | 1125 """ selection.</p>""" |
1082 )) | 1126 )) |
1083 self.streamCommentAct.triggered[()].connect(self.__editStreamComment) | 1127 self.streamCommentAct.triggered.connect(self.__editStreamComment) |
1084 self.editActions.append(self.streamCommentAct) | 1128 self.editActions.append(self.streamCommentAct) |
1085 | 1129 |
1086 self.boxCommentAct = E5Action( | 1130 self.boxCommentAct = E5Action( |
1087 QApplication.translate('ViewManager', 'Box Comment'), | 1131 QApplication.translate('ViewManager', 'Box Comment'), |
1088 QApplication.translate('ViewManager', 'Box Comment'), | 1132 QApplication.translate('ViewManager', 'Box Comment'), |
1094 'ViewManager', | 1138 'ViewManager', |
1095 """<b>Box Comment</b>""" | 1139 """<b>Box Comment</b>""" |
1096 """<p>Box comments the current line or the lines of the""" | 1140 """<p>Box comments the current line or the lines of the""" |
1097 """ current selection.</p>""" | 1141 """ current selection.</p>""" |
1098 )) | 1142 )) |
1099 self.boxCommentAct.triggered[()].connect(self.__editBoxComment) | 1143 self.boxCommentAct.triggered.connect(self.__editBoxComment) |
1100 self.editActions.append(self.boxCommentAct) | 1144 self.editActions.append(self.boxCommentAct) |
1101 | 1145 |
1102 self.selectBraceAct = E5Action( | 1146 self.selectBraceAct = E5Action( |
1103 QApplication.translate('ViewManager', 'Select to brace'), | 1147 QApplication.translate('ViewManager', 'Select to brace'), |
1104 QApplication.translate('ViewManager', 'Select to &brace'), | 1148 QApplication.translate('ViewManager', 'Select to &brace'), |
1112 'ViewManager', | 1156 'ViewManager', |
1113 """<b>Select to brace</b>""" | 1157 """<b>Select to brace</b>""" |
1114 """<p>Select text of the current editor to the matching""" | 1158 """<p>Select text of the current editor to the matching""" |
1115 """ brace.</p>""" | 1159 """ brace.</p>""" |
1116 )) | 1160 )) |
1117 self.selectBraceAct.triggered[()].connect(self.__editSelectBrace) | 1161 self.selectBraceAct.triggered.connect(self.__editSelectBrace) |
1118 self.editActions.append(self.selectBraceAct) | 1162 self.editActions.append(self.selectBraceAct) |
1119 | 1163 |
1120 self.selectAllAct = E5Action( | 1164 self.selectAllAct = E5Action( |
1121 QApplication.translate('ViewManager', 'Select all'), | 1165 QApplication.translate('ViewManager', 'Select all'), |
1122 QApplication.translate('ViewManager', '&Select all'), | 1166 QApplication.translate('ViewManager', '&Select all'), |
1129 self.selectAllAct.setWhatsThis(QApplication.translate( | 1173 self.selectAllAct.setWhatsThis(QApplication.translate( |
1130 'ViewManager', | 1174 'ViewManager', |
1131 """<b>Select All</b>""" | 1175 """<b>Select All</b>""" |
1132 """<p>Select all text of the current editor.</p>""" | 1176 """<p>Select all text of the current editor.</p>""" |
1133 )) | 1177 )) |
1134 self.selectAllAct.triggered[()].connect(self.__editSelectAll) | 1178 self.selectAllAct.triggered.connect(self.__editSelectAll) |
1135 self.editActions.append(self.selectAllAct) | 1179 self.editActions.append(self.selectAllAct) |
1136 | 1180 |
1137 self.deselectAllAct = E5Action( | 1181 self.deselectAllAct = E5Action( |
1138 QApplication.translate('ViewManager', 'Deselect all'), | 1182 QApplication.translate('ViewManager', 'Deselect all'), |
1139 QApplication.translate('ViewManager', '&Deselect all'), | 1183 QApplication.translate('ViewManager', '&Deselect all'), |
1146 self.deselectAllAct.setWhatsThis(QApplication.translate( | 1190 self.deselectAllAct.setWhatsThis(QApplication.translate( |
1147 'ViewManager', | 1191 'ViewManager', |
1148 """<b>Deselect All</b>""" | 1192 """<b>Deselect All</b>""" |
1149 """<p>Deselect all text of the current editor.</p>""" | 1193 """<p>Deselect all text of the current editor.</p>""" |
1150 )) | 1194 )) |
1151 self.deselectAllAct.triggered[()].connect(self.__editDeselectAll) | 1195 self.deselectAllAct.triggered.connect(self.__editDeselectAll) |
1152 self.editActions.append(self.deselectAllAct) | 1196 self.editActions.append(self.deselectAllAct) |
1153 | 1197 |
1154 self.convertEOLAct = E5Action( | 1198 self.convertEOLAct = E5Action( |
1155 QApplication.translate( | 1199 QApplication.translate( |
1156 'ViewManager', 'Convert Line End Characters'), | 1200 'ViewManager', 'Convert Line End Characters'), |
1164 'ViewManager', | 1208 'ViewManager', |
1165 """<b>Convert Line End Characters</b>""" | 1209 """<b>Convert Line End Characters</b>""" |
1166 """<p>Convert the line end characters to the currently set""" | 1210 """<p>Convert the line end characters to the currently set""" |
1167 """ type.</p>""" | 1211 """ type.</p>""" |
1168 )) | 1212 )) |
1169 self.convertEOLAct.triggered[()].connect(self.__convertEOL) | 1213 self.convertEOLAct.triggered.connect(self.__convertEOL) |
1170 self.editActions.append(self.convertEOLAct) | 1214 self.editActions.append(self.convertEOLAct) |
1171 | 1215 |
1172 self.shortenEmptyAct = E5Action( | 1216 self.shortenEmptyAct = E5Action( |
1173 QApplication.translate('ViewManager', 'Shorten empty lines'), | 1217 QApplication.translate('ViewManager', 'Shorten empty lines'), |
1174 QApplication.translate('ViewManager', 'Shorten empty lines'), | 1218 QApplication.translate('ViewManager', 'Shorten empty lines'), |
1180 'ViewManager', | 1224 'ViewManager', |
1181 """<b>Shorten empty lines</b>""" | 1225 """<b>Shorten empty lines</b>""" |
1182 """<p>Shorten lines consisting solely of whitespace""" | 1226 """<p>Shorten lines consisting solely of whitespace""" |
1183 """ characters.</p>""" | 1227 """ characters.</p>""" |
1184 )) | 1228 )) |
1185 self.shortenEmptyAct.triggered[()].connect(self.__shortenEmptyLines) | 1229 self.shortenEmptyAct.triggered.connect(self.__shortenEmptyLines) |
1186 self.editActions.append(self.shortenEmptyAct) | 1230 self.editActions.append(self.shortenEmptyAct) |
1187 | 1231 |
1188 self.autoCompleteAct = E5Action( | 1232 self.autoCompleteAct = E5Action( |
1189 QApplication.translate('ViewManager', 'Autocomplete'), | 1233 QApplication.translate('ViewManager', 'Autocomplete'), |
1190 QApplication.translate('ViewManager', '&Autocomplete'), | 1234 QApplication.translate('ViewManager', '&Autocomplete'), |
1198 'ViewManager', | 1242 'ViewManager', |
1199 """<b>Autocomplete</b>""" | 1243 """<b>Autocomplete</b>""" |
1200 """<p>Performs an autocompletion of the word containing""" | 1244 """<p>Performs an autocompletion of the word containing""" |
1201 """ the cursor.</p>""" | 1245 """ the cursor.</p>""" |
1202 )) | 1246 )) |
1203 self.autoCompleteAct.triggered[()].connect(self.__editAutoComplete) | 1247 self.autoCompleteAct.triggered.connect(self.__editAutoComplete) |
1204 self.editActions.append(self.autoCompleteAct) | 1248 self.editActions.append(self.autoCompleteAct) |
1205 | 1249 |
1206 self.autoCompleteFromDocAct = E5Action( | 1250 self.autoCompleteFromDocAct = E5Action( |
1207 QApplication.translate( | 1251 QApplication.translate( |
1208 'ViewManager', 'Autocomplete from Document'), | 1252 'ViewManager', 'Autocomplete from Document'), |
1220 'ViewManager', | 1264 'ViewManager', |
1221 """<b>Autocomplete from Document</b>""" | 1265 """<b>Autocomplete from Document</b>""" |
1222 """<p>Performs an autocompletion from document of the word""" | 1266 """<p>Performs an autocompletion from document of the word""" |
1223 """ containing the cursor.</p>""" | 1267 """ containing the cursor.</p>""" |
1224 )) | 1268 )) |
1225 self.autoCompleteFromDocAct.triggered[()].connect( | 1269 self.autoCompleteFromDocAct.triggered.connect( |
1226 self.__editAutoCompleteFromDoc) | 1270 self.__editAutoCompleteFromDoc) |
1227 self.editActions.append(self.autoCompleteFromDocAct) | 1271 self.editActions.append(self.autoCompleteFromDocAct) |
1228 | 1272 |
1229 self.autoCompleteFromAPIsAct = E5Action( | 1273 self.autoCompleteFromAPIsAct = E5Action( |
1230 QApplication.translate('ViewManager', 'Autocomplete from APIs'), | 1274 QApplication.translate('ViewManager', 'Autocomplete from APIs'), |
1241 'ViewManager', | 1285 'ViewManager', |
1242 """<b>Autocomplete from APIs</b>""" | 1286 """<b>Autocomplete from APIs</b>""" |
1243 """<p>Performs an autocompletion from APIs of the word""" | 1287 """<p>Performs an autocompletion from APIs of the word""" |
1244 """ containing the cursor.</p>""" | 1288 """ containing the cursor.</p>""" |
1245 )) | 1289 )) |
1246 self.autoCompleteFromAPIsAct.triggered[()].connect( | 1290 self.autoCompleteFromAPIsAct.triggered.connect( |
1247 self.__editAutoCompleteFromAPIs) | 1291 self.__editAutoCompleteFromAPIs) |
1248 self.editActions.append(self.autoCompleteFromAPIsAct) | 1292 self.editActions.append(self.autoCompleteFromAPIsAct) |
1249 | 1293 |
1250 self.autoCompleteFromAllAct = E5Action( | 1294 self.autoCompleteFromAllAct = E5Action( |
1251 QApplication.translate( | 1295 QApplication.translate( |
1264 'ViewManager', | 1308 'ViewManager', |
1265 """<b>Autocomplete from Document and APIs</b>""" | 1309 """<b>Autocomplete from Document and APIs</b>""" |
1266 """<p>Performs an autocompletion from document and APIs""" | 1310 """<p>Performs an autocompletion from document and APIs""" |
1267 """ of the word containing the cursor.</p>""" | 1311 """ of the word containing the cursor.</p>""" |
1268 )) | 1312 )) |
1269 self.autoCompleteFromAllAct.triggered[()].connect( | 1313 self.autoCompleteFromAllAct.triggered.connect( |
1270 self.__editAutoCompleteFromAll) | 1314 self.__editAutoCompleteFromAll) |
1271 self.editActions.append(self.autoCompleteFromAllAct) | 1315 self.editActions.append(self.autoCompleteFromAllAct) |
1272 | 1316 |
1273 self.calltipsAct = E5Action( | 1317 self.calltipsAct = E5Action( |
1274 QApplication.translate('ViewManager', 'Calltip'), | 1318 QApplication.translate('ViewManager', 'Calltip'), |
1283 'ViewManager', | 1327 'ViewManager', |
1284 """<b>Calltip</b>""" | 1328 """<b>Calltip</b>""" |
1285 """<p>Show calltips based on the characters immediately to the""" | 1329 """<p>Show calltips based on the characters immediately to the""" |
1286 """ left of the cursor.</p>""" | 1330 """ left of the cursor.</p>""" |
1287 )) | 1331 )) |
1288 self.calltipsAct.triggered[()].connect(self.__editShowCallTips) | 1332 self.calltipsAct.triggered.connect(self.__editShowCallTips) |
1289 self.editActions.append(self.calltipsAct) | 1333 self.editActions.append(self.calltipsAct) |
1290 | 1334 |
1291 self.sortAct = E5Action( | 1335 self.sortAct = E5Action( |
1292 QApplication.translate('ViewManager', 'Sort'), | 1336 QApplication.translate('ViewManager', 'Sort'), |
1293 QApplication.translate('ViewManager', 'Sort'), | 1337 QApplication.translate('ViewManager', 'Sort'), |
1302 'ViewManager', | 1346 'ViewManager', |
1303 """<b>Sort</b>""" | 1347 """<b>Sort</b>""" |
1304 """<p>Sort the lines spanned by a rectangular selection based on""" | 1348 """<p>Sort the lines spanned by a rectangular selection based on""" |
1305 """ the selection ignoring leading and trailing whitespace.</p>""" | 1349 """ the selection ignoring leading and trailing whitespace.</p>""" |
1306 )) | 1350 )) |
1307 self.sortAct.triggered[()].connect(self.__editSortSelectedLines) | 1351 self.sortAct.triggered.connect(self.__editSortSelectedLines) |
1308 self.editActions.append(self.sortAct) | 1352 self.editActions.append(self.sortAct) |
1309 | 1353 |
1310 self.editActGrp.setEnabled(False) | 1354 self.editActGrp.setEnabled(False) |
1311 self.copyActGrp.setEnabled(False) | 1355 self.copyActGrp.setEnabled(False) |
1312 | 1356 |
1326 self.editorActGrp, 'vm_edit_move_left_char') | 1370 self.editorActGrp, 'vm_edit_move_left_char') |
1327 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT) | 1371 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT) |
1328 if isMacPlatform(): | 1372 if isMacPlatform(): |
1329 act.setAlternateShortcut(QKeySequence( | 1373 act.setAlternateShortcut(QKeySequence( |
1330 QApplication.translate('ViewManager', 'Meta+B'))) | 1374 QApplication.translate('ViewManager', 'Meta+B'))) |
1331 act.triggered[()].connect(self.esm.map) | 1375 act.triggered.connect(self.esm.map) |
1332 self.editActions.append(act) | 1376 self.editActions.append(act) |
1333 | 1377 |
1334 act = E5Action( | 1378 act = E5Action( |
1335 QApplication.translate('ViewManager', 'Move right one character'), | 1379 QApplication.translate('ViewManager', 'Move right one character'), |
1336 QApplication.translate('ViewManager', 'Move right one character'), | 1380 QApplication.translate('ViewManager', 'Move right one character'), |
1338 self.editorActGrp, 'vm_edit_move_right_char') | 1382 self.editorActGrp, 'vm_edit_move_right_char') |
1339 if isMacPlatform(): | 1383 if isMacPlatform(): |
1340 act.setAlternateShortcut(QKeySequence( | 1384 act.setAlternateShortcut(QKeySequence( |
1341 QApplication.translate('ViewManager', 'Meta+F'))) | 1385 QApplication.translate('ViewManager', 'Meta+F'))) |
1342 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT) | 1386 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT) |
1343 act.triggered[()].connect(self.esm.map) | 1387 act.triggered.connect(self.esm.map) |
1344 self.editActions.append(act) | 1388 self.editActions.append(act) |
1345 | 1389 |
1346 act = E5Action( | 1390 act = E5Action( |
1347 QApplication.translate('ViewManager', 'Move up one line'), | 1391 QApplication.translate('ViewManager', 'Move up one line'), |
1348 QApplication.translate('ViewManager', 'Move up one line'), | 1392 QApplication.translate('ViewManager', 'Move up one line'), |
1350 self.editorActGrp, 'vm_edit_move_up_line') | 1394 self.editorActGrp, 'vm_edit_move_up_line') |
1351 if isMacPlatform(): | 1395 if isMacPlatform(): |
1352 act.setAlternateShortcut(QKeySequence( | 1396 act.setAlternateShortcut(QKeySequence( |
1353 QApplication.translate('ViewManager', 'Meta+P'))) | 1397 QApplication.translate('ViewManager', 'Meta+P'))) |
1354 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP) | 1398 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP) |
1355 act.triggered[()].connect(self.esm.map) | 1399 act.triggered.connect(self.esm.map) |
1356 self.editActions.append(act) | 1400 self.editActions.append(act) |
1357 | 1401 |
1358 act = E5Action( | 1402 act = E5Action( |
1359 QApplication.translate('ViewManager', 'Move down one line'), | 1403 QApplication.translate('ViewManager', 'Move down one line'), |
1360 QApplication.translate('ViewManager', 'Move down one line'), | 1404 QApplication.translate('ViewManager', 'Move down one line'), |
1362 self.editorActGrp, 'vm_edit_move_down_line') | 1406 self.editorActGrp, 'vm_edit_move_down_line') |
1363 if isMacPlatform(): | 1407 if isMacPlatform(): |
1364 act.setAlternateShortcut(QKeySequence( | 1408 act.setAlternateShortcut(QKeySequence( |
1365 QApplication.translate('ViewManager', 'Meta+N'))) | 1409 QApplication.translate('ViewManager', 'Meta+N'))) |
1366 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN) | 1410 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN) |
1367 act.triggered[()].connect(self.esm.map) | 1411 act.triggered.connect(self.esm.map) |
1368 self.editActions.append(act) | 1412 self.editActions.append(act) |
1369 | 1413 |
1370 act = E5Action( | 1414 act = E5Action( |
1371 QApplication.translate('ViewManager', 'Move left one word part'), | 1415 QApplication.translate('ViewManager', 'Move left one word part'), |
1372 QApplication.translate('ViewManager', 'Move left one word part'), | 1416 QApplication.translate('ViewManager', 'Move left one word part'), |
1374 self.editorActGrp, 'vm_edit_move_left_word_part') | 1418 self.editorActGrp, 'vm_edit_move_left_word_part') |
1375 if not isMacPlatform(): | 1419 if not isMacPlatform(): |
1376 act.setShortcut(QKeySequence( | 1420 act.setShortcut(QKeySequence( |
1377 QApplication.translate('ViewManager', 'Alt+Left'))) | 1421 QApplication.translate('ViewManager', 'Alt+Left'))) |
1378 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT) | 1422 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT) |
1379 act.triggered[()].connect(self.esm.map) | 1423 act.triggered.connect(self.esm.map) |
1380 self.editActions.append(act) | 1424 self.editActions.append(act) |
1381 | 1425 |
1382 act = E5Action( | 1426 act = E5Action( |
1383 QApplication.translate('ViewManager', 'Move right one word part'), | 1427 QApplication.translate('ViewManager', 'Move right one word part'), |
1384 QApplication.translate('ViewManager', 'Move right one word part'), | 1428 QApplication.translate('ViewManager', 'Move right one word part'), |
1386 self.editorActGrp, 'vm_edit_move_right_word_part') | 1430 self.editorActGrp, 'vm_edit_move_right_word_part') |
1387 if not isMacPlatform(): | 1431 if not isMacPlatform(): |
1388 act.setShortcut(QKeySequence( | 1432 act.setShortcut(QKeySequence( |
1389 QApplication.translate('ViewManager', 'Alt+Right'))) | 1433 QApplication.translate('ViewManager', 'Alt+Right'))) |
1390 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT) | 1434 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT) |
1391 act.triggered[()].connect(self.esm.map) | 1435 act.triggered.connect(self.esm.map) |
1392 self.editActions.append(act) | 1436 self.editActions.append(act) |
1393 | 1437 |
1394 act = E5Action( | 1438 act = E5Action( |
1395 QApplication.translate('ViewManager', 'Move left one word'), | 1439 QApplication.translate('ViewManager', 'Move left one word'), |
1396 QApplication.translate('ViewManager', 'Move left one word'), | 1440 QApplication.translate('ViewManager', 'Move left one word'), |
1401 QApplication.translate('ViewManager', 'Alt+Left'))) | 1445 QApplication.translate('ViewManager', 'Alt+Left'))) |
1402 else: | 1446 else: |
1403 act.setShortcut(QKeySequence( | 1447 act.setShortcut(QKeySequence( |
1404 QApplication.translate('ViewManager', 'Ctrl+Left'))) | 1448 QApplication.translate('ViewManager', 'Ctrl+Left'))) |
1405 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT) | 1449 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT) |
1406 act.triggered[()].connect(self.esm.map) | 1450 act.triggered.connect(self.esm.map) |
1407 self.editActions.append(act) | 1451 self.editActions.append(act) |
1408 | 1452 |
1409 act = E5Action( | 1453 act = E5Action( |
1410 QApplication.translate('ViewManager', 'Move right one word'), | 1454 QApplication.translate('ViewManager', 'Move right one word'), |
1411 QApplication.translate('ViewManager', 'Move right one word'), | 1455 QApplication.translate('ViewManager', 'Move right one word'), |
1413 self.editorActGrp, 'vm_edit_move_right_word') | 1457 self.editorActGrp, 'vm_edit_move_right_word') |
1414 if not isMacPlatform(): | 1458 if not isMacPlatform(): |
1415 act.setShortcut(QKeySequence( | 1459 act.setShortcut(QKeySequence( |
1416 QApplication.translate('ViewManager', 'Ctrl+Right'))) | 1460 QApplication.translate('ViewManager', 'Ctrl+Right'))) |
1417 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT) | 1461 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT) |
1418 act.triggered[()].connect(self.esm.map) | 1462 act.triggered.connect(self.esm.map) |
1419 self.editActions.append(act) | 1463 self.editActions.append(act) |
1420 | 1464 |
1421 act = E5Action( | 1465 act = E5Action( |
1422 QApplication.translate( | 1466 QApplication.translate( |
1423 'ViewManager', | 1467 'ViewManager', |
1429 self.editorActGrp, 'vm_edit_move_first_visible_char') | 1473 self.editorActGrp, 'vm_edit_move_first_visible_char') |
1430 if not isMacPlatform(): | 1474 if not isMacPlatform(): |
1431 act.setShortcut(QKeySequence( | 1475 act.setShortcut(QKeySequence( |
1432 QApplication.translate('ViewManager', 'Home'))) | 1476 QApplication.translate('ViewManager', 'Home'))) |
1433 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME) | 1477 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME) |
1434 act.triggered[()].connect(self.esm.map) | 1478 act.triggered.connect(self.esm.map) |
1435 self.editActions.append(act) | 1479 self.editActions.append(act) |
1436 | 1480 |
1437 act = E5Action( | 1481 act = E5Action( |
1438 QApplication.translate( | 1482 QApplication.translate( |
1439 'ViewManager', 'Move to start of display line'), | 1483 'ViewManager', 'Move to start of display line'), |
1446 QApplication.translate('ViewManager', 'Ctrl+Left'))) | 1490 QApplication.translate('ViewManager', 'Ctrl+Left'))) |
1447 else: | 1491 else: |
1448 act.setShortcut(QKeySequence( | 1492 act.setShortcut(QKeySequence( |
1449 QApplication.translate('ViewManager', 'Alt+Home'))) | 1493 QApplication.translate('ViewManager', 'Alt+Home'))) |
1450 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAY) | 1494 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAY) |
1451 act.triggered[()].connect(self.esm.map) | 1495 act.triggered.connect(self.esm.map) |
1452 self.editActions.append(act) | 1496 self.editActions.append(act) |
1453 | 1497 |
1454 act = E5Action( | 1498 act = E5Action( |
1455 QApplication.translate( | 1499 QApplication.translate( |
1456 'ViewManager', 'Move to end of document line'), | 1500 'ViewManager', 'Move to end of document line'), |
1463 QApplication.translate('ViewManager', 'Meta+E'))) | 1507 QApplication.translate('ViewManager', 'Meta+E'))) |
1464 else: | 1508 else: |
1465 act.setShortcut(QKeySequence( | 1509 act.setShortcut(QKeySequence( |
1466 QApplication.translate('ViewManager', 'End'))) | 1510 QApplication.translate('ViewManager', 'End'))) |
1467 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND) | 1511 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND) |
1468 act.triggered[()].connect(self.esm.map) | 1512 act.triggered.connect(self.esm.map) |
1469 self.editActions.append(act) | 1513 self.editActions.append(act) |
1470 | 1514 |
1471 act = E5Action( | 1515 act = E5Action( |
1472 QApplication.translate('ViewManager', 'Scroll view down one line'), | 1516 QApplication.translate('ViewManager', 'Scroll view down one line'), |
1473 QApplication.translate('ViewManager', 'Scroll view down one line'), | 1517 QApplication.translate('ViewManager', 'Scroll view down one line'), |
1474 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Down')), | 1518 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Down')), |
1475 0, | 1519 0, |
1476 self.editorActGrp, 'vm_edit_scroll_down_line') | 1520 self.editorActGrp, 'vm_edit_scroll_down_line') |
1477 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN) | 1521 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN) |
1478 act.triggered[()].connect(self.esm.map) | 1522 act.triggered.connect(self.esm.map) |
1479 self.editActions.append(act) | 1523 self.editActions.append(act) |
1480 | 1524 |
1481 act = E5Action( | 1525 act = E5Action( |
1482 QApplication.translate('ViewManager', 'Scroll view up one line'), | 1526 QApplication.translate('ViewManager', 'Scroll view up one line'), |
1483 QApplication.translate('ViewManager', 'Scroll view up one line'), | 1527 QApplication.translate('ViewManager', 'Scroll view up one line'), |
1484 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Up')), 0, | 1528 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Up')), 0, |
1485 self.editorActGrp, 'vm_edit_scroll_up_line') | 1529 self.editorActGrp, 'vm_edit_scroll_up_line') |
1486 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP) | 1530 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP) |
1487 act.triggered[()].connect(self.esm.map) | 1531 act.triggered.connect(self.esm.map) |
1488 self.editActions.append(act) | 1532 self.editActions.append(act) |
1489 | 1533 |
1490 act = E5Action( | 1534 act = E5Action( |
1491 QApplication.translate('ViewManager', 'Move up one paragraph'), | 1535 QApplication.translate('ViewManager', 'Move up one paragraph'), |
1492 QApplication.translate('ViewManager', 'Move up one paragraph'), | 1536 QApplication.translate('ViewManager', 'Move up one paragraph'), |
1493 QKeySequence(QApplication.translate('ViewManager', 'Alt+Up')), 0, | 1537 QKeySequence(QApplication.translate('ViewManager', 'Alt+Up')), 0, |
1494 self.editorActGrp, 'vm_edit_move_up_para') | 1538 self.editorActGrp, 'vm_edit_move_up_para') |
1495 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP) | 1539 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP) |
1496 act.triggered[()].connect(self.esm.map) | 1540 act.triggered.connect(self.esm.map) |
1497 self.editActions.append(act) | 1541 self.editActions.append(act) |
1498 | 1542 |
1499 act = E5Action( | 1543 act = E5Action( |
1500 QApplication.translate('ViewManager', 'Move down one paragraph'), | 1544 QApplication.translate('ViewManager', 'Move down one paragraph'), |
1501 QApplication.translate('ViewManager', 'Move down one paragraph'), | 1545 QApplication.translate('ViewManager', 'Move down one paragraph'), |
1502 QKeySequence(QApplication.translate('ViewManager', 'Alt+Down')), 0, | 1546 QKeySequence(QApplication.translate('ViewManager', 'Alt+Down')), 0, |
1503 self.editorActGrp, 'vm_edit_move_down_para') | 1547 self.editorActGrp, 'vm_edit_move_down_para') |
1504 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN) | 1548 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN) |
1505 act.triggered[()].connect(self.esm.map) | 1549 act.triggered.connect(self.esm.map) |
1506 self.editActions.append(act) | 1550 self.editActions.append(act) |
1507 | 1551 |
1508 act = E5Action( | 1552 act = E5Action( |
1509 QApplication.translate('ViewManager', 'Move up one page'), | 1553 QApplication.translate('ViewManager', 'Move up one page'), |
1510 QApplication.translate('ViewManager', 'Move up one page'), | 1554 QApplication.translate('ViewManager', 'Move up one page'), |
1511 QKeySequence(QApplication.translate('ViewManager', 'PgUp')), 0, | 1555 QKeySequence(QApplication.translate('ViewManager', 'PgUp')), 0, |
1512 self.editorActGrp, 'vm_edit_move_up_page') | 1556 self.editorActGrp, 'vm_edit_move_up_page') |
1513 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP) | 1557 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP) |
1514 act.triggered[()].connect(self.esm.map) | 1558 act.triggered.connect(self.esm.map) |
1515 self.editActions.append(act) | 1559 self.editActions.append(act) |
1516 | 1560 |
1517 act = E5Action( | 1561 act = E5Action( |
1518 QApplication.translate('ViewManager', 'Move down one page'), | 1562 QApplication.translate('ViewManager', 'Move down one page'), |
1519 QApplication.translate('ViewManager', 'Move down one page'), | 1563 QApplication.translate('ViewManager', 'Move down one page'), |
1521 self.editorActGrp, 'vm_edit_move_down_page') | 1565 self.editorActGrp, 'vm_edit_move_down_page') |
1522 if isMacPlatform(): | 1566 if isMacPlatform(): |
1523 act.setAlternateShortcut(QKeySequence( | 1567 act.setAlternateShortcut(QKeySequence( |
1524 QApplication.translate('ViewManager', 'Meta+V'))) | 1568 QApplication.translate('ViewManager', 'Meta+V'))) |
1525 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN) | 1569 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN) |
1526 act.triggered[()].connect(self.esm.map) | 1570 act.triggered.connect(self.esm.map) |
1527 self.editActions.append(act) | 1571 self.editActions.append(act) |
1528 | 1572 |
1529 act = E5Action( | 1573 act = E5Action( |
1530 QApplication.translate('ViewManager', 'Move to start of document'), | 1574 QApplication.translate('ViewManager', 'Move to start of document'), |
1531 QApplication.translate('ViewManager', 'Move to start of document'), | 1575 QApplication.translate('ViewManager', 'Move to start of document'), |
1536 QApplication.translate('ViewManager', 'Ctrl+Up'))) | 1580 QApplication.translate('ViewManager', 'Ctrl+Up'))) |
1537 else: | 1581 else: |
1538 act.setShortcut(QKeySequence( | 1582 act.setShortcut(QKeySequence( |
1539 QApplication.translate('ViewManager', 'Ctrl+Home'))) | 1583 QApplication.translate('ViewManager', 'Ctrl+Home'))) |
1540 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART) | 1584 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART) |
1541 act.triggered[()].connect(self.esm.map) | 1585 act.triggered.connect(self.esm.map) |
1542 self.editActions.append(act) | 1586 self.editActions.append(act) |
1543 | 1587 |
1544 act = E5Action( | 1588 act = E5Action( |
1545 QApplication.translate('ViewManager', 'Move to end of document'), | 1589 QApplication.translate('ViewManager', 'Move to end of document'), |
1546 QApplication.translate('ViewManager', 'Move to end of document'), | 1590 QApplication.translate('ViewManager', 'Move to end of document'), |
1551 QApplication.translate('ViewManager', 'Ctrl+Down'))) | 1595 QApplication.translate('ViewManager', 'Ctrl+Down'))) |
1552 else: | 1596 else: |
1553 act.setShortcut(QKeySequence( | 1597 act.setShortcut(QKeySequence( |
1554 QApplication.translate('ViewManager', 'Ctrl+End'))) | 1598 QApplication.translate('ViewManager', 'Ctrl+End'))) |
1555 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND) | 1599 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND) |
1556 act.triggered[()].connect(self.esm.map) | 1600 act.triggered.connect(self.esm.map) |
1557 self.editActions.append(act) | 1601 self.editActions.append(act) |
1558 | 1602 |
1559 act = E5Action( | 1603 act = E5Action( |
1560 QApplication.translate('ViewManager', 'Indent one level'), | 1604 QApplication.translate('ViewManager', 'Indent one level'), |
1561 QApplication.translate('ViewManager', 'Indent one level'), | 1605 QApplication.translate('ViewManager', 'Indent one level'), |
1562 QKeySequence(QApplication.translate('ViewManager', 'Tab')), 0, | 1606 QKeySequence(QApplication.translate('ViewManager', 'Tab')), 0, |
1563 self.editorActGrp, 'vm_edit_indent_one_level') | 1607 self.editorActGrp, 'vm_edit_indent_one_level') |
1564 self.esm.setMapping(act, QsciScintilla.SCI_TAB) | 1608 self.esm.setMapping(act, QsciScintilla.SCI_TAB) |
1565 act.triggered[()].connect(self.esm.map) | 1609 act.triggered.connect(self.esm.map) |
1566 self.editActions.append(act) | 1610 self.editActions.append(act) |
1567 | 1611 |
1568 act = E5Action( | 1612 act = E5Action( |
1569 QApplication.translate('ViewManager', 'Unindent one level'), | 1613 QApplication.translate('ViewManager', 'Unindent one level'), |
1570 QApplication.translate('ViewManager', 'Unindent one level'), | 1614 QApplication.translate('ViewManager', 'Unindent one level'), |
1571 QKeySequence(QApplication.translate('ViewManager', 'Shift+Tab')), | 1615 QKeySequence(QApplication.translate('ViewManager', 'Shift+Tab')), |
1572 0, | 1616 0, |
1573 self.editorActGrp, 'vm_edit_unindent_one_level') | 1617 self.editorActGrp, 'vm_edit_unindent_one_level') |
1574 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB) | 1618 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB) |
1575 act.triggered[()].connect(self.esm.map) | 1619 act.triggered.connect(self.esm.map) |
1576 self.editActions.append(act) | 1620 self.editActions.append(act) |
1577 | 1621 |
1578 act = E5Action( | 1622 act = E5Action( |
1579 QApplication.translate( | 1623 QApplication.translate( |
1580 'ViewManager', 'Extend selection left one character'), | 1624 'ViewManager', 'Extend selection left one character'), |
1585 self.editorActGrp, 'vm_edit_extend_selection_left_char') | 1629 self.editorActGrp, 'vm_edit_extend_selection_left_char') |
1586 if isMacPlatform(): | 1630 if isMacPlatform(): |
1587 act.setAlternateShortcut(QKeySequence( | 1631 act.setAlternateShortcut(QKeySequence( |
1588 QApplication.translate('ViewManager', 'Meta+Shift+B'))) | 1632 QApplication.translate('ViewManager', 'Meta+Shift+B'))) |
1589 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND) | 1633 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND) |
1590 act.triggered[()].connect(self.esm.map) | 1634 act.triggered.connect(self.esm.map) |
1591 self.editActions.append(act) | 1635 self.editActions.append(act) |
1592 | 1636 |
1593 act = E5Action( | 1637 act = E5Action( |
1594 QApplication.translate( | 1638 QApplication.translate( |
1595 'ViewManager', 'Extend selection right one character'), | 1639 'ViewManager', 'Extend selection right one character'), |
1600 self.editorActGrp, 'vm_edit_extend_selection_right_char') | 1644 self.editorActGrp, 'vm_edit_extend_selection_right_char') |
1601 if isMacPlatform(): | 1645 if isMacPlatform(): |
1602 act.setAlternateShortcut(QKeySequence( | 1646 act.setAlternateShortcut(QKeySequence( |
1603 QApplication.translate('ViewManager', 'Meta+Shift+F'))) | 1647 QApplication.translate('ViewManager', 'Meta+Shift+F'))) |
1604 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND) | 1648 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND) |
1605 act.triggered[()].connect(self.esm.map) | 1649 act.triggered.connect(self.esm.map) |
1606 self.editActions.append(act) | 1650 self.editActions.append(act) |
1607 | 1651 |
1608 act = E5Action( | 1652 act = E5Action( |
1609 QApplication.translate( | 1653 QApplication.translate( |
1610 'ViewManager', 'Extend selection up one line'), | 1654 'ViewManager', 'Extend selection up one line'), |
1614 self.editorActGrp, 'vm_edit_extend_selection_up_line') | 1658 self.editorActGrp, 'vm_edit_extend_selection_up_line') |
1615 if isMacPlatform(): | 1659 if isMacPlatform(): |
1616 act.setAlternateShortcut(QKeySequence( | 1660 act.setAlternateShortcut(QKeySequence( |
1617 QApplication.translate('ViewManager', 'Meta+Shift+P'))) | 1661 QApplication.translate('ViewManager', 'Meta+Shift+P'))) |
1618 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND) | 1662 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND) |
1619 act.triggered[()].connect(self.esm.map) | 1663 act.triggered.connect(self.esm.map) |
1620 self.editActions.append(act) | 1664 self.editActions.append(act) |
1621 | 1665 |
1622 act = E5Action( | 1666 act = E5Action( |
1623 QApplication.translate( | 1667 QApplication.translate( |
1624 'ViewManager', 'Extend selection down one line'), | 1668 'ViewManager', 'Extend selection down one line'), |
1629 self.editorActGrp, 'vm_edit_extend_selection_down_line') | 1673 self.editorActGrp, 'vm_edit_extend_selection_down_line') |
1630 if isMacPlatform(): | 1674 if isMacPlatform(): |
1631 act.setAlternateShortcut(QKeySequence( | 1675 act.setAlternateShortcut(QKeySequence( |
1632 QApplication.translate('ViewManager', 'Meta+Shift+N'))) | 1676 QApplication.translate('ViewManager', 'Meta+Shift+N'))) |
1633 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND) | 1677 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND) |
1634 act.triggered[()].connect(self.esm.map) | 1678 act.triggered.connect(self.esm.map) |
1635 self.editActions.append(act) | 1679 self.editActions.append(act) |
1636 | 1680 |
1637 act = E5Action( | 1681 act = E5Action( |
1638 QApplication.translate( | 1682 QApplication.translate( |
1639 'ViewManager', 'Extend selection left one word part'), | 1683 'ViewManager', 'Extend selection left one word part'), |
1643 self.editorActGrp, 'vm_edit_extend_selection_left_word_part') | 1687 self.editorActGrp, 'vm_edit_extend_selection_left_word_part') |
1644 if not isMacPlatform(): | 1688 if not isMacPlatform(): |
1645 act.setShortcut(QKeySequence( | 1689 act.setShortcut(QKeySequence( |
1646 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) | 1690 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) |
1647 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND) | 1691 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND) |
1648 act.triggered[()].connect(self.esm.map) | 1692 act.triggered.connect(self.esm.map) |
1649 self.editActions.append(act) | 1693 self.editActions.append(act) |
1650 | 1694 |
1651 act = E5Action( | 1695 act = E5Action( |
1652 QApplication.translate( | 1696 QApplication.translate( |
1653 'ViewManager', 'Extend selection right one word part'), | 1697 'ViewManager', 'Extend selection right one word part'), |
1657 self.editorActGrp, 'vm_edit_extend_selection_right_word_part') | 1701 self.editorActGrp, 'vm_edit_extend_selection_right_word_part') |
1658 if not isMacPlatform(): | 1702 if not isMacPlatform(): |
1659 act.setShortcut(QKeySequence( | 1703 act.setShortcut(QKeySequence( |
1660 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) | 1704 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) |
1661 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND) | 1705 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND) |
1662 act.triggered[()].connect(self.esm.map) | 1706 act.triggered.connect(self.esm.map) |
1663 self.editActions.append(act) | 1707 self.editActions.append(act) |
1664 | 1708 |
1665 act = E5Action( | 1709 act = E5Action( |
1666 QApplication.translate( | 1710 QApplication.translate( |
1667 'ViewManager', 'Extend selection left one word'), | 1711 'ViewManager', 'Extend selection left one word'), |
1674 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) | 1718 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) |
1675 else: | 1719 else: |
1676 act.setShortcut(QKeySequence( | 1720 act.setShortcut(QKeySequence( |
1677 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) | 1721 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) |
1678 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND) | 1722 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND) |
1679 act.triggered[()].connect(self.esm.map) | 1723 act.triggered.connect(self.esm.map) |
1680 self.editActions.append(act) | 1724 self.editActions.append(act) |
1681 | 1725 |
1682 act = E5Action( | 1726 act = E5Action( |
1683 QApplication.translate( | 1727 QApplication.translate( |
1684 'ViewManager', 'Extend selection right one word'), | 1728 'ViewManager', 'Extend selection right one word'), |
1691 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) | 1735 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) |
1692 else: | 1736 else: |
1693 act.setShortcut(QKeySequence( | 1737 act.setShortcut(QKeySequence( |
1694 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) | 1738 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) |
1695 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND) | 1739 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND) |
1696 act.triggered[()].connect(self.esm.map) | 1740 act.triggered.connect(self.esm.map) |
1697 self.editActions.append(act) | 1741 self.editActions.append(act) |
1698 | 1742 |
1699 act = E5Action( | 1743 act = E5Action( |
1700 QApplication.translate( | 1744 QApplication.translate( |
1701 'ViewManager', | 1745 'ViewManager', |
1709 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char') | 1753 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char') |
1710 if not isMacPlatform(): | 1754 if not isMacPlatform(): |
1711 act.setShortcut(QKeySequence( | 1755 act.setShortcut(QKeySequence( |
1712 QApplication.translate('ViewManager', 'Shift+Home'))) | 1756 QApplication.translate('ViewManager', 'Shift+Home'))) |
1713 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND) | 1757 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND) |
1714 act.triggered[()].connect(self.esm.map) | 1758 act.triggered.connect(self.esm.map) |
1715 self.editActions.append(act) | 1759 self.editActions.append(act) |
1716 | 1760 |
1717 act = E5Action( | 1761 act = E5Action( |
1718 QApplication.translate( | 1762 QApplication.translate( |
1719 'ViewManager', 'Extend selection to end of document line'), | 1763 'ViewManager', 'Extend selection to end of document line'), |
1726 QApplication.translate('ViewManager', 'Meta+Shift+E'))) | 1770 QApplication.translate('ViewManager', 'Meta+Shift+E'))) |
1727 else: | 1771 else: |
1728 act.setShortcut(QKeySequence( | 1772 act.setShortcut(QKeySequence( |
1729 QApplication.translate('ViewManager', 'Shift+End'))) | 1773 QApplication.translate('ViewManager', 'Shift+End'))) |
1730 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND) | 1774 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND) |
1731 act.triggered[()].connect(self.esm.map) | 1775 act.triggered.connect(self.esm.map) |
1732 self.editActions.append(act) | 1776 self.editActions.append(act) |
1733 | 1777 |
1734 act = E5Action( | 1778 act = E5Action( |
1735 QApplication.translate( | 1779 QApplication.translate( |
1736 'ViewManager', 'Extend selection up one paragraph'), | 1780 'ViewManager', 'Extend selection up one paragraph'), |
1739 QKeySequence(QApplication.translate( | 1783 QKeySequence(QApplication.translate( |
1740 'ViewManager', 'Alt+Shift+Up')), | 1784 'ViewManager', 'Alt+Shift+Up')), |
1741 0, | 1785 0, |
1742 self.editorActGrp, 'vm_edit_extend_selection_up_para') | 1786 self.editorActGrp, 'vm_edit_extend_selection_up_para') |
1743 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND) | 1787 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND) |
1744 act.triggered[()].connect(self.esm.map) | 1788 act.triggered.connect(self.esm.map) |
1745 self.editActions.append(act) | 1789 self.editActions.append(act) |
1746 | 1790 |
1747 act = E5Action( | 1791 act = E5Action( |
1748 QApplication.translate( | 1792 QApplication.translate( |
1749 'ViewManager', 'Extend selection down one paragraph'), | 1793 'ViewManager', 'Extend selection down one paragraph'), |
1752 QKeySequence(QApplication.translate( | 1796 QKeySequence(QApplication.translate( |
1753 'ViewManager', 'Alt+Shift+Down')), | 1797 'ViewManager', 'Alt+Shift+Down')), |
1754 0, | 1798 0, |
1755 self.editorActGrp, 'vm_edit_extend_selection_down_para') | 1799 self.editorActGrp, 'vm_edit_extend_selection_down_para') |
1756 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND) | 1800 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND) |
1757 act.triggered[()].connect(self.esm.map) | 1801 act.triggered.connect(self.esm.map) |
1758 self.editActions.append(act) | 1802 self.editActions.append(act) |
1759 | 1803 |
1760 act = E5Action( | 1804 act = E5Action( |
1761 QApplication.translate( | 1805 QApplication.translate( |
1762 'ViewManager', 'Extend selection up one page'), | 1806 'ViewManager', 'Extend selection up one page'), |
1764 'ViewManager', 'Extend selection up one page'), | 1808 'ViewManager', 'Extend selection up one page'), |
1765 QKeySequence(QApplication.translate('ViewManager', 'Shift+PgUp')), | 1809 QKeySequence(QApplication.translate('ViewManager', 'Shift+PgUp')), |
1766 0, | 1810 0, |
1767 self.editorActGrp, 'vm_edit_extend_selection_up_page') | 1811 self.editorActGrp, 'vm_edit_extend_selection_up_page') |
1768 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND) | 1812 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND) |
1769 act.triggered[()].connect(self.esm.map) | 1813 act.triggered.connect(self.esm.map) |
1770 self.editActions.append(act) | 1814 self.editActions.append(act) |
1771 | 1815 |
1772 act = E5Action( | 1816 act = E5Action( |
1773 QApplication.translate( | 1817 QApplication.translate( |
1774 'ViewManager', 'Extend selection down one page'), | 1818 'ViewManager', 'Extend selection down one page'), |
1780 self.editorActGrp, 'vm_edit_extend_selection_down_page') | 1824 self.editorActGrp, 'vm_edit_extend_selection_down_page') |
1781 if isMacPlatform(): | 1825 if isMacPlatform(): |
1782 act.setAlternateShortcut(QKeySequence( | 1826 act.setAlternateShortcut(QKeySequence( |
1783 QApplication.translate('ViewManager', 'Meta+Shift+V'))) | 1827 QApplication.translate('ViewManager', 'Meta+Shift+V'))) |
1784 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND) | 1828 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND) |
1785 act.triggered[()].connect(self.esm.map) | 1829 act.triggered.connect(self.esm.map) |
1786 self.editActions.append(act) | 1830 self.editActions.append(act) |
1787 | 1831 |
1788 act = E5Action( | 1832 act = E5Action( |
1789 QApplication.translate( | 1833 QApplication.translate( |
1790 'ViewManager', 'Extend selection to start of document'), | 1834 'ViewManager', 'Extend selection to start of document'), |
1797 QApplication.translate('ViewManager', 'Ctrl+Shift+Up'))) | 1841 QApplication.translate('ViewManager', 'Ctrl+Shift+Up'))) |
1798 else: | 1842 else: |
1799 act.setShortcut(QKeySequence( | 1843 act.setShortcut(QKeySequence( |
1800 QApplication.translate('ViewManager', 'Ctrl+Shift+Home'))) | 1844 QApplication.translate('ViewManager', 'Ctrl+Shift+Home'))) |
1801 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTARTEXTEND) | 1845 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTARTEXTEND) |
1802 act.triggered[()].connect(self.esm.map) | 1846 act.triggered.connect(self.esm.map) |
1803 self.editActions.append(act) | 1847 self.editActions.append(act) |
1804 | 1848 |
1805 act = E5Action( | 1849 act = E5Action( |
1806 QApplication.translate( | 1850 QApplication.translate( |
1807 'ViewManager', 'Extend selection to end of document'), | 1851 'ViewManager', 'Extend selection to end of document'), |
1814 QApplication.translate('ViewManager', 'Ctrl+Shift+Down'))) | 1858 QApplication.translate('ViewManager', 'Ctrl+Shift+Down'))) |
1815 else: | 1859 else: |
1816 act.setShortcut(QKeySequence( | 1860 act.setShortcut(QKeySequence( |
1817 QApplication.translate('ViewManager', 'Ctrl+Shift+End'))) | 1861 QApplication.translate('ViewManager', 'Ctrl+Shift+End'))) |
1818 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND) | 1862 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND) |
1819 act.triggered[()].connect(self.esm.map) | 1863 act.triggered.connect(self.esm.map) |
1820 self.editActions.append(act) | 1864 self.editActions.append(act) |
1821 | 1865 |
1822 act = E5Action( | 1866 act = E5Action( |
1823 QApplication.translate('ViewManager', 'Delete previous character'), | 1867 QApplication.translate('ViewManager', 'Delete previous character'), |
1824 QApplication.translate('ViewManager', 'Delete previous character'), | 1868 QApplication.translate('ViewManager', 'Delete previous character'), |
1830 QApplication.translate('ViewManager', 'Meta+H'))) | 1874 QApplication.translate('ViewManager', 'Meta+H'))) |
1831 else: | 1875 else: |
1832 act.setAlternateShortcut(QKeySequence( | 1876 act.setAlternateShortcut(QKeySequence( |
1833 QApplication.translate('ViewManager', 'Shift+Backspace'))) | 1877 QApplication.translate('ViewManager', 'Shift+Backspace'))) |
1834 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK) | 1878 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK) |
1835 act.triggered[()].connect(self.esm.map) | 1879 act.triggered.connect(self.esm.map) |
1836 self.editActions.append(act) | 1880 self.editActions.append(act) |
1837 | 1881 |
1838 act = E5Action( | 1882 act = E5Action( |
1839 QApplication.translate( | 1883 QApplication.translate( |
1840 'ViewManager', | 1884 'ViewManager', |
1843 'ViewManager', | 1887 'ViewManager', |
1844 'Delete previous character if not at start of line'), | 1888 'Delete previous character if not at start of line'), |
1845 0, 0, | 1889 0, 0, |
1846 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start') | 1890 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start') |
1847 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE) | 1891 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE) |
1848 act.triggered[()].connect(self.esm.map) | 1892 act.triggered.connect(self.esm.map) |
1849 self.editActions.append(act) | 1893 self.editActions.append(act) |
1850 | 1894 |
1851 act = E5Action( | 1895 act = E5Action( |
1852 QApplication.translate('ViewManager', 'Delete current character'), | 1896 QApplication.translate('ViewManager', 'Delete current character'), |
1853 QApplication.translate('ViewManager', 'Delete current character'), | 1897 QApplication.translate('ViewManager', 'Delete current character'), |
1855 self.editorActGrp, 'vm_edit_delete_current_char') | 1899 self.editorActGrp, 'vm_edit_delete_current_char') |
1856 if isMacPlatform(): | 1900 if isMacPlatform(): |
1857 act.setAlternateShortcut(QKeySequence( | 1901 act.setAlternateShortcut(QKeySequence( |
1858 QApplication.translate('ViewManager', 'Meta+D'))) | 1902 QApplication.translate('ViewManager', 'Meta+D'))) |
1859 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR) | 1903 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR) |
1860 act.triggered[()].connect(self.esm.map) | 1904 act.triggered.connect(self.esm.map) |
1861 self.editActions.append(act) | 1905 self.editActions.append(act) |
1862 | 1906 |
1863 act = E5Action( | 1907 act = E5Action( |
1864 QApplication.translate('ViewManager', 'Delete word to left'), | 1908 QApplication.translate('ViewManager', 'Delete word to left'), |
1865 QApplication.translate('ViewManager', 'Delete word to left'), | 1909 QApplication.translate('ViewManager', 'Delete word to left'), |
1866 QKeySequence(QApplication.translate( | 1910 QKeySequence(QApplication.translate( |
1867 'ViewManager', 'Ctrl+Backspace')), | 1911 'ViewManager', 'Ctrl+Backspace')), |
1868 0, | 1912 0, |
1869 self.editorActGrp, 'vm_edit_delete_word_left') | 1913 self.editorActGrp, 'vm_edit_delete_word_left') |
1870 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT) | 1914 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT) |
1871 act.triggered[()].connect(self.esm.map) | 1915 act.triggered.connect(self.esm.map) |
1872 self.editActions.append(act) | 1916 self.editActions.append(act) |
1873 | 1917 |
1874 act = E5Action( | 1918 act = E5Action( |
1875 QApplication.translate('ViewManager', 'Delete word to right'), | 1919 QApplication.translate('ViewManager', 'Delete word to right'), |
1876 QApplication.translate('ViewManager', 'Delete word to right'), | 1920 QApplication.translate('ViewManager', 'Delete word to right'), |
1877 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Del')), 0, | 1921 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Del')), 0, |
1878 self.editorActGrp, 'vm_edit_delete_word_right') | 1922 self.editorActGrp, 'vm_edit_delete_word_right') |
1879 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT) | 1923 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT) |
1880 act.triggered[()].connect(self.esm.map) | 1924 act.triggered.connect(self.esm.map) |
1881 self.editActions.append(act) | 1925 self.editActions.append(act) |
1882 | 1926 |
1883 act = E5Action( | 1927 act = E5Action( |
1884 QApplication.translate('ViewManager', 'Delete line to left'), | 1928 QApplication.translate('ViewManager', 'Delete line to left'), |
1885 QApplication.translate('ViewManager', 'Delete line to left'), | 1929 QApplication.translate('ViewManager', 'Delete line to left'), |
1886 QKeySequence(QApplication.translate( | 1930 QKeySequence(QApplication.translate( |
1887 'ViewManager', 'Ctrl+Shift+Backspace')), | 1931 'ViewManager', 'Ctrl+Shift+Backspace')), |
1888 0, | 1932 0, |
1889 self.editorActGrp, 'vm_edit_delete_line_left') | 1933 self.editorActGrp, 'vm_edit_delete_line_left') |
1890 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT) | 1934 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT) |
1891 act.triggered[()].connect(self.esm.map) | 1935 act.triggered.connect(self.esm.map) |
1892 self.editActions.append(act) | 1936 self.editActions.append(act) |
1893 | 1937 |
1894 act = E5Action( | 1938 act = E5Action( |
1895 QApplication.translate('ViewManager', 'Delete line to right'), | 1939 QApplication.translate('ViewManager', 'Delete line to right'), |
1896 QApplication.translate('ViewManager', 'Delete line to right'), | 1940 QApplication.translate('ViewManager', 'Delete line to right'), |
1901 QApplication.translate('ViewManager', 'Meta+K'))) | 1945 QApplication.translate('ViewManager', 'Meta+K'))) |
1902 else: | 1946 else: |
1903 act.setShortcut(QKeySequence( | 1947 act.setShortcut(QKeySequence( |
1904 QApplication.translate('ViewManager', 'Ctrl+Shift+Del'))) | 1948 QApplication.translate('ViewManager', 'Ctrl+Shift+Del'))) |
1905 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT) | 1949 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT) |
1906 act.triggered[()].connect(self.esm.map) | 1950 act.triggered.connect(self.esm.map) |
1907 self.editActions.append(act) | 1951 self.editActions.append(act) |
1908 | 1952 |
1909 act = E5Action( | 1953 act = E5Action( |
1910 QApplication.translate('ViewManager', 'Insert new line'), | 1954 QApplication.translate('ViewManager', 'Insert new line'), |
1911 QApplication.translate('ViewManager', 'Insert new line'), | 1955 QApplication.translate('ViewManager', 'Insert new line'), |
1912 QKeySequence(QApplication.translate('ViewManager', 'Return')), | 1956 QKeySequence(QApplication.translate('ViewManager', 'Return')), |
1913 QKeySequence(QApplication.translate('ViewManager', 'Enter')), | 1957 QKeySequence(QApplication.translate('ViewManager', 'Enter')), |
1914 self.editorActGrp, 'vm_edit_insert_line') | 1958 self.editorActGrp, 'vm_edit_insert_line') |
1915 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE) | 1959 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE) |
1916 act.triggered[()].connect(self.esm.map) | 1960 act.triggered.connect(self.esm.map) |
1917 self.editActions.append(act) | 1961 self.editActions.append(act) |
1918 | 1962 |
1919 act = E5Action( | 1963 act = E5Action( |
1920 QApplication.translate( | 1964 QApplication.translate( |
1921 'ViewManager', 'Insert new line below current line'), | 1965 'ViewManager', 'Insert new line below current line'), |
1923 'ViewManager', 'Insert new line below current line'), | 1967 'ViewManager', 'Insert new line below current line'), |
1924 QKeySequence(QApplication.translate( | 1968 QKeySequence(QApplication.translate( |
1925 'ViewManager', 'Shift+Return')), | 1969 'ViewManager', 'Shift+Return')), |
1926 QKeySequence(QApplication.translate('ViewManager', 'Shift+Enter')), | 1970 QKeySequence(QApplication.translate('ViewManager', 'Shift+Enter')), |
1927 self.editorActGrp, 'vm_edit_insert_line_below') | 1971 self.editorActGrp, 'vm_edit_insert_line_below') |
1928 act.triggered[()].connect(self.__newLineBelow) | 1972 act.triggered.connect(self.__newLineBelow) |
1929 self.editActions.append(act) | 1973 self.editActions.append(act) |
1930 | 1974 |
1931 act = E5Action( | 1975 act = E5Action( |
1932 QApplication.translate('ViewManager', 'Delete current line'), | 1976 QApplication.translate('ViewManager', 'Delete current line'), |
1933 QApplication.translate('ViewManager', 'Delete current line'), | 1977 QApplication.translate('ViewManager', 'Delete current line'), |
1934 QKeySequence(QApplication.translate( | 1978 QKeySequence(QApplication.translate( |
1935 'ViewManager', 'Ctrl+Shift+L')), | 1979 'ViewManager', 'Ctrl+Shift+L')), |
1936 0, | 1980 0, |
1937 self.editorActGrp, 'vm_edit_delete_current_line') | 1981 self.editorActGrp, 'vm_edit_delete_current_line') |
1938 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE) | 1982 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE) |
1939 act.triggered[()].connect(self.esm.map) | 1983 act.triggered.connect(self.esm.map) |
1940 self.editActions.append(act) | 1984 self.editActions.append(act) |
1941 | 1985 |
1942 act = E5Action( | 1986 act = E5Action( |
1943 QApplication.translate('ViewManager', 'Duplicate current line'), | 1987 QApplication.translate('ViewManager', 'Duplicate current line'), |
1944 QApplication.translate('ViewManager', 'Duplicate current line'), | 1988 QApplication.translate('ViewManager', 'Duplicate current line'), |
1945 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+D')), 0, | 1989 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+D')), 0, |
1946 self.editorActGrp, 'vm_edit_duplicate_current_line') | 1990 self.editorActGrp, 'vm_edit_duplicate_current_line') |
1947 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE) | 1991 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE) |
1948 act.triggered[()].connect(self.esm.map) | 1992 act.triggered.connect(self.esm.map) |
1949 self.editActions.append(act) | 1993 self.editActions.append(act) |
1950 | 1994 |
1951 act = E5Action( | 1995 act = E5Action( |
1952 QApplication.translate( | 1996 QApplication.translate( |
1953 'ViewManager', 'Swap current and previous lines'), | 1997 'ViewManager', 'Swap current and previous lines'), |
1954 QApplication.translate( | 1998 QApplication.translate( |
1955 'ViewManager', 'Swap current and previous lines'), | 1999 'ViewManager', 'Swap current and previous lines'), |
1956 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+T')), 0, | 2000 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+T')), 0, |
1957 self.editorActGrp, 'vm_edit_swap_current_previous_line') | 2001 self.editorActGrp, 'vm_edit_swap_current_previous_line') |
1958 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE) | 2002 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE) |
1959 act.triggered[()].connect(self.esm.map) | 2003 act.triggered.connect(self.esm.map) |
1960 self.editActions.append(act) | 2004 self.editActions.append(act) |
1961 | 2005 |
1962 act = E5Action( | 2006 act = E5Action( |
1963 QApplication.translate('ViewManager', 'Cut current line'), | 2007 QApplication.translate('ViewManager', 'Cut current line'), |
1964 QApplication.translate('ViewManager', 'Cut current line'), | 2008 QApplication.translate('ViewManager', 'Cut current line'), |
1965 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+L')), | 2009 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+L')), |
1966 0, | 2010 0, |
1967 self.editorActGrp, 'vm_edit_cut_current_line') | 2011 self.editorActGrp, 'vm_edit_cut_current_line') |
1968 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT) | 2012 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT) |
1969 act.triggered[()].connect(self.esm.map) | 2013 act.triggered.connect(self.esm.map) |
1970 self.editActions.append(act) | 2014 self.editActions.append(act) |
1971 | 2015 |
1972 act = E5Action( | 2016 act = E5Action( |
1973 QApplication.translate('ViewManager', 'Copy current line'), | 2017 QApplication.translate('ViewManager', 'Copy current line'), |
1974 QApplication.translate('ViewManager', 'Copy current line'), | 2018 QApplication.translate('ViewManager', 'Copy current line'), |
1975 QKeySequence(QApplication.translate( | 2019 QKeySequence(QApplication.translate( |
1976 'ViewManager', 'Ctrl+Shift+T')), | 2020 'ViewManager', 'Ctrl+Shift+T')), |
1977 0, | 2021 0, |
1978 self.editorActGrp, 'vm_edit_copy_current_line') | 2022 self.editorActGrp, 'vm_edit_copy_current_line') |
1979 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY) | 2023 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY) |
1980 act.triggered[()].connect(self.esm.map) | 2024 act.triggered.connect(self.esm.map) |
1981 self.editActions.append(act) | 2025 self.editActions.append(act) |
1982 | 2026 |
1983 act = E5Action( | 2027 act = E5Action( |
1984 QApplication.translate('ViewManager', 'Toggle insert/overtype'), | 2028 QApplication.translate('ViewManager', 'Toggle insert/overtype'), |
1985 QApplication.translate('ViewManager', 'Toggle insert/overtype'), | 2029 QApplication.translate('ViewManager', 'Toggle insert/overtype'), |
1986 QKeySequence(QApplication.translate('ViewManager', 'Ins')), 0, | 2030 QKeySequence(QApplication.translate('ViewManager', 'Ins')), 0, |
1987 self.editorActGrp, 'vm_edit_toggle_insert_overtype') | 2031 self.editorActGrp, 'vm_edit_toggle_insert_overtype') |
1988 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE) | 2032 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE) |
1989 act.triggered[()].connect(self.esm.map) | 2033 act.triggered.connect(self.esm.map) |
1990 self.editActions.append(act) | 2034 self.editActions.append(act) |
1991 | 2035 |
1992 act = E5Action( | 2036 act = E5Action( |
1993 QApplication.translate( | 2037 QApplication.translate( |
1994 'ViewManager', 'Move to end of display line'), | 2038 'ViewManager', 'Move to end of display line'), |
2001 QApplication.translate('ViewManager', 'Ctrl+Right'))) | 2045 QApplication.translate('ViewManager', 'Ctrl+Right'))) |
2002 else: | 2046 else: |
2003 act.setShortcut(QKeySequence( | 2047 act.setShortcut(QKeySequence( |
2004 QApplication.translate('ViewManager', 'Alt+End'))) | 2048 QApplication.translate('ViewManager', 'Alt+End'))) |
2005 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY) | 2049 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY) |
2006 act.triggered[()].connect(self.esm.map) | 2050 act.triggered.connect(self.esm.map) |
2007 self.editActions.append(act) | 2051 self.editActions.append(act) |
2008 | 2052 |
2009 act = E5Action( | 2053 act = E5Action( |
2010 QApplication.translate( | 2054 QApplication.translate( |
2011 'ViewManager', 'Extend selection to end of display line'), | 2055 'ViewManager', 'Extend selection to end of display line'), |
2015 self.editorActGrp, 'vm_edit_extend_selection_end_displayed_line') | 2059 self.editorActGrp, 'vm_edit_extend_selection_end_displayed_line') |
2016 if isMacPlatform(): | 2060 if isMacPlatform(): |
2017 act.setShortcut(QKeySequence( | 2061 act.setShortcut(QKeySequence( |
2018 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) | 2062 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) |
2019 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND) | 2063 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND) |
2020 act.triggered[()].connect(self.esm.map) | 2064 act.triggered.connect(self.esm.map) |
2021 self.editActions.append(act) | 2065 self.editActions.append(act) |
2022 | 2066 |
2023 act = E5Action( | 2067 act = E5Action( |
2024 QApplication.translate('ViewManager', 'Formfeed'), | 2068 QApplication.translate('ViewManager', 'Formfeed'), |
2025 QApplication.translate('ViewManager', 'Formfeed'), | 2069 QApplication.translate('ViewManager', 'Formfeed'), |
2026 0, 0, | 2070 0, 0, |
2027 self.editorActGrp, 'vm_edit_formfeed') | 2071 self.editorActGrp, 'vm_edit_formfeed') |
2028 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) | 2072 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) |
2029 act.triggered[()].connect(self.esm.map) | 2073 act.triggered.connect(self.esm.map) |
2030 self.editActions.append(act) | 2074 self.editActions.append(act) |
2031 | 2075 |
2032 act = E5Action( | 2076 act = E5Action( |
2033 QApplication.translate('ViewManager', 'Escape'), | 2077 QApplication.translate('ViewManager', 'Escape'), |
2034 QApplication.translate('ViewManager', 'Escape'), | 2078 QApplication.translate('ViewManager', 'Escape'), |
2035 QKeySequence(QApplication.translate('ViewManager', 'Esc')), 0, | 2079 QKeySequence(QApplication.translate('ViewManager', 'Esc')), 0, |
2036 self.editorActGrp, 'vm_edit_escape') | 2080 self.editorActGrp, 'vm_edit_escape') |
2037 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL) | 2081 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL) |
2038 act.triggered[()].connect(self.esm.map) | 2082 act.triggered.connect(self.esm.map) |
2039 self.editActions.append(act) | 2083 self.editActions.append(act) |
2040 | 2084 |
2041 act = E5Action( | 2085 act = E5Action( |
2042 QApplication.translate( | 2086 QApplication.translate( |
2043 'ViewManager', 'Extend rectangular selection down one line'), | 2087 'ViewManager', 'Extend rectangular selection down one line'), |
2049 self.editorActGrp, 'vm_edit_extend_rect_selection_down_line') | 2093 self.editorActGrp, 'vm_edit_extend_rect_selection_down_line') |
2050 if isMacPlatform(): | 2094 if isMacPlatform(): |
2051 act.setAlternateShortcut(QKeySequence( | 2095 act.setAlternateShortcut(QKeySequence( |
2052 QApplication.translate('ViewManager', 'Meta+Alt+Shift+N'))) | 2096 QApplication.translate('ViewManager', 'Meta+Alt+Shift+N'))) |
2053 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND) | 2097 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND) |
2054 act.triggered[()].connect(self.esm.map) | 2098 act.triggered.connect(self.esm.map) |
2055 self.editActions.append(act) | 2099 self.editActions.append(act) |
2056 | 2100 |
2057 act = E5Action( | 2101 act = E5Action( |
2058 QApplication.translate( | 2102 QApplication.translate( |
2059 'ViewManager', 'Extend rectangular selection up one line'), | 2103 'ViewManager', 'Extend rectangular selection up one line'), |
2064 self.editorActGrp, 'vm_edit_extend_rect_selection_up_line') | 2108 self.editorActGrp, 'vm_edit_extend_rect_selection_up_line') |
2065 if isMacPlatform(): | 2109 if isMacPlatform(): |
2066 act.setAlternateShortcut(QKeySequence( | 2110 act.setAlternateShortcut(QKeySequence( |
2067 QApplication.translate('ViewManager', 'Meta+Alt+Shift+P'))) | 2111 QApplication.translate('ViewManager', 'Meta+Alt+Shift+P'))) |
2068 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND) | 2112 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND) |
2069 act.triggered[()].connect(self.esm.map) | 2113 act.triggered.connect(self.esm.map) |
2070 self.editActions.append(act) | 2114 self.editActions.append(act) |
2071 | 2115 |
2072 act = E5Action( | 2116 act = E5Action( |
2073 QApplication.translate( | 2117 QApplication.translate( |
2074 'ViewManager', | 2118 'ViewManager', |
2082 self.editorActGrp, 'vm_edit_extend_rect_selection_left_char') | 2126 self.editorActGrp, 'vm_edit_extend_rect_selection_left_char') |
2083 if isMacPlatform(): | 2127 if isMacPlatform(): |
2084 act.setAlternateShortcut(QKeySequence( | 2128 act.setAlternateShortcut(QKeySequence( |
2085 QApplication.translate('ViewManager', 'Meta+Alt+Shift+B'))) | 2129 QApplication.translate('ViewManager', 'Meta+Alt+Shift+B'))) |
2086 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND) | 2130 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND) |
2087 act.triggered[()].connect(self.esm.map) | 2131 act.triggered.connect(self.esm.map) |
2088 self.editActions.append(act) | 2132 self.editActions.append(act) |
2089 | 2133 |
2090 act = E5Action( | 2134 act = E5Action( |
2091 QApplication.translate( | 2135 QApplication.translate( |
2092 'ViewManager', | 2136 'ViewManager', |
2100 self.editorActGrp, 'vm_edit_extend_rect_selection_right_char') | 2144 self.editorActGrp, 'vm_edit_extend_rect_selection_right_char') |
2101 if isMacPlatform(): | 2145 if isMacPlatform(): |
2102 act.setAlternateShortcut(QKeySequence( | 2146 act.setAlternateShortcut(QKeySequence( |
2103 QApplication.translate('ViewManager', 'Meta+Alt+Shift+F'))) | 2147 QApplication.translate('ViewManager', 'Meta+Alt+Shift+F'))) |
2104 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND) | 2148 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND) |
2105 act.triggered[()].connect(self.esm.map) | 2149 act.triggered.connect(self.esm.map) |
2106 self.editActions.append(act) | 2150 self.editActions.append(act) |
2107 | 2151 |
2108 act = E5Action( | 2152 act = E5Action( |
2109 QApplication.translate( | 2153 QApplication.translate( |
2110 'ViewManager', | 2154 'ViewManager', |
2119 'vm_edit_extend_rect_selection_first_visible_char') | 2163 'vm_edit_extend_rect_selection_first_visible_char') |
2120 if not isMacPlatform(): | 2164 if not isMacPlatform(): |
2121 act.setShortcut(QKeySequence( | 2165 act.setShortcut(QKeySequence( |
2122 QApplication.translate('ViewManager', 'Alt+Shift+Home'))) | 2166 QApplication.translate('ViewManager', 'Alt+Shift+Home'))) |
2123 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND) | 2167 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND) |
2124 act.triggered[()].connect(self.esm.map) | 2168 act.triggered.connect(self.esm.map) |
2125 self.editActions.append(act) | 2169 self.editActions.append(act) |
2126 | 2170 |
2127 act = E5Action( | 2171 act = E5Action( |
2128 QApplication.translate( | 2172 QApplication.translate( |
2129 'ViewManager', | 2173 'ViewManager', |
2138 QApplication.translate('ViewManager', 'Meta+Alt+Shift+E'))) | 2182 QApplication.translate('ViewManager', 'Meta+Alt+Shift+E'))) |
2139 else: | 2183 else: |
2140 act.setShortcut(QKeySequence( | 2184 act.setShortcut(QKeySequence( |
2141 QApplication.translate('ViewManager', 'Alt+Shift+End'))) | 2185 QApplication.translate('ViewManager', 'Alt+Shift+End'))) |
2142 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND) | 2186 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND) |
2143 act.triggered[()].connect(self.esm.map) | 2187 act.triggered.connect(self.esm.map) |
2144 self.editActions.append(act) | 2188 self.editActions.append(act) |
2145 | 2189 |
2146 act = E5Action( | 2190 act = E5Action( |
2147 QApplication.translate( | 2191 QApplication.translate( |
2148 'ViewManager', | 2192 'ViewManager', |
2153 QKeySequence(QApplication.translate( | 2197 QKeySequence(QApplication.translate( |
2154 'ViewManager', 'Alt+Shift+PgUp')), | 2198 'ViewManager', 'Alt+Shift+PgUp')), |
2155 0, | 2199 0, |
2156 self.editorActGrp, 'vm_edit_extend_rect_selection_up_page') | 2200 self.editorActGrp, 'vm_edit_extend_rect_selection_up_page') |
2157 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND) | 2201 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND) |
2158 act.triggered[()].connect(self.esm.map) | 2202 act.triggered.connect(self.esm.map) |
2159 self.editActions.append(act) | 2203 self.editActions.append(act) |
2160 | 2204 |
2161 act = E5Action( | 2205 act = E5Action( |
2162 QApplication.translate( | 2206 QApplication.translate( |
2163 'ViewManager', | 2207 'ViewManager', |
2171 self.editorActGrp, 'vm_edit_extend_rect_selection_down_page') | 2215 self.editorActGrp, 'vm_edit_extend_rect_selection_down_page') |
2172 if isMacPlatform(): | 2216 if isMacPlatform(): |
2173 act.setAlternateShortcut(QKeySequence( | 2217 act.setAlternateShortcut(QKeySequence( |
2174 QApplication.translate('ViewManager', 'Meta+Alt+Shift+V'))) | 2218 QApplication.translate('ViewManager', 'Meta+Alt+Shift+V'))) |
2175 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND) | 2219 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND) |
2176 act.triggered[()].connect(self.esm.map) | 2220 act.triggered.connect(self.esm.map) |
2177 self.editActions.append(act) | 2221 self.editActions.append(act) |
2178 | 2222 |
2179 act = E5Action( | 2223 act = E5Action( |
2180 QApplication.translate( | 2224 QApplication.translate( |
2181 'ViewManager', 'Duplicate current selection'), | 2225 'ViewManager', 'Duplicate current selection'), |
2184 QKeySequence(QApplication.translate( | 2228 QKeySequence(QApplication.translate( |
2185 'ViewManager', 'Ctrl+Shift+D')), | 2229 'ViewManager', 'Ctrl+Shift+D')), |
2186 0, | 2230 0, |
2187 self.editorActGrp, 'vm_edit_duplicate_current_selection') | 2231 self.editorActGrp, 'vm_edit_duplicate_current_selection') |
2188 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) | 2232 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) |
2189 act.triggered[()].connect(self.esm.map) | 2233 act.triggered.connect(self.esm.map) |
2190 self.editActions.append(act) | 2234 self.editActions.append(act) |
2191 | 2235 |
2192 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"): | 2236 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"): |
2193 act = E5Action( | 2237 act = E5Action( |
2194 QApplication.translate( | 2238 QApplication.translate( |
2199 self.editorActGrp, 'vm_edit_scroll_start_text') | 2243 self.editorActGrp, 'vm_edit_scroll_start_text') |
2200 if isMacPlatform(): | 2244 if isMacPlatform(): |
2201 act.setShortcut(QKeySequence( | 2245 act.setShortcut(QKeySequence( |
2202 QApplication.translate('ViewManager', 'Home'))) | 2246 QApplication.translate('ViewManager', 'Home'))) |
2203 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOSTART) | 2247 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOSTART) |
2204 act.triggered[()].connect(self.esm.map) | 2248 act.triggered.connect(self.esm.map) |
2205 self.editActions.append(act) | 2249 self.editActions.append(act) |
2206 | 2250 |
2207 if hasattr(QsciScintilla, "SCI_SCROLLTOEND"): | 2251 if hasattr(QsciScintilla, "SCI_SCROLLTOEND"): |
2208 act = E5Action( | 2252 act = E5Action( |
2209 QApplication.translate( | 2253 QApplication.translate( |
2214 self.editorActGrp, 'vm_edit_scroll_end_text') | 2258 self.editorActGrp, 'vm_edit_scroll_end_text') |
2215 if isMacPlatform(): | 2259 if isMacPlatform(): |
2216 act.setShortcut(QKeySequence( | 2260 act.setShortcut(QKeySequence( |
2217 QApplication.translate('ViewManager', 'End'))) | 2261 QApplication.translate('ViewManager', 'End'))) |
2218 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOEND) | 2262 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOEND) |
2219 act.triggered[()].connect(self.esm.map) | 2263 act.triggered.connect(self.esm.map) |
2220 self.editActions.append(act) | 2264 self.editActions.append(act) |
2221 | 2265 |
2222 if hasattr(QsciScintilla, "SCI_VERTICALCENTRECARET"): | 2266 if hasattr(QsciScintilla, "SCI_VERTICALCENTRECARET"): |
2223 act = E5Action( | 2267 act = E5Action( |
2224 QApplication.translate( | 2268 QApplication.translate( |
2229 self.editorActGrp, 'vm_edit_scroll_vertically_center') | 2273 self.editorActGrp, 'vm_edit_scroll_vertically_center') |
2230 if isMacPlatform(): | 2274 if isMacPlatform(): |
2231 act.setShortcut(QKeySequence( | 2275 act.setShortcut(QKeySequence( |
2232 QApplication.translate('ViewManager', 'Meta+L'))) | 2276 QApplication.translate('ViewManager', 'Meta+L'))) |
2233 self.esm.setMapping(act, QsciScintilla.SCI_VERTICALCENTRECARET) | 2277 self.esm.setMapping(act, QsciScintilla.SCI_VERTICALCENTRECARET) |
2234 act.triggered[()].connect(self.esm.map) | 2278 act.triggered.connect(self.esm.map) |
2235 self.editActions.append(act) | 2279 self.editActions.append(act) |
2236 | 2280 |
2237 if hasattr(QsciScintilla, "SCI_WORDRIGHTEND"): | 2281 if hasattr(QsciScintilla, "SCI_WORDRIGHTEND"): |
2238 act = E5Action( | 2282 act = E5Action( |
2239 QApplication.translate( | 2283 QApplication.translate( |
2244 self.editorActGrp, 'vm_edit_move_end_next_word') | 2288 self.editorActGrp, 'vm_edit_move_end_next_word') |
2245 if isMacPlatform(): | 2289 if isMacPlatform(): |
2246 act.setShortcut(QKeySequence( | 2290 act.setShortcut(QKeySequence( |
2247 QApplication.translate('ViewManager', 'Alt+Right'))) | 2291 QApplication.translate('ViewManager', 'Alt+Right'))) |
2248 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEND) | 2292 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEND) |
2249 act.triggered[()].connect(self.esm.map) | 2293 act.triggered.connect(self.esm.map) |
2250 self.editActions.append(act) | 2294 self.editActions.append(act) |
2251 | 2295 |
2252 if hasattr(QsciScintilla, "SCI_WORDRIGHTENDEXTEND"): | 2296 if hasattr(QsciScintilla, "SCI_WORDRIGHTENDEXTEND"): |
2253 act = E5Action( | 2297 act = E5Action( |
2254 QApplication.translate( | 2298 QApplication.translate( |
2259 self.editorActGrp, 'vm_edit_select_end_next_word') | 2303 self.editorActGrp, 'vm_edit_select_end_next_word') |
2260 if isMacPlatform(): | 2304 if isMacPlatform(): |
2261 act.setShortcut(QKeySequence( | 2305 act.setShortcut(QKeySequence( |
2262 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) | 2306 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) |
2263 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTENDEXTEND) | 2307 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTENDEXTEND) |
2264 act.triggered[()].connect(self.esm.map) | 2308 act.triggered.connect(self.esm.map) |
2265 self.editActions.append(act) | 2309 self.editActions.append(act) |
2266 | 2310 |
2267 if hasattr(QsciScintilla, "SCI_WORDLEFTEND"): | 2311 if hasattr(QsciScintilla, "SCI_WORDLEFTEND"): |
2268 act = E5Action( | 2312 act = E5Action( |
2269 QApplication.translate( | 2313 QApplication.translate( |
2271 QApplication.translate( | 2315 QApplication.translate( |
2272 'ViewManager', 'Move to end of previous word'), | 2316 'ViewManager', 'Move to end of previous word'), |
2273 0, 0, | 2317 0, 0, |
2274 self.editorActGrp, 'vm_edit_move_end_previous_word') | 2318 self.editorActGrp, 'vm_edit_move_end_previous_word') |
2275 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEND) | 2319 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEND) |
2276 act.triggered[()].connect(self.esm.map) | 2320 act.triggered.connect(self.esm.map) |
2277 self.editActions.append(act) | 2321 self.editActions.append(act) |
2278 | 2322 |
2279 if hasattr(QsciScintilla, "SCI_WORDLEFTENDEXTEND"): | 2323 if hasattr(QsciScintilla, "SCI_WORDLEFTENDEXTEND"): |
2280 act = E5Action( | 2324 act = E5Action( |
2281 QApplication.translate( | 2325 QApplication.translate( |
2283 QApplication.translate( | 2327 QApplication.translate( |
2284 'ViewManager', 'Extend selection to end of previous word'), | 2328 'ViewManager', 'Extend selection to end of previous word'), |
2285 0, 0, | 2329 0, 0, |
2286 self.editorActGrp, 'vm_edit_select_end_previous_word') | 2330 self.editorActGrp, 'vm_edit_select_end_previous_word') |
2287 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTENDEXTEND) | 2331 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTENDEXTEND) |
2288 act.triggered[()].connect(self.esm.map) | 2332 act.triggered.connect(self.esm.map) |
2289 self.editActions.append(act) | 2333 self.editActions.append(act) |
2290 | 2334 |
2291 if hasattr(QsciScintilla, "SCI_HOME"): | 2335 if hasattr(QsciScintilla, "SCI_HOME"): |
2292 act = E5Action( | 2336 act = E5Action( |
2293 QApplication.translate( | 2337 QApplication.translate( |
2298 self.editorActGrp, 'vm_edit_move_start_document_line') | 2342 self.editorActGrp, 'vm_edit_move_start_document_line') |
2299 if isMacPlatform(): | 2343 if isMacPlatform(): |
2300 act.setShortcut(QKeySequence( | 2344 act.setShortcut(QKeySequence( |
2301 QApplication.translate('ViewManager', 'Meta+A'))) | 2345 QApplication.translate('ViewManager', 'Meta+A'))) |
2302 self.esm.setMapping(act, QsciScintilla.SCI_HOME) | 2346 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
2303 act.triggered[()].connect(self.esm.map) | 2347 act.triggered.connect(self.esm.map) |
2304 self.editActions.append(act) | 2348 self.editActions.append(act) |
2305 | 2349 |
2306 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"): | 2350 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"): |
2307 act = E5Action( | 2351 act = E5Action( |
2308 QApplication.translate( | 2352 QApplication.translate( |
2316 'vm_edit_extend_selection_start_document_line') | 2360 'vm_edit_extend_selection_start_document_line') |
2317 if isMacPlatform(): | 2361 if isMacPlatform(): |
2318 act.setShortcut(QKeySequence( | 2362 act.setShortcut(QKeySequence( |
2319 QApplication.translate('ViewManager', 'Meta+Shift+A'))) | 2363 QApplication.translate('ViewManager', 'Meta+Shift+A'))) |
2320 self.esm.setMapping(act, QsciScintilla.SCI_HOME) | 2364 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
2321 act.triggered[()].connect(self.esm.map) | 2365 act.triggered.connect(self.esm.map) |
2322 self.editActions.append(act) | 2366 self.editActions.append(act) |
2323 | 2367 |
2324 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"): | 2368 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"): |
2325 act = E5Action( | 2369 act = E5Action( |
2326 QApplication.translate( | 2370 QApplication.translate( |
2333 self.editorActGrp, 'vm_edit_select_rect_start_line') | 2377 self.editorActGrp, 'vm_edit_select_rect_start_line') |
2334 if isMacPlatform(): | 2378 if isMacPlatform(): |
2335 act.setShortcut(QKeySequence( | 2379 act.setShortcut(QKeySequence( |
2336 QApplication.translate('ViewManager', 'Meta+Alt+Shift+A'))) | 2380 QApplication.translate('ViewManager', 'Meta+Alt+Shift+A'))) |
2337 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND) | 2381 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND) |
2338 act.triggered[()].connect(self.esm.map) | 2382 act.triggered.connect(self.esm.map) |
2339 self.editActions.append(act) | 2383 self.editActions.append(act) |
2340 | 2384 |
2341 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"): | 2385 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"): |
2342 act = E5Action( | 2386 act = E5Action( |
2343 QApplication.translate( | 2387 QApplication.translate( |
2351 'vm_edit_extend_selection_start_display_line') | 2395 'vm_edit_extend_selection_start_display_line') |
2352 if isMacPlatform(): | 2396 if isMacPlatform(): |
2353 act.setShortcut(QKeySequence( | 2397 act.setShortcut(QKeySequence( |
2354 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) | 2398 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) |
2355 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND) | 2399 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND) |
2356 act.triggered[()].connect(self.esm.map) | 2400 act.triggered.connect(self.esm.map) |
2357 self.editActions.append(act) | 2401 self.editActions.append(act) |
2358 | 2402 |
2359 if hasattr(QsciScintilla, "SCI_HOMEWRAP"): | 2403 if hasattr(QsciScintilla, "SCI_HOMEWRAP"): |
2360 act = E5Action( | 2404 act = E5Action( |
2361 QApplication.translate( | 2405 QApplication.translate( |
2365 'ViewManager', | 2409 'ViewManager', |
2366 'Move to start of display or document line'), | 2410 'Move to start of display or document line'), |
2367 0, 0, | 2411 0, 0, |
2368 self.editorActGrp, 'vm_edit_move_start_display_document_line') | 2412 self.editorActGrp, 'vm_edit_move_start_display_document_line') |
2369 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP) | 2413 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP) |
2370 act.triggered[()].connect(self.esm.map) | 2414 act.triggered.connect(self.esm.map) |
2371 self.editActions.append(act) | 2415 self.editActions.append(act) |
2372 | 2416 |
2373 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"): | 2417 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"): |
2374 act = E5Action( | 2418 act = E5Action( |
2375 QApplication.translate( | 2419 QApplication.translate( |
2380 'Extend selection to start of display or document line'), | 2424 'Extend selection to start of display or document line'), |
2381 0, 0, | 2425 0, 0, |
2382 self.editorActGrp, | 2426 self.editorActGrp, |
2383 'vm_edit_extend_selection_start_display_document_line') | 2427 'vm_edit_extend_selection_start_display_document_line') |
2384 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND) | 2428 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND) |
2385 act.triggered[()].connect(self.esm.map) | 2429 act.triggered.connect(self.esm.map) |
2386 self.editActions.append(act) | 2430 self.editActions.append(act) |
2387 | 2431 |
2388 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"): | 2432 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"): |
2389 act = E5Action( | 2433 act = E5Action( |
2390 QApplication.translate( | 2434 QApplication.translate( |
2397 ' line'), | 2441 ' line'), |
2398 0, 0, | 2442 0, 0, |
2399 self.editorActGrp, | 2443 self.editorActGrp, |
2400 'vm_edit_move_first_visible_char_document_line') | 2444 'vm_edit_move_first_visible_char_document_line') |
2401 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAP) | 2445 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAP) |
2402 act.triggered[()].connect(self.esm.map) | 2446 act.triggered.connect(self.esm.map) |
2403 self.editActions.append(act) | 2447 self.editActions.append(act) |
2404 | 2448 |
2405 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"): | 2449 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"): |
2406 act = E5Action( | 2450 act = E5Action( |
2407 QApplication.translate( | 2451 QApplication.translate( |
2414 ' display or document line'), | 2458 ' display or document line'), |
2415 0, 0, | 2459 0, 0, |
2416 self.editorActGrp, | 2460 self.editorActGrp, |
2417 'vm_edit_extend_selection_first_visible_char_document_line') | 2461 'vm_edit_extend_selection_first_visible_char_document_line') |
2418 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAPEXTEND) | 2462 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAPEXTEND) |
2419 act.triggered[()].connect(self.esm.map) | 2463 act.triggered.connect(self.esm.map) |
2420 self.editActions.append(act) | 2464 self.editActions.append(act) |
2421 | 2465 |
2422 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"): | 2466 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"): |
2423 act = E5Action( | 2467 act = E5Action( |
2424 QApplication.translate( | 2468 QApplication.translate( |
2428 'ViewManager', | 2472 'ViewManager', |
2429 'Move to end of display or document line'), | 2473 'Move to end of display or document line'), |
2430 0, 0, | 2474 0, 0, |
2431 self.editorActGrp, 'vm_edit_end_start_display_document_line') | 2475 self.editorActGrp, 'vm_edit_end_start_display_document_line') |
2432 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP) | 2476 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP) |
2433 act.triggered[()].connect(self.esm.map) | 2477 act.triggered.connect(self.esm.map) |
2434 self.editActions.append(act) | 2478 self.editActions.append(act) |
2435 | 2479 |
2436 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"): | 2480 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"): |
2437 act = E5Action( | 2481 act = E5Action( |
2438 QApplication.translate( | 2482 QApplication.translate( |
2443 'Extend selection to end of display or document line'), | 2487 'Extend selection to end of display or document line'), |
2444 0, 0, | 2488 0, 0, |
2445 self.editorActGrp, | 2489 self.editorActGrp, |
2446 'vm_edit_extend_selection_end_display_document_line') | 2490 'vm_edit_extend_selection_end_display_document_line') |
2447 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAPEXTEND) | 2491 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAPEXTEND) |
2448 act.triggered[()].connect(self.esm.map) | 2492 act.triggered.connect(self.esm.map) |
2449 self.editActions.append(act) | 2493 self.editActions.append(act) |
2450 | 2494 |
2451 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"): | 2495 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"): |
2452 act = E5Action( | 2496 act = E5Action( |
2453 QApplication.translate( | 2497 QApplication.translate( |
2455 QApplication.translate( | 2499 QApplication.translate( |
2456 'ViewManager', 'Stuttered move up one page'), | 2500 'ViewManager', 'Stuttered move up one page'), |
2457 0, 0, | 2501 0, 0, |
2458 self.editorActGrp, 'vm_edit_stuttered_move_up_page') | 2502 self.editorActGrp, 'vm_edit_stuttered_move_up_page') |
2459 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP) | 2503 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP) |
2460 act.triggered[()].connect(self.esm.map) | 2504 act.triggered.connect(self.esm.map) |
2461 self.editActions.append(act) | 2505 self.editActions.append(act) |
2462 | 2506 |
2463 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"): | 2507 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"): |
2464 act = E5Action( | 2508 act = E5Action( |
2465 QApplication.translate( | 2509 QApplication.translate( |
2468 'ViewManager', 'Stuttered extend selection up one page'), | 2512 'ViewManager', 'Stuttered extend selection up one page'), |
2469 0, 0, | 2513 0, 0, |
2470 self.editorActGrp, | 2514 self.editorActGrp, |
2471 'vm_edit_stuttered_extend_selection_up_page') | 2515 'vm_edit_stuttered_extend_selection_up_page') |
2472 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUPEXTEND) | 2516 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUPEXTEND) |
2473 act.triggered[()].connect(self.esm.map) | 2517 act.triggered.connect(self.esm.map) |
2474 self.editActions.append(act) | 2518 self.editActions.append(act) |
2475 | 2519 |
2476 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"): | 2520 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"): |
2477 act = E5Action( | 2521 act = E5Action( |
2478 QApplication.translate( | 2522 QApplication.translate( |
2480 QApplication.translate( | 2524 QApplication.translate( |
2481 'ViewManager', 'Stuttered move down one page'), | 2525 'ViewManager', 'Stuttered move down one page'), |
2482 0, 0, | 2526 0, 0, |
2483 self.editorActGrp, 'vm_edit_stuttered_move_down_page') | 2527 self.editorActGrp, 'vm_edit_stuttered_move_down_page') |
2484 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN) | 2528 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN) |
2485 act.triggered[()].connect(self.esm.map) | 2529 act.triggered.connect(self.esm.map) |
2486 self.editActions.append(act) | 2530 self.editActions.append(act) |
2487 | 2531 |
2488 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"): | 2532 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"): |
2489 act = E5Action( | 2533 act = E5Action( |
2490 QApplication.translate( | 2534 QApplication.translate( |
2493 'ViewManager', 'Stuttered extend selection down one page'), | 2537 'ViewManager', 'Stuttered extend selection down one page'), |
2494 0, 0, | 2538 0, 0, |
2495 self.editorActGrp, | 2539 self.editorActGrp, |
2496 'vm_edit_stuttered_extend_selection_down_page') | 2540 'vm_edit_stuttered_extend_selection_down_page') |
2497 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND) | 2541 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND) |
2498 act.triggered[()].connect(self.esm.map) | 2542 act.triggered.connect(self.esm.map) |
2499 self.editActions.append(act) | 2543 self.editActions.append(act) |
2500 | 2544 |
2501 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"): | 2545 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"): |
2502 act = E5Action( | 2546 act = E5Action( |
2503 QApplication.translate( | 2547 QApplication.translate( |
2508 self.editorActGrp, 'vm_edit_delete_right_end_next_word') | 2552 self.editorActGrp, 'vm_edit_delete_right_end_next_word') |
2509 if isMacPlatform(): | 2553 if isMacPlatform(): |
2510 act.setShortcut(QKeySequence( | 2554 act.setShortcut(QKeySequence( |
2511 QApplication.translate('ViewManager', 'Alt+Del'))) | 2555 QApplication.translate('ViewManager', 'Alt+Del'))) |
2512 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND) | 2556 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND) |
2513 act.triggered[()].connect(self.esm.map) | 2557 act.triggered.connect(self.esm.map) |
2514 self.editActions.append(act) | 2558 self.editActions.append(act) |
2515 | 2559 |
2516 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"): | 2560 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"): |
2517 act = E5Action( | 2561 act = E5Action( |
2518 QApplication.translate( | 2562 QApplication.translate( |
2520 QApplication.translate( | 2564 QApplication.translate( |
2521 'ViewManager', 'Move selected lines up one line'), | 2565 'ViewManager', 'Move selected lines up one line'), |
2522 0, 0, | 2566 0, 0, |
2523 self.editorActGrp, 'vm_edit_move_selection_up_one_line') | 2567 self.editorActGrp, 'vm_edit_move_selection_up_one_line') |
2524 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP) | 2568 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP) |
2525 act.triggered[()].connect(self.esm.map) | 2569 act.triggered.connect(self.esm.map) |
2526 self.editActions.append(act) | 2570 self.editActions.append(act) |
2527 | 2571 |
2528 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"): | 2572 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"): |
2529 act = E5Action( | 2573 act = E5Action( |
2530 QApplication.translate( | 2574 QApplication.translate( |
2532 QApplication.translate( | 2576 QApplication.translate( |
2533 'ViewManager', 'Move selected lines down one line'), | 2577 'ViewManager', 'Move selected lines down one line'), |
2534 0, 0, | 2578 0, 0, |
2535 self.editorActGrp, 'vm_edit_move_selection_down_one_line') | 2579 self.editorActGrp, 'vm_edit_move_selection_down_one_line') |
2536 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN) | 2580 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN) |
2537 act.triggered[()].connect(self.esm.map) | 2581 act.triggered.connect(self.esm.map) |
2538 self.editActions.append(act) | 2582 self.editActions.append(act) |
2539 | 2583 |
2540 self.editorActGrp.setEnabled(False) | 2584 self.editorActGrp.setEnabled(False) |
2541 | 2585 |
2542 self.editLowerCaseAct = E5Action( | 2586 self.editLowerCaseAct = E5Action( |
2546 'ViewManager', 'Convert selection to lower case'), | 2590 'ViewManager', 'Convert selection to lower case'), |
2547 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')), | 2591 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')), |
2548 0, | 2592 0, |
2549 self.editActGrp, 'vm_edit_convert_selection_lower') | 2593 self.editActGrp, 'vm_edit_convert_selection_lower') |
2550 self.esm.setMapping(self.editLowerCaseAct, QsciScintilla.SCI_LOWERCASE) | 2594 self.esm.setMapping(self.editLowerCaseAct, QsciScintilla.SCI_LOWERCASE) |
2551 self.editLowerCaseAct.triggered[()].connect(self.esm.map) | 2595 self.editLowerCaseAct.triggered.connect(self.esm.map) |
2552 self.editActions.append(self.editLowerCaseAct) | 2596 self.editActions.append(self.editLowerCaseAct) |
2553 | 2597 |
2554 self.editUpperCaseAct = E5Action( | 2598 self.editUpperCaseAct = E5Action( |
2555 QApplication.translate( | 2599 QApplication.translate( |
2556 'ViewManager', 'Convert selection to upper case'), | 2600 'ViewManager', 'Convert selection to upper case'), |
2559 QKeySequence(QApplication.translate( | 2603 QKeySequence(QApplication.translate( |
2560 'ViewManager', 'Ctrl+Shift+U')), | 2604 'ViewManager', 'Ctrl+Shift+U')), |
2561 0, | 2605 0, |
2562 self.editActGrp, 'vm_edit_convert_selection_upper') | 2606 self.editActGrp, 'vm_edit_convert_selection_upper') |
2563 self.esm.setMapping(self.editUpperCaseAct, QsciScintilla.SCI_UPPERCASE) | 2607 self.esm.setMapping(self.editUpperCaseAct, QsciScintilla.SCI_UPPERCASE) |
2564 self.editUpperCaseAct.triggered[()].connect(self.esm.map) | 2608 self.editUpperCaseAct.triggered.connect(self.esm.map) |
2565 self.editActions.append(self.editUpperCaseAct) | 2609 self.editActions.append(self.editUpperCaseAct) |
2566 | 2610 |
2567 def initEditMenu(self): | 2611 def initEditMenu(self): |
2568 """ | 2612 """ |
2569 Public method to create the Edit menu. | 2613 Public method to create the Edit menu. |
2703 """<b>Search</b>""" | 2747 """<b>Search</b>""" |
2704 """<p>Search for some text in the current editor. A""" | 2748 """<p>Search for some text in the current editor. A""" |
2705 """ dialog is shown to enter the searchtext and options""" | 2749 """ dialog is shown to enter the searchtext and options""" |
2706 """ for the search.</p>""" | 2750 """ for the search.</p>""" |
2707 )) | 2751 )) |
2708 self.searchAct.triggered[()].connect(self.__search) | 2752 self.searchAct.triggered.connect(self.__search) |
2709 self.searchActions.append(self.searchAct) | 2753 self.searchActions.append(self.searchAct) |
2710 | 2754 |
2711 self.searchNextAct = E5Action( | 2755 self.searchNextAct = E5Action( |
2712 QApplication.translate( | 2756 QApplication.translate( |
2713 'ViewManager', 'Search next'), | 2757 'ViewManager', 'Search next'), |
2724 """<b>Search next</b>""" | 2768 """<b>Search next</b>""" |
2725 """<p>Search the next occurrence of some text in the current""" | 2769 """<p>Search the next occurrence of some text in the current""" |
2726 """ editor. The previously entered searchtext and options are""" | 2770 """ editor. The previously entered searchtext and options are""" |
2727 """ reused.</p>""" | 2771 """ reused.</p>""" |
2728 )) | 2772 )) |
2729 self.searchNextAct.triggered[()].connect(self.__searchWidget.findNext) | 2773 self.searchNextAct.triggered.connect(self.__searchWidget.findNext) |
2730 self.searchActions.append(self.searchNextAct) | 2774 self.searchActions.append(self.searchNextAct) |
2731 | 2775 |
2732 self.searchPrevAct = E5Action( | 2776 self.searchPrevAct = E5Action( |
2733 QApplication.translate('ViewManager', 'Search previous'), | 2777 QApplication.translate('ViewManager', 'Search previous'), |
2734 UI.PixmapCache.getIcon("findPrev.png"), | 2778 UI.PixmapCache.getIcon("findPrev.png"), |
2744 """<b>Search previous</b>""" | 2788 """<b>Search previous</b>""" |
2745 """<p>Search the previous occurrence of some text in the current""" | 2789 """<p>Search the previous occurrence of some text in the current""" |
2746 """ editor. The previously entered searchtext and options are""" | 2790 """ editor. The previously entered searchtext and options are""" |
2747 """ reused.</p>""" | 2791 """ reused.</p>""" |
2748 )) | 2792 )) |
2749 self.searchPrevAct.triggered[()].connect(self.__searchWidget.findPrev) | 2793 self.searchPrevAct.triggered.connect(self.__searchWidget.findPrev) |
2750 self.searchActions.append(self.searchPrevAct) | 2794 self.searchActions.append(self.searchPrevAct) |
2751 | 2795 |
2752 self.searchClearMarkersAct = E5Action( | 2796 self.searchClearMarkersAct = E5Action( |
2753 QApplication.translate('ViewManager', 'Clear search markers'), | 2797 QApplication.translate('ViewManager', 'Clear search markers'), |
2754 UI.PixmapCache.getIcon("findClear.png"), | 2798 UI.PixmapCache.getIcon("findClear.png"), |
2762 self.searchClearMarkersAct.setWhatsThis(QApplication.translate( | 2806 self.searchClearMarkersAct.setWhatsThis(QApplication.translate( |
2763 'ViewManager', | 2807 'ViewManager', |
2764 """<b>Clear search markers</b>""" | 2808 """<b>Clear search markers</b>""" |
2765 """<p>Clear all displayed search markers.</p>""" | 2809 """<p>Clear all displayed search markers.</p>""" |
2766 )) | 2810 )) |
2767 self.searchClearMarkersAct.triggered[()].connect( | 2811 self.searchClearMarkersAct.triggered.connect( |
2768 self.__searchClearMarkers) | 2812 self.__searchClearMarkers) |
2769 self.searchActions.append(self.searchClearMarkersAct) | 2813 self.searchActions.append(self.searchClearMarkersAct) |
2770 | 2814 |
2771 self.searchNextWordAct = E5Action( | 2815 self.searchNextWordAct = E5Action( |
2772 QApplication.translate( | 2816 QApplication.translate( |
2786 'ViewManager', | 2830 'ViewManager', |
2787 """<b>Search current word forward</b>""" | 2831 """<b>Search current word forward</b>""" |
2788 """<p>Search the next occurrence of the current word of the""" | 2832 """<p>Search the next occurrence of the current word of the""" |
2789 """ current editor.</p>""" | 2833 """ current editor.</p>""" |
2790 )) | 2834 )) |
2791 self.searchNextWordAct.triggered[()].connect(self.__findNextWord) | 2835 self.searchNextWordAct.triggered.connect(self.__findNextWord) |
2792 self.searchActions.append(self.searchNextWordAct) | 2836 self.searchActions.append(self.searchNextWordAct) |
2793 | 2837 |
2794 self.searchPrevWordAct = E5Action( | 2838 self.searchPrevWordAct = E5Action( |
2795 QApplication.translate( | 2839 QApplication.translate( |
2796 'ViewManager', 'Search current word backward'), | 2840 'ViewManager', 'Search current word backward'), |
2809 'ViewManager', | 2853 'ViewManager', |
2810 """<b>Search current word backward</b>""" | 2854 """<b>Search current word backward</b>""" |
2811 """<p>Search the previous occurrence of the current word of the""" | 2855 """<p>Search the previous occurrence of the current word of the""" |
2812 """ current editor.</p>""" | 2856 """ current editor.</p>""" |
2813 )) | 2857 )) |
2814 self.searchPrevWordAct.triggered[()].connect(self.__findPrevWord) | 2858 self.searchPrevWordAct.triggered.connect(self.__findPrevWord) |
2815 self.searchActions.append(self.searchPrevWordAct) | 2859 self.searchActions.append(self.searchPrevWordAct) |
2816 | 2860 |
2817 self.replaceAct = E5Action( | 2861 self.replaceAct = E5Action( |
2818 QApplication.translate('ViewManager', 'Replace'), | 2862 QApplication.translate('ViewManager', 'Replace'), |
2819 QApplication.translate('ViewManager', '&Replace...'), | 2863 QApplication.translate('ViewManager', '&Replace...'), |
2828 """<b>Replace</b>""" | 2872 """<b>Replace</b>""" |
2829 """<p>Search for some text in the current editor and replace it.""" | 2873 """<p>Search for some text in the current editor and replace it.""" |
2830 """ A dialog is shown to enter the searchtext, the replacement""" | 2874 """ A dialog is shown to enter the searchtext, the replacement""" |
2831 """ text and options for the search and replace.</p>""" | 2875 """ text and options for the search and replace.</p>""" |
2832 )) | 2876 )) |
2833 self.replaceAct.triggered[()].connect(self.__replace) | 2877 self.replaceAct.triggered.connect(self.__replace) |
2834 self.searchActions.append(self.replaceAct) | 2878 self.searchActions.append(self.replaceAct) |
2835 | 2879 |
2836 self.quickSearchAct = E5Action( | 2880 self.quickSearchAct = E5Action( |
2837 QApplication.translate('ViewManager', 'Quicksearch'), | 2881 QApplication.translate('ViewManager', 'Quicksearch'), |
2838 UI.PixmapCache.getIcon("quickFindNext.png"), | 2882 UI.PixmapCache.getIcon("quickFindNext.png"), |
2849 """<p>This activates the quicksearch function of the IDE by""" | 2893 """<p>This activates the quicksearch function of the IDE by""" |
2850 """ giving focus to the quicksearch entry field. If this field""" | 2894 """ giving focus to the quicksearch entry field. If this field""" |
2851 """ is already active and contains text, it searches for the""" | 2895 """ is already active and contains text, it searches for the""" |
2852 """ next occurrence of this text.</p>""" | 2896 """ next occurrence of this text.</p>""" |
2853 )) | 2897 )) |
2854 self.quickSearchAct.triggered[()].connect(self.__quickSearch) | 2898 self.quickSearchAct.triggered.connect(self.__quickSearch) |
2855 self.searchActions.append(self.quickSearchAct) | 2899 self.searchActions.append(self.quickSearchAct) |
2856 | 2900 |
2857 self.quickSearchBackAct = E5Action( | 2901 self.quickSearchBackAct = E5Action( |
2858 QApplication.translate('ViewManager', 'Quicksearch backwards'), | 2902 QApplication.translate('ViewManager', 'Quicksearch backwards'), |
2859 UI.PixmapCache.getIcon("quickFindPrev.png"), | 2903 UI.PixmapCache.getIcon("quickFindPrev.png"), |
2869 'ViewManager', | 2913 'ViewManager', |
2870 """<b>Quicksearch backwards</b>""" | 2914 """<b>Quicksearch backwards</b>""" |
2871 """<p>This searches the previous occurrence of the quicksearch""" | 2915 """<p>This searches the previous occurrence of the quicksearch""" |
2872 """ text.</p>""" | 2916 """ text.</p>""" |
2873 )) | 2917 )) |
2874 self.quickSearchBackAct.triggered[()].connect(self.__quickSearchPrev) | 2918 self.quickSearchBackAct.triggered.connect(self.__quickSearchPrev) |
2875 self.searchActions.append(self.quickSearchBackAct) | 2919 self.searchActions.append(self.quickSearchBackAct) |
2876 | 2920 |
2877 self.quickSearchExtendAct = E5Action( | 2921 self.quickSearchExtendAct = E5Action( |
2878 QApplication.translate('ViewManager', 'Quicksearch extend'), | 2922 QApplication.translate('ViewManager', 'Quicksearch extend'), |
2879 UI.PixmapCache.getIcon("quickFindExtend.png"), | 2923 UI.PixmapCache.getIcon("quickFindExtend.png"), |
2889 'ViewManager', | 2933 'ViewManager', |
2890 """<b>Quicksearch extend</b>""" | 2934 """<b>Quicksearch extend</b>""" |
2891 """<p>This extends the quicksearch text to the end of the word""" | 2935 """<p>This extends the quicksearch text to the end of the word""" |
2892 """ currently found.</p>""" | 2936 """ currently found.</p>""" |
2893 )) | 2937 )) |
2894 self.quickSearchExtendAct.triggered[()].connect( | 2938 self.quickSearchExtendAct.triggered.connect( |
2895 self.__quickSearchExtend) | 2939 self.__quickSearchExtend) |
2896 self.searchActions.append(self.quickSearchExtendAct) | 2940 self.searchActions.append(self.quickSearchExtendAct) |
2897 | 2941 |
2898 self.gotoAct = E5Action( | 2942 self.gotoAct = E5Action( |
2899 QApplication.translate('ViewManager', 'Goto Line'), | 2943 QApplication.translate('ViewManager', 'Goto Line'), |
2909 'ViewManager', | 2953 'ViewManager', |
2910 """<b>Goto Line</b>""" | 2954 """<b>Goto Line</b>""" |
2911 """<p>Go to a specific line of text in the current editor.""" | 2955 """<p>Go to a specific line of text in the current editor.""" |
2912 """ A dialog is shown to enter the linenumber.</p>""" | 2956 """ A dialog is shown to enter the linenumber.</p>""" |
2913 )) | 2957 )) |
2914 self.gotoAct.triggered[()].connect(self.__goto) | 2958 self.gotoAct.triggered.connect(self.__goto) |
2915 self.searchActions.append(self.gotoAct) | 2959 self.searchActions.append(self.gotoAct) |
2916 | 2960 |
2917 self.gotoBraceAct = E5Action( | 2961 self.gotoBraceAct = E5Action( |
2918 QApplication.translate('ViewManager', 'Goto Brace'), | 2962 QApplication.translate('ViewManager', 'Goto Brace'), |
2919 UI.PixmapCache.getIcon("gotoBrace.png"), | 2963 UI.PixmapCache.getIcon("gotoBrace.png"), |
2927 self.gotoBraceAct.setWhatsThis(QApplication.translate( | 2971 self.gotoBraceAct.setWhatsThis(QApplication.translate( |
2928 'ViewManager', | 2972 'ViewManager', |
2929 """<b>Goto Brace</b>""" | 2973 """<b>Goto Brace</b>""" |
2930 """<p>Go to the matching brace in the current editor.</p>""" | 2974 """<p>Go to the matching brace in the current editor.</p>""" |
2931 )) | 2975 )) |
2932 self.gotoBraceAct.triggered[()].connect(self.__gotoBrace) | 2976 self.gotoBraceAct.triggered.connect(self.__gotoBrace) |
2933 self.searchActions.append(self.gotoBraceAct) | 2977 self.searchActions.append(self.gotoBraceAct) |
2934 | 2978 |
2935 self.gotoLastEditAct = E5Action( | 2979 self.gotoLastEditAct = E5Action( |
2936 QApplication.translate('ViewManager', 'Goto Last Edit Location'), | 2980 QApplication.translate('ViewManager', 'Goto Last Edit Location'), |
2937 UI.PixmapCache.getIcon("gotoLastEditPosition.png"), | 2981 UI.PixmapCache.getIcon("gotoLastEditPosition.png"), |
2947 'ViewManager', | 2991 'ViewManager', |
2948 """<b>Goto Last Edit Location</b>""" | 2992 """<b>Goto Last Edit Location</b>""" |
2949 """<p>Go to the location of the last edit in the current""" | 2993 """<p>Go to the location of the last edit in the current""" |
2950 """ editor.</p>""" | 2994 """ editor.</p>""" |
2951 )) | 2995 )) |
2952 self.gotoLastEditAct.triggered[()].connect(self.__gotoLastEditPosition) | 2996 self.gotoLastEditAct.triggered.connect(self.__gotoLastEditPosition) |
2953 self.searchActions.append(self.gotoLastEditAct) | 2997 self.searchActions.append(self.gotoLastEditAct) |
2954 | 2998 |
2955 self.gotoPreviousDefAct = E5Action( | 2999 self.gotoPreviousDefAct = E5Action( |
2956 QApplication.translate( | 3000 QApplication.translate( |
2957 'ViewManager', 'Goto Previous Method or Class'), | 3001 'ViewManager', 'Goto Previous Method or Class'), |
2970 'ViewManager', | 3014 'ViewManager', |
2971 """<b>Goto Previous Method or Class</b>""" | 3015 """<b>Goto Previous Method or Class</b>""" |
2972 """<p>Goes to the line of the previous method or class""" | 3016 """<p>Goes to the line of the previous method or class""" |
2973 """ definition and highlights the name.</p>""" | 3017 """ definition and highlights the name.</p>""" |
2974 )) | 3018 )) |
2975 self.gotoPreviousDefAct.triggered[()].connect( | 3019 self.gotoPreviousDefAct.triggered.connect( |
2976 self.__gotoPreviousMethodClass) | 3020 self.__gotoPreviousMethodClass) |
2977 self.searchActions.append(self.gotoPreviousDefAct) | 3021 self.searchActions.append(self.gotoPreviousDefAct) |
2978 | 3022 |
2979 self.gotoNextDefAct = E5Action( | 3023 self.gotoNextDefAct = E5Action( |
2980 QApplication.translate('ViewManager', 'Goto Next Method or Class'), | 3024 QApplication.translate('ViewManager', 'Goto Next Method or Class'), |
2990 'ViewManager', | 3034 'ViewManager', |
2991 """<b>Goto Next Method or Class</b>""" | 3035 """<b>Goto Next Method or Class</b>""" |
2992 """<p>Goes to the line of the next method or class definition""" | 3036 """<p>Goes to the line of the next method or class definition""" |
2993 """ and highlights the name.</p>""" | 3037 """ and highlights the name.</p>""" |
2994 )) | 3038 )) |
2995 self.gotoNextDefAct.triggered[()].connect(self.__gotoNextMethodClass) | 3039 self.gotoNextDefAct.triggered.connect(self.__gotoNextMethodClass) |
2996 self.searchActions.append(self.gotoNextDefAct) | 3040 self.searchActions.append(self.gotoNextDefAct) |
2997 | 3041 |
2998 self.searchActGrp.setEnabled(False) | 3042 self.searchActGrp.setEnabled(False) |
2999 | 3043 |
3000 self.searchFilesAct = E5Action( | 3044 self.searchFilesAct = E5Action( |
3012 """<b>Search in Files</b>""" | 3056 """<b>Search in Files</b>""" |
3013 """<p>Search for some text in the files of a directory tree""" | 3057 """<p>Search for some text in the files of a directory tree""" |
3014 """ or the project. A dialog is shown to enter the searchtext""" | 3058 """ or the project. A dialog is shown to enter the searchtext""" |
3015 """ and options for the search and to display the result.</p>""" | 3059 """ and options for the search and to display the result.</p>""" |
3016 )) | 3060 )) |
3017 self.searchFilesAct.triggered[()].connect(self.__searchFiles) | 3061 self.searchFilesAct.triggered.connect(self.__searchFiles) |
3018 self.searchActions.append(self.searchFilesAct) | 3062 self.searchActions.append(self.searchFilesAct) |
3019 | 3063 |
3020 self.replaceFilesAct = E5Action( | 3064 self.replaceFilesAct = E5Action( |
3021 QApplication.translate('ViewManager', 'Replace in Files'), | 3065 QApplication.translate('ViewManager', 'Replace in Files'), |
3022 QApplication.translate('ViewManager', 'Replace in F&iles...'), | 3066 QApplication.translate('ViewManager', 'Replace in F&iles...'), |
3032 """<p>Search for some text in the files of a directory tree""" | 3076 """<p>Search for some text in the files of a directory tree""" |
3033 """ or the project and replace it. A dialog is shown to enter""" | 3077 """ or the project and replace it. A dialog is shown to enter""" |
3034 """ the searchtext, the replacement text and options for the""" | 3078 """ the searchtext, the replacement text and options for the""" |
3035 """ search and to display the result.</p>""" | 3079 """ search and to display the result.</p>""" |
3036 )) | 3080 )) |
3037 self.replaceFilesAct.triggered[()].connect(self.__replaceFiles) | 3081 self.replaceFilesAct.triggered.connect(self.__replaceFiles) |
3038 self.searchActions.append(self.replaceFilesAct) | 3082 self.searchActions.append(self.replaceFilesAct) |
3039 | 3083 |
3040 self.searchOpenFilesAct = E5Action( | 3084 self.searchOpenFilesAct = E5Action( |
3041 QApplication.translate('ViewManager', 'Search in Open Files'), | 3085 QApplication.translate('ViewManager', 'Search in Open Files'), |
3042 UI.PixmapCache.getIcon("documentFind.png"), | 3086 UI.PixmapCache.getIcon("documentFind.png"), |
3053 """<b>Search in Open Files</b>""" | 3097 """<b>Search in Open Files</b>""" |
3054 """<p>Search for some text in the currently opened files.""" | 3098 """<p>Search for some text in the currently opened files.""" |
3055 """ A dialog is shown to enter the searchtext""" | 3099 """ A dialog is shown to enter the searchtext""" |
3056 """ and options for the search and to display the result.</p>""" | 3100 """ and options for the search and to display the result.</p>""" |
3057 )) | 3101 )) |
3058 self.searchOpenFilesAct.triggered[()].connect(self.__searchOpenFiles) | 3102 self.searchOpenFilesAct.triggered.connect(self.__searchOpenFiles) |
3059 self.searchActions.append(self.searchOpenFilesAct) | 3103 self.searchActions.append(self.searchOpenFilesAct) |
3060 | 3104 |
3061 self.replaceOpenFilesAct = E5Action( | 3105 self.replaceOpenFilesAct = E5Action( |
3062 QApplication.translate('ViewManager', 'Replace in Open Files'), | 3106 QApplication.translate('ViewManager', 'Replace in Open Files'), |
3063 QApplication.translate('ViewManager', 'Replace in Open Files...'), | 3107 QApplication.translate('ViewManager', 'Replace in Open Files...'), |
3074 """<p>Search for some text in the currently opened files""" | 3118 """<p>Search for some text in the currently opened files""" |
3075 """ and replace it. A dialog is shown to enter""" | 3119 """ and replace it. A dialog is shown to enter""" |
3076 """ the searchtext, the replacement text and options for the""" | 3120 """ the searchtext, the replacement text and options for the""" |
3077 """ search and to display the result.</p>""" | 3121 """ search and to display the result.</p>""" |
3078 )) | 3122 )) |
3079 self.replaceOpenFilesAct.triggered[()].connect(self.__replaceOpenFiles) | 3123 self.replaceOpenFilesAct.triggered.connect(self.__replaceOpenFiles) |
3080 self.searchActions.append(self.replaceOpenFilesAct) | 3124 self.searchActions.append(self.replaceOpenFilesAct) |
3081 | 3125 |
3082 def initSearchToolbars(self, toolbarManager): | 3126 def initSearchToolbars(self, toolbarManager): |
3083 """ | 3127 """ |
3084 Public method to create the Search toolbars. | 3128 Public method to create the Search toolbars. |
3139 self.quickFindtextCombo._editor.gotFocus.connect( | 3183 self.quickFindtextCombo._editor.gotFocus.connect( |
3140 self.__quickSearchFocusIn) | 3184 self.__quickSearchFocusIn) |
3141 self.quickFindtextAction = QWidgetAction(self) | 3185 self.quickFindtextAction = QWidgetAction(self) |
3142 self.quickFindtextAction.setDefaultWidget(self.quickFindtextCombo) | 3186 self.quickFindtextAction.setDefaultWidget(self.quickFindtextCombo) |
3143 self.quickFindtextAction.setObjectName("vm_quickfindtext_action") | 3187 self.quickFindtextAction.setObjectName("vm_quickfindtext_action") |
3144 self.quickFindtextAction.setText(self.trUtf8("Quicksearch Textedit")) | 3188 self.quickFindtextAction.setText(self.tr("Quicksearch Textedit")) |
3145 qtb.addAction(self.quickFindtextAction) | 3189 qtb.addAction(self.quickFindtextAction) |
3146 qtb.addAction(self.quickSearchAct) | 3190 qtb.addAction(self.quickSearchAct) |
3147 qtb.addAction(self.quickSearchBackAct) | 3191 qtb.addAction(self.quickSearchBackAct) |
3148 qtb.addAction(self.quickSearchExtendAct) | 3192 qtb.addAction(self.quickSearchExtendAct) |
3149 self.quickFindtextCombo.setEnabled(False) | 3193 self.quickFindtextCombo.setEnabled(False) |
3204 self.zoomInAct.setWhatsThis(QApplication.translate( | 3248 self.zoomInAct.setWhatsThis(QApplication.translate( |
3205 'ViewManager', | 3249 'ViewManager', |
3206 """<b>Zoom in</b>""" | 3250 """<b>Zoom in</b>""" |
3207 """<p>Zoom in on the text. This makes the text bigger.</p>""" | 3251 """<p>Zoom in on the text. This makes the text bigger.</p>""" |
3208 )) | 3252 )) |
3209 self.zoomInAct.triggered[()].connect(self.__zoomIn) | 3253 self.zoomInAct.triggered.connect(self.__zoomIn) |
3210 self.viewActions.append(self.zoomInAct) | 3254 self.viewActions.append(self.zoomInAct) |
3211 | 3255 |
3212 self.zoomOutAct = E5Action( | 3256 self.zoomOutAct = E5Action( |
3213 QApplication.translate('ViewManager', 'Zoom out'), | 3257 QApplication.translate('ViewManager', 'Zoom out'), |
3214 UI.PixmapCache.getIcon("zoomOut.png"), | 3258 UI.PixmapCache.getIcon("zoomOut.png"), |
3223 self.zoomOutAct.setWhatsThis(QApplication.translate( | 3267 self.zoomOutAct.setWhatsThis(QApplication.translate( |
3224 'ViewManager', | 3268 'ViewManager', |
3225 """<b>Zoom out</b>""" | 3269 """<b>Zoom out</b>""" |
3226 """<p>Zoom out on the text. This makes the text smaller.</p>""" | 3270 """<p>Zoom out on the text. This makes the text smaller.</p>""" |
3227 )) | 3271 )) |
3228 self.zoomOutAct.triggered[()].connect(self.__zoomOut) | 3272 self.zoomOutAct.triggered.connect(self.__zoomOut) |
3229 self.viewActions.append(self.zoomOutAct) | 3273 self.viewActions.append(self.zoomOutAct) |
3230 | 3274 |
3231 self.zoomResetAct = E5Action( | 3275 self.zoomResetAct = E5Action( |
3232 QApplication.translate('ViewManager', 'Zoom reset'), | 3276 QApplication.translate('ViewManager', 'Zoom reset'), |
3233 UI.PixmapCache.getIcon("zoomReset.png"), | 3277 UI.PixmapCache.getIcon("zoomReset.png"), |
3242 'ViewManager', | 3286 'ViewManager', |
3243 """<b>Zoom reset</b>""" | 3287 """<b>Zoom reset</b>""" |
3244 """<p>Reset the zoom of the text. """ | 3288 """<p>Reset the zoom of the text. """ |
3245 """This sets the zoom factor to 100%.</p>""" | 3289 """This sets the zoom factor to 100%.</p>""" |
3246 )) | 3290 )) |
3247 self.zoomResetAct.triggered[()].connect(self.__zoomReset) | 3291 self.zoomResetAct.triggered.connect(self.__zoomReset) |
3248 self.viewActions.append(self.zoomResetAct) | 3292 self.viewActions.append(self.zoomResetAct) |
3249 | 3293 |
3250 self.zoomToAct = E5Action( | 3294 self.zoomToAct = E5Action( |
3251 QApplication.translate('ViewManager', 'Zoom'), | 3295 QApplication.translate('ViewManager', 'Zoom'), |
3252 UI.PixmapCache.getIcon("zoomTo.png"), | 3296 UI.PixmapCache.getIcon("zoomTo.png"), |
3261 'ViewManager', | 3305 'ViewManager', |
3262 """<b>Zoom</b>""" | 3306 """<b>Zoom</b>""" |
3263 """<p>Zoom the text. This opens a dialog where the""" | 3307 """<p>Zoom the text. This opens a dialog where the""" |
3264 """ desired size can be entered.</p>""" | 3308 """ desired size can be entered.</p>""" |
3265 )) | 3309 )) |
3266 self.zoomToAct.triggered[()].connect(self.__zoom) | 3310 self.zoomToAct.triggered.connect(self.__zoom) |
3267 self.viewActions.append(self.zoomToAct) | 3311 self.viewActions.append(self.zoomToAct) |
3268 | 3312 |
3269 self.toggleAllAct = E5Action( | 3313 self.toggleAllAct = E5Action( |
3270 QApplication.translate('ViewManager', 'Toggle all folds'), | 3314 QApplication.translate('ViewManager', 'Toggle all folds'), |
3271 QApplication.translate('ViewManager', 'Toggle &all folds'), | 3315 QApplication.translate('ViewManager', 'Toggle &all folds'), |
3275 self.toggleAllAct.setWhatsThis(QApplication.translate( | 3319 self.toggleAllAct.setWhatsThis(QApplication.translate( |
3276 'ViewManager', | 3320 'ViewManager', |
3277 """<b>Toggle all folds</b>""" | 3321 """<b>Toggle all folds</b>""" |
3278 """<p>Toggle all folds of the current editor.</p>""" | 3322 """<p>Toggle all folds of the current editor.</p>""" |
3279 )) | 3323 )) |
3280 self.toggleAllAct.triggered[()].connect(self.__toggleAll) | 3324 self.toggleAllAct.triggered.connect(self.__toggleAll) |
3281 self.viewActions.append(self.toggleAllAct) | 3325 self.viewActions.append(self.toggleAllAct) |
3282 | 3326 |
3283 self.toggleAllChildrenAct = E5Action( | 3327 self.toggleAllChildrenAct = E5Action( |
3284 QApplication.translate( | 3328 QApplication.translate( |
3285 'ViewManager', 'Toggle all folds (including children)'), | 3329 'ViewManager', 'Toggle all folds (including children)'), |
3292 'ViewManager', | 3336 'ViewManager', |
3293 """<b>Toggle all folds (including children)</b>""" | 3337 """<b>Toggle all folds (including children)</b>""" |
3294 """<p>Toggle all folds of the current editor including""" | 3338 """<p>Toggle all folds of the current editor including""" |
3295 """ all children.</p>""" | 3339 """ all children.</p>""" |
3296 )) | 3340 )) |
3297 self.toggleAllChildrenAct.triggered[()].connect( | 3341 self.toggleAllChildrenAct.triggered.connect( |
3298 self.__toggleAllChildren) | 3342 self.__toggleAllChildren) |
3299 self.viewActions.append(self.toggleAllChildrenAct) | 3343 self.viewActions.append(self.toggleAllChildrenAct) |
3300 | 3344 |
3301 self.toggleCurrentAct = E5Action( | 3345 self.toggleCurrentAct = E5Action( |
3302 QApplication.translate('ViewManager', 'Toggle current fold'), | 3346 QApplication.translate('ViewManager', 'Toggle current fold'), |
3308 'ViewManager', | 3352 'ViewManager', |
3309 """<b>Toggle current fold</b>""" | 3353 """<b>Toggle current fold</b>""" |
3310 """<p>Toggle the folds of the current line of the current""" | 3354 """<p>Toggle the folds of the current line of the current""" |
3311 """ editor.</p>""" | 3355 """ editor.</p>""" |
3312 )) | 3356 )) |
3313 self.toggleCurrentAct.triggered[()].connect(self.__toggleCurrent) | 3357 self.toggleCurrentAct.triggered.connect(self.__toggleCurrent) |
3314 self.viewActions.append(self.toggleCurrentAct) | 3358 self.viewActions.append(self.toggleCurrentAct) |
3315 | 3359 |
3316 self.unhighlightAct = E5Action( | 3360 self.unhighlightAct = E5Action( |
3317 QApplication.translate('ViewManager', 'Remove all highlights'), | 3361 QApplication.translate('ViewManager', 'Remove all highlights'), |
3318 UI.PixmapCache.getIcon("unhighlight.png"), | 3362 UI.PixmapCache.getIcon("unhighlight.png"), |
3324 self.unhighlightAct.setWhatsThis(QApplication.translate( | 3368 self.unhighlightAct.setWhatsThis(QApplication.translate( |
3325 'ViewManager', | 3369 'ViewManager', |
3326 """<b>Remove all highlights</b>""" | 3370 """<b>Remove all highlights</b>""" |
3327 """<p>Remove the highlights of all editors.</p>""" | 3371 """<p>Remove the highlights of all editors.</p>""" |
3328 )) | 3372 )) |
3329 self.unhighlightAct.triggered[()].connect(self.unhighlight) | 3373 self.unhighlightAct.triggered.connect(self.__unhighlight) |
3330 self.viewActions.append(self.unhighlightAct) | 3374 self.viewActions.append(self.unhighlightAct) |
3331 | 3375 |
3332 self.newDocumentViewAct = E5Action( | 3376 self.newDocumentViewAct = E5Action( |
3333 QApplication.translate('ViewManager', 'New Document View'), | 3377 QApplication.translate('ViewManager', 'New Document View'), |
3334 UI.PixmapCache.getIcon("documentNewView.png"), | 3378 UI.PixmapCache.getIcon("documentNewView.png"), |
3341 """<b>New Document View</b>""" | 3385 """<b>New Document View</b>""" |
3342 """<p>Opens a new view of the current document. Both views show""" | 3386 """<p>Opens a new view of the current document. Both views show""" |
3343 """ the same document. However, the cursors may be positioned""" | 3387 """ the same document. However, the cursors may be positioned""" |
3344 """ independently.</p>""" | 3388 """ independently.</p>""" |
3345 )) | 3389 )) |
3346 self.newDocumentViewAct.triggered[()].connect(self.__newDocumentView) | 3390 self.newDocumentViewAct.triggered.connect(self.__newDocumentView) |
3347 self.viewActions.append(self.newDocumentViewAct) | 3391 self.viewActions.append(self.newDocumentViewAct) |
3348 | 3392 |
3349 self.newDocumentSplitViewAct = E5Action( | 3393 self.newDocumentSplitViewAct = E5Action( |
3350 QApplication.translate( | 3394 QApplication.translate( |
3351 'ViewManager', 'New Document View (with new split)'), | 3395 'ViewManager', 'New Document View (with new split)'), |
3361 """<b>New Document View</b>""" | 3405 """<b>New Document View</b>""" |
3362 """<p>Opens a new view of the current document in a new split.""" | 3406 """<p>Opens a new view of the current document in a new split.""" |
3363 """ Both views show the same document. However, the cursors may""" | 3407 """ Both views show the same document. However, the cursors may""" |
3364 """ be positioned independently.</p>""" | 3408 """ be positioned independently.</p>""" |
3365 )) | 3409 )) |
3366 self.newDocumentSplitViewAct.triggered[()].connect( | 3410 self.newDocumentSplitViewAct.triggered.connect( |
3367 self.__newDocumentSplitView) | 3411 self.__newDocumentSplitView) |
3368 self.viewActions.append(self.newDocumentSplitViewAct) | 3412 self.viewActions.append(self.newDocumentSplitViewAct) |
3369 | 3413 |
3370 self.splitViewAct = E5Action( | 3414 self.splitViewAct = E5Action( |
3371 QApplication.translate('ViewManager', 'Split view'), | 3415 QApplication.translate('ViewManager', 'Split view'), |
3377 self.splitViewAct.setWhatsThis(QApplication.translate( | 3421 self.splitViewAct.setWhatsThis(QApplication.translate( |
3378 'ViewManager', | 3422 'ViewManager', |
3379 """<b>Split view</b>""" | 3423 """<b>Split view</b>""" |
3380 """<p>Add a split to the view.</p>""" | 3424 """<p>Add a split to the view.</p>""" |
3381 )) | 3425 )) |
3382 self.splitViewAct.triggered[()].connect(self.__splitView) | 3426 self.splitViewAct.triggered.connect(self.__splitView) |
3383 self.viewActions.append(self.splitViewAct) | 3427 self.viewActions.append(self.splitViewAct) |
3384 | 3428 |
3385 self.splitOrientationAct = E5Action( | 3429 self.splitOrientationAct = E5Action( |
3386 QApplication.translate('ViewManager', 'Arrange horizontally'), | 3430 QApplication.translate('ViewManager', 'Arrange horizontally'), |
3387 QApplication.translate('ViewManager', 'Arrange &horizontally'), | 3431 QApplication.translate('ViewManager', 'Arrange &horizontally'), |
3407 self.splitRemoveAct.setWhatsThis(QApplication.translate( | 3451 self.splitRemoveAct.setWhatsThis(QApplication.translate( |
3408 'ViewManager', | 3452 'ViewManager', |
3409 """<b>Remove split</b>""" | 3453 """<b>Remove split</b>""" |
3410 """<p>Remove the current split.</p>""" | 3454 """<p>Remove the current split.</p>""" |
3411 )) | 3455 )) |
3412 self.splitRemoveAct.triggered[()].connect(self.removeSplit) | 3456 self.splitRemoveAct.triggered.connect(self.removeSplit) |
3413 self.viewActions.append(self.splitRemoveAct) | 3457 self.viewActions.append(self.splitRemoveAct) |
3414 | 3458 |
3415 self.nextSplitAct = E5Action( | 3459 self.nextSplitAct = E5Action( |
3416 QApplication.translate('ViewManager', 'Next split'), | 3460 QApplication.translate('ViewManager', 'Next split'), |
3417 QApplication.translate('ViewManager', '&Next split'), | 3461 QApplication.translate('ViewManager', '&Next split'), |
3424 self.nextSplitAct.setWhatsThis(QApplication.translate( | 3468 self.nextSplitAct.setWhatsThis(QApplication.translate( |
3425 'ViewManager', | 3469 'ViewManager', |
3426 """<b>Next split</b>""" | 3470 """<b>Next split</b>""" |
3427 """<p>Move to the next split.</p>""" | 3471 """<p>Move to the next split.</p>""" |
3428 )) | 3472 )) |
3429 self.nextSplitAct.triggered[()].connect(self.nextSplit) | 3473 self.nextSplitAct.triggered.connect(self.nextSplit) |
3430 self.viewActions.append(self.nextSplitAct) | 3474 self.viewActions.append(self.nextSplitAct) |
3431 | 3475 |
3432 self.prevSplitAct = E5Action( | 3476 self.prevSplitAct = E5Action( |
3433 QApplication.translate('ViewManager', 'Previous split'), | 3477 QApplication.translate('ViewManager', 'Previous split'), |
3434 QApplication.translate('ViewManager', '&Previous split'), | 3478 QApplication.translate('ViewManager', '&Previous split'), |
3440 self.prevSplitAct.setWhatsThis(QApplication.translate( | 3484 self.prevSplitAct.setWhatsThis(QApplication.translate( |
3441 'ViewManager', | 3485 'ViewManager', |
3442 """<b>Previous split</b>""" | 3486 """<b>Previous split</b>""" |
3443 """<p>Move to the previous split.</p>""" | 3487 """<p>Move to the previous split.</p>""" |
3444 )) | 3488 )) |
3445 self.prevSplitAct.triggered[()].connect(self.prevSplit) | 3489 self.prevSplitAct.triggered.connect(self.prevSplit) |
3446 self.viewActions.append(self.prevSplitAct) | 3490 self.viewActions.append(self.prevSplitAct) |
3447 | 3491 |
3448 self.previewAct = E5Action( | 3492 self.previewAct = E5Action( |
3449 QApplication.translate('ViewManager', 'Preview'), | 3493 QApplication.translate('ViewManager', 'Preview'), |
3450 UI.PixmapCache.getIcon("previewer.png"), | 3494 UI.PixmapCache.getIcon("previewer.png"), |
3548 self.macroStartRecAct.setWhatsThis(QApplication.translate( | 3592 self.macroStartRecAct.setWhatsThis(QApplication.translate( |
3549 'ViewManager', | 3593 'ViewManager', |
3550 """<b>Start Macro Recording</b>""" | 3594 """<b>Start Macro Recording</b>""" |
3551 """<p>Start recording editor commands into a new macro.</p>""" | 3595 """<p>Start recording editor commands into a new macro.</p>""" |
3552 )) | 3596 )) |
3553 self.macroStartRecAct.triggered[()].connect(self.__macroStartRecording) | 3597 self.macroStartRecAct.triggered.connect(self.__macroStartRecording) |
3554 self.macroActions.append(self.macroStartRecAct) | 3598 self.macroActions.append(self.macroStartRecAct) |
3555 | 3599 |
3556 self.macroStopRecAct = E5Action( | 3600 self.macroStopRecAct = E5Action( |
3557 QApplication.translate('ViewManager', 'Stop Macro Recording'), | 3601 QApplication.translate('ViewManager', 'Stop Macro Recording'), |
3558 QApplication.translate('ViewManager', 'Sto&p Macro Recording'), | 3602 QApplication.translate('ViewManager', 'Sto&p Macro Recording'), |
3562 self.macroStopRecAct.setWhatsThis(QApplication.translate( | 3606 self.macroStopRecAct.setWhatsThis(QApplication.translate( |
3563 'ViewManager', | 3607 'ViewManager', |
3564 """<b>Stop Macro Recording</b>""" | 3608 """<b>Stop Macro Recording</b>""" |
3565 """<p>Stop recording editor commands into a new macro.</p>""" | 3609 """<p>Stop recording editor commands into a new macro.</p>""" |
3566 )) | 3610 )) |
3567 self.macroStopRecAct.triggered[()].connect(self.__macroStopRecording) | 3611 self.macroStopRecAct.triggered.connect(self.__macroStopRecording) |
3568 self.macroActions.append(self.macroStopRecAct) | 3612 self.macroActions.append(self.macroStopRecAct) |
3569 | 3613 |
3570 self.macroRunAct = E5Action( | 3614 self.macroRunAct = E5Action( |
3571 QApplication.translate('ViewManager', 'Run Macro'), | 3615 QApplication.translate('ViewManager', 'Run Macro'), |
3572 QApplication.translate('ViewManager', '&Run Macro'), | 3616 QApplication.translate('ViewManager', '&Run Macro'), |
3576 self.macroRunAct.setWhatsThis(QApplication.translate( | 3620 self.macroRunAct.setWhatsThis(QApplication.translate( |
3577 'ViewManager', | 3621 'ViewManager', |
3578 """<b>Run Macro</b>""" | 3622 """<b>Run Macro</b>""" |
3579 """<p>Run a previously recorded editor macro.</p>""" | 3623 """<p>Run a previously recorded editor macro.</p>""" |
3580 )) | 3624 )) |
3581 self.macroRunAct.triggered[()].connect(self.__macroRun) | 3625 self.macroRunAct.triggered.connect(self.__macroRun) |
3582 self.macroActions.append(self.macroRunAct) | 3626 self.macroActions.append(self.macroRunAct) |
3583 | 3627 |
3584 self.macroDeleteAct = E5Action( | 3628 self.macroDeleteAct = E5Action( |
3585 QApplication.translate('ViewManager', 'Delete Macro'), | 3629 QApplication.translate('ViewManager', 'Delete Macro'), |
3586 QApplication.translate('ViewManager', '&Delete Macro'), | 3630 QApplication.translate('ViewManager', '&Delete Macro'), |
3590 self.macroDeleteAct.setWhatsThis(QApplication.translate( | 3634 self.macroDeleteAct.setWhatsThis(QApplication.translate( |
3591 'ViewManager', | 3635 'ViewManager', |
3592 """<b>Delete Macro</b>""" | 3636 """<b>Delete Macro</b>""" |
3593 """<p>Delete a previously recorded editor macro.</p>""" | 3637 """<p>Delete a previously recorded editor macro.</p>""" |
3594 )) | 3638 )) |
3595 self.macroDeleteAct.triggered[()].connect(self.__macroDelete) | 3639 self.macroDeleteAct.triggered.connect(self.__macroDelete) |
3596 self.macroActions.append(self.macroDeleteAct) | 3640 self.macroActions.append(self.macroDeleteAct) |
3597 | 3641 |
3598 self.macroLoadAct = E5Action( | 3642 self.macroLoadAct = E5Action( |
3599 QApplication.translate('ViewManager', 'Load Macro'), | 3643 QApplication.translate('ViewManager', 'Load Macro'), |
3600 QApplication.translate('ViewManager', '&Load Macro'), | 3644 QApplication.translate('ViewManager', '&Load Macro'), |
3604 self.macroLoadAct.setWhatsThis(QApplication.translate( | 3648 self.macroLoadAct.setWhatsThis(QApplication.translate( |
3605 'ViewManager', | 3649 'ViewManager', |
3606 """<b>Load Macro</b>""" | 3650 """<b>Load Macro</b>""" |
3607 """<p>Load an editor macro from a file.</p>""" | 3651 """<p>Load an editor macro from a file.</p>""" |
3608 )) | 3652 )) |
3609 self.macroLoadAct.triggered[()].connect(self.__macroLoad) | 3653 self.macroLoadAct.triggered.connect(self.__macroLoad) |
3610 self.macroActions.append(self.macroLoadAct) | 3654 self.macroActions.append(self.macroLoadAct) |
3611 | 3655 |
3612 self.macroSaveAct = E5Action( | 3656 self.macroSaveAct = E5Action( |
3613 QApplication.translate('ViewManager', 'Save Macro'), | 3657 QApplication.translate('ViewManager', 'Save Macro'), |
3614 QApplication.translate('ViewManager', '&Save Macro'), | 3658 QApplication.translate('ViewManager', '&Save Macro'), |
3618 self.macroSaveAct.setWhatsThis(QApplication.translate( | 3662 self.macroSaveAct.setWhatsThis(QApplication.translate( |
3619 'ViewManager', | 3663 'ViewManager', |
3620 """<b>Save Macro</b>""" | 3664 """<b>Save Macro</b>""" |
3621 """<p>Save a previously recorded editor macro to a file.</p>""" | 3665 """<p>Save a previously recorded editor macro to a file.</p>""" |
3622 )) | 3666 )) |
3623 self.macroSaveAct.triggered[()].connect(self.__macroSave) | 3667 self.macroSaveAct.triggered.connect(self.__macroSave) |
3624 self.macroActions.append(self.macroSaveAct) | 3668 self.macroActions.append(self.macroSaveAct) |
3625 | 3669 |
3626 self.macroActGrp.setEnabled(False) | 3670 self.macroActGrp.setEnabled(False) |
3627 | 3671 |
3628 def initMacroMenu(self): | 3672 def initMacroMenu(self): |
3662 'ViewManager', | 3706 'ViewManager', |
3663 """<b>Toggle Bookmark</b>""" | 3707 """<b>Toggle Bookmark</b>""" |
3664 """<p>Toggle a bookmark at the current line of the current""" | 3708 """<p>Toggle a bookmark at the current line of the current""" |
3665 """ editor.</p>""" | 3709 """ editor.</p>""" |
3666 )) | 3710 )) |
3667 self.bookmarkToggleAct.triggered[()].connect(self.__toggleBookmark) | 3711 self.bookmarkToggleAct.triggered.connect(self.__toggleBookmark) |
3668 self.bookmarkActions.append(self.bookmarkToggleAct) | 3712 self.bookmarkActions.append(self.bookmarkToggleAct) |
3669 | 3713 |
3670 self.bookmarkNextAct = E5Action( | 3714 self.bookmarkNextAct = E5Action( |
3671 QApplication.translate('ViewManager', 'Next Bookmark'), | 3715 QApplication.translate('ViewManager', 'Next Bookmark'), |
3672 UI.PixmapCache.getIcon("bookmarkNext.png"), | 3716 UI.PixmapCache.getIcon("bookmarkNext.png"), |
3680 self.bookmarkNextAct.setWhatsThis(QApplication.translate( | 3724 self.bookmarkNextAct.setWhatsThis(QApplication.translate( |
3681 'ViewManager', | 3725 'ViewManager', |
3682 """<b>Next Bookmark</b>""" | 3726 """<b>Next Bookmark</b>""" |
3683 """<p>Go to next bookmark of the current editor.</p>""" | 3727 """<p>Go to next bookmark of the current editor.</p>""" |
3684 )) | 3728 )) |
3685 self.bookmarkNextAct.triggered[()].connect(self.__nextBookmark) | 3729 self.bookmarkNextAct.triggered.connect(self.__nextBookmark) |
3686 self.bookmarkActions.append(self.bookmarkNextAct) | 3730 self.bookmarkActions.append(self.bookmarkNextAct) |
3687 | 3731 |
3688 self.bookmarkPreviousAct = E5Action( | 3732 self.bookmarkPreviousAct = E5Action( |
3689 QApplication.translate('ViewManager', 'Previous Bookmark'), | 3733 QApplication.translate('ViewManager', 'Previous Bookmark'), |
3690 UI.PixmapCache.getIcon("bookmarkPrevious.png"), | 3734 UI.PixmapCache.getIcon("bookmarkPrevious.png"), |
3698 self.bookmarkPreviousAct.setWhatsThis(QApplication.translate( | 3742 self.bookmarkPreviousAct.setWhatsThis(QApplication.translate( |
3699 'ViewManager', | 3743 'ViewManager', |
3700 """<b>Previous Bookmark</b>""" | 3744 """<b>Previous Bookmark</b>""" |
3701 """<p>Go to previous bookmark of the current editor.</p>""" | 3745 """<p>Go to previous bookmark of the current editor.</p>""" |
3702 )) | 3746 )) |
3703 self.bookmarkPreviousAct.triggered[()].connect(self.__previousBookmark) | 3747 self.bookmarkPreviousAct.triggered.connect(self.__previousBookmark) |
3704 self.bookmarkActions.append(self.bookmarkPreviousAct) | 3748 self.bookmarkActions.append(self.bookmarkPreviousAct) |
3705 | 3749 |
3706 self.bookmarkClearAct = E5Action( | 3750 self.bookmarkClearAct = E5Action( |
3707 QApplication.translate('ViewManager', 'Clear Bookmarks'), | 3751 QApplication.translate('ViewManager', 'Clear Bookmarks'), |
3708 QApplication.translate('ViewManager', '&Clear Bookmarks'), | 3752 QApplication.translate('ViewManager', '&Clear Bookmarks'), |
3715 self.bookmarkClearAct.setWhatsThis(QApplication.translate( | 3759 self.bookmarkClearAct.setWhatsThis(QApplication.translate( |
3716 'ViewManager', | 3760 'ViewManager', |
3717 """<b>Clear Bookmarks</b>""" | 3761 """<b>Clear Bookmarks</b>""" |
3718 """<p>Clear bookmarks of all editors.</p>""" | 3762 """<p>Clear bookmarks of all editors.</p>""" |
3719 )) | 3763 )) |
3720 self.bookmarkClearAct.triggered[()].connect(self.__clearAllBookmarks) | 3764 self.bookmarkClearAct.triggered.connect(self.__clearAllBookmarks) |
3721 self.bookmarkActions.append(self.bookmarkClearAct) | 3765 self.bookmarkActions.append(self.bookmarkClearAct) |
3722 | 3766 |
3723 self.syntaxErrorGotoAct = E5Action( | 3767 self.syntaxErrorGotoAct = E5Action( |
3724 QApplication.translate('ViewManager', 'Goto Syntax Error'), | 3768 QApplication.translate('ViewManager', 'Goto Syntax Error'), |
3725 UI.PixmapCache.getIcon("syntaxErrorGoto.png"), | 3769 UI.PixmapCache.getIcon("syntaxErrorGoto.png"), |
3731 self.syntaxErrorGotoAct.setWhatsThis(QApplication.translate( | 3775 self.syntaxErrorGotoAct.setWhatsThis(QApplication.translate( |
3732 'ViewManager', | 3776 'ViewManager', |
3733 """<b>Goto Syntax Error</b>""" | 3777 """<b>Goto Syntax Error</b>""" |
3734 """<p>Go to next syntax error of the current editor.</p>""" | 3778 """<p>Go to next syntax error of the current editor.</p>""" |
3735 )) | 3779 )) |
3736 self.syntaxErrorGotoAct.triggered[()].connect(self.__gotoSyntaxError) | 3780 self.syntaxErrorGotoAct.triggered.connect(self.__gotoSyntaxError) |
3737 self.bookmarkActions.append(self.syntaxErrorGotoAct) | 3781 self.bookmarkActions.append(self.syntaxErrorGotoAct) |
3738 | 3782 |
3739 self.syntaxErrorClearAct = E5Action( | 3783 self.syntaxErrorClearAct = E5Action( |
3740 QApplication.translate('ViewManager', 'Clear Syntax Errors'), | 3784 QApplication.translate('ViewManager', 'Clear Syntax Errors'), |
3741 QApplication.translate('ViewManager', 'Clear &Syntax Errors'), | 3785 QApplication.translate('ViewManager', 'Clear &Syntax Errors'), |
3746 self.syntaxErrorClearAct.setWhatsThis(QApplication.translate( | 3790 self.syntaxErrorClearAct.setWhatsThis(QApplication.translate( |
3747 'ViewManager', | 3791 'ViewManager', |
3748 """<b>Clear Syntax Errors</b>""" | 3792 """<b>Clear Syntax Errors</b>""" |
3749 """<p>Clear syntax errors of all editors.</p>""" | 3793 """<p>Clear syntax errors of all editors.</p>""" |
3750 )) | 3794 )) |
3751 self.syntaxErrorClearAct.triggered[()].connect( | 3795 self.syntaxErrorClearAct.triggered.connect( |
3752 self.__clearAllSyntaxErrors) | 3796 self.__clearAllSyntaxErrors) |
3753 self.bookmarkActions.append(self.syntaxErrorClearAct) | 3797 self.bookmarkActions.append(self.syntaxErrorClearAct) |
3754 | 3798 |
3755 self.warningsNextAct = E5Action( | 3799 self.warningsNextAct = E5Action( |
3756 QApplication.translate('ViewManager', 'Next warning message'), | 3800 QApplication.translate('ViewManager', 'Next warning message'), |
3762 'ViewManager', 'Next warning message')) | 3806 'ViewManager', 'Next warning message')) |
3763 self.warningsNextAct.setWhatsThis(QApplication.translate( | 3807 self.warningsNextAct.setWhatsThis(QApplication.translate( |
3764 'ViewManager', | 3808 'ViewManager', |
3765 """<b>Next warning message</b>""" | 3809 """<b>Next warning message</b>""" |
3766 """<p>Go to next line of the current editor""" | 3810 """<p>Go to next line of the current editor""" |
3767 """ having a py3flakes warning.</p>""" | 3811 """ having a pyflakes warning.</p>""" |
3768 )) | 3812 )) |
3769 self.warningsNextAct.triggered[()].connect(self.__nextWarning) | 3813 self.warningsNextAct.triggered.connect(self.__nextWarning) |
3770 self.bookmarkActions.append(self.warningsNextAct) | 3814 self.bookmarkActions.append(self.warningsNextAct) |
3771 | 3815 |
3772 self.warningsPreviousAct = E5Action( | 3816 self.warningsPreviousAct = E5Action( |
3773 QApplication.translate('ViewManager', 'Previous warning message'), | 3817 QApplication.translate('ViewManager', 'Previous warning message'), |
3774 UI.PixmapCache.getIcon("warningPrev.png"), | 3818 UI.PixmapCache.getIcon("warningPrev.png"), |
3780 'ViewManager', 'Previous warning message')) | 3824 'ViewManager', 'Previous warning message')) |
3781 self.warningsPreviousAct.setWhatsThis(QApplication.translate( | 3825 self.warningsPreviousAct.setWhatsThis(QApplication.translate( |
3782 'ViewManager', | 3826 'ViewManager', |
3783 """<b>Previous warning message</b>""" | 3827 """<b>Previous warning message</b>""" |
3784 """<p>Go to previous line of the current editor""" | 3828 """<p>Go to previous line of the current editor""" |
3785 """ having a py3flakes warning.</p>""" | 3829 """ having a pyflakes warning.</p>""" |
3786 )) | 3830 )) |
3787 self.warningsPreviousAct.triggered[()].connect(self.__previousWarning) | 3831 self.warningsPreviousAct.triggered.connect(self.__previousWarning) |
3788 self.bookmarkActions.append(self.warningsPreviousAct) | 3832 self.bookmarkActions.append(self.warningsPreviousAct) |
3789 | 3833 |
3790 self.warningsClearAct = E5Action( | 3834 self.warningsClearAct = E5Action( |
3791 QApplication.translate('ViewManager', 'Clear Warning Messages'), | 3835 QApplication.translate('ViewManager', 'Clear Warning Messages'), |
3792 QApplication.translate('ViewManager', 'Clear &Warning Messages'), | 3836 QApplication.translate('ViewManager', 'Clear &Warning Messages'), |
3795 self.warningsClearAct.setStatusTip(QApplication.translate( | 3839 self.warningsClearAct.setStatusTip(QApplication.translate( |
3796 'ViewManager', 'Clear Warning Messages')) | 3840 'ViewManager', 'Clear Warning Messages')) |
3797 self.warningsClearAct.setWhatsThis(QApplication.translate( | 3841 self.warningsClearAct.setWhatsThis(QApplication.translate( |
3798 'ViewManager', | 3842 'ViewManager', |
3799 """<b>Clear Warning Messages</b>""" | 3843 """<b>Clear Warning Messages</b>""" |
3800 """<p>Clear py3flakes warning messages of all editors.</p>""" | 3844 """<p>Clear pyflakes warning messages of all editors.</p>""" |
3801 )) | 3845 )) |
3802 self.warningsClearAct.triggered[()].connect(self.__clearAllWarnings) | 3846 self.warningsClearAct.triggered.connect(self.__clearAllWarnings) |
3803 self.bookmarkActions.append(self.warningsClearAct) | 3847 self.bookmarkActions.append(self.warningsClearAct) |
3804 | 3848 |
3805 self.notcoveredNextAct = E5Action( | 3849 self.notcoveredNextAct = E5Action( |
3806 QApplication.translate('ViewManager', 'Next uncovered line'), | 3850 QApplication.translate('ViewManager', 'Next uncovered line'), |
3807 UI.PixmapCache.getIcon("notcoveredNext.png"), | 3851 UI.PixmapCache.getIcon("notcoveredNext.png"), |
3814 'ViewManager', | 3858 'ViewManager', |
3815 """<b>Next uncovered line</b>""" | 3859 """<b>Next uncovered line</b>""" |
3816 """<p>Go to next line of the current editor marked as not""" | 3860 """<p>Go to next line of the current editor marked as not""" |
3817 """ covered.</p>""" | 3861 """ covered.</p>""" |
3818 )) | 3862 )) |
3819 self.notcoveredNextAct.triggered[()].connect(self.__nextUncovered) | 3863 self.notcoveredNextAct.triggered.connect(self.__nextUncovered) |
3820 self.bookmarkActions.append(self.notcoveredNextAct) | 3864 self.bookmarkActions.append(self.notcoveredNextAct) |
3821 | 3865 |
3822 self.notcoveredPreviousAct = E5Action( | 3866 self.notcoveredPreviousAct = E5Action( |
3823 QApplication.translate('ViewManager', 'Previous uncovered line'), | 3867 QApplication.translate('ViewManager', 'Previous uncovered line'), |
3824 UI.PixmapCache.getIcon("notcoveredPrev.png"), | 3868 UI.PixmapCache.getIcon("notcoveredPrev.png"), |
3832 'ViewManager', | 3876 'ViewManager', |
3833 """<b>Previous uncovered line</b>""" | 3877 """<b>Previous uncovered line</b>""" |
3834 """<p>Go to previous line of the current editor marked""" | 3878 """<p>Go to previous line of the current editor marked""" |
3835 """ as not covered.</p>""" | 3879 """ as not covered.</p>""" |
3836 )) | 3880 )) |
3837 self.notcoveredPreviousAct.triggered[()].connect( | 3881 self.notcoveredPreviousAct.triggered.connect( |
3838 self.__previousUncovered) | 3882 self.__previousUncovered) |
3839 self.bookmarkActions.append(self.notcoveredPreviousAct) | 3883 self.bookmarkActions.append(self.notcoveredPreviousAct) |
3840 | 3884 |
3841 self.taskNextAct = E5Action( | 3885 self.taskNextAct = E5Action( |
3842 QApplication.translate('ViewManager', 'Next Task'), | 3886 QApplication.translate('ViewManager', 'Next Task'), |
3849 self.taskNextAct.setWhatsThis(QApplication.translate( | 3893 self.taskNextAct.setWhatsThis(QApplication.translate( |
3850 'ViewManager', | 3894 'ViewManager', |
3851 """<b>Next Task</b>""" | 3895 """<b>Next Task</b>""" |
3852 """<p>Go to next line of the current editor having a task.</p>""" | 3896 """<p>Go to next line of the current editor having a task.</p>""" |
3853 )) | 3897 )) |
3854 self.taskNextAct.triggered[()].connect(self.__nextTask) | 3898 self.taskNextAct.triggered.connect(self.__nextTask) |
3855 self.bookmarkActions.append(self.taskNextAct) | 3899 self.bookmarkActions.append(self.taskNextAct) |
3856 | 3900 |
3857 self.taskPreviousAct = E5Action( | 3901 self.taskPreviousAct = E5Action( |
3858 QApplication.translate('ViewManager', 'Previous Task'), | 3902 QApplication.translate('ViewManager', 'Previous Task'), |
3859 UI.PixmapCache.getIcon("taskPrev.png"), | 3903 UI.PixmapCache.getIcon("taskPrev.png"), |
3867 'ViewManager', | 3911 'ViewManager', |
3868 """<b>Previous Task</b>""" | 3912 """<b>Previous Task</b>""" |
3869 """<p>Go to previous line of the current editor having a""" | 3913 """<p>Go to previous line of the current editor having a""" |
3870 """ task.</p>""" | 3914 """ task.</p>""" |
3871 )) | 3915 )) |
3872 self.taskPreviousAct.triggered[()].connect(self.__previousTask) | 3916 self.taskPreviousAct.triggered.connect(self.__previousTask) |
3873 self.bookmarkActions.append(self.taskPreviousAct) | 3917 self.bookmarkActions.append(self.taskPreviousAct) |
3874 | 3918 |
3875 self.changeNextAct = E5Action( | 3919 self.changeNextAct = E5Action( |
3876 QApplication.translate('ViewManager', 'Next Change'), | 3920 QApplication.translate('ViewManager', 'Next Change'), |
3877 UI.PixmapCache.getIcon("changeNext.png"), | 3921 UI.PixmapCache.getIcon("changeNext.png"), |
3884 'ViewManager', | 3928 'ViewManager', |
3885 """<b>Next Change</b>""" | 3929 """<b>Next Change</b>""" |
3886 """<p>Go to next line of the current editor having a change""" | 3930 """<p>Go to next line of the current editor having a change""" |
3887 """ marker.</p>""" | 3931 """ marker.</p>""" |
3888 )) | 3932 )) |
3889 self.changeNextAct.triggered[()].connect(self.__nextChange) | 3933 self.changeNextAct.triggered.connect(self.__nextChange) |
3890 self.bookmarkActions.append(self.changeNextAct) | 3934 self.bookmarkActions.append(self.changeNextAct) |
3891 | 3935 |
3892 self.changePreviousAct = E5Action( | 3936 self.changePreviousAct = E5Action( |
3893 QApplication.translate('ViewManager', 'Previous Change'), | 3937 QApplication.translate('ViewManager', 'Previous Change'), |
3894 UI.PixmapCache.getIcon("changePrev.png"), | 3938 UI.PixmapCache.getIcon("changePrev.png"), |
3902 'ViewManager', | 3946 'ViewManager', |
3903 """<b>Previous Change</b>""" | 3947 """<b>Previous Change</b>""" |
3904 """<p>Go to previous line of the current editor having""" | 3948 """<p>Go to previous line of the current editor having""" |
3905 """ a change marker.</p>""" | 3949 """ a change marker.</p>""" |
3906 )) | 3950 )) |
3907 self.changePreviousAct.triggered[()].connect(self.__previousChange) | 3951 self.changePreviousAct.triggered.connect(self.__previousChange) |
3908 self.bookmarkActions.append(self.changePreviousAct) | 3952 self.bookmarkActions.append(self.changePreviousAct) |
3909 | 3953 |
3910 self.bookmarkActGrp.setEnabled(False) | 3954 self.bookmarkActGrp.setEnabled(False) |
3911 | 3955 |
3912 def initBookmarkMenu(self): | 3956 def initBookmarkMenu(self): |
4010 self.spellCheckAct.setWhatsThis(QApplication.translate( | 4054 self.spellCheckAct.setWhatsThis(QApplication.translate( |
4011 'ViewManager', | 4055 'ViewManager', |
4012 """<b>Check spelling</b>""" | 4056 """<b>Check spelling</b>""" |
4013 """<p>Perform a spell check of the current editor.</p>""" | 4057 """<p>Perform a spell check of the current editor.</p>""" |
4014 )) | 4058 )) |
4015 self.spellCheckAct.triggered[()].connect(self.__spellCheck) | 4059 self.spellCheckAct.triggered.connect(self.__spellCheck) |
4016 self.spellingActions.append(self.spellCheckAct) | 4060 self.spellingActions.append(self.spellCheckAct) |
4017 | 4061 |
4018 self.autoSpellCheckAct = E5Action( | 4062 self.autoSpellCheckAct = E5Action( |
4019 QApplication.translate('ViewManager', 'Automatic spell checking'), | 4063 QApplication.translate('ViewManager', 'Automatic spell checking'), |
4020 UI.PixmapCache.getIcon("autospellchecking.png"), | 4064 UI.PixmapCache.getIcon("autospellchecking.png"), |
4030 """<p>Activate or deactivate the automatic spell checking""" | 4074 """<p>Activate or deactivate the automatic spell checking""" |
4031 """ function of all editors.</p>""" | 4075 """ function of all editors.</p>""" |
4032 )) | 4076 )) |
4033 self.autoSpellCheckAct.setChecked( | 4077 self.autoSpellCheckAct.setChecked( |
4034 Preferences.getEditor("AutoSpellCheckingEnabled")) | 4078 Preferences.getEditor("AutoSpellCheckingEnabled")) |
4035 self.autoSpellCheckAct.triggered[()].connect( | 4079 self.autoSpellCheckAct.triggered.connect( |
4036 self.__setAutoSpellChecking) | 4080 self.__setAutoSpellChecking) |
4037 self.spellingActions.append(self.autoSpellCheckAct) | 4081 self.spellingActions.append(self.autoSpellCheckAct) |
4038 | 4082 |
4039 self.__enableSpellingActions() | 4083 self.__enableSpellingActions() |
4040 | 4084 |
4101 | 4145 |
4102 ################################################################## | 4146 ################################################################## |
4103 ## Methods and slots that deal with file and window handling | 4147 ## Methods and slots that deal with file and window handling |
4104 ################################################################## | 4148 ################################################################## |
4105 | 4149 |
4106 def openFiles(self, prog=None): | 4150 def __openFiles(self): |
4151 """ | |
4152 Private slot to open some files. | |
4153 """ | |
4154 # set the cwd of the dialog based on the following search criteria: | |
4155 # 1: Directory of currently active editor | |
4156 # 2: Directory of currently active project | |
4157 # 3: CWD | |
4158 import QScintilla.Lexers | |
4159 filter = self._getOpenFileFilter() | |
4160 progs = E5FileDialog.getOpenFileNamesAndFilter( | |
4161 self.ui, | |
4162 QApplication.translate('ViewManager', "Open files"), | |
4163 self._getOpenStartDir(), | |
4164 QScintilla.Lexers.getOpenFileFiltersList(True, True), | |
4165 filter)[0] | |
4166 for prog in progs: | |
4167 self.openFiles(prog) | |
4168 | |
4169 def openFiles(self, prog): | |
4107 """ | 4170 """ |
4108 Public slot to open some files. | 4171 Public slot to open some files. |
4109 | 4172 |
4110 @param prog name of file to be opened (string) | 4173 @param prog name of file to be opened (string) |
4111 """ | 4174 """ |
4112 # Get the file name if one wasn't specified. | 4175 prog = Utilities.normabspath(prog) |
4113 if prog is None: | 4176 # Open up the new files. |
4114 # set the cwd of the dialog based on the following search criteria: | 4177 self.openSourceFile(prog) |
4115 # 1: Directory of currently active editor | |
4116 # 2: Directory of currently active project | |
4117 # 3: CWD | |
4118 import QScintilla.Lexers | |
4119 filter = self._getOpenFileFilter() | |
4120 progs = E5FileDialog.getOpenFileNamesAndFilter( | |
4121 self.ui, | |
4122 QApplication.translate('ViewManager', "Open files"), | |
4123 self._getOpenStartDir(), | |
4124 QScintilla.Lexers.getOpenFileFiltersList(True, True), | |
4125 filter)[0] | |
4126 else: | |
4127 progs = [prog] | |
4128 | |
4129 for prog in progs: | |
4130 prog = Utilities.normabspath(prog) | |
4131 # Open up the new files. | |
4132 self.openSourceFile(prog) | |
4133 | 4178 |
4134 def checkDirty(self, editor, autosave=False): | 4179 def checkDirty(self, editor, autosave=False): |
4135 """ | 4180 """ |
4136 Public method to check dirty status and open a message window. | 4181 Public method to check dirty status and open a message window. |
4137 | 4182 |
4520 pixmap = UI.PixmapCache.getPixmap("eolWindows.png") | 4565 pixmap = UI.PixmapCache.getPixmap("eolWindows.png") |
4521 else: | 4566 else: |
4522 pixmap = QPixmap() | 4567 pixmap = QPixmap() |
4523 return pixmap | 4568 return pixmap |
4524 | 4569 |
4570 def __unhighlight(self): | |
4571 """ | |
4572 Privat slot to switch of all highlights. | |
4573 """ | |
4574 self.unhighlight() | |
4575 | |
4525 def unhighlight(self, current=False): | 4576 def unhighlight(self, current=False): |
4526 """ | 4577 """ |
4527 Public method to switch off all highlights. | 4578 Public method to switch off all highlights or the highlight of |
4579 the current editor. | |
4528 | 4580 |
4529 @param current flag indicating only the current editor should be | 4581 @param current flag indicating only the current editor should be |
4530 unhighlighted (boolean) | 4582 unhighlighted (boolean) |
4531 """ | 4583 """ |
4532 if current: | 4584 if current: |
4543 @return list of all opened filenames (list of strings) | 4595 @return list of all opened filenames (list of strings) |
4544 """ | 4596 """ |
4545 filenames = [] | 4597 filenames = [] |
4546 for editor in self.editors: | 4598 for editor in self.editors: |
4547 fn = editor.getFileName() | 4599 fn = editor.getFileName() |
4548 if fn is not None and fn not in filenames: | 4600 if fn is not None and fn not in filenames and os.path.exists(fn): |
4601 # only return names of existing files | |
4549 filenames.append(fn) | 4602 filenames.append(fn) |
4550 | 4603 |
4551 return filenames | 4604 return filenames |
4552 | 4605 |
4553 def getEditor(self, fn, filetype=""): | 4606 def getEditor(self, fn, filetype=""): |
5537 aw = self.activeWindow() | 5590 aw = self.activeWindow() |
5538 if aw: | 5591 if aw: |
5539 aw.zoomTo(0) | 5592 aw.zoomTo(0) |
5540 self.sbZoom.setValue(aw.getZoom()) | 5593 self.sbZoom.setValue(aw.getZoom()) |
5541 | 5594 |
5542 def __zoom(self, value=None): | 5595 def __zoom(self): |
5543 """ | 5596 """ |
5544 Private method to handle the zoom action. | 5597 Private method to handle the zoom action. |
5545 | |
5546 @keyparam value zoom value to be set (integer) | |
5547 """ | 5598 """ |
5548 if QApplication.focusWidget() == e5App().getObject("Shell"): | 5599 if QApplication.focusWidget() == e5App().getObject("Shell"): |
5549 aw = e5App().getObject("Shell") | 5600 aw = e5App().getObject("Shell") |
5550 else: | 5601 else: |
5551 aw = self.activeWindow() | 5602 aw = self.activeWindow() |
5552 if aw: | 5603 if aw: |
5553 if value is None: | 5604 from QScintilla.ZoomDialog import ZoomDialog |
5554 from QScintilla.ZoomDialog import ZoomDialog | 5605 dlg = ZoomDialog(aw.getZoom(), self.ui, None, True) |
5555 dlg = ZoomDialog(aw.getZoom(), self.ui, None, True) | 5606 if dlg.exec_() == QDialog.Accepted: |
5556 if dlg.exec_() == QDialog.Accepted: | 5607 value = dlg.getZoomSize() |
5557 value = dlg.getZoomSize() | 5608 self.__zoomTo(value) |
5558 if value is not None: | 5609 |
5559 aw.zoomTo(value) | 5610 def __zoomTo(self, value): |
5560 self.sbZoom.setValue(aw.getZoom()) | 5611 """ |
5612 Private slot to zoom to a given value. | |
5613 | |
5614 @param value zoom value to be set (integer) | |
5615 """ | |
5616 if QApplication.focusWidget() == e5App().getObject("Shell"): | |
5617 aw = e5App().getObject("Shell") | |
5618 else: | |
5619 aw = self.activeWindow() | |
5620 if aw: | |
5621 aw.zoomTo(value) | |
5622 self.sbZoom.setValue(aw.getZoom()) | |
5561 | 5623 |
5562 def zoomValueChanged(self, value): | 5624 def zoomValueChanged(self, value): |
5563 """ | 5625 """ |
5564 Public slot to handle changes of the zoom value. | 5626 Public slot to handle changes of the zoom value. |
5565 | 5627 |
6261 if editor.canAutoCompleteFromAPIs(): | 6323 if editor.canAutoCompleteFromAPIs(): |
6262 self.autoCompleteFromAPIsAct.setEnabled(True) | 6324 self.autoCompleteFromAPIsAct.setEnabled(True) |
6263 else: | 6325 else: |
6264 self.autoCompleteFromAPIsAct.setEnabled(False) | 6326 self.autoCompleteFromAPIsAct.setEnabled(False) |
6265 | 6327 |
6266 if editor.getPyVersion() or editor.isRubyFile(): | 6328 if editor.isPyFile() or editor.isRubyFile(): |
6267 self.gotoPreviousDefAct.setEnabled(True) | 6329 self.gotoPreviousDefAct.setEnabled(True) |
6268 self.gotoNextDefAct.setEnabled(True) | 6330 self.gotoNextDefAct.setEnabled(True) |
6269 else: | 6331 else: |
6270 self.gotoPreviousDefAct.setEnabled(False) | 6332 self.gotoPreviousDefAct.setEnabled(False) |
6271 self.gotoNextDefAct.setEnabled(False) | 6333 self.gotoNextDefAct.setEnabled(False) |