500 def __initFileActions(self): |
509 def __initFileActions(self): |
501 """ |
510 """ |
502 Private method defining the user interface actions for file handling. |
511 Private method defining the user interface actions for file handling. |
503 """ |
512 """ |
504 self.newAct = E5Action(QApplication.translate('ViewManager', 'New'), |
513 self.newAct = E5Action(QApplication.translate('ViewManager', 'New'), |
505 UI.PixmapCache.getIcon("new.png"), |
514 UI.PixmapCache.getIcon("new.png"), |
506 QApplication.translate('ViewManager', '&New'), |
515 QApplication.translate('ViewManager', '&New'), |
507 QKeySequence(QApplication.translate('ViewManager', "Ctrl+N", "File|New")), |
516 QKeySequence( |
508 0, self, 'vm_file_new') |
517 QApplication.translate('ViewManager', "Ctrl+N", "File|New")), |
|
518 0, self, 'vm_file_new') |
509 self.newAct.setStatusTip( |
519 self.newAct.setStatusTip( |
510 QApplication.translate('ViewManager', 'Open an empty editor window')) |
520 QApplication.translate( |
|
521 'ViewManager', 'Open an empty editor window')) |
511 self.newAct.setWhatsThis(QApplication.translate('ViewManager', |
522 self.newAct.setWhatsThis(QApplication.translate('ViewManager', |
512 """<b>New</b>""" |
523 """<b>New</b>""" |
513 """<p>An empty editor window will be created.</p>""" |
524 """<p>An empty editor window will be created.</p>""" |
514 )) |
525 )) |
515 self.newAct.triggered[()].connect(self.newEditor) |
526 self.newAct.triggered[()].connect(self.newEditor) |
516 self.fileActions.append(self.newAct) |
527 self.fileActions.append(self.newAct) |
517 |
528 |
518 self.openAct = E5Action(QApplication.translate('ViewManager', 'Open'), |
529 self.openAct = E5Action(QApplication.translate('ViewManager', 'Open'), |
519 UI.PixmapCache.getIcon("open.png"), |
530 UI.PixmapCache.getIcon("open.png"), |
520 QApplication.translate('ViewManager', '&Open...'), |
531 QApplication.translate('ViewManager', '&Open...'), |
521 QKeySequence( |
532 QKeySequence( |
522 QApplication.translate('ViewManager', "Ctrl+O", "File|Open")), |
533 QApplication.translate('ViewManager', "Ctrl+O", "File|Open")), |
523 0, self, 'vm_file_open') |
534 0, self, 'vm_file_open') |
524 self.openAct.setStatusTip(QApplication.translate('ViewManager', 'Open a file')) |
535 self.openAct.setStatusTip(QApplication.translate( |
525 self.openAct.setWhatsThis(QApplication.translate('ViewManager', |
536 'ViewManager', 'Open a file')) |
|
537 self.openAct.setWhatsThis(QApplication.translate( |
|
538 'ViewManager', |
526 """<b>Open a file</b>""" |
539 """<b>Open a file</b>""" |
527 """<p>You will be asked for the name of a file to be opened""" |
540 """<p>You will be asked for the name of a file to be opened""" |
528 """ in an editor window.</p>""" |
541 """ in an editor window.</p>""" |
529 )) |
542 )) |
530 self.openAct.triggered[()].connect(self.openFiles) |
543 self.openAct.triggered[()].connect(self.openFiles) |
531 self.fileActions.append(self.openAct) |
544 self.fileActions.append(self.openAct) |
532 |
545 |
533 self.closeActGrp = createActionGroup(self) |
546 self.closeActGrp = createActionGroup(self) |
534 |
547 |
535 self.closeAct = E5Action(QApplication.translate('ViewManager', 'Close'), |
548 self.closeAct = E5Action( |
536 UI.PixmapCache.getIcon("close.png"), |
549 QApplication.translate('ViewManager', 'Close'), |
537 QApplication.translate('ViewManager', '&Close'), |
550 UI.PixmapCache.getIcon("close.png"), |
538 QKeySequence( |
551 QApplication.translate('ViewManager', '&Close'), |
539 QApplication.translate('ViewManager', "Ctrl+W", "File|Close")), |
552 QKeySequence( |
540 0, self.closeActGrp, 'vm_file_close') |
553 QApplication.translate('ViewManager', "Ctrl+W", "File|Close")), |
|
554 0, self.closeActGrp, 'vm_file_close') |
541 self.closeAct.setStatusTip( |
555 self.closeAct.setStatusTip( |
542 QApplication.translate('ViewManager', 'Close the current window')) |
556 QApplication.translate('ViewManager', 'Close the current window')) |
543 self.closeAct.setWhatsThis(QApplication.translate('ViewManager', |
557 self.closeAct.setWhatsThis(QApplication.translate('ViewManager', |
544 """<b>Close Window</b>""" |
558 """<b>Close Window</b>""" |
545 """<p>Close the current window.</p>""" |
559 """<p>Close the current window.</p>""" |
546 )) |
560 )) |
547 self.closeAct.triggered[()].connect(self.closeCurrentWindow) |
561 self.closeAct.triggered[()].connect(self.closeCurrentWindow) |
548 self.fileActions.append(self.closeAct) |
562 self.fileActions.append(self.closeAct) |
549 |
563 |
550 self.closeAllAct = E5Action(QApplication.translate('ViewManager', 'Close All'), |
564 self.closeAllAct = E5Action( |
551 QApplication.translate('ViewManager', 'Clos&e All'), |
565 QApplication.translate('ViewManager', 'Close All'), |
552 0, 0, self.closeActGrp, 'vm_file_close_all') |
566 QApplication.translate('ViewManager', 'Clos&e All'), |
|
567 0, 0, self.closeActGrp, 'vm_file_close_all') |
553 self.closeAllAct.setStatusTip( |
568 self.closeAllAct.setStatusTip( |
554 QApplication.translate('ViewManager', 'Close all editor windows')) |
569 QApplication.translate('ViewManager', 'Close all editor windows')) |
555 self.closeAllAct.setWhatsThis(QApplication.translate('ViewManager', |
570 self.closeAllAct.setWhatsThis(QApplication.translate('ViewManager', |
556 """<b>Close All Windows</b>""" |
571 """<b>Close All Windows</b>""" |
557 """<p>Close all editor windows.</p>""" |
572 """<p>Close all editor windows.</p>""" |
561 |
576 |
562 self.closeActGrp.setEnabled(False) |
577 self.closeActGrp.setEnabled(False) |
563 |
578 |
564 self.saveActGrp = createActionGroup(self) |
579 self.saveActGrp = createActionGroup(self) |
565 |
580 |
566 self.saveAct = E5Action(QApplication.translate('ViewManager', 'Save'), |
581 self.saveAct = E5Action( |
567 UI.PixmapCache.getIcon("fileSave.png"), |
582 QApplication.translate('ViewManager', 'Save'), |
568 QApplication.translate('ViewManager', '&Save'), |
583 UI.PixmapCache.getIcon("fileSave.png"), |
569 QKeySequence( |
584 QApplication.translate('ViewManager', '&Save'), |
570 QApplication.translate('ViewManager', "Ctrl+S", "File|Save")), |
585 QKeySequence(QApplication.translate( |
571 0, self.saveActGrp, 'vm_file_save') |
586 'ViewManager', "Ctrl+S", "File|Save")), |
|
587 0, self.saveActGrp, 'vm_file_save') |
572 self.saveAct.setStatusTip( |
588 self.saveAct.setStatusTip( |
573 QApplication.translate('ViewManager', 'Save the current file')) |
589 QApplication.translate('ViewManager', 'Save the current file')) |
574 self.saveAct.setWhatsThis(QApplication.translate('ViewManager', |
590 self.saveAct.setWhatsThis(QApplication.translate('ViewManager', |
575 """<b>Save File</b>""" |
591 """<b>Save File</b>""" |
576 """<p>Save the contents of current editor window.</p>""" |
592 """<p>Save the contents of current editor window.</p>""" |
577 )) |
593 )) |
578 self.saveAct.triggered[()].connect(self.saveCurrentEditor) |
594 self.saveAct.triggered[()].connect(self.saveCurrentEditor) |
579 self.fileActions.append(self.saveAct) |
595 self.fileActions.append(self.saveAct) |
580 |
596 |
581 self.saveAsAct = E5Action(QApplication.translate('ViewManager', 'Save as'), |
597 self.saveAsAct = E5Action( |
582 UI.PixmapCache.getIcon("fileSaveAs.png"), |
598 QApplication.translate('ViewManager', 'Save as'), |
583 QApplication.translate('ViewManager', 'Save &as...'), |
599 UI.PixmapCache.getIcon("fileSaveAs.png"), |
584 QKeySequence(QApplication.translate('ViewManager', |
600 QApplication.translate('ViewManager', 'Save &as...'), |
585 "Shift+Ctrl+S", "File|Save As")), |
601 QKeySequence(QApplication.translate('ViewManager', |
586 0, self.saveActGrp, 'vm_file_save_as') |
602 "Shift+Ctrl+S", "File|Save As")), |
|
603 0, self.saveActGrp, 'vm_file_save_as') |
587 self.saveAsAct.setStatusTip(QApplication.translate('ViewManager', |
604 self.saveAsAct.setStatusTip(QApplication.translate('ViewManager', |
588 'Save the current file to a new one')) |
605 'Save the current file to a new one')) |
589 self.saveAsAct.setWhatsThis(QApplication.translate('ViewManager', |
606 self.saveAsAct.setWhatsThis(QApplication.translate('ViewManager', |
590 """<b>Save File as</b>""" |
607 """<b>Save File as</b>""" |
591 """<p>Save the contents of current editor window to a new file.""" |
608 """<p>Save the contents of current editor window to a new file.""" |
592 """ The file can be entered in a file selection dialog.</p>""" |
609 """ The file can be entered in a file selection dialog.</p>""" |
593 )) |
610 )) |
594 self.saveAsAct.triggered[()].connect(self.saveAsCurrentEditor) |
611 self.saveAsAct.triggered[()].connect(self.saveAsCurrentEditor) |
595 self.fileActions.append(self.saveAsAct) |
612 self.fileActions.append(self.saveAsAct) |
596 |
613 |
597 self.saveAllAct = E5Action(QApplication.translate('ViewManager', 'Save all'), |
614 self.saveAllAct = E5Action( |
598 UI.PixmapCache.getIcon("fileSaveAll.png"), |
615 QApplication.translate('ViewManager', 'Save all'), |
599 QApplication.translate('ViewManager', 'Save a&ll'), |
616 UI.PixmapCache.getIcon("fileSaveAll.png"), |
600 0, 0, self.saveActGrp, 'vm_file_save_all') |
617 QApplication.translate('ViewManager', 'Save a&ll'), |
|
618 0, 0, self.saveActGrp, 'vm_file_save_all') |
601 self.saveAllAct.setStatusTip(QApplication.translate('ViewManager', |
619 self.saveAllAct.setStatusTip(QApplication.translate('ViewManager', |
602 'Save all files')) |
620 'Save all files')) |
603 self.saveAllAct.setWhatsThis(QApplication.translate('ViewManager', |
621 self.saveAllAct.setWhatsThis(QApplication.translate('ViewManager', |
604 """<b>Save All Files</b>""" |
622 """<b>Save All Files</b>""" |
605 """<p>Save the contents of all editor windows.</p>""" |
623 """<p>Save the contents of all editor windows.</p>""" |
828 self.copyActGrp, 'vm_edit_copy') |
855 self.copyActGrp, 'vm_edit_copy') |
829 self.copyAct.setStatusTip(QApplication.translate('ViewManager', |
856 self.copyAct.setStatusTip(QApplication.translate('ViewManager', |
830 'Copy the selection')) |
857 'Copy the selection')) |
831 self.copyAct.setWhatsThis(QApplication.translate('ViewManager', |
858 self.copyAct.setWhatsThis(QApplication.translate('ViewManager', |
832 """<b>Copy</b>""" |
859 """<b>Copy</b>""" |
833 """<p>Copy the selected text of the current editor to the clipboard.</p>""" |
860 """<p>Copy the selected text of the current editor to the""" |
|
861 """ clipboard.</p>""" |
834 )) |
862 )) |
835 self.copyAct.triggered[()].connect(self.__editCopy) |
863 self.copyAct.triggered[()].connect(self.__editCopy) |
836 self.editActions.append(self.copyAct) |
864 self.editActions.append(self.copyAct) |
837 |
865 |
838 self.pasteAct = E5Action(QApplication.translate('ViewManager', 'Paste'), |
866 self.pasteAct = E5Action( |
839 UI.PixmapCache.getIcon("editPaste.png"), |
867 QApplication.translate('ViewManager', 'Paste'), |
840 QApplication.translate('ViewManager', '&Paste'), |
868 UI.PixmapCache.getIcon("editPaste.png"), |
841 QKeySequence(QApplication.translate('ViewManager', |
869 QApplication.translate('ViewManager', '&Paste'), |
842 "Ctrl+V", "Edit|Paste")), |
870 QKeySequence(QApplication.translate('ViewManager', |
843 QKeySequence(QApplication.translate('ViewManager', |
871 "Ctrl+V", "Edit|Paste")), |
844 "Shift+Ins", "Edit|Paste")), |
872 QKeySequence(QApplication.translate('ViewManager', |
845 self.copyActGrp, 'vm_edit_paste') |
873 "Shift+Ins", "Edit|Paste")), |
|
874 self.copyActGrp, 'vm_edit_paste') |
846 self.pasteAct.setStatusTip(QApplication.translate('ViewManager', |
875 self.pasteAct.setStatusTip(QApplication.translate('ViewManager', |
847 'Paste the last cut/copied text')) |
876 'Paste the last cut/copied text')) |
848 self.pasteAct.setWhatsThis(QApplication.translate('ViewManager', |
877 self.pasteAct.setWhatsThis(QApplication.translate('ViewManager', |
849 """<b>Paste</b>""" |
878 """<b>Paste</b>""" |
850 """<p>Paste the last cut/copied text from the clipboard to""" |
879 """<p>Paste the last cut/copied text from the clipboard to""" |
851 """ the current editor.</p>""" |
880 """ the current editor.</p>""" |
852 )) |
881 )) |
853 self.pasteAct.triggered[()].connect(self.__editPaste) |
882 self.pasteAct.triggered[()].connect(self.__editPaste) |
854 self.editActions.append(self.pasteAct) |
883 self.editActions.append(self.pasteAct) |
855 |
884 |
856 self.deleteAct = E5Action(QApplication.translate('ViewManager', 'Clear'), |
885 self.deleteAct = E5Action( |
857 UI.PixmapCache.getIcon("editDelete.png"), |
886 QApplication.translate('ViewManager', 'Clear'), |
858 QApplication.translate('ViewManager', 'Clear'), |
887 UI.PixmapCache.getIcon("editDelete.png"), |
859 QKeySequence(QApplication.translate('ViewManager', |
888 QApplication.translate('ViewManager', 'Clear'), |
860 "Alt+Shift+C", "Edit|Clear")), |
889 QKeySequence(QApplication.translate('ViewManager', |
861 0, |
890 "Alt+Shift+C", "Edit|Clear")), |
862 self.copyActGrp, 'vm_edit_clear') |
891 0, |
|
892 self.copyActGrp, 'vm_edit_clear') |
863 self.deleteAct.setStatusTip(QApplication.translate('ViewManager', |
893 self.deleteAct.setStatusTip(QApplication.translate('ViewManager', |
864 'Clear all text')) |
894 'Clear all text')) |
865 self.deleteAct.setWhatsThis(QApplication.translate('ViewManager', |
895 self.deleteAct.setWhatsThis(QApplication.translate('ViewManager', |
866 """<b>Clear</b>""" |
896 """<b>Clear</b>""" |
867 """<p>Delete all text of the current editor.</p>""" |
897 """<p>Delete all text of the current editor.</p>""" |
868 )) |
898 )) |
869 self.deleteAct.triggered[()].connect(self.__editDelete) |
899 self.deleteAct.triggered[()].connect(self.__editDelete) |
870 self.editActions.append(self.deleteAct) |
900 self.editActions.append(self.deleteAct) |
871 |
901 |
872 self.joinAct = E5Action(QApplication.translate('ViewManager', 'Join Lines'), |
902 self.joinAct = E5Action( |
873 QApplication.translate('ViewManager', 'Join Lines'), |
903 QApplication.translate('ViewManager', 'Join Lines'), |
874 QKeySequence(QApplication.translate('ViewManager', |
904 QApplication.translate('ViewManager', 'Join Lines'), |
875 "Ctrl+J", "Edit|Join Lines")), |
905 QKeySequence(QApplication.translate('ViewManager', |
876 0, |
906 "Ctrl+J", "Edit|Join Lines")), |
877 self.copyActGrp, 'vm_edit_join_lines') |
907 0, |
|
908 self.copyActGrp, 'vm_edit_join_lines') |
878 self.joinAct.setStatusTip(QApplication.translate('ViewManager', |
909 self.joinAct.setStatusTip(QApplication.translate('ViewManager', |
879 'Join Lines')) |
910 'Join Lines')) |
880 self.joinAct.setWhatsThis(QApplication.translate('ViewManager', |
911 self.joinAct.setWhatsThis(QApplication.translate('ViewManager', |
881 """<b>Join Lines</b>""" |
912 """<b>Join Lines</b>""" |
882 """<p>Join the current and the next lines.</p>""" |
913 """<p>Join the current and the next lines.</p>""" |
883 )) |
914 )) |
884 self.joinAct.triggered[()].connect(self.__editJoin) |
915 self.joinAct.triggered[()].connect(self.__editJoin) |
885 self.editActions.append(self.joinAct) |
916 self.editActions.append(self.joinAct) |
886 |
917 |
887 self.indentAct = E5Action(QApplication.translate('ViewManager', 'Indent'), |
918 self.indentAct = E5Action( |
888 UI.PixmapCache.getIcon("editIndent.png"), |
919 QApplication.translate('ViewManager', 'Indent'), |
889 QApplication.translate('ViewManager', '&Indent'), |
920 UI.PixmapCache.getIcon("editIndent.png"), |
890 QKeySequence(QApplication.translate('ViewManager', |
921 QApplication.translate('ViewManager', '&Indent'), |
891 "Ctrl+I", "Edit|Indent")), |
922 QKeySequence(QApplication.translate('ViewManager', |
892 0, |
923 "Ctrl+I", "Edit|Indent")), |
893 self.editActGrp, 'vm_edit_indent') |
924 0, |
894 self.indentAct.setStatusTip(QApplication.translate('ViewManager', 'Indent line')) |
925 self.editActGrp, 'vm_edit_indent') |
|
926 self.indentAct.setStatusTip(QApplication.translate('ViewManager', |
|
927 'Indent line')) |
895 self.indentAct.setWhatsThis(QApplication.translate('ViewManager', |
928 self.indentAct.setWhatsThis(QApplication.translate('ViewManager', |
896 """<b>Indent</b>""" |
929 """<b>Indent</b>""" |
897 """<p>Indents the current line or the lines of the""" |
930 """<p>Indents the current line or the lines of the""" |
898 """ selection by one level.</p>""" |
931 """ selection by one level.</p>""" |
899 )) |
932 )) |
900 self.indentAct.triggered[()].connect(self.__editIndent) |
933 self.indentAct.triggered[()].connect(self.__editIndent) |
901 self.editActions.append(self.indentAct) |
934 self.editActions.append(self.indentAct) |
902 |
935 |
903 self.unindentAct = E5Action(QApplication.translate('ViewManager', 'Unindent'), |
936 self.unindentAct = E5Action( |
904 UI.PixmapCache.getIcon("editUnindent.png"), |
937 QApplication.translate('ViewManager', 'Unindent'), |
905 QApplication.translate('ViewManager', 'U&nindent'), |
938 UI.PixmapCache.getIcon("editUnindent.png"), |
906 QKeySequence(QApplication.translate('ViewManager', |
939 QApplication.translate('ViewManager', 'U&nindent'), |
907 "Ctrl+Shift+I", "Edit|Unindent")), |
940 QKeySequence(QApplication.translate('ViewManager', |
908 0, |
941 "Ctrl+Shift+I", "Edit|Unindent")), |
909 self.editActGrp, 'vm_edit_unindent') |
942 0, |
|
943 self.editActGrp, 'vm_edit_unindent') |
910 self.unindentAct.setStatusTip(QApplication.translate('ViewManager', |
944 self.unindentAct.setStatusTip(QApplication.translate('ViewManager', |
911 'Unindent line')) |
945 'Unindent line')) |
912 self.unindentAct.setWhatsThis(QApplication.translate('ViewManager', |
946 self.unindentAct.setWhatsThis(QApplication.translate('ViewManager', |
913 """<b>Unindent</b>""" |
947 """<b>Unindent</b>""" |
914 """<p>Unindents the current line or the lines of the""" |
948 """<p>Unindents the current line or the lines of the""" |
1101 self.editActGrp, 'vm_edit_autocomplete') |
1149 self.editActGrp, 'vm_edit_autocomplete') |
1102 self.autoCompleteAct.setStatusTip(QApplication.translate('ViewManager', |
1150 self.autoCompleteAct.setStatusTip(QApplication.translate('ViewManager', |
1103 'Autocomplete current word')) |
1151 'Autocomplete current word')) |
1104 self.autoCompleteAct.setWhatsThis(QApplication.translate('ViewManager', |
1152 self.autoCompleteAct.setWhatsThis(QApplication.translate('ViewManager', |
1105 """<b>Autocomplete</b>""" |
1153 """<b>Autocomplete</b>""" |
1106 """<p>Performs an autocompletion of the word containing the cursor.</p>""" |
1154 """<p>Performs an autocompletion of the word containing""" |
|
1155 """ the cursor.</p>""" |
1107 )) |
1156 )) |
1108 self.autoCompleteAct.triggered[()].connect(self.__editAutoComplete) |
1157 self.autoCompleteAct.triggered[()].connect(self.__editAutoComplete) |
1109 self.editActions.append(self.autoCompleteAct) |
1158 self.editActions.append(self.autoCompleteAct) |
1110 |
1159 |
1111 self.autoCompleteFromDocAct = E5Action(QApplication.translate('ViewManager', |
1160 self.autoCompleteFromDocAct = E5Action( |
1112 'Autocomplete from Document'), |
1161 QApplication.translate( |
1113 QApplication.translate('ViewManager', 'Autocomplete from Document'), |
1162 'ViewManager', 'Autocomplete from Document'), |
1114 QKeySequence(QApplication.translate('ViewManager', "Ctrl+Shift+Space", |
1163 QApplication.translate( |
1115 "Edit|Autocomplete from Document")), |
1164 'ViewManager', 'Autocomplete from Document'), |
1116 0, |
1165 QKeySequence(QApplication.translate( |
1117 self.editActGrp, 'vm_edit_autocomplete_from_document') |
1166 'ViewManager', "Ctrl+Shift+Space", |
1118 self.autoCompleteFromDocAct.setStatusTip(QApplication.translate('ViewManager', |
1167 "Edit|Autocomplete from Document")), |
|
1168 0, |
|
1169 self.editActGrp, 'vm_edit_autocomplete_from_document') |
|
1170 self.autoCompleteFromDocAct.setStatusTip(QApplication.translate( |
|
1171 'ViewManager', |
1119 'Autocomplete current word from Document')) |
1172 'Autocomplete current word from Document')) |
1120 self.autoCompleteFromDocAct.setWhatsThis(QApplication.translate('ViewManager', |
1173 self.autoCompleteFromDocAct.setWhatsThis(QApplication.translate( |
|
1174 'ViewManager', |
1121 """<b>Autocomplete from Document</b>""" |
1175 """<b>Autocomplete from Document</b>""" |
1122 """<p>Performs an autocompletion from document of the word""" |
1176 """<p>Performs an autocompletion from document of the word""" |
1123 """ containing the cursor.</p>""" |
1177 """ containing the cursor.</p>""" |
1124 )) |
1178 )) |
1125 self.autoCompleteFromDocAct.triggered[()].connect(self.__editAutoCompleteFromDoc) |
1179 self.autoCompleteFromDocAct.triggered[()].connect( |
|
1180 self.__editAutoCompleteFromDoc) |
1126 self.editActions.append(self.autoCompleteFromDocAct) |
1181 self.editActions.append(self.autoCompleteFromDocAct) |
1127 |
1182 |
1128 self.autoCompleteFromAPIsAct = E5Action(QApplication.translate('ViewManager', |
1183 self.autoCompleteFromAPIsAct = E5Action( |
1129 'Autocomplete from APIs'), |
1184 QApplication.translate('ViewManager', 'Autocomplete from APIs'), |
1130 QApplication.translate('ViewManager', 'Autocomplete from APIs'), |
1185 QApplication.translate('ViewManager', 'Autocomplete from APIs'), |
1131 QKeySequence(QApplication.translate('ViewManager', "Ctrl+Alt+Space", |
1186 QKeySequence(QApplication.translate( |
1132 "Edit|Autocomplete from APIs")), |
1187 'ViewManager', "Ctrl+Alt+Space", |
1133 0, |
1188 "Edit|Autocomplete from APIs")), |
1134 self.editActGrp, 'vm_edit_autocomplete_from_api') |
1189 0, |
1135 self.autoCompleteFromAPIsAct.setStatusTip(QApplication.translate('ViewManager', |
1190 self.editActGrp, 'vm_edit_autocomplete_from_api') |
|
1191 self.autoCompleteFromAPIsAct.setStatusTip(QApplication.translate( |
|
1192 'ViewManager', |
1136 'Autocomplete current word from APIs')) |
1193 'Autocomplete current word from APIs')) |
1137 self.autoCompleteFromAPIsAct.setWhatsThis(QApplication.translate('ViewManager', |
1194 self.autoCompleteFromAPIsAct.setWhatsThis(QApplication.translate( |
|
1195 'ViewManager', |
1138 """<b>Autocomplete from APIs</b>""" |
1196 """<b>Autocomplete from APIs</b>""" |
1139 """<p>Performs an autocompletion from APIs of the word containing""" |
1197 """<p>Performs an autocompletion from APIs of the word""" |
1140 """ the cursor.</p>""" |
1198 """ containing the cursor.</p>""" |
1141 )) |
1199 )) |
1142 self.autoCompleteFromAPIsAct.triggered[()].connect(self.__editAutoCompleteFromAPIs) |
1200 self.autoCompleteFromAPIsAct.triggered[()].connect( |
|
1201 self.__editAutoCompleteFromAPIs) |
1143 self.editActions.append(self.autoCompleteFromAPIsAct) |
1202 self.editActions.append(self.autoCompleteFromAPIsAct) |
1144 |
1203 |
1145 self.autoCompleteFromAllAct = E5Action( |
1204 self.autoCompleteFromAllAct = E5Action( |
1146 QApplication.translate('ViewManager', |
1205 QApplication.translate( |
1147 'Autocomplete from Document and APIs'), |
1206 'ViewManager', 'Autocomplete from Document and APIs'), |
1148 QApplication.translate('ViewManager', |
1207 QApplication.translate( |
1149 'Autocomplete from Document and APIs'), |
1208 'ViewManager', 'Autocomplete from Document and APIs'), |
1150 QKeySequence(QApplication.translate('ViewManager', "Alt+Shift+Space", |
1209 QKeySequence(QApplication.translate( |
1151 "Edit|Autocomplete from Document and APIs")), |
1210 'ViewManager', "Alt+Shift+Space", |
1152 0, |
1211 "Edit|Autocomplete from Document and APIs")), |
1153 self.editActGrp, 'vm_edit_autocomplete_from_all') |
1212 0, |
1154 self.autoCompleteFromAllAct.setStatusTip(QApplication.translate('ViewManager', |
1213 self.editActGrp, 'vm_edit_autocomplete_from_all') |
|
1214 self.autoCompleteFromAllAct.setStatusTip(QApplication.translate( |
|
1215 'ViewManager', |
1155 'Autocomplete current word from Document and APIs')) |
1216 'Autocomplete current word from Document and APIs')) |
1156 self.autoCompleteFromAllAct.setWhatsThis(QApplication.translate('ViewManager', |
1217 self.autoCompleteFromAllAct.setWhatsThis(QApplication.translate( |
|
1218 'ViewManager', |
1157 """<b>Autocomplete from Document and APIs</b>""" |
1219 """<b>Autocomplete from Document and APIs</b>""" |
1158 """<p>Performs an autocompletion from document and APIs""" |
1220 """<p>Performs an autocompletion from document and APIs""" |
1159 """ of the word containing the cursor.</p>""" |
1221 """ of the word containing the cursor.</p>""" |
1160 )) |
1222 )) |
1161 self.autoCompleteFromAllAct.triggered[()].connect(self.__editAutoCompleteFromAll) |
1223 self.autoCompleteFromAllAct.triggered[()].connect( |
|
1224 self.__editAutoCompleteFromAll) |
1162 self.editActions.append(self.autoCompleteFromAllAct) |
1225 self.editActions.append(self.autoCompleteFromAllAct) |
1163 |
1226 |
1164 self.calltipsAct = E5Action(QApplication.translate('ViewManager', |
1227 self.calltipsAct = E5Action(QApplication.translate('ViewManager', |
1165 'Calltip'), |
1228 'Calltip'), |
1166 QApplication.translate('ViewManager', '&Calltip'), |
1229 QApplication.translate('ViewManager', '&Calltip'), |
1204 self.esm = QSignalMapper(self) |
1267 self.esm = QSignalMapper(self) |
1205 self.esm.mapped[int].connect(self.__editorCommand) |
1268 self.esm.mapped[int].connect(self.__editorCommand) |
1206 |
1269 |
1207 self.editorActGrp = createActionGroup(self.editActGrp) |
1270 self.editorActGrp = createActionGroup(self.editActGrp) |
1208 |
1271 |
1209 act = E5Action(QApplication.translate('ViewManager', 'Move left one character'), |
1272 act = E5Action( |
1210 QApplication.translate('ViewManager', 'Move left one character'), |
1273 QApplication.translate('ViewManager', 'Move left one character'), |
1211 QKeySequence(QApplication.translate('ViewManager', 'Left')), 0, |
1274 QApplication.translate('ViewManager', 'Move left one character'), |
1212 self.editorActGrp, 'vm_edit_move_left_char') |
1275 QKeySequence(QApplication.translate('ViewManager', 'Left')), 0, |
|
1276 self.editorActGrp, 'vm_edit_move_left_char') |
1213 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT) |
1277 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT) |
1214 if isMacPlatform(): |
1278 if isMacPlatform(): |
1215 act.setAlternateShortcut(QKeySequence( |
1279 act.setAlternateShortcut(QKeySequence( |
1216 QApplication.translate('ViewManager', 'Meta+B'))) |
1280 QApplication.translate('ViewManager', 'Meta+B'))) |
1217 act.triggered[()].connect(self.esm.map) |
1281 act.triggered[()].connect(self.esm.map) |
1218 self.editActions.append(act) |
1282 self.editActions.append(act) |
1219 |
1283 |
1220 act = E5Action(QApplication.translate('ViewManager', 'Move right one character'), |
1284 act = E5Action( |
1221 QApplication.translate('ViewManager', 'Move right one character'), |
1285 QApplication.translate('ViewManager', 'Move right one character'), |
1222 QKeySequence(QApplication.translate('ViewManager', 'Right')), 0, |
1286 QApplication.translate('ViewManager', 'Move right one character'), |
1223 self.editorActGrp, 'vm_edit_move_right_char') |
1287 QKeySequence(QApplication.translate('ViewManager', 'Right')), 0, |
|
1288 self.editorActGrp, 'vm_edit_move_right_char') |
1224 if isMacPlatform(): |
1289 if isMacPlatform(): |
1225 act.setAlternateShortcut(QKeySequence( |
1290 act.setAlternateShortcut(QKeySequence( |
1226 QApplication.translate('ViewManager', 'Meta+F'))) |
1291 QApplication.translate('ViewManager', 'Meta+F'))) |
1227 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT) |
1292 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT) |
1228 act.triggered[()].connect(self.esm.map) |
1293 act.triggered[()].connect(self.esm.map) |
1229 self.editActions.append(act) |
1294 self.editActions.append(act) |
1230 |
1295 |
1231 act = E5Action(QApplication.translate('ViewManager', 'Move up one line'), |
1296 act = E5Action( |
1232 QApplication.translate('ViewManager', 'Move up one line'), |
1297 QApplication.translate('ViewManager', 'Move up one line'), |
1233 QKeySequence(QApplication.translate('ViewManager', 'Up')), 0, |
1298 QApplication.translate('ViewManager', 'Move up one line'), |
1234 self.editorActGrp, 'vm_edit_move_up_line') |
1299 QKeySequence(QApplication.translate('ViewManager', 'Up')), 0, |
|
1300 self.editorActGrp, 'vm_edit_move_up_line') |
1235 if isMacPlatform(): |
1301 if isMacPlatform(): |
1236 act.setAlternateShortcut(QKeySequence( |
1302 act.setAlternateShortcut(QKeySequence( |
1237 QApplication.translate('ViewManager', 'Meta+P'))) |
1303 QApplication.translate('ViewManager', 'Meta+P'))) |
1238 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP) |
1304 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP) |
1239 act.triggered[()].connect(self.esm.map) |
1305 act.triggered[()].connect(self.esm.map) |
1240 self.editActions.append(act) |
1306 self.editActions.append(act) |
1241 |
1307 |
1242 act = E5Action(QApplication.translate('ViewManager', 'Move down one line'), |
1308 act = E5Action( |
1243 QApplication.translate('ViewManager', 'Move down one line'), |
1309 QApplication.translate('ViewManager', 'Move down one line'), |
1244 QKeySequence(QApplication.translate('ViewManager', 'Down')), 0, |
1310 QApplication.translate('ViewManager', 'Move down one line'), |
1245 self.editorActGrp, 'vm_edit_move_down_line') |
1311 QKeySequence(QApplication.translate('ViewManager', 'Down')), 0, |
|
1312 self.editorActGrp, 'vm_edit_move_down_line') |
1246 if isMacPlatform(): |
1313 if isMacPlatform(): |
1247 act.setAlternateShortcut(QKeySequence( |
1314 act.setAlternateShortcut(QKeySequence( |
1248 QApplication.translate('ViewManager', 'Meta+N'))) |
1315 QApplication.translate('ViewManager', 'Meta+N'))) |
1249 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN) |
1316 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN) |
1250 act.triggered[()].connect(self.esm.map) |
1317 act.triggered[()].connect(self.esm.map) |
1251 self.editActions.append(act) |
1318 self.editActions.append(act) |
1252 |
1319 |
1253 act = E5Action(QApplication.translate('ViewManager', 'Move left one word part'), |
1320 act = E5Action( |
1254 QApplication.translate('ViewManager', 'Move left one word part'), |
1321 QApplication.translate('ViewManager', 'Move left one word part'), |
1255 0, 0, |
1322 QApplication.translate('ViewManager', 'Move left one word part'), |
1256 self.editorActGrp, 'vm_edit_move_left_word_part') |
1323 0, 0, |
|
1324 self.editorActGrp, 'vm_edit_move_left_word_part') |
1257 if not isMacPlatform(): |
1325 if not isMacPlatform(): |
1258 act.setShortcut(QKeySequence( |
1326 act.setShortcut(QKeySequence( |
1259 QApplication.translate('ViewManager', 'Alt+Left'))) |
1327 QApplication.translate('ViewManager', 'Alt+Left'))) |
1260 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT) |
1328 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT) |
1261 act.triggered[()].connect(self.esm.map) |
1329 act.triggered[()].connect(self.esm.map) |
1262 self.editActions.append(act) |
1330 self.editActions.append(act) |
1263 |
1331 |
1264 act = E5Action(QApplication.translate('ViewManager', 'Move right one word part'), |
1332 act = E5Action( |
1265 QApplication.translate('ViewManager', 'Move right one word part'), |
1333 QApplication.translate('ViewManager', 'Move right one word part'), |
1266 0, 0, |
1334 QApplication.translate('ViewManager', 'Move right one word part'), |
1267 self.editorActGrp, 'vm_edit_move_right_word_part') |
1335 0, 0, |
|
1336 self.editorActGrp, 'vm_edit_move_right_word_part') |
1268 if not isMacPlatform(): |
1337 if not isMacPlatform(): |
1269 act.setShortcut(QKeySequence( |
1338 act.setShortcut(QKeySequence( |
1270 QApplication.translate('ViewManager', 'Alt+Right'))) |
1339 QApplication.translate('ViewManager', 'Alt+Right'))) |
1271 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT) |
1340 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT) |
1272 act.triggered[()].connect(self.esm.map) |
1341 act.triggered[()].connect(self.esm.map) |
1273 self.editActions.append(act) |
1342 self.editActions.append(act) |
1274 |
1343 |
1275 act = E5Action(QApplication.translate('ViewManager', 'Move left one word'), |
1344 act = E5Action( |
1276 QApplication.translate('ViewManager', 'Move left one word'), |
1345 QApplication.translate('ViewManager', 'Move left one word'), |
1277 0, 0, |
1346 QApplication.translate('ViewManager', 'Move left one word'), |
1278 self.editorActGrp, 'vm_edit_move_left_word') |
1347 0, 0, |
|
1348 self.editorActGrp, 'vm_edit_move_left_word') |
1279 if isMacPlatform(): |
1349 if isMacPlatform(): |
1280 act.setShortcut(QKeySequence( |
1350 act.setShortcut(QKeySequence( |
1281 QApplication.translate('ViewManager', 'Alt+Left'))) |
1351 QApplication.translate('ViewManager', 'Alt+Left'))) |
1282 else: |
1352 else: |
1283 act.setShortcut(QKeySequence( |
1353 act.setShortcut(QKeySequence( |
1284 QApplication.translate('ViewManager', 'Ctrl+Left'))) |
1354 QApplication.translate('ViewManager', 'Ctrl+Left'))) |
1285 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT) |
1355 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT) |
1286 act.triggered[()].connect(self.esm.map) |
1356 act.triggered[()].connect(self.esm.map) |
1287 self.editActions.append(act) |
1357 self.editActions.append(act) |
1288 |
1358 |
1289 act = E5Action(QApplication.translate('ViewManager', 'Move right one word'), |
1359 act = E5Action( |
1290 QApplication.translate('ViewManager', 'Move right one word'), |
1360 QApplication.translate('ViewManager', 'Move right one word'), |
1291 0, 0, |
1361 QApplication.translate('ViewManager', 'Move right one word'), |
1292 self.editorActGrp, 'vm_edit_move_right_word') |
1362 0, 0, |
|
1363 self.editorActGrp, 'vm_edit_move_right_word') |
1293 if not isMacPlatform(): |
1364 if not isMacPlatform(): |
1294 act.setShortcut(QKeySequence( |
1365 act.setShortcut(QKeySequence( |
1295 QApplication.translate('ViewManager', 'Ctrl+Right'))) |
1366 QApplication.translate('ViewManager', 'Ctrl+Right'))) |
1296 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT) |
1367 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT) |
1297 act.triggered[()].connect(self.esm.map) |
1368 act.triggered[()].connect(self.esm.map) |
1340 QApplication.translate('ViewManager', 'End'))) |
1411 QApplication.translate('ViewManager', 'End'))) |
1341 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND) |
1412 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND) |
1342 act.triggered[()].connect(self.esm.map) |
1413 act.triggered[()].connect(self.esm.map) |
1343 self.editActions.append(act) |
1414 self.editActions.append(act) |
1344 |
1415 |
1345 act = E5Action(QApplication.translate('ViewManager', 'Scroll view down one line'), |
1416 act = E5Action( |
1346 QApplication.translate('ViewManager', 'Scroll view down one line'), |
1417 QApplication.translate('ViewManager', 'Scroll view down one line'), |
1347 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Down')), 0, |
1418 QApplication.translate('ViewManager', 'Scroll view down one line'), |
1348 self.editorActGrp, 'vm_edit_scroll_down_line') |
1419 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Down')), |
|
1420 0, |
|
1421 self.editorActGrp, 'vm_edit_scroll_down_line') |
1349 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN) |
1422 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN) |
1350 act.triggered[()].connect(self.esm.map) |
1423 act.triggered[()].connect(self.esm.map) |
1351 self.editActions.append(act) |
1424 self.editActions.append(act) |
1352 |
1425 |
1353 act = E5Action(QApplication.translate('ViewManager', 'Scroll view up one line'), |
1426 act = E5Action( |
1354 QApplication.translate('ViewManager', 'Scroll view up one line'), |
1427 QApplication.translate('ViewManager', 'Scroll view up one line'), |
1355 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Up')), 0, |
1428 QApplication.translate('ViewManager', 'Scroll view up one line'), |
1356 self.editorActGrp, 'vm_edit_scroll_up_line') |
1429 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Up')), 0, |
|
1430 self.editorActGrp, 'vm_edit_scroll_up_line') |
1357 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP) |
1431 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP) |
1358 act.triggered[()].connect(self.esm.map) |
1432 act.triggered[()].connect(self.esm.map) |
1359 self.editActions.append(act) |
1433 self.editActions.append(act) |
1360 |
1434 |
1361 act = E5Action(QApplication.translate('ViewManager', 'Move up one paragraph'), |
1435 act = E5Action( |
1362 QApplication.translate('ViewManager', 'Move up one paragraph'), |
1436 QApplication.translate('ViewManager', 'Move up one paragraph'), |
1363 QKeySequence(QApplication.translate('ViewManager', 'Alt+Up')), 0, |
1437 QApplication.translate('ViewManager', 'Move up one paragraph'), |
1364 self.editorActGrp, 'vm_edit_move_up_para') |
1438 QKeySequence(QApplication.translate('ViewManager', 'Alt+Up')), 0, |
|
1439 self.editorActGrp, 'vm_edit_move_up_para') |
1365 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP) |
1440 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP) |
1366 act.triggered[()].connect(self.esm.map) |
1441 act.triggered[()].connect(self.esm.map) |
1367 self.editActions.append(act) |
1442 self.editActions.append(act) |
1368 |
1443 |
1369 act = E5Action(QApplication.translate('ViewManager', 'Move down one paragraph'), |
1444 act = E5Action( |
1370 QApplication.translate('ViewManager', 'Move down one paragraph'), |
1445 QApplication.translate('ViewManager', 'Move down one paragraph'), |
1371 QKeySequence(QApplication.translate('ViewManager', 'Alt+Down')), 0, |
1446 QApplication.translate('ViewManager', 'Move down one paragraph'), |
1372 self.editorActGrp, 'vm_edit_move_down_para') |
1447 QKeySequence(QApplication.translate('ViewManager', 'Alt+Down')), 0, |
|
1448 self.editorActGrp, 'vm_edit_move_down_para') |
1373 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN) |
1449 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN) |
1374 act.triggered[()].connect(self.esm.map) |
1450 act.triggered[()].connect(self.esm.map) |
1375 self.editActions.append(act) |
1451 self.editActions.append(act) |
1376 |
1452 |
1377 act = E5Action(QApplication.translate('ViewManager', 'Move up one page'), |
1453 act = E5Action( |
1378 QApplication.translate('ViewManager', 'Move up one page'), |
1454 QApplication.translate('ViewManager', 'Move up one page'), |
1379 QKeySequence(QApplication.translate('ViewManager', 'PgUp')), 0, |
1455 QApplication.translate('ViewManager', 'Move up one page'), |
1380 self.editorActGrp, 'vm_edit_move_up_page') |
1456 QKeySequence(QApplication.translate('ViewManager', 'PgUp')), 0, |
|
1457 self.editorActGrp, 'vm_edit_move_up_page') |
1381 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP) |
1458 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP) |
1382 act.triggered[()].connect(self.esm.map) |
1459 act.triggered[()].connect(self.esm.map) |
1383 self.editActions.append(act) |
1460 self.editActions.append(act) |
1384 |
1461 |
1385 act = E5Action(QApplication.translate('ViewManager', 'Move down one page'), |
1462 act = E5Action( |
1386 QApplication.translate('ViewManager', 'Move down one page'), |
1463 QApplication.translate('ViewManager', 'Move down one page'), |
1387 QKeySequence(QApplication.translate('ViewManager', 'PgDown')), 0, |
1464 QApplication.translate('ViewManager', 'Move down one page'), |
1388 self.editorActGrp, 'vm_edit_move_down_page') |
1465 QKeySequence(QApplication.translate('ViewManager', 'PgDown')), 0, |
|
1466 self.editorActGrp, 'vm_edit_move_down_page') |
1389 if isMacPlatform(): |
1467 if isMacPlatform(): |
1390 act.setAlternateShortcut(QKeySequence( |
1468 act.setAlternateShortcut(QKeySequence( |
1391 QApplication.translate('ViewManager', 'Meta+V'))) |
1469 QApplication.translate('ViewManager', 'Meta+V'))) |
1392 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN) |
1470 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN) |
1393 act.triggered[()].connect(self.esm.map) |
1471 act.triggered[()].connect(self.esm.map) |
1394 self.editActions.append(act) |
1472 self.editActions.append(act) |
1395 |
1473 |
1396 act = E5Action(QApplication.translate('ViewManager', 'Move to start of document'), |
1474 act = E5Action( |
1397 QApplication.translate('ViewManager', 'Move to start of document'), |
1475 QApplication.translate('ViewManager', 'Move to start of document'), |
1398 0, 0, |
1476 QApplication.translate('ViewManager', 'Move to start of document'), |
1399 self.editorActGrp, 'vm_edit_move_start_text') |
1477 0, 0, |
|
1478 self.editorActGrp, 'vm_edit_move_start_text') |
1400 if isMacPlatform(): |
1479 if isMacPlatform(): |
1401 act.setShortcut(QKeySequence( |
1480 act.setShortcut(QKeySequence( |
1402 QApplication.translate('ViewManager', 'Ctrl+Up'))) |
1481 QApplication.translate('ViewManager', 'Ctrl+Up'))) |
1403 else: |
1482 else: |
1404 act.setShortcut(QKeySequence( |
1483 act.setShortcut(QKeySequence( |
1405 QApplication.translate('ViewManager', 'Ctrl+Home'))) |
1484 QApplication.translate('ViewManager', 'Ctrl+Home'))) |
1406 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART) |
1485 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART) |
1407 act.triggered[()].connect(self.esm.map) |
1486 act.triggered[()].connect(self.esm.map) |
1408 self.editActions.append(act) |
1487 self.editActions.append(act) |
1409 |
1488 |
1410 act = E5Action(QApplication.translate('ViewManager', 'Move to end of document'), |
1489 act = E5Action( |
1411 QApplication.translate('ViewManager', 'Move to end of document'), |
1490 QApplication.translate('ViewManager', 'Move to end of document'), |
1412 0, 0, |
1491 QApplication.translate('ViewManager', 'Move to end of document'), |
1413 self.editorActGrp, 'vm_edit_move_end_text') |
1492 0, 0, |
|
1493 self.editorActGrp, 'vm_edit_move_end_text') |
1414 if isMacPlatform(): |
1494 if isMacPlatform(): |
1415 act.setShortcut(QKeySequence( |
1495 act.setShortcut(QKeySequence( |
1416 QApplication.translate('ViewManager', 'Ctrl+Down'))) |
1496 QApplication.translate('ViewManager', 'Ctrl+Down'))) |
1417 else: |
1497 else: |
1418 act.setShortcut(QKeySequence( |
1498 act.setShortcut(QKeySequence( |
1419 QApplication.translate('ViewManager', 'Ctrl+End'))) |
1499 QApplication.translate('ViewManager', 'Ctrl+End'))) |
1420 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND) |
1500 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND) |
1421 act.triggered[()].connect(self.esm.map) |
1501 act.triggered[()].connect(self.esm.map) |
1422 self.editActions.append(act) |
1502 self.editActions.append(act) |
1423 |
1503 |
1424 act = E5Action(QApplication.translate('ViewManager', 'Indent one level'), |
1504 act = E5Action( |
1425 QApplication.translate('ViewManager', 'Indent one level'), |
1505 QApplication.translate('ViewManager', 'Indent one level'), |
1426 QKeySequence(QApplication.translate('ViewManager', 'Tab')), 0, |
1506 QApplication.translate('ViewManager', 'Indent one level'), |
1427 self.editorActGrp, 'vm_edit_indent_one_level') |
1507 QKeySequence(QApplication.translate('ViewManager', 'Tab')), 0, |
|
1508 self.editorActGrp, 'vm_edit_indent_one_level') |
1428 self.esm.setMapping(act, QsciScintilla.SCI_TAB) |
1509 self.esm.setMapping(act, QsciScintilla.SCI_TAB) |
1429 act.triggered[()].connect(self.esm.map) |
1510 act.triggered[()].connect(self.esm.map) |
1430 self.editActions.append(act) |
1511 self.editActions.append(act) |
1431 |
1512 |
1432 act = E5Action(QApplication.translate('ViewManager', 'Unindent one level'), |
1513 act = E5Action( |
1433 QApplication.translate('ViewManager', 'Unindent one level'), |
1514 QApplication.translate('ViewManager', 'Unindent one level'), |
1434 QKeySequence(QApplication.translate('ViewManager', 'Shift+Tab')), 0, |
1515 QApplication.translate('ViewManager', 'Unindent one level'), |
1435 self.editorActGrp, 'vm_edit_unindent_one_level') |
1516 QKeySequence(QApplication.translate('ViewManager', 'Shift+Tab')), |
|
1517 0, |
|
1518 self.editorActGrp, 'vm_edit_unindent_one_level') |
1436 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB) |
1519 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB) |
1437 act.triggered[()].connect(self.esm.map) |
1520 act.triggered[()].connect(self.esm.map) |
1438 self.editActions.append(act) |
1521 self.editActions.append(act) |
1439 |
1522 |
1440 act = E5Action(QApplication.translate('ViewManager', |
1523 act = E5Action( |
1441 'Extend selection left one character'), |
1524 QApplication.translate( |
1442 QApplication.translate('ViewManager', |
1525 'ViewManager', 'Extend selection left one character'), |
1443 'Extend selection left one character'), |
1526 QApplication.translate( |
1444 QKeySequence(QApplication.translate('ViewManager', 'Shift+Left')), |
1527 'ViewManager', 'Extend selection left one character'), |
1445 0, |
1528 QKeySequence(QApplication.translate('ViewManager', 'Shift+Left')), |
1446 self.editorActGrp, 'vm_edit_extend_selection_left_char') |
1529 0, |
|
1530 self.editorActGrp, 'vm_edit_extend_selection_left_char') |
1447 if isMacPlatform(): |
1531 if isMacPlatform(): |
1448 act.setAlternateShortcut(QKeySequence( |
1532 act.setAlternateShortcut(QKeySequence( |
1449 QApplication.translate('ViewManager', 'Meta+Shift+B'))) |
1533 QApplication.translate('ViewManager', 'Meta+Shift+B'))) |
1450 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND) |
1534 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND) |
1451 act.triggered[()].connect(self.esm.map) |
1535 act.triggered[()].connect(self.esm.map) |
1452 self.editActions.append(act) |
1536 self.editActions.append(act) |
1453 |
1537 |
1454 act = E5Action(QApplication.translate('ViewManager', |
1538 act = E5Action( |
1455 'Extend selection right one character'), |
1539 QApplication.translate( |
1456 QApplication.translate('ViewManager', |
1540 'ViewManager', 'Extend selection right one character'), |
1457 'Extend selection right one character'), |
1541 QApplication.translate( |
1458 QKeySequence(QApplication.translate('ViewManager', 'Shift+Right')), |
1542 'ViewManager', 'Extend selection right one character'), |
1459 0, |
1543 QKeySequence(QApplication.translate('ViewManager', 'Shift+Right')), |
1460 self.editorActGrp, 'vm_edit_extend_selection_right_char') |
1544 0, |
|
1545 self.editorActGrp, 'vm_edit_extend_selection_right_char') |
1461 if isMacPlatform(): |
1546 if isMacPlatform(): |
1462 act.setAlternateShortcut(QKeySequence( |
1547 act.setAlternateShortcut(QKeySequence( |
1463 QApplication.translate('ViewManager', 'Meta+Shift+F'))) |
1548 QApplication.translate('ViewManager', 'Meta+Shift+F'))) |
1464 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND) |
1549 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND) |
1465 act.triggered[()].connect(self.esm.map) |
1550 act.triggered[()].connect(self.esm.map) |
1466 self.editActions.append(act) |
1551 self.editActions.append(act) |
1467 |
1552 |
1468 act = E5Action(QApplication.translate('ViewManager', |
1553 act = E5Action( |
1469 'Extend selection up one line'), |
1554 QApplication.translate( |
1470 QApplication.translate('ViewManager', |
1555 'ViewManager', 'Extend selection up one line'), |
1471 'Extend selection up one line'), |
1556 QApplication.translate( |
1472 QKeySequence(QApplication.translate('ViewManager', 'Shift+Up')), 0, |
1557 'ViewManager', 'Extend selection up one line'), |
1473 self.editorActGrp, 'vm_edit_extend_selection_up_line') |
1558 QKeySequence(QApplication.translate('ViewManager', 'Shift+Up')), 0, |
|
1559 self.editorActGrp, 'vm_edit_extend_selection_up_line') |
1474 if isMacPlatform(): |
1560 if isMacPlatform(): |
1475 act.setAlternateShortcut(QKeySequence( |
1561 act.setAlternateShortcut(QKeySequence( |
1476 QApplication.translate('ViewManager', 'Meta+Shift+P'))) |
1562 QApplication.translate('ViewManager', 'Meta+Shift+P'))) |
1477 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND) |
1563 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND) |
1478 act.triggered[()].connect(self.esm.map) |
1564 act.triggered[()].connect(self.esm.map) |
1479 self.editActions.append(act) |
1565 self.editActions.append(act) |
1480 |
1566 |
1481 act = E5Action(QApplication.translate('ViewManager', |
1567 act = E5Action( |
1482 'Extend selection down one line'), |
1568 QApplication.translate( |
1483 QApplication.translate('ViewManager', |
1569 'ViewManager', 'Extend selection down one line'), |
1484 'Extend selection down one line'), |
1570 QApplication.translate( |
1485 QKeySequence(QApplication.translate('ViewManager', 'Shift+Down')), |
1571 'ViewManager', 'Extend selection down one line'), |
1486 0, |
1572 QKeySequence(QApplication.translate('ViewManager', 'Shift+Down')), |
1487 self.editorActGrp, 'vm_edit_extend_selection_down_line') |
1573 0, |
|
1574 self.editorActGrp, 'vm_edit_extend_selection_down_line') |
1488 if isMacPlatform(): |
1575 if isMacPlatform(): |
1489 act.setAlternateShortcut(QKeySequence( |
1576 act.setAlternateShortcut(QKeySequence( |
1490 QApplication.translate('ViewManager', 'Meta+Shift+N'))) |
1577 QApplication.translate('ViewManager', 'Meta+Shift+N'))) |
1491 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND) |
1578 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND) |
1492 act.triggered[()].connect(self.esm.map) |
1579 act.triggered[()].connect(self.esm.map) |
1493 self.editActions.append(act) |
1580 self.editActions.append(act) |
1494 |
1581 |
1495 act = E5Action(QApplication.translate('ViewManager', |
1582 act = E5Action( |
1496 'Extend selection left one word part'), |
1583 QApplication.translate( |
1497 QApplication.translate('ViewManager', |
1584 'ViewManager', 'Extend selection left one word part'), |
1498 'Extend selection left one word part'), |
1585 QApplication.translate( |
1499 0, 0, |
1586 'ViewManager', 'Extend selection left one word part'), |
1500 self.editorActGrp, 'vm_edit_extend_selection_left_word_part') |
1587 0, 0, |
|
1588 self.editorActGrp, 'vm_edit_extend_selection_left_word_part') |
1501 if not isMacPlatform(): |
1589 if not isMacPlatform(): |
1502 act.setShortcut(QKeySequence( |
1590 act.setShortcut(QKeySequence( |
1503 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) |
1591 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) |
1504 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND) |
1592 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND) |
1505 act.triggered[()].connect(self.esm.map) |
1593 act.triggered[()].connect(self.esm.map) |
1506 self.editActions.append(act) |
1594 self.editActions.append(act) |
1507 |
1595 |
1508 act = E5Action(QApplication.translate('ViewManager', |
1596 act = E5Action( |
1509 'Extend selection right one word part'), |
1597 QApplication.translate( |
1510 QApplication.translate('ViewManager', |
1598 'ViewManager', 'Extend selection right one word part'), |
1511 'Extend selection right one word part'), |
1599 QApplication.translate( |
1512 0, 0, |
1600 'ViewManager', 'Extend selection right one word part'), |
1513 self.editorActGrp, 'vm_edit_extend_selection_right_word_part') |
1601 0, 0, |
|
1602 self.editorActGrp, 'vm_edit_extend_selection_right_word_part') |
1514 if not isMacPlatform(): |
1603 if not isMacPlatform(): |
1515 act.setShortcut(QKeySequence( |
1604 act.setShortcut(QKeySequence( |
1516 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) |
1605 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) |
1517 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND) |
1606 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND) |
1518 act.triggered[()].connect(self.esm.map) |
1607 act.triggered[()].connect(self.esm.map) |
1657 QApplication.translate('ViewManager', 'Ctrl+Shift+End'))) |
1756 QApplication.translate('ViewManager', 'Ctrl+Shift+End'))) |
1658 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND) |
1757 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND) |
1659 act.triggered[()].connect(self.esm.map) |
1758 act.triggered[()].connect(self.esm.map) |
1660 self.editActions.append(act) |
1759 self.editActions.append(act) |
1661 |
1760 |
1662 act = E5Action(QApplication.translate('ViewManager', |
1761 act = E5Action( |
1663 'Delete previous character'), |
1762 QApplication.translate('ViewManager', 'Delete previous character'), |
1664 QApplication.translate('ViewManager', 'Delete previous character'), |
1763 QApplication.translate('ViewManager', 'Delete previous character'), |
1665 QKeySequence(QApplication.translate('ViewManager', 'Backspace')), |
1764 QKeySequence(QApplication.translate('ViewManager', 'Backspace')), |
1666 0, |
1765 0, |
1667 self.editorActGrp, 'vm_edit_delete_previous_char') |
1766 self.editorActGrp, 'vm_edit_delete_previous_char') |
1668 if isMacPlatform(): |
1767 if isMacPlatform(): |
1669 act.setAlternateShortcut(QKeySequence( |
1768 act.setAlternateShortcut(QKeySequence( |
1670 QApplication.translate('ViewManager', 'Meta+H'))) |
1769 QApplication.translate('ViewManager', 'Meta+H'))) |
1671 else: |
1770 else: |
1672 act.setAlternateShortcut(QKeySequence( |
1771 act.setAlternateShortcut(QKeySequence( |
1673 QApplication.translate('ViewManager', 'Shift+Backspace'))) |
1772 QApplication.translate('ViewManager', 'Shift+Backspace'))) |
1674 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK) |
1773 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK) |
1675 act.triggered[()].connect(self.esm.map) |
1774 act.triggered[()].connect(self.esm.map) |
1676 self.editActions.append(act) |
1775 self.editActions.append(act) |
1677 |
1776 |
1678 act = E5Action(QApplication.translate('ViewManager', |
1777 act = E5Action( |
1679 'Delete previous character if not at start of line'), |
1778 QApplication.translate( |
1680 QApplication.translate('ViewManager', |
1779 'ViewManager', |
1681 'Delete previous character if not at start of line'), |
1780 'Delete previous character if not at start of line'), |
1682 0, 0, |
1781 QApplication.translate( |
1683 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start') |
1782 'ViewManager', |
|
1783 'Delete previous character if not at start of line'), |
|
1784 0, 0, |
|
1785 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start') |
1684 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE) |
1786 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE) |
1685 act.triggered[()].connect(self.esm.map) |
1787 act.triggered[()].connect(self.esm.map) |
1686 self.editActions.append(act) |
1788 self.editActions.append(act) |
1687 |
1789 |
1688 act = E5Action(QApplication.translate('ViewManager', 'Delete current character'), |
1790 act = E5Action( |
1689 QApplication.translate('ViewManager', 'Delete current character'), |
1791 QApplication.translate('ViewManager', 'Delete current character'), |
1690 QKeySequence(QApplication.translate('ViewManager', 'Del')), 0, |
1792 QApplication.translate('ViewManager', 'Delete current character'), |
1691 self.editorActGrp, 'vm_edit_delete_current_char') |
1793 QKeySequence(QApplication.translate('ViewManager', 'Del')), 0, |
|
1794 self.editorActGrp, 'vm_edit_delete_current_char') |
1692 if isMacPlatform(): |
1795 if isMacPlatform(): |
1693 act.setAlternateShortcut(QKeySequence( |
1796 act.setAlternateShortcut(QKeySequence( |
1694 QApplication.translate('ViewManager', 'Meta+D'))) |
1797 QApplication.translate('ViewManager', 'Meta+D'))) |
1695 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR) |
1798 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR) |
1696 act.triggered[()].connect(self.esm.map) |
1799 act.triggered[()].connect(self.esm.map) |
1697 self.editActions.append(act) |
1800 self.editActions.append(act) |
1698 |
1801 |
1699 act = E5Action(QApplication.translate('ViewManager', 'Delete word to left'), |
1802 act = E5Action( |
1700 QApplication.translate('ViewManager', 'Delete word to left'), |
1803 QApplication.translate('ViewManager', 'Delete word to left'), |
1701 QKeySequence(QApplication.translate('ViewManager', |
1804 QApplication.translate('ViewManager', 'Delete word to left'), |
1702 'Ctrl+Backspace')), |
1805 QKeySequence(QApplication.translate( |
1703 0, |
1806 'ViewManager', 'Ctrl+Backspace')), |
1704 self.editorActGrp, 'vm_edit_delete_word_left') |
1807 0, |
|
1808 self.editorActGrp, 'vm_edit_delete_word_left') |
1705 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT) |
1809 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT) |
1706 act.triggered[()].connect(self.esm.map) |
1810 act.triggered[()].connect(self.esm.map) |
1707 self.editActions.append(act) |
1811 self.editActions.append(act) |
1708 |
1812 |
1709 act = E5Action(QApplication.translate('ViewManager', 'Delete word to right'), |
1813 act = E5Action( |
1710 QApplication.translate('ViewManager', 'Delete word to right'), |
1814 QApplication.translate('ViewManager', 'Delete word to right'), |
1711 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Del')), 0, |
1815 QApplication.translate('ViewManager', 'Delete word to right'), |
1712 self.editorActGrp, 'vm_edit_delete_word_right') |
1816 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Del')), 0, |
|
1817 self.editorActGrp, 'vm_edit_delete_word_right') |
1713 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT) |
1818 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT) |
1714 act.triggered[()].connect(self.esm.map) |
1819 act.triggered[()].connect(self.esm.map) |
1715 self.editActions.append(act) |
1820 self.editActions.append(act) |
1716 |
1821 |
1717 act = E5Action(QApplication.translate('ViewManager', 'Delete line to left'), |
1822 act = E5Action( |
1718 QApplication.translate('ViewManager', 'Delete line to left'), |
1823 QApplication.translate('ViewManager', 'Delete line to left'), |
1719 QKeySequence(QApplication.translate('ViewManager', |
1824 QApplication.translate('ViewManager', 'Delete line to left'), |
1720 'Ctrl+Shift+Backspace')), |
1825 QKeySequence(QApplication.translate( |
1721 0, |
1826 'ViewManager', 'Ctrl+Shift+Backspace')), |
1722 self.editorActGrp, 'vm_edit_delete_line_left') |
1827 0, |
|
1828 self.editorActGrp, 'vm_edit_delete_line_left') |
1723 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT) |
1829 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT) |
1724 act.triggered[()].connect(self.esm.map) |
1830 act.triggered[()].connect(self.esm.map) |
1725 self.editActions.append(act) |
1831 self.editActions.append(act) |
1726 |
1832 |
1727 act = E5Action(QApplication.translate('ViewManager', 'Delete line to right'), |
1833 act = E5Action( |
1728 QApplication.translate('ViewManager', 'Delete line to right'), |
1834 QApplication.translate('ViewManager', 'Delete line to right'), |
1729 0, 0, |
1835 QApplication.translate('ViewManager', 'Delete line to right'), |
1730 self.editorActGrp, 'vm_edit_delete_line_right') |
1836 0, 0, |
|
1837 self.editorActGrp, 'vm_edit_delete_line_right') |
1731 if isMacPlatform(): |
1838 if isMacPlatform(): |
1732 act.setShortcut(QKeySequence( |
1839 act.setShortcut(QKeySequence( |
1733 QApplication.translate('ViewManager', 'Meta+K'))) |
1840 QApplication.translate('ViewManager', 'Meta+K'))) |
1734 else: |
1841 else: |
1735 act.setShortcut(QKeySequence( |
1842 act.setShortcut(QKeySequence( |
1736 QApplication.translate('ViewManager', 'Ctrl+Shift+Del'))) |
1843 QApplication.translate('ViewManager', 'Ctrl+Shift+Del'))) |
1737 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT) |
1844 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT) |
1738 act.triggered[()].connect(self.esm.map) |
1845 act.triggered[()].connect(self.esm.map) |
1739 self.editActions.append(act) |
1846 self.editActions.append(act) |
1740 |
1847 |
1741 act = E5Action(QApplication.translate('ViewManager', 'Insert new line'), |
1848 act = E5Action( |
1742 QApplication.translate('ViewManager', 'Insert new line'), |
1849 QApplication.translate('ViewManager', 'Insert new line'), |
1743 QKeySequence(QApplication.translate('ViewManager', 'Return')), |
1850 QApplication.translate('ViewManager', 'Insert new line'), |
1744 QKeySequence(QApplication.translate('ViewManager', 'Enter')), |
1851 QKeySequence(QApplication.translate('ViewManager', 'Return')), |
1745 self.editorActGrp, 'vm_edit_insert_line') |
1852 QKeySequence(QApplication.translate('ViewManager', 'Enter')), |
|
1853 self.editorActGrp, 'vm_edit_insert_line') |
1746 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE) |
1854 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE) |
1747 act.triggered[()].connect(self.esm.map) |
1855 act.triggered[()].connect(self.esm.map) |
1748 self.editActions.append(act) |
1856 self.editActions.append(act) |
1749 |
1857 |
1750 act = E5Action(QApplication.translate('ViewManager', |
1858 act = E5Action( |
1751 'Insert new line below current line'), |
1859 QApplication.translate( |
1752 QApplication.translate('ViewManager', |
1860 'ViewManager', 'Insert new line below current line'), |
1753 'Insert new line below current line'), |
1861 QApplication.translate( |
1754 QKeySequence(QApplication.translate('ViewManager', 'Shift+Return')), |
1862 'ViewManager', 'Insert new line below current line'), |
1755 QKeySequence(QApplication.translate('ViewManager', 'Shift+Enter')), |
1863 QKeySequence(QApplication.translate( |
1756 self.editorActGrp, 'vm_edit_insert_line_below') |
1864 'ViewManager', 'Shift+Return')), |
|
1865 QKeySequence(QApplication.translate('ViewManager', 'Shift+Enter')), |
|
1866 self.editorActGrp, 'vm_edit_insert_line_below') |
1757 act.triggered[()].connect(self.__newLineBelow) |
1867 act.triggered[()].connect(self.__newLineBelow) |
1758 self.editActions.append(act) |
1868 self.editActions.append(act) |
1759 |
1869 |
1760 act = E5Action(QApplication.translate('ViewManager', 'Delete current line'), |
1870 act = E5Action( |
1761 QApplication.translate('ViewManager', 'Delete current line'), |
1871 QApplication.translate('ViewManager', 'Delete current line'), |
1762 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+L')), |
1872 QApplication.translate('ViewManager', 'Delete current line'), |
1763 0, |
1873 QKeySequence(QApplication.translate( |
1764 self.editorActGrp, 'vm_edit_delete_current_line') |
1874 'ViewManager', 'Ctrl+Shift+L')), |
|
1875 0, |
|
1876 self.editorActGrp, 'vm_edit_delete_current_line') |
1765 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE) |
1877 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE) |
1766 act.triggered[()].connect(self.esm.map) |
1878 act.triggered[()].connect(self.esm.map) |
1767 self.editActions.append(act) |
1879 self.editActions.append(act) |
1768 |
1880 |
1769 act = E5Action(QApplication.translate('ViewManager', 'Duplicate current line'), |
1881 act = E5Action( |
1770 QApplication.translate('ViewManager', 'Duplicate current line'), |
1882 QApplication.translate('ViewManager', 'Duplicate current line'), |
1771 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+D')), 0, |
1883 QApplication.translate('ViewManager', 'Duplicate current line'), |
1772 self.editorActGrp, 'vm_edit_duplicate_current_line') |
1884 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+D')), 0, |
|
1885 self.editorActGrp, 'vm_edit_duplicate_current_line') |
1773 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE) |
1886 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE) |
1774 act.triggered[()].connect(self.esm.map) |
1887 act.triggered[()].connect(self.esm.map) |
1775 self.editActions.append(act) |
1888 self.editActions.append(act) |
1776 |
1889 |
1777 act = E5Action(QApplication.translate('ViewManager', |
1890 act = E5Action( |
1778 'Swap current and previous lines'), |
1891 QApplication.translate( |
1779 QApplication.translate('ViewManager', |
1892 'ViewManager', 'Swap current and previous lines'), |
1780 'Swap current and previous lines'), |
1893 QApplication.translate( |
1781 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+T')), 0, |
1894 'ViewManager', 'Swap current and previous lines'), |
1782 self.editorActGrp, 'vm_edit_swap_current_previous_line') |
1895 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+T')), 0, |
|
1896 self.editorActGrp, 'vm_edit_swap_current_previous_line') |
1783 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE) |
1897 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE) |
1784 act.triggered[()].connect(self.esm.map) |
1898 act.triggered[()].connect(self.esm.map) |
1785 self.editActions.append(act) |
1899 self.editActions.append(act) |
1786 |
1900 |
1787 act = E5Action(QApplication.translate('ViewManager', 'Cut current line'), |
1901 act = E5Action( |
1788 QApplication.translate('ViewManager', 'Cut current line'), |
1902 QApplication.translate('ViewManager', 'Cut current line'), |
1789 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+L')), |
1903 QApplication.translate('ViewManager', 'Cut current line'), |
1790 0, |
1904 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+L')), |
1791 self.editorActGrp, 'vm_edit_cut_current_line') |
1905 0, |
|
1906 self.editorActGrp, 'vm_edit_cut_current_line') |
1792 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT) |
1907 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT) |
1793 act.triggered[()].connect(self.esm.map) |
1908 act.triggered[()].connect(self.esm.map) |
1794 self.editActions.append(act) |
1909 self.editActions.append(act) |
1795 |
1910 |
1796 act = E5Action(QApplication.translate('ViewManager', 'Copy current line'), |
1911 act = E5Action( |
1797 QApplication.translate('ViewManager', 'Copy current line'), |
1912 QApplication.translate('ViewManager', 'Copy current line'), |
1798 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+T')), |
1913 QApplication.translate('ViewManager', 'Copy current line'), |
1799 0, |
1914 QKeySequence(QApplication.translate( |
1800 self.editorActGrp, 'vm_edit_copy_current_line') |
1915 'ViewManager', 'Ctrl+Shift+T')), |
|
1916 0, |
|
1917 self.editorActGrp, 'vm_edit_copy_current_line') |
1801 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY) |
1918 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY) |
1802 act.triggered[()].connect(self.esm.map) |
1919 act.triggered[()].connect(self.esm.map) |
1803 self.editActions.append(act) |
1920 self.editActions.append(act) |
1804 |
1921 |
1805 act = E5Action(QApplication.translate('ViewManager', 'Toggle insert/overtype'), |
1922 act = E5Action( |
1806 QApplication.translate('ViewManager', 'Toggle insert/overtype'), |
1923 QApplication.translate('ViewManager', 'Toggle insert/overtype'), |
1807 QKeySequence(QApplication.translate('ViewManager', 'Ins')), 0, |
1924 QApplication.translate('ViewManager', 'Toggle insert/overtype'), |
1808 self.editorActGrp, 'vm_edit_toggle_insert_overtype') |
1925 QKeySequence(QApplication.translate('ViewManager', 'Ins')), 0, |
|
1926 self.editorActGrp, 'vm_edit_toggle_insert_overtype') |
1809 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE) |
1927 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE) |
1810 act.triggered[()].connect(self.esm.map) |
1928 act.triggered[()].connect(self.esm.map) |
1811 self.editActions.append(act) |
1929 self.editActions.append(act) |
1812 |
1930 |
1813 act = E5Action(QApplication.translate('ViewManager', |
1931 act = E5Action(QApplication.translate('ViewManager', |
1845 self.editorActGrp, 'vm_edit_formfeed') |
1964 self.editorActGrp, 'vm_edit_formfeed') |
1846 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) |
1965 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) |
1847 act.triggered[()].connect(self.esm.map) |
1966 act.triggered[()].connect(self.esm.map) |
1848 self.editActions.append(act) |
1967 self.editActions.append(act) |
1849 |
1968 |
1850 act = E5Action(QApplication.translate('ViewManager', 'Escape'), |
1969 act = E5Action( |
1851 QApplication.translate('ViewManager', 'Escape'), |
1970 QApplication.translate('ViewManager', 'Escape'), |
1852 QKeySequence(QApplication.translate('ViewManager', 'Esc')), 0, |
1971 QApplication.translate('ViewManager', 'Escape'), |
1853 self.editorActGrp, 'vm_edit_escape') |
1972 QKeySequence(QApplication.translate('ViewManager', 'Esc')), 0, |
|
1973 self.editorActGrp, 'vm_edit_escape') |
1854 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL) |
1974 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL) |
1855 act.triggered[()].connect(self.esm.map) |
1975 act.triggered[()].connect(self.esm.map) |
1856 self.editActions.append(act) |
1976 self.editActions.append(act) |
1857 |
1977 |
1858 act = E5Action(QApplication.translate('ViewManager', |
1978 act = E5Action( |
1859 'Extend rectangular selection down one line'), |
1979 QApplication.translate( |
1860 QApplication.translate('ViewManager', |
1980 'ViewManager', 'Extend rectangular selection down one line'), |
1861 'Extend rectangular selection down one line'), |
1981 QApplication.translate( |
1862 QKeySequence(QApplication.translate('ViewManager', |
1982 'ViewManager', 'Extend rectangular selection down one line'), |
1863 'Alt+Ctrl+Down')), |
1983 QKeySequence(QApplication.translate( |
1864 0, |
1984 'ViewManager', 'Alt+Ctrl+Down')), |
1865 self.editorActGrp, 'vm_edit_extend_rect_selection_down_line') |
1985 0, |
|
1986 self.editorActGrp, 'vm_edit_extend_rect_selection_down_line') |
1866 if isMacPlatform(): |
1987 if isMacPlatform(): |
1867 act.setAlternateShortcut(QKeySequence( |
1988 act.setAlternateShortcut(QKeySequence( |
1868 QApplication.translate('ViewManager', 'Meta+Alt+Shift+N'))) |
1989 QApplication.translate('ViewManager', 'Meta+Alt+Shift+N'))) |
1869 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND) |
1990 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND) |
1870 act.triggered[()].connect(self.esm.map) |
1991 act.triggered[()].connect(self.esm.map) |
1871 self.editActions.append(act) |
1992 self.editActions.append(act) |
1872 |
1993 |
1873 act = E5Action(QApplication.translate('ViewManager', |
1994 act = E5Action( |
1874 'Extend rectangular selection up one line'), |
1995 QApplication.translate( |
1875 QApplication.translate('ViewManager', |
1996 'ViewManager', 'Extend rectangular selection up one line'), |
1876 'Extend rectangular selection up one line'), |
1997 QApplication.translate( |
1877 QKeySequence(QApplication.translate('ViewManager', 'Alt+Ctrl+Up')), |
1998 'ViewManager', 'Extend rectangular selection up one line'), |
1878 0, |
1999 QKeySequence(QApplication.translate('ViewManager', 'Alt+Ctrl+Up')), |
1879 self.editorActGrp, 'vm_edit_extend_rect_selection_up_line') |
2000 0, |
|
2001 self.editorActGrp, 'vm_edit_extend_rect_selection_up_line') |
1880 if isMacPlatform(): |
2002 if isMacPlatform(): |
1881 act.setAlternateShortcut(QKeySequence( |
2003 act.setAlternateShortcut(QKeySequence( |
1882 QApplication.translate('ViewManager', 'Meta+Alt+Shift+P'))) |
2004 QApplication.translate('ViewManager', 'Meta+Alt+Shift+P'))) |
1883 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND) |
2005 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND) |
1884 act.triggered[()].connect(self.esm.map) |
2006 act.triggered[()].connect(self.esm.map) |
1885 self.editActions.append(act) |
2007 self.editActions.append(act) |
1886 |
2008 |
1887 act = E5Action(QApplication.translate('ViewManager', |
2009 act = E5Action( |
1888 'Extend rectangular selection left one character'), |
2010 QApplication.translate( |
1889 QApplication.translate('ViewManager', |
2011 'ViewManager', |
1890 'Extend rectangular selection left one character'), |
2012 'Extend rectangular selection left one character'), |
1891 QKeySequence(QApplication.translate('ViewManager', |
2013 QApplication.translate( |
1892 'Alt+Ctrl+Left')), |
2014 'ViewManager', |
1893 0, |
2015 'Extend rectangular selection left one character'), |
1894 self.editorActGrp, 'vm_edit_extend_rect_selection_left_char') |
2016 QKeySequence(QApplication.translate( |
|
2017 'ViewManager', 'Alt+Ctrl+Left')), |
|
2018 0, |
|
2019 self.editorActGrp, 'vm_edit_extend_rect_selection_left_char') |
1895 if isMacPlatform(): |
2020 if isMacPlatform(): |
1896 act.setAlternateShortcut(QKeySequence( |
2021 act.setAlternateShortcut(QKeySequence( |
1897 QApplication.translate('ViewManager', 'Meta+Alt+Shift+B'))) |
2022 QApplication.translate('ViewManager', 'Meta+Alt+Shift+B'))) |
1898 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND) |
2023 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND) |
1899 act.triggered[()].connect(self.esm.map) |
2024 act.triggered[()].connect(self.esm.map) |
1900 self.editActions.append(act) |
2025 self.editActions.append(act) |
1901 |
2026 |
1902 act = E5Action(QApplication.translate('ViewManager', |
2027 act = E5Action( |
1903 'Extend rectangular selection right one character'), |
2028 QApplication.translate( |
1904 QApplication.translate('ViewManager', |
2029 'ViewManager', |
1905 'Extend rectangular selection right one character'), |
2030 'Extend rectangular selection right one character'), |
1906 QKeySequence(QApplication.translate('ViewManager', |
2031 QApplication.translate( |
1907 'Alt+Ctrl+Right')), |
2032 'ViewManager', |
1908 0, |
2033 'Extend rectangular selection right one character'), |
1909 self.editorActGrp, 'vm_edit_extend_rect_selection_right_char') |
2034 QKeySequence(QApplication.translate( |
|
2035 'ViewManager', 'Alt+Ctrl+Right')), |
|
2036 0, |
|
2037 self.editorActGrp, 'vm_edit_extend_rect_selection_right_char') |
1910 if isMacPlatform(): |
2038 if isMacPlatform(): |
1911 act.setAlternateShortcut(QKeySequence( |
2039 act.setAlternateShortcut(QKeySequence( |
1912 QApplication.translate('ViewManager', 'Meta+Alt+Shift+F'))) |
2040 QApplication.translate('ViewManager', 'Meta+Alt+Shift+F'))) |
1913 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND) |
2041 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND) |
1914 act.triggered[()].connect(self.esm.map) |
2042 act.triggered[()].connect(self.esm.map) |
1928 QApplication.translate('ViewManager', 'Alt+Shift+Home'))) |
2056 QApplication.translate('ViewManager', 'Alt+Shift+Home'))) |
1929 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND) |
2057 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND) |
1930 act.triggered[()].connect(self.esm.map) |
2058 act.triggered[()].connect(self.esm.map) |
1931 self.editActions.append(act) |
2059 self.editActions.append(act) |
1932 |
2060 |
1933 act = E5Action(QApplication.translate('ViewManager', |
2061 act = E5Action( |
1934 'Extend rectangular selection to end of document line'), |
2062 QApplication.translate( |
1935 QApplication.translate('ViewManager', |
2063 'ViewManager', |
1936 'Extend rectangular selection to end of document line'), |
2064 'Extend rectangular selection to end of document line'), |
1937 0, 0, |
2065 QApplication.translate( |
1938 self.editorActGrp, 'vm_edit_extend_rect_selection_end_line') |
2066 'ViewManager', |
|
2067 'Extend rectangular selection to end of document line'), |
|
2068 0, 0, |
|
2069 self.editorActGrp, 'vm_edit_extend_rect_selection_end_line') |
1939 if isMacPlatform(): |
2070 if isMacPlatform(): |
1940 act.setShortcut(QKeySequence( |
2071 act.setShortcut(QKeySequence( |
1941 QApplication.translate('ViewManager', 'Meta+Alt+Shift+E'))) |
2072 QApplication.translate('ViewManager', 'Meta+Alt+Shift+E'))) |
1942 else: |
2073 else: |
1943 act.setShortcut(QKeySequence( |
2074 act.setShortcut(QKeySequence( |
1944 QApplication.translate('ViewManager', 'Alt+Shift+End'))) |
2075 QApplication.translate('ViewManager', 'Alt+Shift+End'))) |
1945 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND) |
2076 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND) |
1946 act.triggered[()].connect(self.esm.map) |
2077 act.triggered[()].connect(self.esm.map) |
1947 self.editActions.append(act) |
2078 self.editActions.append(act) |
1948 |
2079 |
1949 act = E5Action(QApplication.translate('ViewManager', |
2080 act = E5Action( |
1950 'Extend rectangular selection up one page'), |
2081 QApplication.translate( |
1951 QApplication.translate('ViewManager', |
2082 'ViewManager', |
1952 'Extend rectangular selection up one page'), |
2083 'Extend rectangular selection up one page'), |
1953 QKeySequence(QApplication.translate('ViewManager', |
2084 QApplication.translate( |
1954 'Alt+Shift+PgUp')), |
2085 'ViewManager', |
1955 0, |
2086 'Extend rectangular selection up one page'), |
1956 self.editorActGrp, 'vm_edit_extend_rect_selection_up_page') |
2087 QKeySequence(QApplication.translate( |
|
2088 'ViewManager', 'Alt+Shift+PgUp')), |
|
2089 0, |
|
2090 self.editorActGrp, 'vm_edit_extend_rect_selection_up_page') |
1957 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND) |
2091 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND) |
1958 act.triggered[()].connect(self.esm.map) |
2092 act.triggered[()].connect(self.esm.map) |
1959 self.editActions.append(act) |
2093 self.editActions.append(act) |
1960 |
2094 |
1961 act = E5Action(QApplication.translate('ViewManager', |
2095 act = E5Action( |
1962 'Extend rectangular selection down one page'), |
2096 QApplication.translate( |
1963 QApplication.translate('ViewManager', |
2097 'ViewManager', |
1964 'Extend rectangular selection down one page'), |
2098 'Extend rectangular selection down one page'), |
1965 QKeySequence(QApplication.translate('ViewManager', |
2099 QApplication.translate( |
1966 'Alt+Shift+PgDown')), |
2100 'ViewManager', |
1967 0, |
2101 'Extend rectangular selection down one page'), |
1968 self.editorActGrp, 'vm_edit_extend_rect_selection_down_page') |
2102 QKeySequence(QApplication.translate( |
|
2103 'ViewManager', 'Alt+Shift+PgDown')), |
|
2104 0, |
|
2105 self.editorActGrp, 'vm_edit_extend_rect_selection_down_page') |
1969 if isMacPlatform(): |
2106 if isMacPlatform(): |
1970 act.setAlternateShortcut(QKeySequence( |
2107 act.setAlternateShortcut(QKeySequence( |
1971 QApplication.translate('ViewManager', 'Meta+Alt+Shift+V'))) |
2108 QApplication.translate('ViewManager', 'Meta+Alt+Shift+V'))) |
1972 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND) |
2109 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND) |
1973 act.triggered[()].connect(self.esm.map) |
2110 act.triggered[()].connect(self.esm.map) |
1974 self.editActions.append(act) |
2111 self.editActions.append(act) |
1975 |
2112 |
1976 act = E5Action(QApplication.translate('ViewManager', |
2113 act = E5Action( |
1977 'Duplicate current selection'), |
2114 QApplication.translate( |
1978 QApplication.translate('ViewManager', |
2115 'ViewManager', 'Duplicate current selection'), |
1979 'Duplicate current selection'), |
2116 QApplication.translate( |
1980 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+D')), |
2117 'ViewManager', 'Duplicate current selection'), |
1981 0, |
2118 QKeySequence(QApplication.translate( |
1982 self.editorActGrp, 'vm_edit_duplicate_current_selection') |
2119 'ViewManager', 'Ctrl+Shift+D')), |
|
2120 0, |
|
2121 self.editorActGrp, 'vm_edit_duplicate_current_selection') |
1983 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) |
2122 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) |
1984 act.triggered[()].connect(self.esm.map) |
2123 act.triggered[()].connect(self.esm.map) |
1985 self.editActions.append(act) |
2124 self.editActions.append(act) |
1986 |
2125 |
1987 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"): |
2126 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"): |
2089 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
2228 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
2090 act.triggered[()].connect(self.esm.map) |
2229 act.triggered[()].connect(self.esm.map) |
2091 self.editActions.append(act) |
2230 self.editActions.append(act) |
2092 |
2231 |
2093 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"): |
2232 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"): |
2094 act = E5Action(QApplication.translate('ViewManager', |
2233 act = E5Action( |
2095 'Extend selection to start of document line'), |
2234 QApplication.translate( |
2096 QApplication.translate('ViewManager', |
2235 'ViewManager', |
2097 'Extend selection to start of document line'), |
2236 'Extend selection to start of document line'), |
2098 0, 0, |
2237 QApplication.translate( |
2099 self.editorActGrp, 'vm_edit_extend_selection_start_document_line') |
2238 'ViewManager', |
|
2239 'Extend selection to start of document line'), |
|
2240 0, 0, |
|
2241 self.editorActGrp, |
|
2242 'vm_edit_extend_selection_start_document_line') |
2100 if isMacPlatform(): |
2243 if isMacPlatform(): |
2101 act.setShortcut(QKeySequence( |
2244 act.setShortcut(QKeySequence( |
2102 QApplication.translate('ViewManager', 'Meta+Shift+A'))) |
2245 QApplication.translate('ViewManager', 'Meta+Shift+A'))) |
2103 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
2246 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
2104 act.triggered[()].connect(self.esm.map) |
2247 act.triggered[()].connect(self.esm.map) |
2105 self.editActions.append(act) |
2248 self.editActions.append(act) |
2106 |
2249 |
2107 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"): |
2250 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"): |
2108 act = E5Action(QApplication.translate('ViewManager', |
2251 act = E5Action( |
2109 'Extend rectangular selection to start of document line'), |
2252 QApplication.translate( |
2110 QApplication.translate('ViewManager', |
2253 'ViewManager', |
2111 'Extend rectangular selection to start of document line'), |
2254 'Extend rectangular selection to start of document line'), |
2112 0, 0, |
2255 QApplication.translate( |
2113 self.editorActGrp, 'vm_edit_select_rect_start_line') |
2256 'ViewManager', |
|
2257 'Extend rectangular selection to start of document line'), |
|
2258 0, 0, |
|
2259 self.editorActGrp, 'vm_edit_select_rect_start_line') |
2114 if isMacPlatform(): |
2260 if isMacPlatform(): |
2115 act.setShortcut(QKeySequence( |
2261 act.setShortcut(QKeySequence( |
2116 QApplication.translate('ViewManager', 'Meta+Alt+Shift+A'))) |
2262 QApplication.translate('ViewManager', 'Meta+Alt+Shift+A'))) |
2117 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND) |
2263 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND) |
2118 act.triggered[()].connect(self.esm.map) |
2264 act.triggered[()].connect(self.esm.map) |
2119 self.editActions.append(act) |
2265 self.editActions.append(act) |
2120 |
2266 |
2121 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"): |
2267 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"): |
2122 act = E5Action(QApplication.translate('ViewManager', |
2268 act = E5Action( |
2123 'Extend selection to start of display line'), |
2269 QApplication.translate( |
2124 QApplication.translate('ViewManager', |
2270 'ViewManager', |
2125 'Extend selection to start of display line'), |
2271 'Extend selection to start of display line'), |
2126 0, 0, |
2272 QApplication.translate( |
2127 self.editorActGrp, 'vm_edit_extend_selection_start_display_line') |
2273 'ViewManager', |
|
2274 'Extend selection to start of display line'), |
|
2275 0, 0, |
|
2276 self.editorActGrp, |
|
2277 'vm_edit_extend_selection_start_display_line') |
2128 if isMacPlatform(): |
2278 if isMacPlatform(): |
2129 act.setShortcut(QKeySequence( |
2279 act.setShortcut(QKeySequence( |
2130 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) |
2280 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) |
2131 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND) |
2281 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND) |
2132 act.triggered[()].connect(self.esm.map) |
2282 act.triggered[()].connect(self.esm.map) |
2133 self.editActions.append(act) |
2283 self.editActions.append(act) |
2134 |
2284 |
2135 if hasattr(QsciScintilla, "SCI_HOMEWRAP"): |
2285 if hasattr(QsciScintilla, "SCI_HOMEWRAP"): |
2136 act = E5Action(QApplication.translate('ViewManager', |
2286 act = E5Action( |
2137 'Move to start of display or document line'), |
2287 QApplication.translate( |
2138 QApplication.translate('ViewManager', |
2288 'ViewManager', |
2139 'Move to start of display or document line'), |
2289 'Move to start of display or document line'), |
2140 0, 0, |
2290 QApplication.translate( |
2141 self.editorActGrp, 'vm_edit_move_start_display_document_line') |
2291 'ViewManager', |
|
2292 'Move to start of display or document line'), |
|
2293 0, 0, |
|
2294 self.editorActGrp, 'vm_edit_move_start_display_document_line') |
2142 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP) |
2295 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP) |
2143 act.triggered[()].connect(self.esm.map) |
2296 act.triggered[()].connect(self.esm.map) |
2144 self.editActions.append(act) |
2297 self.editActions.append(act) |
2145 |
2298 |
2146 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"): |
2299 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"): |
2147 act = E5Action(QApplication.translate('ViewManager', |
2300 act = E5Action( |
2148 'Extend selection to start of display or document line'), |
2301 QApplication.translate( |
2149 QApplication.translate('ViewManager', |
2302 'ViewManager', |
2150 'Extend selection to start of display or document line'), |
2303 'Extend selection to start of display or document line'), |
2151 0, 0, |
2304 QApplication.translate( |
2152 self.editorActGrp, |
2305 'ViewManager', |
2153 'vm_edit_extend_selection_start_display_document_line') |
2306 'Extend selection to start of display or document line'), |
|
2307 0, 0, |
|
2308 self.editorActGrp, |
|
2309 'vm_edit_extend_selection_start_display_document_line') |
2154 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND) |
2310 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND) |
2155 act.triggered[()].connect(self.esm.map) |
2311 act.triggered[()].connect(self.esm.map) |
2156 self.editActions.append(act) |
2312 self.editActions.append(act) |
2157 |
2313 |
2158 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"): |
2314 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"): |
2238 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN) |
2405 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN) |
2239 act.triggered[()].connect(self.esm.map) |
2406 act.triggered[()].connect(self.esm.map) |
2240 self.editActions.append(act) |
2407 self.editActions.append(act) |
2241 |
2408 |
2242 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"): |
2409 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"): |
2243 act = E5Action(QApplication.translate('ViewManager', |
2410 act = E5Action( |
2244 'Stuttered extend selection down one page'), |
2411 QApplication.translate( |
2245 QApplication.translate('ViewManager', |
2412 'ViewManager', 'Stuttered extend selection down one page'), |
2246 'Stuttered extend selection down one page'), |
2413 QApplication.translate( |
2247 0, 0, |
2414 'ViewManager', 'Stuttered extend selection down one page'), |
2248 self.editorActGrp, 'vm_edit_stuttered_extend_selection_down_page') |
2415 0, 0, |
|
2416 self.editorActGrp, |
|
2417 'vm_edit_stuttered_extend_selection_down_page') |
2249 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND) |
2418 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND) |
2250 act.triggered[()].connect(self.esm.map) |
2419 act.triggered[()].connect(self.esm.map) |
2251 self.editActions.append(act) |
2420 self.editActions.append(act) |
2252 |
2421 |
2253 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"): |
2422 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"): |
2254 act = E5Action(QApplication.translate('ViewManager', |
2423 act = E5Action( |
2255 'Delete right to end of next word'), |
2424 QApplication.translate( |
2256 QApplication.translate('ViewManager', |
2425 'ViewManager', 'Delete right to end of next word'), |
2257 'Delete right to end of next word'), |
2426 QApplication.translate( |
2258 0, 0, |
2427 'ViewManager', 'Delete right to end of next word'), |
2259 self.editorActGrp, 'vm_edit_delete_right_end_next_word') |
2428 0, 0, |
|
2429 self.editorActGrp, 'vm_edit_delete_right_end_next_word') |
2260 if isMacPlatform(): |
2430 if isMacPlatform(): |
2261 act.setShortcut(QKeySequence( |
2431 act.setShortcut(QKeySequence( |
2262 QApplication.translate('ViewManager', 'Alt+Del'))) |
2432 QApplication.translate('ViewManager', 'Alt+Del'))) |
2263 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND) |
2433 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND) |
2264 act.triggered[()].connect(self.esm.map) |
2434 act.triggered[()].connect(self.esm.map) |
2265 self.editActions.append(act) |
2435 self.editActions.append(act) |
2266 |
2436 |
2267 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"): |
2437 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"): |
2268 act = E5Action(QApplication.translate('ViewManager', |
2438 act = E5Action( |
2269 'Move selected lines up one line'), |
2439 QApplication.translate( |
2270 QApplication.translate('ViewManager', |
2440 'ViewManager', 'Move selected lines up one line'), |
2271 'Move selected lines up one line'), |
2441 QApplication.translate( |
2272 0, 0, |
2442 'ViewManager', 'Move selected lines up one line'), |
2273 self.editorActGrp, 'vm_edit_move_selection_up_one_line') |
2443 0, 0, |
|
2444 self.editorActGrp, 'vm_edit_move_selection_up_one_line') |
2274 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP) |
2445 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP) |
2275 act.triggered[()].connect(self.esm.map) |
2446 act.triggered[()].connect(self.esm.map) |
2276 self.editActions.append(act) |
2447 self.editActions.append(act) |
2277 |
2448 |
2278 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"): |
2449 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"): |
2279 act = E5Action(QApplication.translate('ViewManager', |
2450 act = E5Action( |
2280 'Move selected lines down one line'), |
2451 QApplication.translate( |
2281 QApplication.translate('ViewManager', |
2452 'ViewManager', 'Move selected lines down one line'), |
2282 'Move selected lines down one line'), |
2453 QApplication.translate( |
2283 0, 0, |
2454 'ViewManager', 'Move selected lines down one line'), |
2284 self.editorActGrp, 'vm_edit_move_selection_down_one_line') |
2455 0, 0, |
|
2456 self.editorActGrp, 'vm_edit_move_selection_down_one_line') |
2285 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN) |
2457 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN) |
2286 act.triggered[()].connect(self.esm.map) |
2458 act.triggered[()].connect(self.esm.map) |
2287 self.editActions.append(act) |
2459 self.editActions.append(act) |
2288 |
2460 |
2289 self.editorActGrp.setEnabled(False) |
2461 self.editorActGrp.setEnabled(False) |
2290 |
2462 |
2291 self.editLowerCaseAct = E5Action(QApplication.translate('ViewManager', |
2463 self.editLowerCaseAct = E5Action( |
2292 'Convert selection to lower case'), |
2464 QApplication.translate( |
2293 QApplication.translate('ViewManager', |
2465 'ViewManager', 'Convert selection to lower case'), |
2294 'Convert selection to lower case'), |
2466 QApplication.translate( |
2295 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')), |
2467 'ViewManager', 'Convert selection to lower case'), |
2296 0, |
2468 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')), |
2297 self.editActGrp, 'vm_edit_convert_selection_lower') |
2469 0, |
|
2470 self.editActGrp, 'vm_edit_convert_selection_lower') |
2298 self.esm.setMapping(self.editLowerCaseAct, QsciScintilla.SCI_LOWERCASE) |
2471 self.esm.setMapping(self.editLowerCaseAct, QsciScintilla.SCI_LOWERCASE) |
2299 self.editLowerCaseAct.triggered[()].connect(self.esm.map) |
2472 self.editLowerCaseAct.triggered[()].connect(self.esm.map) |
2300 self.editActions.append(self.editLowerCaseAct) |
2473 self.editActions.append(self.editLowerCaseAct) |
2301 |
2474 |
2302 self.editUpperCaseAct = E5Action(QApplication.translate('ViewManager', |
2475 self.editUpperCaseAct = E5Action( |
2303 'Convert selection to upper case'), |
2476 QApplication.translate( |
2304 QApplication.translate('ViewManager', |
2477 'ViewManager', 'Convert selection to upper case'), |
2305 'Convert selection to upper case'), |
2478 QApplication.translate( |
2306 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+U')), |
2479 'ViewManager', 'Convert selection to upper case'), |
2307 0, |
2480 QKeySequence(QApplication.translate( |
2308 self.editActGrp, 'vm_edit_convert_selection_upper') |
2481 'ViewManager', 'Ctrl+Shift+U')), |
|
2482 0, |
|
2483 self.editActGrp, 'vm_edit_convert_selection_upper') |
2309 self.esm.setMapping(self.editUpperCaseAct, QsciScintilla.SCI_UPPERCASE) |
2484 self.esm.setMapping(self.editUpperCaseAct, QsciScintilla.SCI_UPPERCASE) |
2310 self.editUpperCaseAct.triggered[()].connect(self.esm.map) |
2485 self.editUpperCaseAct.triggered[()].connect(self.esm.map) |
2311 self.editActions.append(self.editUpperCaseAct) |
2486 self.editActions.append(self.editUpperCaseAct) |
2312 |
2487 |
2313 def initEditMenu(self): |
2488 def initEditMenu(self): |
2314 """ |
2489 """ |
2315 Public method to create the Edit menu |
2490 Public method to create the Edit menu. |
2316 |
2491 |
2317 @return the generated menu |
2492 @return the generated menu |
2318 """ |
2493 """ |
2319 autocompletionMenu = \ |
2494 autocompletionMenu = QMenu( |
2320 QMenu(QApplication.translate('ViewManager', '&Autocomplete'), self.ui) |
2495 QApplication.translate('ViewManager', '&Autocomplete'), self.ui) |
2321 autocompletionMenu.setTearOffEnabled(True) |
2496 autocompletionMenu.setTearOffEnabled(True) |
2322 autocompletionMenu.addAction(self.autoCompleteAct) |
2497 autocompletionMenu.addAction(self.autoCompleteAct) |
2323 autocompletionMenu.addAction(self.autoCompleteFromDocAct) |
2498 autocompletionMenu.addAction(self.autoCompleteFromDocAct) |
2324 autocompletionMenu.addAction(self.autoCompleteFromAPIsAct) |
2499 autocompletionMenu.addAction(self.autoCompleteFromAPIsAct) |
2325 autocompletionMenu.addAction(self.autoCompleteFromAllAct) |
2500 autocompletionMenu.addAction(self.autoCompleteFromAllAct) |
2448 """ for the search.</p>""" |
2626 """ for the search.</p>""" |
2449 )) |
2627 )) |
2450 self.searchAct.triggered[()].connect(self.__search) |
2628 self.searchAct.triggered[()].connect(self.__search) |
2451 self.searchActions.append(self.searchAct) |
2629 self.searchActions.append(self.searchAct) |
2452 |
2630 |
2453 self.searchNextAct = E5Action(QApplication.translate('ViewManager', |
2631 self.searchNextAct = E5Action( |
2454 'Search next'), |
2632 QApplication.translate( |
2455 UI.PixmapCache.getIcon("findNext.png"), |
2633 'ViewManager', 'Search next'), |
2456 QApplication.translate('ViewManager', 'Search &next'), |
2634 UI.PixmapCache.getIcon("findNext.png"), |
2457 QKeySequence(QApplication.translate('ViewManager', |
2635 QApplication.translate('ViewManager', 'Search &next'), |
2458 "F3", "Search|Search next")), |
2636 QKeySequence(QApplication.translate('ViewManager', |
2459 0, |
2637 "F3", "Search|Search next")), |
2460 self.searchActGrp, 'vm_search_next') |
2638 0, |
|
2639 self.searchActGrp, 'vm_search_next') |
2461 self.searchNextAct.setStatusTip(QApplication.translate('ViewManager', |
2640 self.searchNextAct.setStatusTip(QApplication.translate('ViewManager', |
2462 'Search next occurrence of text')) |
2641 'Search next occurrence of text')) |
2463 self.searchNextAct.setWhatsThis(QApplication.translate('ViewManager', |
2642 self.searchNextAct.setWhatsThis(QApplication.translate('ViewManager', |
2464 """<b>Search next</b>""" |
2643 """<b>Search next</b>""" |
2465 """<p>Search the next occurrence of some text in the current editor.""" |
2644 """<p>Search the next occurrence of some text in the current""" |
2466 """ The previously entered searchtext and options are reused.</p>""" |
2645 """ editor. The previously entered searchtext and options are""" |
|
2646 """ reused.</p>""" |
2467 )) |
2647 )) |
2468 self.searchNextAct.triggered[()].connect(self.__searchWidget.findNext) |
2648 self.searchNextAct.triggered[()].connect(self.__searchWidget.findNext) |
2469 self.searchActions.append(self.searchNextAct) |
2649 self.searchActions.append(self.searchNextAct) |
2470 |
2650 |
2471 self.searchPrevAct = E5Action(QApplication.translate('ViewManager', |
2651 self.searchPrevAct = E5Action( |
2472 'Search previous'), |
2652 QApplication.translate('ViewManager', 'Search previous'), |
2473 UI.PixmapCache.getIcon("findPrev.png"), |
2653 UI.PixmapCache.getIcon("findPrev.png"), |
2474 QApplication.translate('ViewManager', 'Search &previous'), |
2654 QApplication.translate('ViewManager', 'Search &previous'), |
2475 QKeySequence(QApplication.translate('ViewManager', |
2655 QKeySequence(QApplication.translate('ViewManager', |
2476 "Shift+F3", "Search|Search previous")), |
2656 "Shift+F3", "Search|Search previous")), |
2477 0, |
2657 0, |
2478 self.searchActGrp, 'vm_search_previous') |
2658 self.searchActGrp, 'vm_search_previous') |
2479 self.searchPrevAct.setStatusTip(QApplication.translate('ViewManager', |
2659 self.searchPrevAct.setStatusTip(QApplication.translate('ViewManager', |
2480 'Search previous occurrence of text')) |
2660 'Search previous occurrence of text')) |
2481 self.searchPrevAct.setWhatsThis(QApplication.translate('ViewManager', |
2661 self.searchPrevAct.setWhatsThis(QApplication.translate('ViewManager', |
2482 """<b>Search previous</b>""" |
2662 """<b>Search previous</b>""" |
2483 """<p>Search the previous occurrence of some text in the current editor.""" |
2663 """<p>Search the previous occurrence of some text in the current""" |
2484 """ The previously entered searchtext and options are reused.</p>""" |
2664 """ editor. The previously entered searchtext and options are""" |
|
2665 """ reused.</p>""" |
2485 )) |
2666 )) |
2486 self.searchPrevAct.triggered[()].connect(self.__searchWidget.findPrev) |
2667 self.searchPrevAct.triggered[()].connect(self.__searchWidget.findPrev) |
2487 self.searchActions.append(self.searchPrevAct) |
2668 self.searchActions.append(self.searchPrevAct) |
2488 |
2669 |
2489 self.searchClearMarkersAct = E5Action(QApplication.translate('ViewManager', |
2670 self.searchClearMarkersAct = E5Action( |
2490 'Clear search markers'), |
2671 QApplication.translate('ViewManager', 'Clear search markers'), |
2491 UI.PixmapCache.getIcon("findClear.png"), |
2672 UI.PixmapCache.getIcon("findClear.png"), |
2492 QApplication.translate('ViewManager', 'Clear search markers'), |
2673 QApplication.translate('ViewManager', 'Clear search markers'), |
2493 QKeySequence(QApplication.translate('ViewManager', |
2674 QKeySequence(QApplication.translate('ViewManager', |
2494 "Ctrl+3", "Search|Clear search markers")), |
2675 "Ctrl+3", "Search|Clear search markers")), |
2495 0, |
2676 0, |
2496 self.searchActGrp, 'vm_clear_search_markers') |
2677 self.searchActGrp, 'vm_clear_search_markers') |
2497 self.searchClearMarkersAct.setStatusTip(QApplication.translate('ViewManager', |
2678 self.searchClearMarkersAct.setStatusTip(QApplication.translate( |
|
2679 'ViewManager', |
2498 'Clear all displayed search markers')) |
2680 'Clear all displayed search markers')) |
2499 self.searchClearMarkersAct.setWhatsThis(QApplication.translate('ViewManager', |
2681 self.searchClearMarkersAct.setWhatsThis(QApplication.translate( |
|
2682 'ViewManager', |
2500 """<b>Clear search markers</b>""" |
2683 """<b>Clear search markers</b>""" |
2501 """<p>Clear all displayed search markers.</p>""" |
2684 """<p>Clear all displayed search markers.</p>""" |
2502 )) |
2685 )) |
2503 self.searchClearMarkersAct.triggered[()].connect(self.__searchClearMarkers) |
2686 self.searchClearMarkersAct.triggered[()].connect( |
|
2687 self.__searchClearMarkers) |
2504 self.searchActions.append(self.searchClearMarkersAct) |
2688 self.searchActions.append(self.searchClearMarkersAct) |
2505 |
2689 |
2506 self.searchNextWordAct = E5Action(QApplication.translate('ViewManager', |
2690 self.searchNextWordAct = E5Action( |
2507 'Search current word forward'), |
2691 QApplication.translate( |
2508 UI.PixmapCache.getIcon("findWordNext.png"), |
2692 'ViewManager', 'Search current word forward'), |
2509 QApplication.translate('ViewManager', 'Search current word forward'), |
2693 UI.PixmapCache.getIcon("findWordNext.png"), |
2510 QKeySequence(QApplication.translate('ViewManager', |
2694 QApplication.translate( |
2511 "Ctrl+.", "Search|Search current word forward")), |
2695 'ViewManager', 'Search current word forward'), |
2512 0, |
2696 QKeySequence(QApplication.translate('ViewManager', |
2513 self.searchActGrp, 'vm_search_word_next') |
2697 "Ctrl+.", "Search|Search current word forward")), |
2514 self.searchNextWordAct.setStatusTip(QApplication.translate('ViewManager', |
2698 0, |
|
2699 self.searchActGrp, 'vm_search_word_next') |
|
2700 self.searchNextWordAct.setStatusTip(QApplication.translate( |
|
2701 'ViewManager', |
2515 'Search next occurrence of the current word')) |
2702 'Search next occurrence of the current word')) |
2516 self.searchNextWordAct.setWhatsThis(QApplication.translate('ViewManager', |
2703 self.searchNextWordAct.setWhatsThis(QApplication.translate( |
|
2704 'ViewManager', |
2517 """<b>Search current word forward</b>""" |
2705 """<b>Search current word forward</b>""" |
2518 """<p>Search the next occurrence of the current word of the current""" |
2706 """<p>Search the next occurrence of the current word of the""" |
2519 """ editor.</p>""" |
2707 """ current editor.</p>""" |
2520 )) |
2708 )) |
2521 self.searchNextWordAct.triggered[()].connect(self.__findNextWord) |
2709 self.searchNextWordAct.triggered[()].connect(self.__findNextWord) |
2522 self.searchActions.append(self.searchNextWordAct) |
2710 self.searchActions.append(self.searchNextWordAct) |
2523 |
2711 |
2524 self.searchPrevWordAct = E5Action(QApplication.translate('ViewManager', |
2712 self.searchPrevWordAct = E5Action( |
2525 'Search current word backward'), |
2713 QApplication.translate( |
2526 UI.PixmapCache.getIcon("findWordPrev.png"), |
2714 'ViewManager', 'Search current word backward'), |
2527 QApplication.translate('ViewManager', 'Search current word backward'), |
2715 UI.PixmapCache.getIcon("findWordPrev.png"), |
2528 QKeySequence(QApplication.translate('ViewManager', |
2716 QApplication.translate( |
2529 "Ctrl+,", "Search|Search current word backward")), |
2717 'ViewManager', 'Search current word backward'), |
2530 0, |
2718 QKeySequence(QApplication.translate('ViewManager', |
2531 self.searchActGrp, 'vm_search_word_previous') |
2719 "Ctrl+,", "Search|Search current word backward")), |
2532 self.searchPrevWordAct.setStatusTip(QApplication.translate('ViewManager', |
2720 0, |
|
2721 self.searchActGrp, 'vm_search_word_previous') |
|
2722 self.searchPrevWordAct.setStatusTip(QApplication.translate( |
|
2723 'ViewManager', |
2533 'Search previous occurrence of the current word')) |
2724 'Search previous occurrence of the current word')) |
2534 self.searchPrevWordAct.setWhatsThis(QApplication.translate('ViewManager', |
2725 self.searchPrevWordAct.setWhatsThis(QApplication.translate( |
|
2726 'ViewManager', |
2535 """<b>Search current word backward</b>""" |
2727 """<b>Search current word backward</b>""" |
2536 """<p>Search the previous occurrence of the current word of the current""" |
2728 """<p>Search the previous occurrence of the current word of the""" |
2537 """ editor.</p>""" |
2729 """ current editor.</p>""" |
2538 )) |
2730 )) |
2539 self.searchPrevWordAct.triggered[()].connect(self.__findPrevWord) |
2731 self.searchPrevWordAct.triggered[()].connect(self.__findPrevWord) |
2540 self.searchActions.append(self.searchPrevWordAct) |
2732 self.searchActions.append(self.searchPrevWordAct) |
2541 |
2733 |
2542 self.replaceAct = E5Action(QApplication.translate('ViewManager', 'Replace'), |
2734 self.replaceAct = E5Action( |
2543 QApplication.translate('ViewManager', '&Replace...'), |
2735 QApplication.translate('ViewManager', 'Replace'), |
2544 QKeySequence(QApplication.translate('ViewManager', |
2736 QApplication.translate('ViewManager', '&Replace...'), |
2545 "Ctrl+R", "Search|Replace")), |
2737 QKeySequence(QApplication.translate('ViewManager', |
2546 0, |
2738 "Ctrl+R", "Search|Replace")), |
2547 self.searchActGrp, 'vm_search_replace') |
2739 0, |
|
2740 self.searchActGrp, 'vm_search_replace') |
2548 self.replaceAct.setStatusTip(QApplication.translate('ViewManager', |
2741 self.replaceAct.setStatusTip(QApplication.translate('ViewManager', |
2549 'Replace some text')) |
2742 'Replace some text')) |
2550 self.replaceAct.setWhatsThis(QApplication.translate('ViewManager', |
2743 self.replaceAct.setWhatsThis(QApplication.translate('ViewManager', |
2551 """<b>Replace</b>""" |
2744 """<b>Replace</b>""" |
2552 """<p>Search for some text in the current editor and replace it. A""" |
2745 """<p>Search for some text in the current editor and replace it.""" |
2553 """ dialog is shown to enter the searchtext, the replacement text""" |
2746 """ A dialog is shown to enter the searchtext, the replacement""" |
2554 """ and options for the search and replace.</p>""" |
2747 """ text and options for the search and replace.</p>""" |
2555 )) |
2748 )) |
2556 self.replaceAct.triggered[()].connect(self.__replace) |
2749 self.replaceAct.triggered[()].connect(self.__replace) |
2557 self.searchActions.append(self.replaceAct) |
2750 self.searchActions.append(self.replaceAct) |
2558 |
2751 |
2559 self.quickSearchAct = E5Action(QApplication.translate('ViewManager', |
2752 self.quickSearchAct = E5Action(QApplication.translate('ViewManager', |
2574 """ next occurrence of this text.</p>""" |
2767 """ next occurrence of this text.</p>""" |
2575 )) |
2768 )) |
2576 self.quickSearchAct.triggered[()].connect(self.__quickSearch) |
2769 self.quickSearchAct.triggered[()].connect(self.__quickSearch) |
2577 self.searchActions.append(self.quickSearchAct) |
2770 self.searchActions.append(self.quickSearchAct) |
2578 |
2771 |
2579 self.quickSearchBackAct = E5Action(QApplication.translate('ViewManager', |
2772 self.quickSearchBackAct = E5Action( |
2580 'Quicksearch backwards'), |
2773 QApplication.translate('ViewManager', 'Quicksearch backwards'), |
2581 UI.PixmapCache.getIcon("quickFindPrev.png"), |
2774 UI.PixmapCache.getIcon("quickFindPrev.png"), |
2582 QApplication.translate('ViewManager', 'Quicksearch &backwards'), |
2775 QApplication.translate('ViewManager', 'Quicksearch &backwards'), |
2583 QKeySequence(QApplication.translate('ViewManager', |
2776 QKeySequence(QApplication.translate('ViewManager', |
2584 "Ctrl+Shift+J", "Search|Quicksearch backwards")), |
2777 "Ctrl+Shift+J", "Search|Quicksearch backwards")), |
2585 0, self.searchActGrp, 'vm_quicksearch_backwards') |
2778 0, self.searchActGrp, 'vm_quicksearch_backwards') |
2586 self.quickSearchBackAct.setStatusTip(QApplication.translate('ViewManager', |
2779 self.quickSearchBackAct.setStatusTip(QApplication.translate( |
|
2780 'ViewManager', |
2587 'Perform a quicksearch backwards')) |
2781 'Perform a quicksearch backwards')) |
2588 self.quickSearchBackAct.setWhatsThis(QApplication.translate('ViewManager', |
2782 self.quickSearchBackAct.setWhatsThis(QApplication.translate( |
|
2783 'ViewManager', |
2589 """<b>Quicksearch backwards</b>""" |
2784 """<b>Quicksearch backwards</b>""" |
2590 """<p>This searches the previous occurrence of the quicksearch text.</p>""" |
2785 """<p>This searches the previous occurrence of the quicksearch""" |
|
2786 """ text.</p>""" |
2591 )) |
2787 )) |
2592 self.quickSearchBackAct.triggered[()].connect(self.__quickSearchPrev) |
2788 self.quickSearchBackAct.triggered[()].connect(self.__quickSearchPrev) |
2593 self.searchActions.append(self.quickSearchBackAct) |
2789 self.searchActions.append(self.quickSearchBackAct) |
2594 |
2790 |
2595 self.quickSearchExtendAct = E5Action(QApplication.translate('ViewManager', |
2791 self.quickSearchExtendAct = E5Action( |
2596 'Quicksearch extend'), |
2792 QApplication.translate('ViewManager', 'Quicksearch extend'), |
2597 UI.PixmapCache.getIcon("quickFindExtend.png"), |
2793 UI.PixmapCache.getIcon("quickFindExtend.png"), |
2598 QApplication.translate('ViewManager', 'Quicksearch e&xtend'), |
2794 QApplication.translate('ViewManager', 'Quicksearch e&xtend'), |
2599 QKeySequence(QApplication.translate('ViewManager', |
2795 QKeySequence(QApplication.translate('ViewManager', |
2600 "Ctrl+Shift+H", "Search|Quicksearch extend")), |
2796 "Ctrl+Shift+H", "Search|Quicksearch extend")), |
2601 0, |
2797 0, |
2602 self.searchActGrp, 'vm_quicksearch_extend') |
2798 self.searchActGrp, 'vm_quicksearch_extend') |
2603 self.quickSearchExtendAct.setStatusTip(QApplication.translate('ViewManager', \ |
2799 self.quickSearchExtendAct.setStatusTip(QApplication.translate( |
|
2800 'ViewManager', \ |
2604 'Extend the quicksearch to the end of the current word')) |
2801 'Extend the quicksearch to the end of the current word')) |
2605 self.quickSearchExtendAct.setWhatsThis(QApplication.translate('ViewManager', |
2802 self.quickSearchExtendAct.setWhatsThis(QApplication.translate( |
|
2803 'ViewManager', |
2606 """<b>Quicksearch extend</b>""" |
2804 """<b>Quicksearch extend</b>""" |
2607 """<p>This extends the quicksearch text to the end of the word""" |
2805 """<p>This extends the quicksearch text to the end of the word""" |
2608 """ currently found.</p>""" |
2806 """ currently found.</p>""" |
2609 )) |
2807 )) |
2610 self.quickSearchExtendAct.triggered[()].connect(self.__quickSearchExtend) |
2808 self.quickSearchExtendAct.triggered[()].connect( |
|
2809 self.__quickSearchExtend) |
2611 self.searchActions.append(self.quickSearchExtendAct) |
2810 self.searchActions.append(self.quickSearchExtendAct) |
2612 |
2811 |
2613 self.gotoAct = E5Action(QApplication.translate('ViewManager', 'Goto Line'), |
2812 self.gotoAct = E5Action( |
2614 UI.PixmapCache.getIcon("goto.png"), |
2813 QApplication.translate('ViewManager', 'Goto Line'), |
2615 QApplication.translate('ViewManager', '&Goto Line...'), |
2814 UI.PixmapCache.getIcon("goto.png"), |
2616 QKeySequence(QApplication.translate('ViewManager', |
2815 QApplication.translate('ViewManager', '&Goto Line...'), |
2617 "Ctrl+G", "Search|Goto Line")), |
2816 QKeySequence(QApplication.translate('ViewManager', |
2618 0, |
2817 "Ctrl+G", "Search|Goto Line")), |
2619 self.searchActGrp, 'vm_search_goto_line') |
2818 0, |
2620 self.gotoAct.setStatusTip(QApplication.translate('ViewManager', 'Goto Line')) |
2819 self.searchActGrp, 'vm_search_goto_line') |
2621 self.gotoAct.setWhatsThis(QApplication.translate('ViewManager', |
2820 self.gotoAct.setStatusTip(QApplication.translate( |
|
2821 'ViewManager', 'Goto Line')) |
|
2822 self.gotoAct.setWhatsThis(QApplication.translate( |
|
2823 'ViewManager', |
2622 """<b>Goto Line</b>""" |
2824 """<b>Goto Line</b>""" |
2623 """<p>Go to a specific line of text in the current editor.""" |
2825 """<p>Go to a specific line of text in the current editor.""" |
2624 """ A dialog is shown to enter the linenumber.</p>""" |
2826 """ A dialog is shown to enter the linenumber.</p>""" |
2625 )) |
2827 )) |
2626 self.gotoAct.triggered[()].connect(self.__goto) |
2828 self.gotoAct.triggered[()].connect(self.__goto) |
2627 self.searchActions.append(self.gotoAct) |
2829 self.searchActions.append(self.gotoAct) |
2628 |
2830 |
2629 self.gotoBraceAct = E5Action(QApplication.translate('ViewManager', 'Goto Brace'), |
2831 self.gotoBraceAct = E5Action( |
2630 UI.PixmapCache.getIcon("gotoBrace.png"), |
2832 QApplication.translate('ViewManager', 'Goto Brace'), |
2631 QApplication.translate('ViewManager', 'Goto &Brace'), |
2833 UI.PixmapCache.getIcon("gotoBrace.png"), |
2632 QKeySequence(QApplication.translate('ViewManager', |
2834 QApplication.translate('ViewManager', 'Goto &Brace'), |
2633 "Ctrl+L", "Search|Goto Brace")), |
2835 QKeySequence(QApplication.translate('ViewManager', |
2634 0, |
2836 "Ctrl+L", "Search|Goto Brace")), |
2635 self.searchActGrp, 'vm_search_goto_brace') |
2837 0, |
2636 self.gotoBraceAct.setStatusTip(QApplication.translate('ViewManager', |
2838 self.searchActGrp, 'vm_search_goto_brace') |
2637 'Goto Brace')) |
2839 self.gotoBraceAct.setStatusTip(QApplication.translate( |
2638 self.gotoBraceAct.setWhatsThis(QApplication.translate('ViewManager', |
2840 'ViewManager', 'Goto Brace')) |
|
2841 self.gotoBraceAct.setWhatsThis(QApplication.translate( |
|
2842 'ViewManager', |
2639 """<b>Goto Brace</b>""" |
2843 """<b>Goto Brace</b>""" |
2640 """<p>Go to the matching brace in the current editor.</p>""" |
2844 """<p>Go to the matching brace in the current editor.</p>""" |
2641 )) |
2845 )) |
2642 self.gotoBraceAct.triggered[()].connect(self.__gotoBrace) |
2846 self.gotoBraceAct.triggered[()].connect(self.__gotoBrace) |
2643 self.searchActions.append(self.gotoBraceAct) |
2847 self.searchActions.append(self.gotoBraceAct) |
2644 |
2848 |
2645 self.gotoLastEditAct = E5Action( |
2849 self.gotoLastEditAct = E5Action( |
2646 QApplication.translate('ViewManager', 'Goto Last Edit Location'), |
2850 QApplication.translate('ViewManager', 'Goto Last Edit Location'), |
2647 UI.PixmapCache.getIcon("gotoLastEditPosition.png"), |
2851 UI.PixmapCache.getIcon("gotoLastEditPosition.png"), |
2648 QApplication.translate('ViewManager', 'Goto Last &Edit Location'), |
2852 QApplication.translate('ViewManager', 'Goto Last &Edit Location'), |
2649 QKeySequence(QApplication.translate('ViewManager', |
2853 QKeySequence(QApplication.translate('ViewManager', |
2650 "Ctrl+Shift+G", "Search|Goto Last Edit Location")), |
2854 "Ctrl+Shift+G", "Search|Goto Last Edit Location")), |
2651 0, |
2855 0, |
2652 self.searchActGrp, 'vm_search_goto_last_edit_location') |
2856 self.searchActGrp, 'vm_search_goto_last_edit_location') |
2653 self.gotoLastEditAct.setStatusTip( |
2857 self.gotoLastEditAct.setStatusTip( |
2654 QApplication.translate('ViewManager', 'Goto Last Edit Location')) |
2858 QApplication.translate('ViewManager', 'Goto Last Edit Location')) |
2655 self.gotoLastEditAct.setWhatsThis(QApplication.translate('ViewManager', |
2859 self.gotoLastEditAct.setWhatsThis(QApplication.translate('ViewManager', |
2656 """<b>Goto Last Edit Location</b>""" |
2860 """<b>Goto Last Edit Location</b>""" |
2657 """<p>Go to the location of the last edit in the current editor.</p>""" |
2861 """<p>Go to the location of the last edit in the current""" |
|
2862 """ editor.</p>""" |
2658 )) |
2863 )) |
2659 self.gotoLastEditAct.triggered[()].connect(self.__gotoLastEditPosition) |
2864 self.gotoLastEditAct.triggered[()].connect(self.__gotoLastEditPosition) |
2660 self.searchActions.append(self.gotoLastEditAct) |
2865 self.searchActions.append(self.gotoLastEditAct) |
2661 |
2866 |
2662 self.gotoPreviousDefAct = E5Action( |
2867 self.gotoPreviousDefAct = E5Action( |
2663 QApplication.translate('ViewManager', 'Goto Previous Method or Class'), |
2868 QApplication.translate( |
2664 QApplication.translate('ViewManager', 'Goto Previous Method or Class'), |
2869 'ViewManager', 'Goto Previous Method or Class'), |
2665 QKeySequence(QApplication.translate('ViewManager', |
2870 QApplication.translate( |
2666 "Ctrl+Shift+Up", "Search|Goto Previous Method or Class")), |
2871 'ViewManager', 'Goto Previous Method or Class'), |
2667 0, |
2872 QKeySequence(QApplication.translate( |
2668 self.searchActGrp, 'vm_search_goto_previous_method_or_class') |
2873 'ViewManager', |
|
2874 "Ctrl+Shift+Up", "Search|Goto Previous Method or Class")), |
|
2875 0, |
|
2876 self.searchActGrp, 'vm_search_goto_previous_method_or_class') |
2669 self.gotoPreviousDefAct.setStatusTip( |
2877 self.gotoPreviousDefAct.setStatusTip( |
2670 QApplication.translate('ViewManager', |
2878 QApplication.translate( |
2671 'Go to the previous method or class definition')) |
2879 'ViewManager', |
2672 self.gotoPreviousDefAct.setWhatsThis(QApplication.translate('ViewManager', |
2880 'Go to the previous method or class definition')) |
|
2881 self.gotoPreviousDefAct.setWhatsThis(QApplication.translate( |
|
2882 'ViewManager', |
2673 """<b>Goto Previous Method or Class</b>""" |
2883 """<b>Goto Previous Method or Class</b>""" |
2674 """<p>Goes to the line of the previous method or class definition""" |
2884 """<p>Goes to the line of the previous method or class""" |
2675 """ and highlights the name.</p>""" |
2885 """ definition and highlights the name.</p>""" |
2676 )) |
2886 )) |
2677 self.gotoPreviousDefAct.triggered[()].connect(self.__gotoPreviousMethodClass) |
2887 self.gotoPreviousDefAct.triggered[()].connect( |
|
2888 self.__gotoPreviousMethodClass) |
2678 self.searchActions.append(self.gotoPreviousDefAct) |
2889 self.searchActions.append(self.gotoPreviousDefAct) |
2679 |
2890 |
2680 self.gotoNextDefAct = E5Action( |
2891 self.gotoNextDefAct = E5Action( |
2681 QApplication.translate('ViewManager', 'Goto Next Method or Class'), |
2892 QApplication.translate('ViewManager', 'Goto Next Method or Class'), |
2682 QApplication.translate('ViewManager', 'Goto Next Method or Class'), |
2893 QApplication.translate('ViewManager', 'Goto Next Method or Class'), |
2683 QKeySequence(QApplication.translate('ViewManager', |
2894 QKeySequence(QApplication.translate('ViewManager', |
2684 "Ctrl+Shift+Down", "Search|Goto Next Method or Class")), |
2895 "Ctrl+Shift+Down", "Search|Goto Next Method or Class")), |
2685 0, |
2896 0, |
2686 self.searchActGrp, 'vm_search_goto_next_method_or_class') |
2897 self.searchActGrp, 'vm_search_goto_next_method_or_class') |
2687 self.gotoNextDefAct.setStatusTip( |
2898 self.gotoNextDefAct.setStatusTip(QApplication.translate( |
2688 QApplication.translate('ViewManager', |
2899 'ViewManager', 'Go to the next method or class definition')) |
2689 'Go to the next method or class definition')) |
|
2690 self.gotoNextDefAct.setWhatsThis(QApplication.translate('ViewManager', |
2900 self.gotoNextDefAct.setWhatsThis(QApplication.translate('ViewManager', |
2691 """<b>Goto Next Method or Class</b>""" |
2901 """<b>Goto Next Method or Class</b>""" |
2692 """<p>Goes to the line of the next method or class definition""" |
2902 """<p>Goes to the line of the next method or class definition""" |
2693 """ and highlights the name.</p>""" |
2903 """ and highlights the name.</p>""" |
2694 )) |
2904 )) |
2733 """ search and to display the result.</p>""" |
2943 """ search and to display the result.</p>""" |
2734 )) |
2944 )) |
2735 self.replaceFilesAct.triggered[()].connect(self.__replaceFiles) |
2945 self.replaceFilesAct.triggered[()].connect(self.__replaceFiles) |
2736 self.searchActions.append(self.replaceFilesAct) |
2946 self.searchActions.append(self.replaceFilesAct) |
2737 |
2947 |
2738 self.searchOpenFilesAct = E5Action(QApplication.translate('ViewManager', |
2948 self.searchOpenFilesAct = E5Action( |
2739 'Search in Open Files'), |
2949 QApplication.translate('ViewManager', 'Search in Open Files'), |
2740 UI.PixmapCache.getIcon("documentFind.png"), |
2950 UI.PixmapCache.getIcon("documentFind.png"), |
2741 QApplication.translate('ViewManager', 'Search in Open Files...'), |
2951 QApplication.translate('ViewManager', 'Search in Open Files...'), |
2742 QKeySequence(QApplication.translate('ViewManager', |
2952 QKeySequence(QApplication.translate('ViewManager', |
2743 "Meta+Ctrl+Alt+F", "Search|Search Open Files")), |
2953 "Meta+Ctrl+Alt+F", "Search|Search Open Files")), |
2744 0, |
2954 0, |
2745 self.searchActGrp, 'vm_search_in_open_files') |
2955 self.searchActGrp, 'vm_search_in_open_files') |
2746 self.searchOpenFilesAct.setStatusTip(QApplication.translate('ViewManager', |
2956 self.searchOpenFilesAct.setStatusTip(QApplication.translate( |
2747 'Search for a text in open files')) |
2957 'ViewManager', 'Search for a text in open files')) |
2748 self.searchOpenFilesAct.setWhatsThis(QApplication.translate('ViewManager', |
2958 self.searchOpenFilesAct.setWhatsThis(QApplication.translate( |
|
2959 'ViewManager', |
2749 """<b>Search in Open Files</b>""" |
2960 """<b>Search in Open Files</b>""" |
2750 """<p>Search for some text in the currently opened files.""" |
2961 """<p>Search for some text in the currently opened files.""" |
2751 """ A dialog is shown to enter the searchtext""" |
2962 """ A dialog is shown to enter the searchtext""" |
2752 """ and options for the search and to display the result.</p>""" |
2963 """ and options for the search and to display the result.</p>""" |
2753 )) |
2964 )) |
2754 self.searchOpenFilesAct.triggered[()].connect(self.__searchOpenFiles) |
2965 self.searchOpenFilesAct.triggered[()].connect(self.__searchOpenFiles) |
2755 self.searchActions.append(self.searchOpenFilesAct) |
2966 self.searchActions.append(self.searchOpenFilesAct) |
2756 |
2967 |
2757 self.replaceOpenFilesAct = E5Action(QApplication.translate('ViewManager', |
2968 self.replaceOpenFilesAct = E5Action( |
2758 'Replace in Open Files'), |
2969 QApplication.translate('ViewManager', 'Replace in Open Files'), |
2759 QApplication.translate('ViewManager', 'Replace in Open Files...'), |
2970 QApplication.translate('ViewManager', 'Replace in Open Files...'), |
2760 QKeySequence(QApplication.translate('ViewManager', |
2971 QKeySequence(QApplication.translate('ViewManager', |
2761 "Meta+Ctrl+Alt+R", "Search|Replace in Open Files")), |
2972 "Meta+Ctrl+Alt+R", "Search|Replace in Open Files")), |
2762 0, |
2973 0, |
2763 self.searchActGrp, 'vm_replace_in_open_files') |
2974 self.searchActGrp, 'vm_replace_in_open_files') |
2764 self.replaceOpenFilesAct.setStatusTip(QApplication.translate('ViewManager', |
2975 self.replaceOpenFilesAct.setStatusTip(QApplication.translate( |
2765 'Search for a text in open files and replace it')) |
2976 'ViewManager', 'Search for a text in open files and replace it')) |
2766 self.replaceOpenFilesAct.setWhatsThis(QApplication.translate('ViewManager', |
2977 self.replaceOpenFilesAct.setWhatsThis(QApplication.translate( |
|
2978 'ViewManager', |
2767 """<b>Replace in Open Files</b>""" |
2979 """<b>Replace in Open Files</b>""" |
2768 """<p>Search for some text in the currently opened files""" |
2980 """<p>Search for some text in the currently opened files""" |
2769 """ and replace it. A dialog is shown to enter""" |
2981 """ and replace it. A dialog is shown to enter""" |
2770 """ the searchtext, the replacement text and options for the""" |
2982 """ the searchtext, the replacement text and options for the""" |
2771 """ search and to display the result.</p>""" |
2983 """ search and to display the result.</p>""" |
2868 ## Initialize the view related actions, view menu and toolbar |
3088 ## Initialize the view related actions, view menu and toolbar |
2869 ################################################################## |
3089 ################################################################## |
2870 |
3090 |
2871 def __initViewActions(self): |
3091 def __initViewActions(self): |
2872 """ |
3092 """ |
2873 Private method defining the user interface actions for the view commands. |
3093 Private method defining the user interface actions for the view |
|
3094 commands. |
2874 """ |
3095 """ |
2875 self.viewActGrp = createActionGroup(self) |
3096 self.viewActGrp = createActionGroup(self) |
2876 self.viewFoldActGrp = createActionGroup(self) |
3097 self.viewFoldActGrp = createActionGroup(self) |
2877 |
3098 |
2878 self.zoomInAct = E5Action(QApplication.translate('ViewManager', 'Zoom in'), |
3099 self.zoomInAct = E5Action( |
2879 UI.PixmapCache.getIcon("zoomIn.png"), |
3100 QApplication.translate('ViewManager', 'Zoom in'), |
2880 QApplication.translate('ViewManager', 'Zoom &in'), |
3101 UI.PixmapCache.getIcon("zoomIn.png"), |
2881 QKeySequence(QApplication.translate('ViewManager', |
3102 QApplication.translate('ViewManager', 'Zoom &in'), |
2882 "Ctrl++", "View|Zoom in")), |
3103 QKeySequence(QApplication.translate('ViewManager', |
2883 QKeySequence(QApplication.translate('ViewManager', |
3104 "Ctrl++", "View|Zoom in")), |
2884 "Zoom In", "View|Zoom in")), |
3105 QKeySequence(QApplication.translate('ViewManager', |
2885 self.viewActGrp, 'vm_view_zoom_in') |
3106 "Zoom In", "View|Zoom in")), |
|
3107 self.viewActGrp, 'vm_view_zoom_in') |
2886 self.zoomInAct.setStatusTip(QApplication.translate('ViewManager', |
3108 self.zoomInAct.setStatusTip(QApplication.translate('ViewManager', |
2887 'Zoom in on the text')) |
3109 'Zoom in on the text')) |
2888 self.zoomInAct.setWhatsThis(QApplication.translate('ViewManager', |
3110 self.zoomInAct.setWhatsThis(QApplication.translate('ViewManager', |
2889 """<b>Zoom in</b>""" |
3111 """<b>Zoom in</b>""" |
2890 """<p>Zoom in on the text. This makes the text bigger.</p>""" |
3112 """<p>Zoom in on the text. This makes the text bigger.</p>""" |
2891 )) |
3113 )) |
2892 self.zoomInAct.triggered[()].connect(self.__zoomIn) |
3114 self.zoomInAct.triggered[()].connect(self.__zoomIn) |
2893 self.viewActions.append(self.zoomInAct) |
3115 self.viewActions.append(self.zoomInAct) |
2894 |
3116 |
2895 self.zoomOutAct = E5Action(QApplication.translate('ViewManager', 'Zoom out'), |
3117 self.zoomOutAct = E5Action( |
2896 UI.PixmapCache.getIcon("zoomOut.png"), |
3118 QApplication.translate('ViewManager', 'Zoom out'), |
2897 QApplication.translate('ViewManager', 'Zoom &out'), |
3119 UI.PixmapCache.getIcon("zoomOut.png"), |
2898 QKeySequence(QApplication.translate('ViewManager', |
3120 QApplication.translate('ViewManager', 'Zoom &out'), |
2899 "Ctrl+-", "View|Zoom out")), |
3121 QKeySequence(QApplication.translate('ViewManager', |
2900 QKeySequence(QApplication.translate('ViewManager', |
3122 "Ctrl+-", "View|Zoom out")), |
2901 "Zoom Out", "View|Zoom out")), |
3123 QKeySequence(QApplication.translate('ViewManager', |
2902 self.viewActGrp, 'vm_view_zoom_out') |
3124 "Zoom Out", "View|Zoom out")), |
|
3125 self.viewActGrp, 'vm_view_zoom_out') |
2903 self.zoomOutAct.setStatusTip(QApplication.translate('ViewManager', |
3126 self.zoomOutAct.setStatusTip(QApplication.translate('ViewManager', |
2904 'Zoom out on the text')) |
3127 'Zoom out on the text')) |
2905 self.zoomOutAct.setWhatsThis(QApplication.translate('ViewManager', |
3128 self.zoomOutAct.setWhatsThis(QApplication.translate('ViewManager', |
2906 """<b>Zoom out</b>""" |
3129 """<b>Zoom out</b>""" |
2907 """<p>Zoom out on the text. This makes the text smaller.</p>""" |
3130 """<p>Zoom out on the text. This makes the text smaller.</p>""" |
2908 )) |
3131 )) |
2909 self.zoomOutAct.triggered[()].connect(self.__zoomOut) |
3132 self.zoomOutAct.triggered[()].connect(self.__zoomOut) |
2910 self.viewActions.append(self.zoomOutAct) |
3133 self.viewActions.append(self.zoomOutAct) |
2911 |
3134 |
2912 self.zoomResetAct = E5Action(QApplication.translate('ViewManager', 'Zoom reset'), |
3135 self.zoomResetAct = E5Action( |
2913 UI.PixmapCache.getIcon("zoomReset.png"), |
3136 QApplication.translate('ViewManager', 'Zoom reset'), |
2914 QApplication.translate('ViewManager', 'Zoom &reset'), |
3137 UI.PixmapCache.getIcon("zoomReset.png"), |
2915 QKeySequence(QApplication.translate('ViewManager', |
3138 QApplication.translate('ViewManager', 'Zoom &reset'), |
2916 "Ctrl+0", "View|Zoom reset")), |
3139 QKeySequence(QApplication.translate('ViewManager', |
2917 0, |
3140 "Ctrl+0", "View|Zoom reset")), |
2918 self.viewActGrp, 'vm_view_zoom_reset') |
3141 0, |
|
3142 self.viewActGrp, 'vm_view_zoom_reset') |
2919 self.zoomResetAct.setStatusTip(QApplication.translate('ViewManager', |
3143 self.zoomResetAct.setStatusTip(QApplication.translate('ViewManager', |
2920 'Reset the zoom of the text')) |
3144 'Reset the zoom of the text')) |
2921 self.zoomResetAct.setWhatsThis(QApplication.translate('ViewManager', |
3145 self.zoomResetAct.setWhatsThis(QApplication.translate('ViewManager', |
2922 """<b>Zoom reset</b>""" |
3146 """<b>Zoom reset</b>""" |
2923 """<p>Reset the zoom of the text. """ |
3147 """<p>Reset the zoom of the text. """ |
2924 """This sets the zoom factor to 100%.</p>""" |
3148 """This sets the zoom factor to 100%.</p>""" |
2925 )) |
3149 )) |
2926 self.zoomResetAct.triggered[()].connect(self.__zoomReset) |
3150 self.zoomResetAct.triggered[()].connect(self.__zoomReset) |
2927 self.viewActions.append(self.zoomResetAct) |
3151 self.viewActions.append(self.zoomResetAct) |
2928 |
3152 |
2929 self.zoomToAct = E5Action(QApplication.translate('ViewManager', 'Zoom'), |
3153 self.zoomToAct = E5Action( |
2930 UI.PixmapCache.getIcon("zoomTo.png"), |
3154 QApplication.translate('ViewManager', 'Zoom'), |
2931 QApplication.translate('ViewManager', '&Zoom'), |
3155 UI.PixmapCache.getIcon("zoomTo.png"), |
2932 QKeySequence(QApplication.translate('ViewManager', |
3156 QApplication.translate('ViewManager', '&Zoom'), |
2933 "Ctrl+#", "View|Zoom")), |
3157 QKeySequence(QApplication.translate('ViewManager', |
2934 0, |
3158 "Ctrl+#", "View|Zoom")), |
2935 self.viewActGrp, 'vm_view_zoom') |
3159 0, |
|
3160 self.viewActGrp, 'vm_view_zoom') |
2936 self.zoomToAct.setStatusTip(QApplication.translate('ViewManager', |
3161 self.zoomToAct.setStatusTip(QApplication.translate('ViewManager', |
2937 'Zoom the text')) |
3162 'Zoom the text')) |
2938 self.zoomToAct.setWhatsThis(QApplication.translate('ViewManager', |
3163 self.zoomToAct.setWhatsThis(QApplication.translate('ViewManager', |
2939 """<b>Zoom</b>""" |
3164 """<b>Zoom</b>""" |
2940 """<p>Zoom the text. This opens a dialog where the""" |
3165 """<p>Zoom the text. This opens a dialog where the""" |
2941 """ desired size can be entered.</p>""" |
3166 """ desired size can be entered.</p>""" |
2942 )) |
3167 )) |
2943 self.zoomToAct.triggered[()].connect(self.__zoom) |
3168 self.zoomToAct.triggered[()].connect(self.__zoom) |
2944 self.viewActions.append(self.zoomToAct) |
3169 self.viewActions.append(self.zoomToAct) |
2945 |
3170 |
2946 self.toggleAllAct = E5Action(QApplication.translate('ViewManager', |
3171 self.toggleAllAct = E5Action( |
2947 'Toggle all folds'), |
3172 QApplication.translate('ViewManager', 'Toggle all folds'), |
2948 QApplication.translate('ViewManager', 'Toggle &all folds'), |
3173 QApplication.translate('ViewManager', 'Toggle &all folds'), |
2949 0, 0, self.viewFoldActGrp, 'vm_view_toggle_all_folds') |
3174 0, 0, self.viewFoldActGrp, 'vm_view_toggle_all_folds') |
2950 self.toggleAllAct.setStatusTip(QApplication.translate('ViewManager', |
3175 self.toggleAllAct.setStatusTip(QApplication.translate('ViewManager', |
2951 'Toggle all folds')) |
3176 'Toggle all folds')) |
2952 self.toggleAllAct.setWhatsThis(QApplication.translate('ViewManager', |
3177 self.toggleAllAct.setWhatsThis(QApplication.translate('ViewManager', |
2953 """<b>Toggle all folds</b>""" |
3178 """<b>Toggle all folds</b>""" |
2954 """<p>Toggle all folds of the current editor.</p>""" |
3179 """<p>Toggle all folds of the current editor.</p>""" |
2955 )) |
3180 )) |
2956 self.toggleAllAct.triggered[()].connect(self.__toggleAll) |
3181 self.toggleAllAct.triggered[()].connect(self.__toggleAll) |
2957 self.viewActions.append(self.toggleAllAct) |
3182 self.viewActions.append(self.toggleAllAct) |
2958 |
3183 |
2959 self.toggleAllChildrenAct = \ |
3184 self.toggleAllChildrenAct = E5Action( |
2960 E5Action(QApplication.translate('ViewManager', |
3185 QApplication.translate( |
2961 'Toggle all folds (including children)'), |
3186 'ViewManager', 'Toggle all folds (including children)'), |
2962 QApplication.translate('ViewManager', |
3187 QApplication.translate( |
2963 'Toggle all &folds (including children)'), |
3188 'ViewManager', 'Toggle all &folds (including children)'), |
2964 0, 0, self.viewFoldActGrp, 'vm_view_toggle_all_folds_children') |
3189 0, 0, self.viewFoldActGrp, 'vm_view_toggle_all_folds_children') |
2965 self.toggleAllChildrenAct.setStatusTip(QApplication.translate('ViewManager', |
3190 self.toggleAllChildrenAct.setStatusTip(QApplication.translate( |
2966 'Toggle all folds (including children)')) |
3191 'ViewManager', 'Toggle all folds (including children)')) |
2967 self.toggleAllChildrenAct.setWhatsThis(QApplication.translate('ViewManager', |
3192 self.toggleAllChildrenAct.setWhatsThis(QApplication.translate( |
2968 """<b>Toggle all folds (including children)</b>""" |
3193 'ViewManager', |
2969 """<p>Toggle all folds of the current editor including""" |
3194 """<b>Toggle all folds (including children)</b>""" |
2970 """ all children.</p>""" |
3195 """<p>Toggle all folds of the current editor including""" |
2971 )) |
3196 """ all children.</p>""" |
2972 self.toggleAllChildrenAct.triggered[()].connect(self.__toggleAllChildren) |
3197 )) |
|
3198 self.toggleAllChildrenAct.triggered[()].connect( |
|
3199 self.__toggleAllChildren) |
2973 self.viewActions.append(self.toggleAllChildrenAct) |
3200 self.viewActions.append(self.toggleAllChildrenAct) |
2974 |
3201 |
2975 self.toggleCurrentAct = E5Action(QApplication.translate('ViewManager', |
3202 self.toggleCurrentAct = E5Action( |
2976 'Toggle current fold'), |
3203 QApplication.translate('ViewManager', 'Toggle current fold'), |
2977 QApplication.translate('ViewManager', 'Toggle ¤t fold'), |
3204 QApplication.translate('ViewManager', 'Toggle ¤t fold'), |
2978 0, 0, self.viewFoldActGrp, 'vm_view_toggle_current_fold') |
3205 0, 0, self.viewFoldActGrp, 'vm_view_toggle_current_fold') |
2979 self.toggleCurrentAct.setStatusTip(QApplication.translate('ViewManager', |
3206 self.toggleCurrentAct.setStatusTip(QApplication.translate( |
2980 'Toggle current fold')) |
3207 'ViewManager', 'Toggle current fold')) |
2981 self.toggleCurrentAct.setWhatsThis(QApplication.translate('ViewManager', |
3208 self.toggleCurrentAct.setWhatsThis(QApplication.translate( |
2982 """<b>Toggle current fold</b>""" |
3209 'ViewManager', |
2983 """<p>Toggle the folds of the current line of the current editor.</p>""" |
3210 """<b>Toggle current fold</b>""" |
2984 )) |
3211 """<p>Toggle the folds of the current line of the current""" |
|
3212 """ editor.</p>""" |
|
3213 )) |
2985 self.toggleCurrentAct.triggered[()].connect(self.__toggleCurrent) |
3214 self.toggleCurrentAct.triggered[()].connect(self.__toggleCurrent) |
2986 self.viewActions.append(self.toggleCurrentAct) |
3215 self.viewActions.append(self.toggleCurrentAct) |
2987 |
3216 |
2988 self.unhighlightAct = E5Action(QApplication.translate('ViewManager', |
3217 self.unhighlightAct = E5Action(QApplication.translate('ViewManager', |
2989 'Remove all highlights'), |
3218 'Remove all highlights'), |
2998 """<p>Remove the highlights of all editors.</p>""" |
3227 """<p>Remove the highlights of all editors.</p>""" |
2999 )) |
3228 )) |
3000 self.unhighlightAct.triggered[()].connect(self.unhighlight) |
3229 self.unhighlightAct.triggered[()].connect(self.unhighlight) |
3001 self.viewActions.append(self.unhighlightAct) |
3230 self.viewActions.append(self.unhighlightAct) |
3002 |
3231 |
3003 self.splitViewAct = E5Action(QApplication.translate('ViewManager', 'Split view'), |
3232 self.splitViewAct = E5Action( |
3004 UI.PixmapCache.getIcon("splitVertical.png"), |
3233 QApplication.translate('ViewManager', 'Split view'), |
3005 QApplication.translate('ViewManager', '&Split view'), |
3234 UI.PixmapCache.getIcon("splitVertical.png"), |
3006 0, 0, self, 'vm_view_split_view') |
3235 QApplication.translate('ViewManager', '&Split view'), |
|
3236 0, 0, self, 'vm_view_split_view') |
3007 self.splitViewAct.setStatusTip(QApplication.translate('ViewManager', |
3237 self.splitViewAct.setStatusTip(QApplication.translate('ViewManager', |
3008 'Add a split to the view')) |
3238 'Add a split to the view')) |
3009 self.splitViewAct.setWhatsThis(QApplication.translate('ViewManager', |
3239 self.splitViewAct.setWhatsThis(QApplication.translate('ViewManager', |
3010 """<b>Split view</b>""" |
3240 """<b>Split view</b>""" |
3011 """<p>Add a split to the view.</p>""" |
3241 """<p>Add a split to the view.</p>""" |
3012 )) |
3242 )) |
3013 self.splitViewAct.triggered[()].connect(self.__splitView) |
3243 self.splitViewAct.triggered[()].connect(self.__splitView) |
3014 self.viewActions.append(self.splitViewAct) |
3244 self.viewActions.append(self.splitViewAct) |
3015 |
3245 |
3016 self.splitOrientationAct = E5Action(QApplication.translate('ViewManager', |
3246 self.splitOrientationAct = E5Action( |
3017 'Arrange horizontally'), |
3247 QApplication.translate('ViewManager', 'Arrange horizontally'), |
3018 QApplication.translate('ViewManager', |
3248 QApplication.translate('ViewManager', 'Arrange &horizontally'), |
3019 'Arrange &horizontally'), |
3249 0, 0, self, 'vm_view_arrange_horizontally', True) |
3020 0, 0, self, 'vm_view_arrange_horizontally', True) |
3250 self.splitOrientationAct.setStatusTip(QApplication.translate( |
3021 self.splitOrientationAct.setStatusTip(QApplication.translate('ViewManager', |
3251 'ViewManager', 'Arrange the splitted views horizontally')) |
3022 'Arrange the splitted views horizontally')) |
3252 self.splitOrientationAct.setWhatsThis(QApplication.translate( |
3023 self.splitOrientationAct.setWhatsThis(QApplication.translate('ViewManager', |
3253 'ViewManager', |
3024 """<b>Arrange horizontally</b>""" |
3254 """<b>Arrange horizontally</b>""" |
3025 """<p>Arrange the splitted views horizontally.</p>""" |
3255 """<p>Arrange the splitted views horizontally.</p>""" |
3026 )) |
3256 )) |
3027 self.splitOrientationAct.setChecked(False) |
3257 self.splitOrientationAct.setChecked(False) |
3028 self.splitOrientationAct.toggled[bool].connect(self.__splitOrientation) |
3258 self.splitOrientationAct.toggled[bool].connect(self.__splitOrientation) |
3029 self.viewActions.append(self.splitOrientationAct) |
3259 self.viewActions.append(self.splitOrientationAct) |
3030 |
3260 |
3031 self.splitRemoveAct = E5Action(QApplication.translate('ViewManager', |
3261 self.splitRemoveAct = E5Action( |
3032 'Remove split'), |
3262 QApplication.translate('ViewManager', 'Remove split'), |
3033 UI.PixmapCache.getIcon("remsplitVertical.png"), |
3263 UI.PixmapCache.getIcon("remsplitVertical.png"), |
3034 QApplication.translate('ViewManager', '&Remove split'), |
3264 QApplication.translate('ViewManager', '&Remove split'), |
3035 0, 0, self, 'vm_view_remove_split') |
3265 0, 0, self, 'vm_view_remove_split') |
3036 self.splitRemoveAct.setStatusTip(QApplication.translate('ViewManager', |
3266 self.splitRemoveAct.setStatusTip(QApplication.translate('ViewManager', |
3037 'Remove the current split')) |
3267 'Remove the current split')) |
3038 self.splitRemoveAct.setWhatsThis(QApplication.translate('ViewManager', |
3268 self.splitRemoveAct.setWhatsThis(QApplication.translate('ViewManager', |
3039 """<b>Remove split</b>""" |
3269 """<b>Remove split</b>""" |
3040 """<p>Remove the current split.</p>""" |
3270 """<p>Remove the current split.</p>""" |
3041 )) |
3271 )) |
3042 self.splitRemoveAct.triggered[()].connect(self.removeSplit) |
3272 self.splitRemoveAct.triggered[()].connect(self.removeSplit) |
3043 self.viewActions.append(self.splitRemoveAct) |
3273 self.viewActions.append(self.splitRemoveAct) |
3044 |
3274 |
3045 self.nextSplitAct = E5Action(QApplication.translate('ViewManager', 'Next split'), |
3275 self.nextSplitAct = E5Action( |
3046 QApplication.translate('ViewManager', '&Next split'), |
3276 QApplication.translate('ViewManager', 'Next split'), |
3047 QKeySequence(QApplication.translate('ViewManager', |
3277 QApplication.translate('ViewManager', '&Next split'), |
3048 "Ctrl+Alt+N", "View|Next split")), |
3278 QKeySequence(QApplication.translate('ViewManager', |
3049 0, |
3279 "Ctrl+Alt+N", "View|Next split")), |
3050 self, 'vm_next_split') |
3280 0, |
|
3281 self, 'vm_next_split') |
3051 self.nextSplitAct.setStatusTip(QApplication.translate('ViewManager', |
3282 self.nextSplitAct.setStatusTip(QApplication.translate('ViewManager', |
3052 'Move to the next split')) |
3283 'Move to the next split')) |
3053 self.nextSplitAct.setWhatsThis(QApplication.translate('ViewManager', |
3284 self.nextSplitAct.setWhatsThis(QApplication.translate('ViewManager', |
3054 """<b>Next split</b>""" |
3285 """<b>Next split</b>""" |
3055 """<p>Move to the next split.</p>""" |
3286 """<p>Move to the next split.</p>""" |
3056 )) |
3287 )) |
3057 self.nextSplitAct.triggered[()].connect(self.nextSplit) |
3288 self.nextSplitAct.triggered[()].connect(self.nextSplit) |
3058 self.viewActions.append(self.nextSplitAct) |
3289 self.viewActions.append(self.nextSplitAct) |
3059 |
3290 |
3060 self.prevSplitAct = E5Action(QApplication.translate('ViewManager', |
3291 self.prevSplitAct = E5Action( |
3061 'Previous split'), |
3292 QApplication.translate('ViewManager', 'Previous split'), |
3062 QApplication.translate('ViewManager', '&Previous split'), |
3293 QApplication.translate('ViewManager', '&Previous split'), |
3063 QKeySequence(QApplication.translate('ViewManager', |
3294 QKeySequence(QApplication.translate('ViewManager', |
3064 "Ctrl+Alt+P", "View|Previous split")), |
3295 "Ctrl+Alt+P", "View|Previous split")), |
3065 0, self, 'vm_previous_split') |
3296 0, self, 'vm_previous_split') |
3066 self.prevSplitAct.setStatusTip(QApplication.translate('ViewManager', |
3297 self.prevSplitAct.setStatusTip(QApplication.translate('ViewManager', |
3067 'Move to the previous split')) |
3298 'Move to the previous split')) |
3068 self.prevSplitAct.setWhatsThis(QApplication.translate('ViewManager', |
3299 self.prevSplitAct.setWhatsThis(QApplication.translate('ViewManager', |
3069 """<b>Previous split</b>""" |
3300 """<b>Previous split</b>""" |
3070 """<p>Move to the previous split.</p>""" |
3301 """<p>Move to the previous split.</p>""" |
3182 """<p>Stop recording editor commands into a new macro.</p>""" |
3415 """<p>Stop recording editor commands into a new macro.</p>""" |
3183 )) |
3416 )) |
3184 self.macroStopRecAct.triggered[()].connect(self.__macroStopRecording) |
3417 self.macroStopRecAct.triggered[()].connect(self.__macroStopRecording) |
3185 self.macroActions.append(self.macroStopRecAct) |
3418 self.macroActions.append(self.macroStopRecAct) |
3186 |
3419 |
3187 self.macroRunAct = E5Action(QApplication.translate('ViewManager', 'Run Macro'), |
3420 self.macroRunAct = E5Action( |
3188 QApplication.translate('ViewManager', '&Run Macro'), |
3421 QApplication.translate('ViewManager', 'Run Macro'), |
3189 0, 0, self.macroActGrp, 'vm_macro_run') |
3422 QApplication.translate('ViewManager', '&Run Macro'), |
3190 self.macroRunAct.setStatusTip(QApplication.translate('ViewManager', 'Run Macro')) |
3423 0, 0, self.macroActGrp, 'vm_macro_run') |
3191 self.macroRunAct.setWhatsThis(QApplication.translate('ViewManager', |
3424 self.macroRunAct.setStatusTip(QApplication.translate( |
3192 """<b>Run Macro</b>""" |
3425 'ViewManager', 'Run Macro')) |
3193 """<p>Run a previously recorded editor macro.</p>""" |
3426 self.macroRunAct.setWhatsThis(QApplication.translate( |
3194 )) |
3427 'ViewManager', |
|
3428 """<b>Run Macro</b>""" |
|
3429 """<p>Run a previously recorded editor macro.</p>""" |
|
3430 )) |
3195 self.macroRunAct.triggered[()].connect(self.__macroRun) |
3431 self.macroRunAct.triggered[()].connect(self.__macroRun) |
3196 self.macroActions.append(self.macroRunAct) |
3432 self.macroActions.append(self.macroRunAct) |
3197 |
3433 |
3198 self.macroDeleteAct = E5Action(QApplication.translate('ViewManager', |
3434 self.macroDeleteAct = E5Action( |
3199 'Delete Macro'), |
3435 QApplication.translate('ViewManager', 'Delete Macro'), |
3200 QApplication.translate('ViewManager', '&Delete Macro'), |
3436 QApplication.translate('ViewManager', '&Delete Macro'), |
3201 0, 0, self.macroActGrp, 'vm_macro_delete') |
3437 0, 0, self.macroActGrp, 'vm_macro_delete') |
3202 self.macroDeleteAct.setStatusTip(QApplication.translate('ViewManager', |
3438 self.macroDeleteAct.setStatusTip(QApplication.translate( |
3203 'Delete Macro')) |
3439 'ViewManager', 'Delete Macro')) |
3204 self.macroDeleteAct.setWhatsThis(QApplication.translate('ViewManager', |
3440 self.macroDeleteAct.setWhatsThis(QApplication.translate( |
3205 """<b>Delete Macro</b>""" |
3441 'ViewManager', |
3206 """<p>Delete a previously recorded editor macro.</p>""" |
3442 """<b>Delete Macro</b>""" |
3207 )) |
3443 """<p>Delete a previously recorded editor macro.</p>""" |
|
3444 )) |
3208 self.macroDeleteAct.triggered[()].connect(self.__macroDelete) |
3445 self.macroDeleteAct.triggered[()].connect(self.__macroDelete) |
3209 self.macroActions.append(self.macroDeleteAct) |
3446 self.macroActions.append(self.macroDeleteAct) |
3210 |
3447 |
3211 self.macroLoadAct = E5Action(QApplication.translate('ViewManager', 'Load Macro'), |
3448 self.macroLoadAct = E5Action( |
3212 QApplication.translate('ViewManager', '&Load Macro'), |
3449 QApplication.translate('ViewManager', 'Load Macro'), |
3213 0, 0, self.macroActGrp, 'vm_macro_load') |
3450 QApplication.translate('ViewManager', '&Load Macro'), |
3214 self.macroLoadAct.setStatusTip(QApplication.translate('ViewManager', |
3451 0, 0, self.macroActGrp, 'vm_macro_load') |
3215 'Load Macro')) |
3452 self.macroLoadAct.setStatusTip(QApplication.translate( |
3216 self.macroLoadAct.setWhatsThis(QApplication.translate('ViewManager', |
3453 'ViewManager', 'Load Macro')) |
3217 """<b>Load Macro</b>""" |
3454 self.macroLoadAct.setWhatsThis(QApplication.translate( |
3218 """<p>Load an editor macro from a file.</p>""" |
3455 'ViewManager', |
3219 )) |
3456 """<b>Load Macro</b>""" |
|
3457 """<p>Load an editor macro from a file.</p>""" |
|
3458 )) |
3220 self.macroLoadAct.triggered[()].connect(self.__macroLoad) |
3459 self.macroLoadAct.triggered[()].connect(self.__macroLoad) |
3221 self.macroActions.append(self.macroLoadAct) |
3460 self.macroActions.append(self.macroLoadAct) |
3222 |
3461 |
3223 self.macroSaveAct = E5Action(QApplication.translate('ViewManager', 'Save Macro'), |
3462 self.macroSaveAct = E5Action( |
3224 QApplication.translate('ViewManager', '&Save Macro'), |
3463 QApplication.translate('ViewManager', 'Save Macro'), |
3225 0, 0, self.macroActGrp, 'vm_macro_save') |
3464 QApplication.translate('ViewManager', '&Save Macro'), |
|
3465 0, 0, self.macroActGrp, 'vm_macro_save') |
3226 self.macroSaveAct.setStatusTip(QApplication.translate('ViewManager', |
3466 self.macroSaveAct.setStatusTip(QApplication.translate('ViewManager', |
3227 'Save Macro')) |
3467 'Save Macro')) |
3228 self.macroSaveAct.setWhatsThis(QApplication.translate('ViewManager', |
3468 self.macroSaveAct.setWhatsThis(QApplication.translate('ViewManager', |
3229 """<b>Save Macro</b>""" |
3469 """<b>Save Macro</b>""" |
3230 """<p>Save a previously recorded editor macro to a file.</p>""" |
3470 """<p>Save a previously recorded editor macro to a file.</p>""" |
3250 ## Initialize the bookmark related actions, bookmark menu and toolbar |
3490 ## Initialize the bookmark related actions, bookmark menu and toolbar |
3251 ##################################################################### |
3491 ##################################################################### |
3252 |
3492 |
3253 def __initBookmarkActions(self): |
3493 def __initBookmarkActions(self): |
3254 """ |
3494 """ |
3255 Private method defining the user interface actions for the bookmarks commands. |
3495 Private method defining the user interface actions for the bookmarks |
|
3496 commands. |
3256 """ |
3497 """ |
3257 self.bookmarkActGrp = createActionGroup(self) |
3498 self.bookmarkActGrp = createActionGroup(self) |
3258 |
3499 |
3259 self.bookmarkToggleAct = E5Action(QApplication.translate('ViewManager', |
3500 self.bookmarkToggleAct = E5Action( |
3260 'Toggle Bookmark'), |
3501 QApplication.translate('ViewManager', 'Toggle Bookmark'), |
3261 UI.PixmapCache.getIcon("bookmarkToggle.png"), |
3502 UI.PixmapCache.getIcon("bookmarkToggle.png"), |
3262 QApplication.translate('ViewManager', '&Toggle Bookmark'), |
3503 QApplication.translate('ViewManager', '&Toggle Bookmark'), |
3263 QKeySequence(QApplication.translate('ViewManager', |
3504 QKeySequence(QApplication.translate( |
3264 "Alt+Ctrl+T", "Bookmark|Toggle")), 0, |
3505 'ViewManager', "Alt+Ctrl+T", "Bookmark|Toggle")), |
3265 self.bookmarkActGrp, 'vm_bookmark_toggle') |
3506 0, |
3266 self.bookmarkToggleAct.setStatusTip(QApplication.translate('ViewManager', |
3507 self.bookmarkActGrp, 'vm_bookmark_toggle') |
3267 'Toggle Bookmark')) |
3508 self.bookmarkToggleAct.setStatusTip(QApplication.translate( |
3268 self.bookmarkToggleAct.setWhatsThis(QApplication.translate('ViewManager', |
3509 'ViewManager', 'Toggle Bookmark')) |
3269 """<b>Toggle Bookmark</b>""" |
3510 self.bookmarkToggleAct.setWhatsThis(QApplication.translate( |
3270 """<p>Toggle a bookmark at the current line of the current editor.</p>""" |
3511 'ViewManager', |
3271 )) |
3512 """<b>Toggle Bookmark</b>""" |
|
3513 """<p>Toggle a bookmark at the current line of the current""" |
|
3514 """ editor.</p>""" |
|
3515 )) |
3272 self.bookmarkToggleAct.triggered[()].connect(self.__toggleBookmark) |
3516 self.bookmarkToggleAct.triggered[()].connect(self.__toggleBookmark) |
3273 self.bookmarkActions.append(self.bookmarkToggleAct) |
3517 self.bookmarkActions.append(self.bookmarkToggleAct) |
3274 |
3518 |
3275 self.bookmarkNextAct = E5Action(QApplication.translate('ViewManager', |
3519 self.bookmarkNextAct = E5Action( |
3276 'Next Bookmark'), |
3520 QApplication.translate('ViewManager', 'Next Bookmark'), |
3277 UI.PixmapCache.getIcon("bookmarkNext.png"), |
3521 UI.PixmapCache.getIcon("bookmarkNext.png"), |
3278 QApplication.translate('ViewManager', '&Next Bookmark'), |
3522 QApplication.translate('ViewManager', '&Next Bookmark'), |
3279 QKeySequence(QApplication.translate('ViewManager', |
3523 QKeySequence(QApplication.translate( |
3280 "Ctrl+PgDown", "Bookmark|Next")), 0, |
3524 'ViewManager', "Ctrl+PgDown", "Bookmark|Next")), |
3281 self.bookmarkActGrp, 'vm_bookmark_next') |
3525 0, |
|
3526 self.bookmarkActGrp, 'vm_bookmark_next') |
3282 self.bookmarkNextAct.setStatusTip(QApplication.translate('ViewManager', |
3527 self.bookmarkNextAct.setStatusTip(QApplication.translate('ViewManager', |
3283 'Next Bookmark')) |
3528 'Next Bookmark')) |
3284 self.bookmarkNextAct.setWhatsThis(QApplication.translate('ViewManager', |
3529 self.bookmarkNextAct.setWhatsThis(QApplication.translate('ViewManager', |
3285 """<b>Next Bookmark</b>""" |
3530 """<b>Next Bookmark</b>""" |
3286 """<p>Go to next bookmark of the current editor.</p>""" |
3531 """<p>Go to next bookmark of the current editor.</p>""" |
3287 )) |
3532 )) |
3288 self.bookmarkNextAct.triggered[()].connect(self.__nextBookmark) |
3533 self.bookmarkNextAct.triggered[()].connect(self.__nextBookmark) |
3289 self.bookmarkActions.append(self.bookmarkNextAct) |
3534 self.bookmarkActions.append(self.bookmarkNextAct) |
3290 |
3535 |
3291 self.bookmarkPreviousAct = E5Action(QApplication.translate('ViewManager', |
3536 self.bookmarkPreviousAct = E5Action( |
3292 'Previous Bookmark'), |
3537 QApplication.translate('ViewManager', 'Previous Bookmark'), |
3293 UI.PixmapCache.getIcon("bookmarkPrevious.png"), |
3538 UI.PixmapCache.getIcon("bookmarkPrevious.png"), |
3294 QApplication.translate('ViewManager', '&Previous Bookmark'), |
3539 QApplication.translate('ViewManager', '&Previous Bookmark'), |
3295 QKeySequence(QApplication.translate('ViewManager', |
3540 QKeySequence(QApplication.translate( |
3296 "Ctrl+PgUp", "Bookmark|Previous")), |
3541 'ViewManager', "Ctrl+PgUp", "Bookmark|Previous")), |
3297 0, self.bookmarkActGrp, 'vm_bookmark_previous') |
3542 0, |
3298 self.bookmarkPreviousAct.setStatusTip(QApplication.translate('ViewManager', |
3543 self.bookmarkActGrp, 'vm_bookmark_previous') |
3299 'Previous Bookmark')) |
3544 self.bookmarkPreviousAct.setStatusTip(QApplication.translate( |
3300 self.bookmarkPreviousAct.setWhatsThis(QApplication.translate('ViewManager', |
3545 'ViewManager', 'Previous Bookmark')) |
3301 """<b>Previous Bookmark</b>""" |
3546 self.bookmarkPreviousAct.setWhatsThis(QApplication.translate( |
3302 """<p>Go to previous bookmark of the current editor.</p>""" |
3547 'ViewManager', |
3303 )) |
3548 """<b>Previous Bookmark</b>""" |
|
3549 """<p>Go to previous bookmark of the current editor.</p>""" |
|
3550 )) |
3304 self.bookmarkPreviousAct.triggered[()].connect(self.__previousBookmark) |
3551 self.bookmarkPreviousAct.triggered[()].connect(self.__previousBookmark) |
3305 self.bookmarkActions.append(self.bookmarkPreviousAct) |
3552 self.bookmarkActions.append(self.bookmarkPreviousAct) |
3306 |
3553 |
3307 self.bookmarkClearAct = E5Action(QApplication.translate('ViewManager', |
3554 self.bookmarkClearAct = E5Action( |
3308 'Clear Bookmarks'), |
3555 QApplication.translate('ViewManager', 'Clear Bookmarks'), |
3309 QApplication.translate('ViewManager', '&Clear Bookmarks'), |
3556 QApplication.translate('ViewManager', '&Clear Bookmarks'), |
3310 QKeySequence(QApplication.translate('ViewManager', |
3557 QKeySequence(QApplication.translate( |
3311 "Alt+Ctrl+C", "Bookmark|Clear")), |
3558 'ViewManager', "Alt+Ctrl+C", "Bookmark|Clear")), |
3312 0, |
3559 0, |
3313 self.bookmarkActGrp, 'vm_bookmark_clear') |
3560 self.bookmarkActGrp, 'vm_bookmark_clear') |
3314 self.bookmarkClearAct.setStatusTip(QApplication.translate('ViewManager', |
3561 self.bookmarkClearAct.setStatusTip(QApplication.translate( |
3315 'Clear Bookmarks')) |
3562 'ViewManager', 'Clear Bookmarks')) |
3316 self.bookmarkClearAct.setWhatsThis(QApplication.translate('ViewManager', |
3563 self.bookmarkClearAct.setWhatsThis(QApplication.translate( |
3317 """<b>Clear Bookmarks</b>""" |
3564 'ViewManager', |
3318 """<p>Clear bookmarks of all editors.</p>""" |
3565 """<b>Clear Bookmarks</b>""" |
3319 )) |
3566 """<p>Clear bookmarks of all editors.</p>""" |
|
3567 )) |
3320 self.bookmarkClearAct.triggered[()].connect(self.__clearAllBookmarks) |
3568 self.bookmarkClearAct.triggered[()].connect(self.__clearAllBookmarks) |
3321 self.bookmarkActions.append(self.bookmarkClearAct) |
3569 self.bookmarkActions.append(self.bookmarkClearAct) |
3322 |
3570 |
3323 self.syntaxErrorGotoAct = E5Action(QApplication.translate('ViewManager', |
3571 self.syntaxErrorGotoAct = E5Action( |
3324 'Goto Syntax Error'), |
3572 QApplication.translate('ViewManager', 'Goto Syntax Error'), |
3325 UI.PixmapCache.getIcon("syntaxErrorGoto.png"), |
3573 UI.PixmapCache.getIcon("syntaxErrorGoto.png"), |
3326 QApplication.translate('ViewManager', '&Goto Syntax Error'), |
3574 QApplication.translate('ViewManager', '&Goto Syntax Error'), |
3327 0, 0, |
3575 0, 0, |
3328 self.bookmarkActGrp, 'vm_syntaxerror_goto') |
3576 self.bookmarkActGrp, 'vm_syntaxerror_goto') |
3329 self.syntaxErrorGotoAct.setStatusTip(QApplication.translate('ViewManager', |
3577 self.syntaxErrorGotoAct.setStatusTip(QApplication.translate( |
3330 'Goto Syntax Error')) |
3578 'ViewManager', 'Goto Syntax Error')) |
3331 self.syntaxErrorGotoAct.setWhatsThis(QApplication.translate('ViewManager', |
3579 self.syntaxErrorGotoAct.setWhatsThis(QApplication.translate( |
3332 """<b>Goto Syntax Error</b>""" |
3580 'ViewManager', |
3333 """<p>Go to next syntax error of the current editor.</p>""" |
3581 """<b>Goto Syntax Error</b>""" |
3334 )) |
3582 """<p>Go to next syntax error of the current editor.</p>""" |
|
3583 )) |
3335 self.syntaxErrorGotoAct.triggered[()].connect(self.__gotoSyntaxError) |
3584 self.syntaxErrorGotoAct.triggered[()].connect(self.__gotoSyntaxError) |
3336 self.bookmarkActions.append(self.syntaxErrorGotoAct) |
3585 self.bookmarkActions.append(self.syntaxErrorGotoAct) |
3337 |
3586 |
3338 self.syntaxErrorClearAct = E5Action(QApplication.translate('ViewManager', |
3587 self.syntaxErrorClearAct = E5Action( |
3339 'Clear Syntax Errors'), |
3588 QApplication.translate('ViewManager', 'Clear Syntax Errors'), |
3340 QApplication.translate('ViewManager', 'Clear &Syntax Errors'), |
3589 QApplication.translate('ViewManager', 'Clear &Syntax Errors'), |
3341 0, 0, |
3590 0, 0, |
3342 self.bookmarkActGrp, 'vm_syntaxerror_clear') |
3591 self.bookmarkActGrp, 'vm_syntaxerror_clear') |
3343 self.syntaxErrorClearAct.setStatusTip(QApplication.translate('ViewManager', |
3592 self.syntaxErrorClearAct.setStatusTip(QApplication.translate( |
3344 'Clear Syntax Errors')) |
3593 'ViewManager', 'Clear Syntax Errors')) |
3345 self.syntaxErrorClearAct.setWhatsThis(QApplication.translate('ViewManager', |
3594 self.syntaxErrorClearAct.setWhatsThis(QApplication.translate( |
3346 """<b>Clear Syntax Errors</b>""" |
3595 'ViewManager', |
3347 """<p>Clear syntax errors of all editors.</p>""" |
3596 """<b>Clear Syntax Errors</b>""" |
3348 )) |
3597 """<p>Clear syntax errors of all editors.</p>""" |
3349 self.syntaxErrorClearAct.triggered[()].connect(self.__clearAllSyntaxErrors) |
3598 )) |
|
3599 self.syntaxErrorClearAct.triggered[()].connect( |
|
3600 self.__clearAllSyntaxErrors) |
3350 self.bookmarkActions.append(self.syntaxErrorClearAct) |
3601 self.bookmarkActions.append(self.syntaxErrorClearAct) |
3351 |
3602 |
3352 self.warningsNextAct = E5Action(QApplication.translate('ViewManager', |
3603 self.warningsNextAct = E5Action(QApplication.translate('ViewManager', |
3353 'Next warning message'), |
3604 'Next warning message'), |
3354 UI.PixmapCache.getIcon("warningNext.png"), |
3605 UI.PixmapCache.getIcon("warningNext.png"), |
3364 """ having a py3flakes warning.</p>""" |
3615 """ having a py3flakes warning.</p>""" |
3365 )) |
3616 )) |
3366 self.warningsNextAct.triggered[()].connect(self.__nextWarning) |
3617 self.warningsNextAct.triggered[()].connect(self.__nextWarning) |
3367 self.bookmarkActions.append(self.warningsNextAct) |
3618 self.bookmarkActions.append(self.warningsNextAct) |
3368 |
3619 |
3369 self.warningsPreviousAct = E5Action(QApplication.translate('ViewManager', |
3620 self.warningsPreviousAct = E5Action( |
3370 'Previous warning message'), |
3621 QApplication.translate('ViewManager', 'Previous warning message'), |
3371 UI.PixmapCache.getIcon("warningPrev.png"), |
3622 UI.PixmapCache.getIcon("warningPrev.png"), |
3372 QApplication.translate('ViewManager', |
3623 QApplication.translate('ViewManager', |
3373 '&Previous warning message'), |
3624 '&Previous warning message'), |
3374 0, 0, |
3625 0, 0, |
3375 self.bookmarkActGrp, 'vm_warning_previous') |
3626 self.bookmarkActGrp, 'vm_warning_previous') |
3376 self.warningsPreviousAct.setStatusTip(QApplication.translate('ViewManager', |
3627 self.warningsPreviousAct.setStatusTip(QApplication.translate( |
3377 'Previous warning message')) |
3628 'ViewManager', 'Previous warning message')) |
3378 self.warningsPreviousAct.setWhatsThis(QApplication.translate('ViewManager', |
3629 self.warningsPreviousAct.setWhatsThis(QApplication.translate( |
3379 """<b>Previous warning message</b>""" |
3630 'ViewManager', |
3380 """<p>Go to previous line of the current editor""" |
3631 """<b>Previous warning message</b>""" |
3381 """ having a py3flakes warning.</p>""" |
3632 """<p>Go to previous line of the current editor""" |
3382 )) |
3633 """ having a py3flakes warning.</p>""" |
|
3634 )) |
3383 self.warningsPreviousAct.triggered[()].connect(self.__previousWarning) |
3635 self.warningsPreviousAct.triggered[()].connect(self.__previousWarning) |
3384 self.bookmarkActions.append(self.warningsPreviousAct) |
3636 self.bookmarkActions.append(self.warningsPreviousAct) |
3385 |
3637 |
3386 self.warningsClearAct = E5Action(QApplication.translate('ViewManager', |
3638 self.warningsClearAct = E5Action( |
3387 'Clear Warning Messages'), |
3639 QApplication.translate('ViewManager', 'Clear Warning Messages'), |
3388 QApplication.translate('ViewManager', |
3640 QApplication.translate('ViewManager', 'Clear &Warning Messages'), |
3389 'Clear &Warning Messages'), |
3641 0, 0, |
3390 0, 0, |
3642 self.bookmarkActGrp, 'vm_warnings_clear') |
3391 self.bookmarkActGrp, 'vm_warnings_clear') |
3643 self.warningsClearAct.setStatusTip(QApplication.translate( |
3392 self.warningsClearAct.setStatusTip(QApplication.translate('ViewManager', |
3644 'ViewManager', 'Clear Warning Messages')) |
3393 'Clear Warning Messages')) |
3645 self.warningsClearAct.setWhatsThis(QApplication.translate( |
3394 self.warningsClearAct.setWhatsThis(QApplication.translate('ViewManager', |
3646 'ViewManager', |
3395 """<b>Clear Warning Messages</b>""" |
3647 """<b>Clear Warning Messages</b>""" |
3396 """<p>Clear py3flakes warning messages of all editors.</p>""" |
3648 """<p>Clear py3flakes warning messages of all editors.</p>""" |
3397 )) |
3649 )) |
3398 self.warningsClearAct.triggered[()].connect(self.__clearAllWarnings) |
3650 self.warningsClearAct.triggered[()].connect(self.__clearAllWarnings) |
3399 self.bookmarkActions.append(self.warningsClearAct) |
3651 self.bookmarkActions.append(self.warningsClearAct) |
3400 |
3652 |
3401 self.notcoveredNextAct = E5Action(QApplication.translate('ViewManager', |
3653 self.notcoveredNextAct = E5Action( |
3402 'Next uncovered line'), |
3654 QApplication.translate('ViewManager', 'Next uncovered line'), |
3403 UI.PixmapCache.getIcon("notcoveredNext.png"), |
3655 UI.PixmapCache.getIcon("notcoveredNext.png"), |
3404 QApplication.translate('ViewManager', '&Next uncovered line'), |
3656 QApplication.translate('ViewManager', '&Next uncovered line'), |
3405 0, 0, |
3657 0, 0, |
3406 self.bookmarkActGrp, 'vm_uncovered_next') |
3658 self.bookmarkActGrp, 'vm_uncovered_next') |
3407 self.notcoveredNextAct.setStatusTip(QApplication.translate('ViewManager', |
3659 self.notcoveredNextAct.setStatusTip(QApplication.translate( |
3408 'Next uncovered line')) |
3660 'ViewManager', 'Next uncovered line')) |
3409 self.notcoveredNextAct.setWhatsThis(QApplication.translate('ViewManager', |
3661 self.notcoveredNextAct.setWhatsThis(QApplication.translate( |
3410 """<b>Next uncovered line</b>""" |
3662 'ViewManager', |
3411 """<p>Go to next line of the current editor marked as not covered.</p>""" |
3663 """<b>Next uncovered line</b>""" |
3412 )) |
3664 """<p>Go to next line of the current editor marked as not""" |
|
3665 """ covered.</p>""" |
|
3666 )) |
3413 self.notcoveredNextAct.triggered[()].connect(self.__nextUncovered) |
3667 self.notcoveredNextAct.triggered[()].connect(self.__nextUncovered) |
3414 self.bookmarkActions.append(self.notcoveredNextAct) |
3668 self.bookmarkActions.append(self.notcoveredNextAct) |
3415 |
3669 |
3416 self.notcoveredPreviousAct = E5Action(QApplication.translate('ViewManager', |
3670 self.notcoveredPreviousAct = E5Action( |
3417 'Previous uncovered line'), |
3671 QApplication.translate('ViewManager', 'Previous uncovered line'), |
3418 UI.PixmapCache.getIcon("notcoveredPrev.png"), |
3672 UI.PixmapCache.getIcon("notcoveredPrev.png"), |
3419 QApplication.translate('ViewManager', |
3673 QApplication.translate('ViewManager', |
3420 '&Previous uncovered line'), |
3674 '&Previous uncovered line'), |
3421 0, 0, |
3675 0, 0, |
3422 self.bookmarkActGrp, 'vm_uncovered_previous') |
3676 self.bookmarkActGrp, 'vm_uncovered_previous') |
3423 self.notcoveredPreviousAct.setStatusTip(QApplication.translate('ViewManager', |
3677 self.notcoveredPreviousAct.setStatusTip(QApplication.translate( |
3424 'Previous uncovered line')) |
3678 'ViewManager', 'Previous uncovered line')) |
3425 self.notcoveredPreviousAct.setWhatsThis(QApplication.translate('ViewManager', |
3679 self.notcoveredPreviousAct.setWhatsThis(QApplication.translate( |
3426 """<b>Previous uncovered line</b>""" |
3680 'ViewManager', |
3427 """<p>Go to previous line of the current editor marked""" |
3681 """<b>Previous uncovered line</b>""" |
3428 """ as not covered.</p>""" |
3682 """<p>Go to previous line of the current editor marked""" |
3429 )) |
3683 """ as not covered.</p>""" |
3430 self.notcoveredPreviousAct.triggered[()].connect(self.__previousUncovered) |
3684 )) |
|
3685 self.notcoveredPreviousAct.triggered[()].connect( |
|
3686 self.__previousUncovered) |
3431 self.bookmarkActions.append(self.notcoveredPreviousAct) |
3687 self.bookmarkActions.append(self.notcoveredPreviousAct) |
3432 |
3688 |
3433 self.taskNextAct = E5Action(QApplication.translate('ViewManager', |
3689 self.taskNextAct = E5Action( |
3434 'Next Task'), |
3690 QApplication.translate('ViewManager', 'Next Task'), |
3435 UI.PixmapCache.getIcon("taskNext.png"), |
3691 UI.PixmapCache.getIcon("taskNext.png"), |
3436 QApplication.translate('ViewManager', '&Next Task'), |
3692 QApplication.translate('ViewManager', '&Next Task'), |
3437 0, 0, |
3693 0, 0, |
3438 self.bookmarkActGrp, 'vm_task_next') |
3694 self.bookmarkActGrp, 'vm_task_next') |
3439 self.taskNextAct.setStatusTip(QApplication.translate('ViewManager', |
3695 self.taskNextAct.setStatusTip(QApplication.translate( |
3440 'Next Task')) |
3696 'ViewManager', 'Next Task')) |
3441 self.taskNextAct.setWhatsThis(QApplication.translate('ViewManager', |
3697 self.taskNextAct.setWhatsThis(QApplication.translate( |
3442 """<b>Next Task</b>""" |
3698 'ViewManager', |
3443 """<p>Go to next line of the current editor having a task.</p>""" |
3699 """<b>Next Task</b>""" |
3444 )) |
3700 """<p>Go to next line of the current editor having a task.</p>""" |
|
3701 )) |
3445 self.taskNextAct.triggered[()].connect(self.__nextTask) |
3702 self.taskNextAct.triggered[()].connect(self.__nextTask) |
3446 self.bookmarkActions.append(self.taskNextAct) |
3703 self.bookmarkActions.append(self.taskNextAct) |
3447 |
3704 |
3448 self.taskPreviousAct = E5Action(QApplication.translate('ViewManager', |
3705 self.taskPreviousAct = E5Action( |
3449 'Previous Task'), |
3706 QApplication.translate('ViewManager', 'Previous Task'), |
3450 UI.PixmapCache.getIcon("taskPrev.png"), |
3707 UI.PixmapCache.getIcon("taskPrev.png"), |
3451 QApplication.translate('ViewManager', |
3708 QApplication.translate('ViewManager', |
3452 '&Previous Task'), |
3709 '&Previous Task'), |
3453 0, 0, |
3710 0, 0, |
3454 self.bookmarkActGrp, 'vm_task_previous') |
3711 self.bookmarkActGrp, 'vm_task_previous') |
3455 self.taskPreviousAct.setStatusTip(QApplication.translate('ViewManager', |
3712 self.taskPreviousAct.setStatusTip(QApplication.translate( |
3456 'Previous Task')) |
3713 'ViewManager', 'Previous Task')) |
3457 self.taskPreviousAct.setWhatsThis(QApplication.translate('ViewManager', |
3714 self.taskPreviousAct.setWhatsThis(QApplication.translate( |
3458 """<b>Previous Task</b>""" |
3715 'ViewManager', |
3459 """<p>Go to previous line of the current editor having a task.</p>""" |
3716 """<b>Previous Task</b>""" |
3460 )) |
3717 """<p>Go to previous line of the current editor having a""" |
|
3718 """ task.</p>""" |
|
3719 )) |
3461 self.taskPreviousAct.triggered[()].connect(self.__previousTask) |
3720 self.taskPreviousAct.triggered[()].connect(self.__previousTask) |
3462 self.bookmarkActions.append(self.taskPreviousAct) |
3721 self.bookmarkActions.append(self.taskPreviousAct) |
3463 |
3722 |
3464 self.changeNextAct = E5Action(QApplication.translate('ViewManager', |
3723 self.changeNextAct = E5Action( |
3465 'Next Change'), |
3724 QApplication.translate('ViewManager', 'Next Change'), |
3466 UI.PixmapCache.getIcon("changeNext.png"), |
3725 UI.PixmapCache.getIcon("changeNext.png"), |
3467 QApplication.translate('ViewManager', '&Next Change'), |
3726 QApplication.translate('ViewManager', '&Next Change'), |
3468 0, 0, |
3727 0, 0, |
3469 self.bookmarkActGrp, 'vm_change_next') |
3728 self.bookmarkActGrp, 'vm_change_next') |
3470 self.changeNextAct.setStatusTip(QApplication.translate('ViewManager', |
3729 self.changeNextAct.setStatusTip(QApplication.translate( |
3471 'Next Change')) |
3730 'ViewManager', 'Next Change')) |
3472 self.changeNextAct.setWhatsThis(QApplication.translate('ViewManager', |
3731 self.changeNextAct.setWhatsThis(QApplication.translate( |
3473 """<b>Next Change</b>""" |
3732 'ViewManager', |
3474 """<p>Go to next line of the current editor having a change marker.</p>""" |
3733 """<b>Next Change</b>""" |
3475 )) |
3734 """<p>Go to next line of the current editor having a change""" |
|
3735 """ marker.</p>""" |
|
3736 )) |
3476 self.changeNextAct.triggered[()].connect(self.__nextChange) |
3737 self.changeNextAct.triggered[()].connect(self.__nextChange) |
3477 self.bookmarkActions.append(self.changeNextAct) |
3738 self.bookmarkActions.append(self.changeNextAct) |
3478 |
3739 |
3479 self.changePreviousAct = E5Action(QApplication.translate('ViewManager', |
3740 self.changePreviousAct = E5Action( |
3480 'Previous Change'), |
3741 QApplication.translate('ViewManager', 'Previous Change'), |
3481 UI.PixmapCache.getIcon("changePrev.png"), |
3742 UI.PixmapCache.getIcon("changePrev.png"), |
3482 QApplication.translate('ViewManager', |
3743 QApplication.translate('ViewManager', |
3483 '&Previous Change'), |
3744 '&Previous Change'), |
3484 0, 0, |
3745 0, 0, |
3485 self.bookmarkActGrp, 'vm_change_previous') |
3746 self.bookmarkActGrp, 'vm_change_previous') |
3486 self.changePreviousAct.setStatusTip(QApplication.translate('ViewManager', |
3747 self.changePreviousAct.setStatusTip(QApplication.translate( |
3487 'Previous Change')) |
3748 'ViewManager', 'Previous Change')) |
3488 self.changePreviousAct.setWhatsThis(QApplication.translate('ViewManager', |
3749 self.changePreviousAct.setWhatsThis(QApplication.translate( |
3489 """<b>Previous Change</b>""" |
3750 'ViewManager', |
3490 """<p>Go to previous line of the current editor having""" |
3751 """<b>Previous Change</b>""" |
3491 """ a change marker.</p>""" |
3752 """<p>Go to previous line of the current editor having""" |
3492 )) |
3753 """ a change marker.</p>""" |
|
3754 )) |
3493 self.changePreviousAct.triggered[()].connect(self.__previousChange) |
3755 self.changePreviousAct.triggered[()].connect(self.__previousChange) |
3494 self.bookmarkActions.append(self.changePreviousAct) |
3756 self.bookmarkActions.append(self.changePreviousAct) |
3495 |
3757 |
3496 self.bookmarkActGrp.setEnabled(False) |
3758 self.bookmarkActGrp.setEnabled(False) |
3497 |
3759 |
3498 def initBookmarkMenu(self): |
3760 def initBookmarkMenu(self): |
3499 """ |
3761 """ |
3500 Public method to create the Bookmark menu |
3762 Public method to create the Bookmark menu. |
3501 |
3763 |
3502 @return the generated menu |
3764 @return the generated menu |
3503 """ |
3765 """ |
3504 menu = QMenu(QApplication.translate('ViewManager', '&Bookmarks'), self.ui) |
3766 menu = QMenu(QApplication.translate('ViewManager', '&Bookmarks'), |
3505 self.bookmarksMenu = QMenu(QApplication.translate('ViewManager', '&Bookmarks'), |
3767 self.ui) |
|
3768 self.bookmarksMenu = QMenu( |
|
3769 QApplication.translate('ViewManager', '&Bookmarks'), |
3506 menu) |
3770 menu) |
3507 menu.setTearOffEnabled(True) |
3771 menu.setTearOffEnabled(True) |
3508 |
3772 |
3509 menu.addAction(self.bookmarkToggleAct) |
3773 menu.addAction(self.bookmarkToggleAct) |
3510 menu.addAction(self.bookmarkNextAct) |
3774 menu.addAction(self.bookmarkNextAct) |
3576 """ |
3842 """ |
3577 Private method to initialize the spell checking actions. |
3843 Private method to initialize the spell checking actions. |
3578 """ |
3844 """ |
3579 self.spellingActGrp = createActionGroup(self) |
3845 self.spellingActGrp = createActionGroup(self) |
3580 |
3846 |
3581 self.spellCheckAct = E5Action(QApplication.translate('ViewManager', |
3847 self.spellCheckAct = E5Action( |
3582 'Check spelling'), |
3848 QApplication.translate('ViewManager', 'Check spelling'), |
3583 UI.PixmapCache.getIcon("spellchecking.png"), |
3849 UI.PixmapCache.getIcon("spellchecking.png"), |
3584 QApplication.translate('ViewManager', |
3850 QApplication.translate('ViewManager', |
3585 'Check &spelling...'), |
3851 'Check &spelling...'), |
3586 QKeySequence(QApplication.translate('ViewManager', |
3852 QKeySequence(QApplication.translate('ViewManager', |
3587 "Shift+F7", "Spelling|Spell Check")), |
3853 "Shift+F7", "Spelling|Spell Check")), |
3588 0, |
3854 0, |
3589 self.spellingActGrp, 'vm_spelling_spellcheck') |
3855 self.spellingActGrp, 'vm_spelling_spellcheck') |
3590 self.spellCheckAct.setStatusTip(QApplication.translate('ViewManager', |
3856 self.spellCheckAct.setStatusTip(QApplication.translate( |
3591 'Perform spell check of current editor')) |
3857 'ViewManager', 'Perform spell check of current editor')) |
3592 self.spellCheckAct.setWhatsThis(QApplication.translate('ViewManager', |
3858 self.spellCheckAct.setWhatsThis(QApplication.translate( |
3593 """<b>Check spelling</b>""" |
3859 'ViewManager', |
3594 """<p>Perform a spell check of the current editor.</p>""" |
3860 """<b>Check spelling</b>""" |
3595 )) |
3861 """<p>Perform a spell check of the current editor.</p>""" |
|
3862 )) |
3596 self.spellCheckAct.triggered[()].connect(self.__spellCheck) |
3863 self.spellCheckAct.triggered[()].connect(self.__spellCheck) |
3597 self.spellingActions.append(self.spellCheckAct) |
3864 self.spellingActions.append(self.spellCheckAct) |
3598 |
3865 |
3599 self.autoSpellCheckAct = E5Action(QApplication.translate('ViewManager', |
3866 self.autoSpellCheckAct = E5Action( |
3600 'Automatic spell checking'), |
3867 QApplication.translate('ViewManager', 'Automatic spell checking'), |
3601 UI.PixmapCache.getIcon("autospellchecking.png"), |
3868 UI.PixmapCache.getIcon("autospellchecking.png"), |
3602 QApplication.translate('ViewManager', |
3869 QApplication.translate('ViewManager', |
3603 '&Automatic spell checking'), |
3870 '&Automatic spell checking'), |
3604 0, 0, |
3871 0, 0, |
3605 self.spellingActGrp, 'vm_spelling_autospellcheck', True) |
3872 self.spellingActGrp, 'vm_spelling_autospellcheck', True) |
3606 self.autoSpellCheckAct.setStatusTip(QApplication.translate('ViewManager', |
3873 self.autoSpellCheckAct.setStatusTip(QApplication.translate( |
3607 '(De-)Activate automatic spell checking')) |
3874 'ViewManager', '(De-)Activate automatic spell checking')) |
3608 self.autoSpellCheckAct.setWhatsThis(QApplication.translate('ViewManager', |
3875 self.autoSpellCheckAct.setWhatsThis(QApplication.translate( |
3609 """<b>Automatic spell checking</b>""" |
3876 'ViewManager', |
3610 """<p>Activate or deactivate the automatic spell checking function of""" |
3877 """<b>Automatic spell checking</b>""" |
3611 """ all editors.</p>""" |
3878 """<p>Activate or deactivate the automatic spell checking""" |
3612 )) |
3879 """ function of all editors.</p>""" |
|
3880 )) |
3613 self.autoSpellCheckAct.setChecked( |
3881 self.autoSpellCheckAct.setChecked( |
3614 Preferences.getEditor("AutoSpellCheckingEnabled")) |
3882 Preferences.getEditor("AutoSpellCheckingEnabled")) |
3615 self.autoSpellCheckAct.triggered[()].connect(self.__setAutoSpellChecking) |
3883 self.autoSpellCheckAct.triggered[()].connect( |
|
3884 self.__setAutoSpellChecking) |
3616 self.spellingActions.append(self.autoSpellCheckAct) |
3885 self.spellingActions.append(self.autoSpellCheckAct) |
3617 |
3886 |
3618 self.__enableSpellingActions() |
3887 self.__enableSpellingActions() |
3619 |
3888 |
3620 def __enableSpellingActions(self): |
3889 def __enableSpellingActions(self): |
5497 self.__editSpellingDictionary(pel) |
5804 self.__editSpellingDictionary(pel) |
5498 |
5805 |
5499 def __editSpellingDictionary(self, dictionaryFile): |
5806 def __editSpellingDictionary(self, dictionaryFile): |
5500 """ |
5807 """ |
5501 Private slot to edit the given spelling dictionary. |
5808 Private slot to edit the given spelling dictionary. |
|
5809 |
|
5810 @param dictionaryFile file name of the dictionary to edit (string) |
5502 """ |
5811 """ |
5503 if os.path.exists(dictionaryFile): |
5812 if os.path.exists(dictionaryFile): |
5504 try: |
5813 try: |
5505 f = open(dictionaryFile, "r", encoding="utf-8") |
5814 f = open(dictionaryFile, "r", encoding="utf-8") |
5506 data = f.read() |
5815 data = f.read() |
5507 f.close() |
5816 f.close() |
5508 except (IOError, OSError) as err: |
5817 except (IOError, OSError) as err: |
5509 E5MessageBox.critical(self.ui, |
5818 E5MessageBox.critical( |
5510 QApplication.translate('ViewManager', "Edit Spelling Dictionary"), |
5819 self.ui, |
5511 QApplication.translate('ViewManager', |
5820 QApplication.translate( |
|
5821 'ViewManager', "Edit Spelling Dictionary"), |
|
5822 QApplication.translate( |
|
5823 'ViewManager', |
5512 """<p>The spelling dictionary file <b>{0}</b> could""" |
5824 """<p>The spelling dictionary file <b>{0}</b> could""" |
5513 """ not be read.</p><p>Reason: {1}</p>""").format( |
5825 """ not be read.</p><p>Reason: {1}</p>""").format( |
5514 dictionaryFile, str(err))) |
5826 dictionaryFile, str(err))) |
5515 return |
5827 return |
5516 |
5828 |
5517 fileInfo = dictionaryFile if len(dictionaryFile) < 40 \ |
5829 fileInfo = dictionaryFile if len(dictionaryFile) < 40 \ |
5518 else "...{0}".format(dictionaryFile[-40:]) |
5830 else "...{0}".format(dictionaryFile[-40:]) |
5519 from QScintilla.SpellingDictionaryEditDialog import \ |
5831 from QScintilla.SpellingDictionaryEditDialog import \ |
5520 SpellingDictionaryEditDialog |
5832 SpellingDictionaryEditDialog |
5521 dlg = SpellingDictionaryEditDialog(data, |
5833 dlg = SpellingDictionaryEditDialog( |
5522 QApplication.translate('ViewManager', "Editing {0}").format(fileInfo), |
5834 data, |
|
5835 QApplication.translate('ViewManager', "Editing {0}") |
|
5836 .format(fileInfo), |
5523 self.ui) |
5837 self.ui) |
5524 if dlg.exec_() == QDialog.Accepted: |
5838 if dlg.exec_() == QDialog.Accepted: |
5525 data = dlg.getData() |
5839 data = dlg.getData() |
5526 try: |
5840 try: |
5527 f = open(dictionaryFile, "w", encoding="utf-8") |
5841 f = open(dictionaryFile, "w", encoding="utf-8") |
5528 f.write(data) |
5842 f.write(data) |
5529 f.close() |
5843 f.close() |
5530 except (IOError, OSError) as err: |
5844 except (IOError, OSError) as err: |
5531 E5MessageBox.critical(self.ui, |
5845 E5MessageBox.critical( |
5532 QApplication.translate('ViewManager', "Edit Spelling Dictionary"), |
5846 self.ui, |
5533 QApplication.translate('ViewManager', |
5847 QApplication.translate( |
5534 """<p>The spelling dictionary file <b>{0}</b> could""" |
5848 'ViewManager', "Edit Spelling Dictionary"), |
5535 """ not be written.</p><p>Reason: {1}</p>""").format( |
5849 QApplication.translate( |
|
5850 'ViewManager', |
|
5851 """<p>The spelling dictionary file <b>{0}</b>""" |
|
5852 """ could not be written.</p>""" |
|
5853 """<p>Reason: {1}</p>""").format( |
5536 dictionaryFile, str(err))) |
5854 dictionaryFile, str(err))) |
5537 return |
5855 return |
5538 |
5856 |
5539 if self.ui.notificationsEnabled(): |
5857 if self.ui.notificationsEnabled(): |
5540 self.ui.showNotification( |
5858 self.ui.showNotification( |
5541 UI.PixmapCache.getPixmap("spellchecking48.png"), |
5859 UI.PixmapCache.getPixmap("spellchecking48.png"), |
5542 QApplication.translate('ViewManager', "Edit Spelling Dictionary"), |
5860 QApplication.translate( |
5543 QApplication.translate('ViewManager', |
5861 'ViewManager', "Edit Spelling Dictionary"), |
|
5862 QApplication.translate( |
|
5863 'ViewManager', |
5544 "The spelling dictionary was saved successfully.")) |
5864 "The spelling dictionary was saved successfully.")) |
5545 |
5865 |
5546 ################################################################## |
5866 ################################################################## |
5547 ## Below are general utility methods |
5867 ## Below are general utility methods |
5548 ################################################################## |
5868 ################################################################## |