580 self.__readShortcut(act, "File") |
588 self.__readShortcut(act, "File") |
581 for act in self.searchActions: |
589 for act in self.searchActions: |
582 self.__readShortcut(act, "Search") |
590 self.__readShortcut(act, "Search") |
583 for act in self.viewActions: |
591 for act in self.viewActions: |
584 self.__readShortcut(act, "View") |
592 self.__readShortcut(act, "View") |
585 |
593 |
586 def __createFileActions(self): |
594 def __createFileActions(self): |
587 """ |
595 """ |
588 Private method to create the File actions. |
596 Private method to create the File actions. |
589 """ |
597 """ |
590 self.newAct = EricAction( |
598 self.newAct = EricAction( |
591 self.tr('New'), |
599 self.tr("New"), |
592 UI.PixmapCache.getIcon("new"), |
600 UI.PixmapCache.getIcon("new"), |
593 self.tr('&New'), |
601 self.tr("&New"), |
594 QKeySequence(self.tr("Ctrl+N", "File|New")), |
602 QKeySequence(self.tr("Ctrl+N", "File|New")), |
595 0, self, 'vm_file_new') |
603 0, |
596 self.newAct.setStatusTip(self.tr('Open an empty editor window')) |
604 self, |
597 self.newAct.setWhatsThis(self.tr( |
605 "vm_file_new", |
598 """<b>New</b>""" |
606 ) |
599 """<p>An empty editor window will be created.</p>""" |
607 self.newAct.setStatusTip(self.tr("Open an empty editor window")) |
600 )) |
608 self.newAct.setWhatsThis( |
|
609 self.tr( |
|
610 """<b>New</b>""" """<p>An empty editor window will be created.</p>""" |
|
611 ) |
|
612 ) |
601 self.newAct.triggered.connect(self.__newFile) |
613 self.newAct.triggered.connect(self.__newFile) |
602 self.fileActions.append(self.newAct) |
614 self.fileActions.append(self.newAct) |
603 |
615 |
604 self.openAct = EricAction( |
616 self.openAct = EricAction( |
605 self.tr('Open'), |
617 self.tr("Open"), |
606 UI.PixmapCache.getIcon("open"), |
618 UI.PixmapCache.getIcon("open"), |
607 self.tr('&Open...'), |
619 self.tr("&Open..."), |
608 QKeySequence(self.tr("Ctrl+O", "File|Open")), |
620 QKeySequence(self.tr("Ctrl+O", "File|Open")), |
609 0, self, 'vm_file_open') |
621 0, |
610 self.openAct.setStatusTip(self.tr('Open a file')) |
622 self, |
611 self.openAct.setWhatsThis(self.tr( |
623 "vm_file_open", |
612 """<b>Open a file</b>""" |
624 ) |
613 """<p>You will be asked for the name of a file to be opened.</p>""" |
625 self.openAct.setStatusTip(self.tr("Open a file")) |
614 )) |
626 self.openAct.setWhatsThis( |
|
627 self.tr( |
|
628 """<b>Open a file</b>""" |
|
629 """<p>You will be asked for the name of a file to be opened.</p>""" |
|
630 ) |
|
631 ) |
615 self.openAct.triggered.connect(self.__open) |
632 self.openAct.triggered.connect(self.__open) |
616 self.fileActions.append(self.openAct) |
633 self.fileActions.append(self.openAct) |
617 |
634 |
618 self.saveAct = EricAction( |
635 self.saveAct = EricAction( |
619 self.tr('Save'), |
636 self.tr("Save"), |
620 UI.PixmapCache.getIcon("fileSave"), |
637 UI.PixmapCache.getIcon("fileSave"), |
621 self.tr('&Save'), |
638 self.tr("&Save"), |
622 QKeySequence(self.tr("Ctrl+S", "File|Save")), |
639 QKeySequence(self.tr("Ctrl+S", "File|Save")), |
623 0, self, 'vm_file_save') |
640 0, |
624 self.saveAct.setStatusTip(self.tr('Save the current file')) |
641 self, |
625 self.saveAct.setWhatsThis(self.tr( |
642 "vm_file_save", |
626 """<b>Save File</b>""" |
643 ) |
627 """<p>Save the contents of current editor window.</p>""" |
644 self.saveAct.setStatusTip(self.tr("Save the current file")) |
628 )) |
645 self.saveAct.setWhatsThis( |
|
646 self.tr( |
|
647 """<b>Save File</b>""" |
|
648 """<p>Save the contents of current editor window.</p>""" |
|
649 ) |
|
650 ) |
629 self.saveAct.triggered.connect(self.__save) |
651 self.saveAct.triggered.connect(self.__save) |
630 self.fileActions.append(self.saveAct) |
652 self.fileActions.append(self.saveAct) |
631 |
653 |
632 self.saveAsAct = EricAction( |
654 self.saveAsAct = EricAction( |
633 self.tr('Save as'), |
655 self.tr("Save as"), |
634 UI.PixmapCache.getIcon("fileSaveAs"), |
656 UI.PixmapCache.getIcon("fileSaveAs"), |
635 self.tr('Save &as...'), |
657 self.tr("Save &as..."), |
636 QKeySequence(self.tr("Shift+Ctrl+S", "File|Save As")), |
658 QKeySequence(self.tr("Shift+Ctrl+S", "File|Save As")), |
637 0, self, 'vm_file_save_as') |
659 0, |
638 self.saveAsAct.setStatusTip(self.tr( |
660 self, |
639 'Save the current file to a new one')) |
661 "vm_file_save_as", |
640 self.saveAsAct.setWhatsThis(self.tr( |
662 ) |
641 """<b>Save File as</b>""" |
663 self.saveAsAct.setStatusTip(self.tr("Save the current file to a new one")) |
642 """<p>Save the contents of current editor window to a new file.""" |
664 self.saveAsAct.setWhatsThis( |
643 """ The file can be entered in a file selection dialog.</p>""" |
665 self.tr( |
644 )) |
666 """<b>Save File as</b>""" |
|
667 """<p>Save the contents of current editor window to a new file.""" |
|
668 """ The file can be entered in a file selection dialog.</p>""" |
|
669 ) |
|
670 ) |
645 self.saveAsAct.triggered.connect(self.__saveAs) |
671 self.saveAsAct.triggered.connect(self.__saveAs) |
646 self.fileActions.append(self.saveAsAct) |
672 self.fileActions.append(self.saveAsAct) |
647 |
673 |
648 self.saveCopyAct = EricAction( |
674 self.saveCopyAct = EricAction( |
649 self.tr('Save Copy'), |
675 self.tr("Save Copy"), |
650 UI.PixmapCache.getIcon("fileSaveCopy"), |
676 UI.PixmapCache.getIcon("fileSaveCopy"), |
651 self.tr('Save &Copy...'), |
677 self.tr("Save &Copy..."), |
652 0, 0, self, 'vm_file_save_copy') |
678 0, |
653 self.saveCopyAct.setStatusTip(self.tr( |
679 0, |
654 'Save a copy of the current file')) |
680 self, |
655 self.saveCopyAct.setWhatsThis(self.tr( |
681 "vm_file_save_copy", |
656 """<b>Save Copy</b>""" |
682 ) |
657 """<p>Save a copy of the contents of current editor window.""" |
683 self.saveCopyAct.setStatusTip(self.tr("Save a copy of the current file")) |
658 """ The file can be entered in a file selection dialog.</p>""" |
684 self.saveCopyAct.setWhatsThis( |
659 )) |
685 self.tr( |
|
686 """<b>Save Copy</b>""" |
|
687 """<p>Save a copy of the contents of current editor window.""" |
|
688 """ The file can be entered in a file selection dialog.</p>""" |
|
689 ) |
|
690 ) |
660 self.saveCopyAct.triggered.connect(self.__saveCopy) |
691 self.saveCopyAct.triggered.connect(self.__saveCopy) |
661 self.fileActions.append(self.saveCopyAct) |
692 self.fileActions.append(self.saveCopyAct) |
662 |
693 |
663 self.closeAct = EricAction( |
694 self.closeAct = EricAction( |
664 self.tr('Close'), |
695 self.tr("Close"), |
665 UI.PixmapCache.getIcon("close"), |
696 UI.PixmapCache.getIcon("close"), |
666 self.tr('&Close'), |
697 self.tr("&Close"), |
667 QKeySequence(self.tr("Ctrl+W", "File|Close")), |
698 QKeySequence(self.tr("Ctrl+W", "File|Close")), |
668 0, self, 'vm_file_close') |
699 0, |
669 self.closeAct.setStatusTip(self.tr('Close the editor window')) |
700 self, |
670 self.closeAct.setWhatsThis(self.tr( |
701 "vm_file_close", |
671 """<b>Close Window</b>""" |
702 ) |
672 """<p>Close the current window.</p>""" |
703 self.closeAct.setStatusTip(self.tr("Close the editor window")) |
673 )) |
704 self.closeAct.setWhatsThis( |
|
705 self.tr("""<b>Close Window</b>""" """<p>Close the current window.</p>""") |
|
706 ) |
674 self.closeAct.triggered.connect(self.close) |
707 self.closeAct.triggered.connect(self.close) |
675 self.fileActions.append(self.closeAct) |
708 self.fileActions.append(self.closeAct) |
676 |
709 |
677 self.printAct = EricAction( |
710 self.printAct = EricAction( |
678 self.tr('Print'), |
711 self.tr("Print"), |
679 UI.PixmapCache.getIcon("print"), |
712 UI.PixmapCache.getIcon("print"), |
680 self.tr('&Print'), |
713 self.tr("&Print"), |
681 QKeySequence(self.tr("Ctrl+P", "File|Print")), |
714 QKeySequence(self.tr("Ctrl+P", "File|Print")), |
682 0, self, 'vm_file_print') |
715 0, |
683 self.printAct.setStatusTip(self.tr('Print the current file')) |
716 self, |
684 self.printAct.setWhatsThis(self.tr( |
717 "vm_file_print", |
685 """<b>Print File</b>""" |
718 ) |
686 """<p>Print the contents of the current file.</p>""" |
719 self.printAct.setStatusTip(self.tr("Print the current file")) |
687 )) |
720 self.printAct.setWhatsThis( |
|
721 self.tr( |
|
722 """<b>Print File</b>""" |
|
723 """<p>Print the contents of the current file.</p>""" |
|
724 ) |
|
725 ) |
688 self.printAct.triggered.connect(self.__printFile) |
726 self.printAct.triggered.connect(self.__printFile) |
689 self.fileActions.append(self.printAct) |
727 self.fileActions.append(self.printAct) |
690 |
728 |
691 self.printPreviewAct = EricAction( |
729 self.printPreviewAct = EricAction( |
692 self.tr('Print Preview'), |
730 self.tr("Print Preview"), |
693 UI.PixmapCache.getIcon("printPreview"), |
731 UI.PixmapCache.getIcon("printPreview"), |
694 QCoreApplication.translate('ViewManager', 'Print Preview'), |
732 QCoreApplication.translate("ViewManager", "Print Preview"), |
695 0, 0, self, 'vm_file_print_preview') |
733 0, |
696 self.printPreviewAct.setStatusTip(self.tr( |
734 0, |
697 'Print preview of the current file')) |
735 self, |
698 self.printPreviewAct.setWhatsThis(self.tr( |
736 "vm_file_print_preview", |
699 """<b>Print Preview</b>""" |
737 ) |
700 """<p>Print preview of the current file.</p>""" |
738 self.printPreviewAct.setStatusTip(self.tr("Print preview of the current file")) |
701 )) |
739 self.printPreviewAct.setWhatsThis( |
|
740 self.tr( |
|
741 """<b>Print Preview</b>""" |
|
742 """<p>Print preview of the current file.</p>""" |
|
743 ) |
|
744 ) |
702 self.printPreviewAct.triggered.connect(self.__printPreviewFile) |
745 self.printPreviewAct.triggered.connect(self.__printPreviewFile) |
703 self.fileActions.append(self.printPreviewAct) |
746 self.fileActions.append(self.printPreviewAct) |
704 |
747 |
705 def __createEditActions(self): |
748 def __createEditActions(self): |
706 """ |
749 """ |
707 Private method to create the Edit actions. |
750 Private method to create the Edit actions. |
708 """ |
751 """ |
709 self.undoAct = EricAction( |
752 self.undoAct = EricAction( |
710 self.tr('Undo'), |
753 self.tr("Undo"), |
711 UI.PixmapCache.getIcon("editUndo"), |
754 UI.PixmapCache.getIcon("editUndo"), |
712 self.tr('&Undo'), |
755 self.tr("&Undo"), |
713 QKeySequence(self.tr("Ctrl+Z", "Edit|Undo")), |
756 QKeySequence(self.tr("Ctrl+Z", "Edit|Undo")), |
714 QKeySequence(self.tr("Alt+Backspace", "Edit|Undo")), |
757 QKeySequence(self.tr("Alt+Backspace", "Edit|Undo")), |
715 self, 'vm_edit_undo') |
758 self, |
716 self.undoAct.setStatusTip(self.tr('Undo the last change')) |
759 "vm_edit_undo", |
717 self.undoAct.setWhatsThis(self.tr( |
760 ) |
718 """<b>Undo</b>""" |
761 self.undoAct.setStatusTip(self.tr("Undo the last change")) |
719 """<p>Undo the last change done in the current editor.</p>""" |
762 self.undoAct.setWhatsThis( |
720 )) |
763 self.tr( |
|
764 """<b>Undo</b>""" |
|
765 """<p>Undo the last change done in the current editor.</p>""" |
|
766 ) |
|
767 ) |
721 self.undoAct.triggered.connect(self.__undo) |
768 self.undoAct.triggered.connect(self.__undo) |
722 self.editActions.append(self.undoAct) |
769 self.editActions.append(self.undoAct) |
723 |
770 |
724 self.redoAct = EricAction( |
771 self.redoAct = EricAction( |
725 self.tr('Redo'), |
772 self.tr("Redo"), |
726 UI.PixmapCache.getIcon("editRedo"), |
773 UI.PixmapCache.getIcon("editRedo"), |
727 self.tr('&Redo'), |
774 self.tr("&Redo"), |
728 QKeySequence(self.tr("Ctrl+Shift+Z", "Edit|Redo")), |
775 QKeySequence(self.tr("Ctrl+Shift+Z", "Edit|Redo")), |
729 0, self, 'vm_edit_redo') |
776 0, |
730 self.redoAct.setStatusTip(self.tr('Redo the last change')) |
777 self, |
731 self.redoAct.setWhatsThis(self.tr( |
778 "vm_edit_redo", |
732 """<b>Redo</b>""" |
779 ) |
733 """<p>Redo the last change done in the current editor.</p>""" |
780 self.redoAct.setStatusTip(self.tr("Redo the last change")) |
734 )) |
781 self.redoAct.setWhatsThis( |
|
782 self.tr( |
|
783 """<b>Redo</b>""" |
|
784 """<p>Redo the last change done in the current editor.</p>""" |
|
785 ) |
|
786 ) |
735 self.redoAct.triggered.connect(self.__redo) |
787 self.redoAct.triggered.connect(self.__redo) |
736 self.editActions.append(self.redoAct) |
788 self.editActions.append(self.redoAct) |
737 |
789 |
738 self.cutAct = EricAction( |
790 self.cutAct = EricAction( |
739 self.tr('Cut'), |
791 self.tr("Cut"), |
740 UI.PixmapCache.getIcon("editCut"), |
792 UI.PixmapCache.getIcon("editCut"), |
741 self.tr('Cu&t'), |
793 self.tr("Cu&t"), |
742 QKeySequence(self.tr("Ctrl+X", "Edit|Cut")), |
794 QKeySequence(self.tr("Ctrl+X", "Edit|Cut")), |
743 QKeySequence(self.tr("Shift+Del", "Edit|Cut")), |
795 QKeySequence(self.tr("Shift+Del", "Edit|Cut")), |
744 self, 'vm_edit_cut') |
796 self, |
745 self.cutAct.setStatusTip(self.tr('Cut the selection')) |
797 "vm_edit_cut", |
746 self.cutAct.setWhatsThis(self.tr( |
798 ) |
747 """<b>Cut</b>""" |
799 self.cutAct.setStatusTip(self.tr("Cut the selection")) |
748 """<p>Cut the selected text of the current editor to the""" |
800 self.cutAct.setWhatsThis( |
749 """ clipboard.</p>""" |
801 self.tr( |
750 )) |
802 """<b>Cut</b>""" |
|
803 """<p>Cut the selected text of the current editor to the""" |
|
804 """ clipboard.</p>""" |
|
805 ) |
|
806 ) |
751 self.cutAct.triggered.connect(self.__textEdit.cut) |
807 self.cutAct.triggered.connect(self.__textEdit.cut) |
752 self.editActions.append(self.cutAct) |
808 self.editActions.append(self.cutAct) |
753 |
809 |
754 self.copyAct = EricAction( |
810 self.copyAct = EricAction( |
755 self.tr('Copy'), |
811 self.tr("Copy"), |
756 UI.PixmapCache.getIcon("editCopy"), |
812 UI.PixmapCache.getIcon("editCopy"), |
757 self.tr('&Copy'), |
813 self.tr("&Copy"), |
758 QKeySequence(self.tr("Ctrl+C", "Edit|Copy")), |
814 QKeySequence(self.tr("Ctrl+C", "Edit|Copy")), |
759 QKeySequence(self.tr("Ctrl+Ins", "Edit|Copy")), |
815 QKeySequence(self.tr("Ctrl+Ins", "Edit|Copy")), |
760 self, 'vm_edit_copy') |
816 self, |
761 self.copyAct.setStatusTip(self.tr('Copy the selection')) |
817 "vm_edit_copy", |
762 self.copyAct.setWhatsThis(self.tr( |
818 ) |
763 """<b>Copy</b>""" |
819 self.copyAct.setStatusTip(self.tr("Copy the selection")) |
764 """<p>Copy the selected text of the current editor to the""" |
820 self.copyAct.setWhatsThis( |
765 """ clipboard.</p>""" |
821 self.tr( |
766 )) |
822 """<b>Copy</b>""" |
|
823 """<p>Copy the selected text of the current editor to the""" |
|
824 """ clipboard.</p>""" |
|
825 ) |
|
826 ) |
767 self.copyAct.triggered.connect(self.__textEdit.copy) |
827 self.copyAct.triggered.connect(self.__textEdit.copy) |
768 self.editActions.append(self.copyAct) |
828 self.editActions.append(self.copyAct) |
769 |
829 |
770 self.pasteAct = EricAction( |
830 self.pasteAct = EricAction( |
771 self.tr('Paste'), |
831 self.tr("Paste"), |
772 UI.PixmapCache.getIcon("editPaste"), |
832 UI.PixmapCache.getIcon("editPaste"), |
773 self.tr('&Paste'), |
833 self.tr("&Paste"), |
774 QKeySequence(self.tr("Ctrl+V", "Edit|Paste")), |
834 QKeySequence(self.tr("Ctrl+V", "Edit|Paste")), |
775 QKeySequence(self.tr("Shift+Ins", "Edit|Paste")), |
835 QKeySequence(self.tr("Shift+Ins", "Edit|Paste")), |
776 self, 'vm_edit_paste') |
836 self, |
777 self.pasteAct.setStatusTip(self.tr( |
837 "vm_edit_paste", |
778 'Paste the last cut/copied text')) |
838 ) |
779 self.pasteAct.setWhatsThis(self.tr( |
839 self.pasteAct.setStatusTip(self.tr("Paste the last cut/copied text")) |
780 """<b>Paste</b>""" |
840 self.pasteAct.setWhatsThis( |
781 """<p>Paste the last cut/copied text from the clipboard to""" |
841 self.tr( |
782 """ the current editor.</p>""" |
842 """<b>Paste</b>""" |
783 )) |
843 """<p>Paste the last cut/copied text from the clipboard to""" |
|
844 """ the current editor.</p>""" |
|
845 ) |
|
846 ) |
784 self.pasteAct.triggered.connect(self.__textEdit.paste) |
847 self.pasteAct.triggered.connect(self.__textEdit.paste) |
785 self.editActions.append(self.pasteAct) |
848 self.editActions.append(self.pasteAct) |
786 |
849 |
787 self.deleteAct = EricAction( |
850 self.deleteAct = EricAction( |
788 self.tr('Clear'), |
851 self.tr("Clear"), |
789 UI.PixmapCache.getIcon("editDelete"), |
852 UI.PixmapCache.getIcon("editDelete"), |
790 self.tr('Cl&ear'), |
853 self.tr("Cl&ear"), |
791 QKeySequence(self.tr("Alt+Shift+C", "Edit|Clear")), |
854 QKeySequence(self.tr("Alt+Shift+C", "Edit|Clear")), |
792 0, |
855 0, |
793 self, 'vm_edit_clear') |
856 self, |
794 self.deleteAct.setStatusTip(self.tr('Clear all text')) |
857 "vm_edit_clear", |
795 self.deleteAct.setWhatsThis(self.tr( |
858 ) |
796 """<b>Clear</b>""" |
859 self.deleteAct.setStatusTip(self.tr("Clear all text")) |
797 """<p>Delete all text of the current editor.</p>""" |
860 self.deleteAct.setWhatsThis( |
798 )) |
861 self.tr( |
|
862 """<b>Clear</b>""" """<p>Delete all text of the current editor.</p>""" |
|
863 ) |
|
864 ) |
799 self.deleteAct.triggered.connect(self.__textEdit.clear) |
865 self.deleteAct.triggered.connect(self.__textEdit.clear) |
800 self.editActions.append(self.deleteAct) |
866 self.editActions.append(self.deleteAct) |
801 |
867 |
802 self.cutAct.setEnabled(False) |
868 self.cutAct.setEnabled(False) |
803 self.copyAct.setEnabled(False) |
869 self.copyAct.setEnabled(False) |
804 self.__textEdit.copyAvailable.connect(self.cutAct.setEnabled) |
870 self.__textEdit.copyAvailable.connect(self.cutAct.setEnabled) |
805 self.__textEdit.copyAvailable.connect(self.copyAct.setEnabled) |
871 self.__textEdit.copyAvailable.connect(self.copyAct.setEnabled) |
806 |
872 |
807 #################################################################### |
873 #################################################################### |
808 ## Below follow the actions for QScintilla standard commands. |
874 ## Below follow the actions for QScintilla standard commands. |
809 #################################################################### |
875 #################################################################### |
810 |
876 |
811 self.esm = QSignalMapper(self) |
877 self.esm = QSignalMapper(self) |
812 try: |
878 try: |
813 self.esm.mappedInt.connect(self.__textEdit.editorCommand) |
879 self.esm.mappedInt.connect(self.__textEdit.editorCommand) |
814 except AttributeError: |
880 except AttributeError: |
815 # pre Qt 5.15 |
881 # pre Qt 5.15 |
816 self.esm.mapped[int].connect(self.__textEdit.editorCommand) |
882 self.esm.mapped[int].connect(self.__textEdit.editorCommand) |
817 |
883 |
818 self.editorActGrp = createActionGroup(self) |
884 self.editorActGrp = createActionGroup(self) |
819 |
885 |
820 act = EricAction( |
886 act = EricAction( |
821 QCoreApplication.translate('ViewManager', |
887 QCoreApplication.translate("ViewManager", "Move left one character"), |
822 'Move left one character'), |
888 QCoreApplication.translate("ViewManager", "Move left one character"), |
823 QCoreApplication.translate('ViewManager', |
889 QKeySequence(QCoreApplication.translate("ViewManager", "Left")), |
824 'Move left one character'), |
890 0, |
825 QKeySequence(QCoreApplication.translate('ViewManager', 'Left')), 0, |
891 self.editorActGrp, |
826 self.editorActGrp, 'vm_edit_move_left_char') |
892 "vm_edit_move_left_char", |
|
893 ) |
827 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT) |
894 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT) |
828 if isMacPlatform(): |
895 if isMacPlatform(): |
829 act.setAlternateShortcut(QKeySequence( |
896 act.setAlternateShortcut( |
830 QCoreApplication.translate('ViewManager', 'Meta+B'))) |
897 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+B")) |
831 act.triggered.connect(self.esm.map) |
898 ) |
832 self.editActions.append(act) |
899 act.triggered.connect(self.esm.map) |
833 |
900 self.editActions.append(act) |
834 act = EricAction( |
901 |
835 QCoreApplication.translate('ViewManager', |
902 act = EricAction( |
836 'Move right one character'), |
903 QCoreApplication.translate("ViewManager", "Move right one character"), |
837 QCoreApplication.translate('ViewManager', |
904 QCoreApplication.translate("ViewManager", "Move right one character"), |
838 'Move right one character'), |
905 QKeySequence(QCoreApplication.translate("ViewManager", "Right")), |
839 QKeySequence(QCoreApplication.translate('ViewManager', 'Right')), |
906 0, |
840 0, self.editorActGrp, 'vm_edit_move_right_char') |
907 self.editorActGrp, |
|
908 "vm_edit_move_right_char", |
|
909 ) |
841 if isMacPlatform(): |
910 if isMacPlatform(): |
842 act.setAlternateShortcut(QKeySequence( |
911 act.setAlternateShortcut( |
843 QCoreApplication.translate('ViewManager', 'Meta+F'))) |
912 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+F")) |
|
913 ) |
844 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT) |
914 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT) |
845 act.triggered.connect(self.esm.map) |
915 act.triggered.connect(self.esm.map) |
846 self.editActions.append(act) |
916 self.editActions.append(act) |
847 |
917 |
848 act = EricAction( |
918 act = EricAction( |
849 QCoreApplication.translate('ViewManager', 'Move up one line'), |
919 QCoreApplication.translate("ViewManager", "Move up one line"), |
850 QCoreApplication.translate('ViewManager', 'Move up one line'), |
920 QCoreApplication.translate("ViewManager", "Move up one line"), |
851 QKeySequence(QCoreApplication.translate('ViewManager', 'Up')), 0, |
921 QKeySequence(QCoreApplication.translate("ViewManager", "Up")), |
852 self.editorActGrp, 'vm_edit_move_up_line') |
922 0, |
|
923 self.editorActGrp, |
|
924 "vm_edit_move_up_line", |
|
925 ) |
853 if isMacPlatform(): |
926 if isMacPlatform(): |
854 act.setAlternateShortcut(QKeySequence( |
927 act.setAlternateShortcut( |
855 QCoreApplication.translate('ViewManager', 'Meta+P'))) |
928 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+P")) |
|
929 ) |
856 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP) |
930 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP) |
857 act.triggered.connect(self.esm.map) |
931 act.triggered.connect(self.esm.map) |
858 self.editActions.append(act) |
932 self.editActions.append(act) |
859 |
933 |
860 act = EricAction( |
934 act = EricAction( |
861 QCoreApplication.translate('ViewManager', 'Move down one line'), |
935 QCoreApplication.translate("ViewManager", "Move down one line"), |
862 QCoreApplication.translate('ViewManager', 'Move down one line'), |
936 QCoreApplication.translate("ViewManager", "Move down one line"), |
863 QKeySequence(QCoreApplication.translate('ViewManager', 'Down')), 0, |
937 QKeySequence(QCoreApplication.translate("ViewManager", "Down")), |
864 self.editorActGrp, 'vm_edit_move_down_line') |
938 0, |
|
939 self.editorActGrp, |
|
940 "vm_edit_move_down_line", |
|
941 ) |
865 if isMacPlatform(): |
942 if isMacPlatform(): |
866 act.setAlternateShortcut(QKeySequence( |
943 act.setAlternateShortcut( |
867 QCoreApplication.translate('ViewManager', 'Meta+N'))) |
944 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+N")) |
|
945 ) |
868 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN) |
946 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN) |
869 act.triggered.connect(self.esm.map) |
947 act.triggered.connect(self.esm.map) |
870 self.editActions.append(act) |
948 self.editActions.append(act) |
871 |
949 |
872 act = EricAction( |
950 act = EricAction( |
873 QCoreApplication.translate('ViewManager', |
951 QCoreApplication.translate("ViewManager", "Move left one word part"), |
874 'Move left one word part'), |
952 QCoreApplication.translate("ViewManager", "Move left one word part"), |
875 QCoreApplication.translate('ViewManager', |
953 0, |
876 'Move left one word part'), |
954 0, |
877 0, 0, |
955 self.editorActGrp, |
878 self.editorActGrp, 'vm_edit_move_left_word_part') |
956 "vm_edit_move_left_word_part", |
|
957 ) |
879 if not isMacPlatform(): |
958 if not isMacPlatform(): |
880 act.setShortcut(QKeySequence( |
959 act.setShortcut( |
881 QCoreApplication.translate('ViewManager', 'Alt+Left'))) |
960 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Left")) |
|
961 ) |
882 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT) |
962 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT) |
883 act.triggered.connect(self.esm.map) |
963 act.triggered.connect(self.esm.map) |
884 self.editActions.append(act) |
964 self.editActions.append(act) |
885 |
965 |
886 act = EricAction( |
966 act = EricAction( |
887 QCoreApplication.translate('ViewManager', |
967 QCoreApplication.translate("ViewManager", "Move right one word part"), |
888 'Move right one word part'), |
968 QCoreApplication.translate("ViewManager", "Move right one word part"), |
889 QCoreApplication.translate('ViewManager', |
969 0, |
890 'Move right one word part'), |
970 0, |
891 0, 0, |
971 self.editorActGrp, |
892 self.editorActGrp, 'vm_edit_move_right_word_part') |
972 "vm_edit_move_right_word_part", |
|
973 ) |
893 if not isMacPlatform(): |
974 if not isMacPlatform(): |
894 act.setShortcut(QKeySequence( |
975 act.setShortcut( |
895 QCoreApplication.translate('ViewManager', 'Alt+Right'))) |
976 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Right")) |
|
977 ) |
896 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT) |
978 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT) |
897 act.triggered.connect(self.esm.map) |
979 act.triggered.connect(self.esm.map) |
898 self.editActions.append(act) |
980 self.editActions.append(act) |
899 |
981 |
900 act = EricAction( |
982 act = EricAction( |
901 QCoreApplication.translate('ViewManager', 'Move left one word'), |
983 QCoreApplication.translate("ViewManager", "Move left one word"), |
902 QCoreApplication.translate('ViewManager', 'Move left one word'), |
984 QCoreApplication.translate("ViewManager", "Move left one word"), |
903 0, 0, |
985 0, |
904 self.editorActGrp, 'vm_edit_move_left_word') |
986 0, |
|
987 self.editorActGrp, |
|
988 "vm_edit_move_left_word", |
|
989 ) |
905 if isMacPlatform(): |
990 if isMacPlatform(): |
906 act.setShortcut(QKeySequence( |
991 act.setShortcut( |
907 QCoreApplication.translate('ViewManager', 'Alt+Left'))) |
992 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Left")) |
|
993 ) |
908 else: |
994 else: |
909 act.setShortcut(QKeySequence( |
995 act.setShortcut( |
910 QCoreApplication.translate('ViewManager', 'Ctrl+Left'))) |
996 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Left")) |
|
997 ) |
911 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT) |
998 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT) |
912 act.triggered.connect(self.esm.map) |
999 act.triggered.connect(self.esm.map) |
913 self.editActions.append(act) |
1000 self.editActions.append(act) |
914 |
1001 |
915 act = EricAction( |
1002 act = EricAction( |
916 QCoreApplication.translate('ViewManager', 'Move right one word'), |
1003 QCoreApplication.translate("ViewManager", "Move right one word"), |
917 QCoreApplication.translate('ViewManager', 'Move right one word'), |
1004 QCoreApplication.translate("ViewManager", "Move right one word"), |
918 0, 0, |
1005 0, |
919 self.editorActGrp, 'vm_edit_move_right_word') |
1006 0, |
|
1007 self.editorActGrp, |
|
1008 "vm_edit_move_right_word", |
|
1009 ) |
920 if isMacPlatform(): |
1010 if isMacPlatform(): |
921 act.setShortcut(QKeySequence( |
1011 act.setShortcut( |
922 QCoreApplication.translate('ViewManager', 'Alt+Right'))) |
1012 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Right")) |
|
1013 ) |
923 else: |
1014 else: |
924 act.setShortcut(QKeySequence( |
1015 act.setShortcut( |
925 QCoreApplication.translate('ViewManager', 'Ctrl+Right'))) |
1016 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Right")) |
|
1017 ) |
926 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT) |
1018 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT) |
927 act.triggered.connect(self.esm.map) |
1019 act.triggered.connect(self.esm.map) |
928 self.editActions.append(act) |
1020 self.editActions.append(act) |
929 |
1021 |
930 act = EricAction( |
1022 act = EricAction( |
931 QCoreApplication.translate( |
1023 QCoreApplication.translate( |
932 'ViewManager', |
1024 "ViewManager", "Move to first visible character in document line" |
933 'Move to first visible character in document line'), |
1025 ), |
934 QCoreApplication.translate( |
1026 QCoreApplication.translate( |
935 'ViewManager', |
1027 "ViewManager", "Move to first visible character in document line" |
936 'Move to first visible character in document line'), |
1028 ), |
937 0, 0, |
1029 0, |
938 self.editorActGrp, 'vm_edit_move_first_visible_char') |
1030 0, |
|
1031 self.editorActGrp, |
|
1032 "vm_edit_move_first_visible_char", |
|
1033 ) |
939 if not isMacPlatform(): |
1034 if not isMacPlatform(): |
940 act.setShortcut(QKeySequence( |
1035 act.setShortcut( |
941 QCoreApplication.translate('ViewManager', 'Home'))) |
1036 QKeySequence(QCoreApplication.translate("ViewManager", "Home")) |
|
1037 ) |
942 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME) |
1038 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME) |
943 act.triggered.connect(self.esm.map) |
1039 act.triggered.connect(self.esm.map) |
944 self.editActions.append(act) |
1040 self.editActions.append(act) |
945 |
1041 |
946 act = EricAction( |
1042 act = EricAction( |
947 QCoreApplication.translate( |
1043 QCoreApplication.translate("ViewManager", "Move to start of display line"), |
948 'ViewManager', |
1044 QCoreApplication.translate("ViewManager", "Move to start of display line"), |
949 'Move to start of display line'), |
1045 0, |
950 QCoreApplication.translate( |
1046 0, |
951 'ViewManager', |
1047 self.editorActGrp, |
952 'Move to start of display line'), |
1048 "vm_edit_move_start_line", |
953 0, 0, |
1049 ) |
954 self.editorActGrp, 'vm_edit_move_start_line') |
|
955 if isMacPlatform(): |
1050 if isMacPlatform(): |
956 act.setShortcut(QKeySequence( |
1051 act.setShortcut( |
957 QCoreApplication.translate('ViewManager', 'Ctrl+Left'))) |
1052 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Left")) |
|
1053 ) |
958 else: |
1054 else: |
959 act.setShortcut(QKeySequence( |
1055 act.setShortcut( |
960 QCoreApplication.translate('ViewManager', 'Alt+Home'))) |
1056 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Home")) |
|
1057 ) |
961 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAY) |
1058 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAY) |
962 act.triggered.connect(self.esm.map) |
1059 act.triggered.connect(self.esm.map) |
963 self.editActions.append(act) |
1060 self.editActions.append(act) |
964 |
1061 |
965 act = EricAction( |
1062 act = EricAction( |
966 QCoreApplication.translate( |
1063 QCoreApplication.translate("ViewManager", "Move to end of document line"), |
967 'ViewManager', |
1064 QCoreApplication.translate("ViewManager", "Move to end of document line"), |
968 'Move to end of document line'), |
1065 0, |
969 QCoreApplication.translate( |
1066 0, |
970 'ViewManager', |
1067 self.editorActGrp, |
971 'Move to end of document line'), |
1068 "vm_edit_move_end_line", |
972 0, 0, |
1069 ) |
973 self.editorActGrp, 'vm_edit_move_end_line') |
|
974 if isMacPlatform(): |
1070 if isMacPlatform(): |
975 act.setShortcut(QKeySequence( |
1071 act.setShortcut( |
976 QCoreApplication.translate('ViewManager', 'Meta+E'))) |
1072 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+E")) |
|
1073 ) |
977 else: |
1074 else: |
978 act.setShortcut(QKeySequence( |
1075 act.setShortcut( |
979 QCoreApplication.translate('ViewManager', 'End'))) |
1076 QKeySequence(QCoreApplication.translate("ViewManager", "End")) |
|
1077 ) |
980 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND) |
1078 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND) |
981 act.triggered.connect(self.esm.map) |
1079 act.triggered.connect(self.esm.map) |
982 self.editActions.append(act) |
1080 self.editActions.append(act) |
983 |
1081 |
984 act = EricAction( |
1082 act = EricAction( |
985 QCoreApplication.translate('ViewManager', |
1083 QCoreApplication.translate("ViewManager", "Scroll view down one line"), |
986 'Scroll view down one line'), |
1084 QCoreApplication.translate("ViewManager", "Scroll view down one line"), |
987 QCoreApplication.translate('ViewManager', |
1085 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Down")), |
988 'Scroll view down one line'), |
1086 0, |
989 QKeySequence(QCoreApplication.translate('ViewManager', |
1087 self.editorActGrp, |
990 'Ctrl+Down')), |
1088 "vm_edit_scroll_down_line", |
991 0, self.editorActGrp, 'vm_edit_scroll_down_line') |
1089 ) |
992 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN) |
1090 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN) |
993 act.triggered.connect(self.esm.map) |
1091 act.triggered.connect(self.esm.map) |
994 self.editActions.append(act) |
1092 self.editActions.append(act) |
995 |
1093 |
996 act = EricAction( |
1094 act = EricAction( |
997 QCoreApplication.translate('ViewManager', |
1095 QCoreApplication.translate("ViewManager", "Scroll view up one line"), |
998 'Scroll view up one line'), |
1096 QCoreApplication.translate("ViewManager", "Scroll view up one line"), |
999 QCoreApplication.translate('ViewManager', |
1097 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Up")), |
1000 'Scroll view up one line'), |
1098 0, |
1001 QKeySequence(QCoreApplication.translate('ViewManager', 'Ctrl+Up')), |
1099 self.editorActGrp, |
1002 0, self.editorActGrp, 'vm_edit_scroll_up_line') |
1100 "vm_edit_scroll_up_line", |
|
1101 ) |
1003 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP) |
1102 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP) |
1004 act.triggered.connect(self.esm.map) |
1103 act.triggered.connect(self.esm.map) |
1005 self.editActions.append(act) |
1104 self.editActions.append(act) |
1006 |
1105 |
1007 act = EricAction( |
1106 act = EricAction( |
1008 QCoreApplication.translate('ViewManager', 'Move up one paragraph'), |
1107 QCoreApplication.translate("ViewManager", "Move up one paragraph"), |
1009 QCoreApplication.translate('ViewManager', 'Move up one paragraph'), |
1108 QCoreApplication.translate("ViewManager", "Move up one paragraph"), |
1010 QKeySequence(QCoreApplication.translate('ViewManager', 'Alt+Up')), |
1109 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Up")), |
1011 0, self.editorActGrp, 'vm_edit_move_up_para') |
1110 0, |
|
1111 self.editorActGrp, |
|
1112 "vm_edit_move_up_para", |
|
1113 ) |
1012 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP) |
1114 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP) |
1013 act.triggered.connect(self.esm.map) |
1115 act.triggered.connect(self.esm.map) |
1014 self.editActions.append(act) |
1116 self.editActions.append(act) |
1015 |
1117 |
1016 act = EricAction( |
1118 act = EricAction( |
1017 QCoreApplication.translate('ViewManager', |
1119 QCoreApplication.translate("ViewManager", "Move down one paragraph"), |
1018 'Move down one paragraph'), |
1120 QCoreApplication.translate("ViewManager", "Move down one paragraph"), |
1019 QCoreApplication.translate('ViewManager', |
1121 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Down")), |
1020 'Move down one paragraph'), |
1122 0, |
1021 QKeySequence(QCoreApplication.translate('ViewManager', |
1123 self.editorActGrp, |
1022 'Alt+Down')), |
1124 "vm_edit_move_down_para", |
1023 0, self.editorActGrp, 'vm_edit_move_down_para') |
1125 ) |
1024 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN) |
1126 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN) |
1025 act.triggered.connect(self.esm.map) |
1127 act.triggered.connect(self.esm.map) |
1026 self.editActions.append(act) |
1128 self.editActions.append(act) |
1027 |
1129 |
1028 act = EricAction( |
1130 act = EricAction( |
1029 QCoreApplication.translate('ViewManager', 'Move up one page'), |
1131 QCoreApplication.translate("ViewManager", "Move up one page"), |
1030 QCoreApplication.translate('ViewManager', 'Move up one page'), |
1132 QCoreApplication.translate("ViewManager", "Move up one page"), |
1031 QKeySequence(QCoreApplication.translate('ViewManager', 'PgUp')), 0, |
1133 QKeySequence(QCoreApplication.translate("ViewManager", "PgUp")), |
1032 self.editorActGrp, 'vm_edit_move_up_page') |
1134 0, |
|
1135 self.editorActGrp, |
|
1136 "vm_edit_move_up_page", |
|
1137 ) |
1033 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP) |
1138 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP) |
1034 act.triggered.connect(self.esm.map) |
1139 act.triggered.connect(self.esm.map) |
1035 self.editActions.append(act) |
1140 self.editActions.append(act) |
1036 |
1141 |
1037 act = EricAction( |
1142 act = EricAction( |
1038 QCoreApplication.translate('ViewManager', 'Move down one page'), |
1143 QCoreApplication.translate("ViewManager", "Move down one page"), |
1039 QCoreApplication.translate('ViewManager', 'Move down one page'), |
1144 QCoreApplication.translate("ViewManager", "Move down one page"), |
1040 QKeySequence(QCoreApplication.translate('ViewManager', 'PgDown')), |
1145 QKeySequence(QCoreApplication.translate("ViewManager", "PgDown")), |
1041 0, self.editorActGrp, 'vm_edit_move_down_page') |
1146 0, |
|
1147 self.editorActGrp, |
|
1148 "vm_edit_move_down_page", |
|
1149 ) |
1042 if isMacPlatform(): |
1150 if isMacPlatform(): |
1043 act.setAlternateShortcut(QKeySequence( |
1151 act.setAlternateShortcut( |
1044 QCoreApplication.translate('ViewManager', 'Meta+V'))) |
1152 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+V")) |
|
1153 ) |
1045 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN) |
1154 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN) |
1046 act.triggered.connect(self.esm.map) |
1155 act.triggered.connect(self.esm.map) |
1047 self.editActions.append(act) |
1156 self.editActions.append(act) |
1048 |
1157 |
1049 act = EricAction( |
1158 act = EricAction( |
1050 QCoreApplication.translate('ViewManager', |
1159 QCoreApplication.translate("ViewManager", "Move to start of document"), |
1051 'Move to start of document'), |
1160 QCoreApplication.translate("ViewManager", "Move to start of document"), |
1052 QCoreApplication.translate('ViewManager', |
1161 0, |
1053 'Move to start of document'), |
1162 0, |
1054 0, 0, |
1163 self.editorActGrp, |
1055 self.editorActGrp, 'vm_edit_move_start_text') |
1164 "vm_edit_move_start_text", |
|
1165 ) |
1056 if isMacPlatform(): |
1166 if isMacPlatform(): |
1057 act.setShortcut(QKeySequence( |
1167 act.setShortcut( |
1058 QCoreApplication.translate('ViewManager', 'Ctrl+Up'))) |
1168 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Up")) |
|
1169 ) |
1059 else: |
1170 else: |
1060 act.setShortcut(QKeySequence( |
1171 act.setShortcut( |
1061 QCoreApplication.translate('ViewManager', 'Ctrl+Home'))) |
1172 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Home")) |
|
1173 ) |
1062 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART) |
1174 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART) |
1063 act.triggered.connect(self.esm.map) |
1175 act.triggered.connect(self.esm.map) |
1064 self.editActions.append(act) |
1176 self.editActions.append(act) |
1065 |
1177 |
1066 act = EricAction( |
1178 act = EricAction( |
1067 QCoreApplication.translate('ViewManager', |
1179 QCoreApplication.translate("ViewManager", "Move to end of document"), |
1068 'Move to end of document'), |
1180 QCoreApplication.translate("ViewManager", "Move to end of document"), |
1069 QCoreApplication.translate('ViewManager', |
1181 0, |
1070 'Move to end of document'), |
1182 0, |
1071 0, 0, |
1183 self.editorActGrp, |
1072 self.editorActGrp, 'vm_edit_move_end_text') |
1184 "vm_edit_move_end_text", |
|
1185 ) |
1073 if isMacPlatform(): |
1186 if isMacPlatform(): |
1074 act.setShortcut(QKeySequence( |
1187 act.setShortcut( |
1075 QCoreApplication.translate('ViewManager', 'Ctrl+Down'))) |
1188 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Down")) |
|
1189 ) |
1076 else: |
1190 else: |
1077 act.setShortcut(QKeySequence( |
1191 act.setShortcut( |
1078 QCoreApplication.translate('ViewManager', 'Ctrl+End'))) |
1192 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+End")) |
|
1193 ) |
1079 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND) |
1194 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND) |
1080 act.triggered.connect(self.esm.map) |
1195 act.triggered.connect(self.esm.map) |
1081 self.editActions.append(act) |
1196 self.editActions.append(act) |
1082 |
1197 |
1083 act = EricAction( |
1198 act = EricAction( |
1084 QCoreApplication.translate('ViewManager', 'Indent one level'), |
1199 QCoreApplication.translate("ViewManager", "Indent one level"), |
1085 QCoreApplication.translate('ViewManager', 'Indent one level'), |
1200 QCoreApplication.translate("ViewManager", "Indent one level"), |
1086 QKeySequence(QCoreApplication.translate('ViewManager', 'Tab')), 0, |
1201 QKeySequence(QCoreApplication.translate("ViewManager", "Tab")), |
1087 self.editorActGrp, 'vm_edit_indent_one_level') |
1202 0, |
|
1203 self.editorActGrp, |
|
1204 "vm_edit_indent_one_level", |
|
1205 ) |
1088 self.esm.setMapping(act, QsciScintilla.SCI_TAB) |
1206 self.esm.setMapping(act, QsciScintilla.SCI_TAB) |
1089 act.triggered.connect(self.esm.map) |
1207 act.triggered.connect(self.esm.map) |
1090 self.editActions.append(act) |
1208 self.editActions.append(act) |
1091 |
1209 |
1092 act = EricAction( |
1210 act = EricAction( |
1093 QCoreApplication.translate('ViewManager', 'Unindent one level'), |
1211 QCoreApplication.translate("ViewManager", "Unindent one level"), |
1094 QCoreApplication.translate('ViewManager', 'Unindent one level'), |
1212 QCoreApplication.translate("ViewManager", "Unindent one level"), |
1095 QKeySequence(QCoreApplication.translate('ViewManager', |
1213 QKeySequence(QCoreApplication.translate("ViewManager", "Shift+Tab")), |
1096 'Shift+Tab')), |
1214 0, |
1097 0, self.editorActGrp, 'vm_edit_unindent_one_level') |
1215 self.editorActGrp, |
|
1216 "vm_edit_unindent_one_level", |
|
1217 ) |
1098 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB) |
1218 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB) |
1099 act.triggered.connect(self.esm.map) |
1219 act.triggered.connect(self.esm.map) |
1100 self.editActions.append(act) |
1220 self.editActions.append(act) |
1101 |
1221 |
1102 act = EricAction( |
1222 act = EricAction( |
1103 QCoreApplication.translate( |
1223 QCoreApplication.translate( |
1104 'ViewManager', 'Extend selection left one character'), |
1224 "ViewManager", "Extend selection left one character" |
1105 QCoreApplication.translate( |
1225 ), |
1106 'ViewManager', |
1226 QCoreApplication.translate( |
1107 'Extend selection left one character'), |
1227 "ViewManager", "Extend selection left one character" |
1108 QKeySequence(QCoreApplication.translate('ViewManager', |
1228 ), |
1109 'Shift+Left')), |
1229 QKeySequence(QCoreApplication.translate("ViewManager", "Shift+Left")), |
1110 0, self.editorActGrp, 'vm_edit_extend_selection_left_char') |
1230 0, |
|
1231 self.editorActGrp, |
|
1232 "vm_edit_extend_selection_left_char", |
|
1233 ) |
1111 if isMacPlatform(): |
1234 if isMacPlatform(): |
1112 act.setAlternateShortcut(QKeySequence( |
1235 act.setAlternateShortcut( |
1113 QCoreApplication.translate('ViewManager', 'Meta+Shift+B'))) |
1236 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+Shift+B")) |
|
1237 ) |
1114 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND) |
1238 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND) |
1115 act.triggered.connect(self.esm.map) |
1239 act.triggered.connect(self.esm.map) |
1116 self.editActions.append(act) |
1240 self.editActions.append(act) |
1117 |
1241 |
1118 act = EricAction( |
1242 act = EricAction( |
1119 QCoreApplication.translate( |
1243 QCoreApplication.translate( |
1120 'ViewManager', |
1244 "ViewManager", "Extend selection right one character" |
1121 'Extend selection right one character'), |
1245 ), |
1122 QCoreApplication.translate( |
1246 QCoreApplication.translate( |
1123 'ViewManager', |
1247 "ViewManager", "Extend selection right one character" |
1124 'Extend selection right one character'), |
1248 ), |
1125 QKeySequence(QCoreApplication.translate('ViewManager', |
1249 QKeySequence(QCoreApplication.translate("ViewManager", "Shift+Right")), |
1126 'Shift+Right')), |
1250 0, |
1127 0, self.editorActGrp, 'vm_edit_extend_selection_right_char') |
1251 self.editorActGrp, |
|
1252 "vm_edit_extend_selection_right_char", |
|
1253 ) |
1128 if isMacPlatform(): |
1254 if isMacPlatform(): |
1129 act.setAlternateShortcut(QKeySequence( |
1255 act.setAlternateShortcut( |
1130 QCoreApplication.translate('ViewManager', 'Meta+Shift+F'))) |
1256 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+Shift+F")) |
|
1257 ) |
1131 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND) |
1258 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND) |
1132 act.triggered.connect(self.esm.map) |
1259 act.triggered.connect(self.esm.map) |
1133 self.editActions.append(act) |
1260 self.editActions.append(act) |
1134 |
1261 |
1135 act = EricAction( |
1262 act = EricAction( |
1136 QCoreApplication.translate( |
1263 QCoreApplication.translate("ViewManager", "Extend selection up one line"), |
1137 'ViewManager', |
1264 QCoreApplication.translate("ViewManager", "Extend selection up one line"), |
1138 'Extend selection up one line'), |
1265 QKeySequence(QCoreApplication.translate("ViewManager", "Shift+Up")), |
1139 QCoreApplication.translate( |
1266 0, |
1140 'ViewManager', |
1267 self.editorActGrp, |
1141 'Extend selection up one line'), |
1268 "vm_edit_extend_selection_up_line", |
1142 QKeySequence(QCoreApplication.translate('ViewManager', |
1269 ) |
1143 'Shift+Up')), |
|
1144 0, self.editorActGrp, 'vm_edit_extend_selection_up_line') |
|
1145 if isMacPlatform(): |
1270 if isMacPlatform(): |
1146 act.setAlternateShortcut(QKeySequence( |
1271 act.setAlternateShortcut( |
1147 QCoreApplication.translate('ViewManager', 'Meta+Shift+P'))) |
1272 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+Shift+P")) |
|
1273 ) |
1148 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND) |
1274 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND) |
1149 act.triggered.connect(self.esm.map) |
1275 act.triggered.connect(self.esm.map) |
1150 self.editActions.append(act) |
1276 self.editActions.append(act) |
1151 |
1277 |
1152 act = EricAction( |
1278 act = EricAction( |
1153 QCoreApplication.translate( |
1279 QCoreApplication.translate("ViewManager", "Extend selection down one line"), |
1154 'ViewManager', |
1280 QCoreApplication.translate("ViewManager", "Extend selection down one line"), |
1155 'Extend selection down one line'), |
1281 QKeySequence(QCoreApplication.translate("ViewManager", "Shift+Down")), |
1156 QCoreApplication.translate( |
1282 0, |
1157 'ViewManager', |
1283 self.editorActGrp, |
1158 'Extend selection down one line'), |
1284 "vm_edit_extend_selection_down_line", |
1159 QKeySequence(QCoreApplication.translate('ViewManager', |
1285 ) |
1160 'Shift+Down')), |
|
1161 0, self.editorActGrp, 'vm_edit_extend_selection_down_line') |
|
1162 if isMacPlatform(): |
1286 if isMacPlatform(): |
1163 act.setAlternateShortcut(QKeySequence( |
1287 act.setAlternateShortcut( |
1164 QCoreApplication.translate('ViewManager', 'Meta+Shift+N'))) |
1288 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+Shift+N")) |
|
1289 ) |
1165 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND) |
1290 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND) |
1166 act.triggered.connect(self.esm.map) |
1291 act.triggered.connect(self.esm.map) |
1167 self.editActions.append(act) |
1292 self.editActions.append(act) |
1168 |
1293 |
1169 act = EricAction( |
1294 act = EricAction( |
1170 QCoreApplication.translate( |
1295 QCoreApplication.translate( |
1171 'ViewManager', |
1296 "ViewManager", "Extend selection left one word part" |
1172 'Extend selection left one word part'), |
1297 ), |
1173 QCoreApplication.translate( |
1298 QCoreApplication.translate( |
1174 'ViewManager', |
1299 "ViewManager", "Extend selection left one word part" |
1175 'Extend selection left one word part'), |
1300 ), |
1176 0, 0, |
1301 0, |
1177 self.editorActGrp, 'vm_edit_extend_selection_left_word_part') |
1302 0, |
|
1303 self.editorActGrp, |
|
1304 "vm_edit_extend_selection_left_word_part", |
|
1305 ) |
1178 if not isMacPlatform(): |
1306 if not isMacPlatform(): |
1179 act.setShortcut(QKeySequence( |
1307 act.setShortcut( |
1180 QCoreApplication.translate('ViewManager', 'Alt+Shift+Left'))) |
1308 QKeySequence( |
|
1309 QCoreApplication.translate("ViewManager", "Alt+Shift+Left") |
|
1310 ) |
|
1311 ) |
1181 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND) |
1312 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND) |
1182 act.triggered.connect(self.esm.map) |
1313 act.triggered.connect(self.esm.map) |
1183 self.editActions.append(act) |
1314 self.editActions.append(act) |
1184 |
1315 |
1185 act = EricAction( |
1316 act = EricAction( |
1186 QCoreApplication.translate( |
1317 QCoreApplication.translate( |
1187 'ViewManager', |
1318 "ViewManager", "Extend selection right one word part" |
1188 'Extend selection right one word part'), |
1319 ), |
1189 QCoreApplication.translate( |
1320 QCoreApplication.translate( |
1190 'ViewManager', |
1321 "ViewManager", "Extend selection right one word part" |
1191 'Extend selection right one word part'), |
1322 ), |
1192 0, 0, |
1323 0, |
1193 self.editorActGrp, 'vm_edit_extend_selection_right_word_part') |
1324 0, |
|
1325 self.editorActGrp, |
|
1326 "vm_edit_extend_selection_right_word_part", |
|
1327 ) |
1194 if not isMacPlatform(): |
1328 if not isMacPlatform(): |
1195 act.setShortcut(QKeySequence( |
1329 act.setShortcut( |
1196 QCoreApplication.translate('ViewManager', 'Alt+Shift+Right'))) |
1330 QKeySequence( |
|
1331 QCoreApplication.translate("ViewManager", "Alt+Shift+Right") |
|
1332 ) |
|
1333 ) |
1197 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND) |
1334 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND) |
1198 act.triggered.connect(self.esm.map) |
1335 act.triggered.connect(self.esm.map) |
1199 self.editActions.append(act) |
1336 self.editActions.append(act) |
1200 |
1337 |
1201 act = EricAction( |
1338 act = EricAction( |
1202 QCoreApplication.translate( |
1339 QCoreApplication.translate("ViewManager", "Extend selection left one word"), |
1203 'ViewManager', 'Extend selection left one word'), |
1340 QCoreApplication.translate("ViewManager", "Extend selection left one word"), |
1204 QCoreApplication.translate( |
1341 0, |
1205 'ViewManager', 'Extend selection left one word'), |
1342 0, |
1206 0, 0, |
1343 self.editorActGrp, |
1207 self.editorActGrp, 'vm_edit_extend_selection_left_word') |
1344 "vm_edit_extend_selection_left_word", |
|
1345 ) |
1208 if isMacPlatform(): |
1346 if isMacPlatform(): |
1209 act.setShortcut(QKeySequence( |
1347 act.setShortcut( |
1210 QCoreApplication.translate('ViewManager', 'Alt+Shift+Left'))) |
1348 QKeySequence( |
|
1349 QCoreApplication.translate("ViewManager", "Alt+Shift+Left") |
|
1350 ) |
|
1351 ) |
1211 else: |
1352 else: |
1212 act.setShortcut(QKeySequence( |
1353 act.setShortcut( |
1213 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) |
1354 QKeySequence( |
|
1355 QCoreApplication.translate("ViewManager", "Ctrl+Shift+Left") |
|
1356 ) |
|
1357 ) |
1214 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND) |
1358 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND) |
1215 act.triggered.connect(self.esm.map) |
1359 act.triggered.connect(self.esm.map) |
1216 self.editActions.append(act) |
1360 self.editActions.append(act) |
1217 |
1361 |
1218 act = EricAction( |
1362 act = EricAction( |
1219 QCoreApplication.translate( |
1363 QCoreApplication.translate( |
1220 'ViewManager', 'Extend selection right one word'), |
1364 "ViewManager", "Extend selection right one word" |
1221 QCoreApplication.translate( |
1365 ), |
1222 'ViewManager', 'Extend selection right one word'), |
1366 QCoreApplication.translate( |
1223 0, 0, |
1367 "ViewManager", "Extend selection right one word" |
1224 self.editorActGrp, 'vm_edit_extend_selection_right_word') |
1368 ), |
|
1369 0, |
|
1370 0, |
|
1371 self.editorActGrp, |
|
1372 "vm_edit_extend_selection_right_word", |
|
1373 ) |
1225 if isMacPlatform(): |
1374 if isMacPlatform(): |
1226 act.setShortcut(QKeySequence( |
1375 act.setShortcut( |
1227 QCoreApplication.translate('ViewManager', 'Alt+Shift+Right'))) |
1376 QKeySequence( |
|
1377 QCoreApplication.translate("ViewManager", "Alt+Shift+Right") |
|
1378 ) |
|
1379 ) |
1228 else: |
1380 else: |
1229 act.setShortcut(QKeySequence( |
1381 act.setShortcut( |
1230 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) |
1382 QKeySequence( |
|
1383 QCoreApplication.translate("ViewManager", "Ctrl+Shift+Right") |
|
1384 ) |
|
1385 ) |
1231 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND) |
1386 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND) |
1232 act.triggered.connect(self.esm.map) |
1387 act.triggered.connect(self.esm.map) |
1233 self.editActions.append(act) |
1388 self.editActions.append(act) |
1234 |
1389 |
1235 act = EricAction( |
1390 act = EricAction( |
1236 QCoreApplication.translate( |
1391 QCoreApplication.translate( |
1237 'ViewManager', |
1392 "ViewManager", |
1238 'Extend selection to first visible character in document' |
1393 "Extend selection to first visible character in document" " line", |
1239 ' line'), |
1394 ), |
1240 QCoreApplication.translate( |
1395 QCoreApplication.translate( |
1241 'ViewManager', |
1396 "ViewManager", |
1242 'Extend selection to first visible character in document' |
1397 "Extend selection to first visible character in document" " line", |
1243 ' line'), |
1398 ), |
1244 0, 0, |
1399 0, |
1245 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char') |
1400 0, |
|
1401 self.editorActGrp, |
|
1402 "vm_edit_extend_selection_first_visible_char", |
|
1403 ) |
1246 if not isMacPlatform(): |
1404 if not isMacPlatform(): |
1247 act.setShortcut(QKeySequence( |
1405 act.setShortcut( |
1248 QCoreApplication.translate('ViewManager', 'Shift+Home'))) |
1406 QKeySequence(QCoreApplication.translate("ViewManager", "Shift+Home")) |
|
1407 ) |
1249 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND) |
1408 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND) |
1250 act.triggered.connect(self.esm.map) |
1409 act.triggered.connect(self.esm.map) |
1251 self.editActions.append(act) |
1410 self.editActions.append(act) |
1252 |
1411 |
1253 act = EricAction( |
1412 act = EricAction( |
1254 QCoreApplication.translate( |
1413 QCoreApplication.translate( |
1255 'ViewManager', 'Extend selection to end of document line'), |
1414 "ViewManager", "Extend selection to end of document line" |
1256 QCoreApplication.translate( |
1415 ), |
1257 'ViewManager', 'Extend selection to end of document line'), |
1416 QCoreApplication.translate( |
1258 0, 0, |
1417 "ViewManager", "Extend selection to end of document line" |
1259 self.editorActGrp, 'vm_edit_extend_selection_end_line') |
1418 ), |
|
1419 0, |
|
1420 0, |
|
1421 self.editorActGrp, |
|
1422 "vm_edit_extend_selection_end_line", |
|
1423 ) |
1260 if isMacPlatform(): |
1424 if isMacPlatform(): |
1261 act.setShortcut(QKeySequence( |
1425 act.setShortcut( |
1262 QCoreApplication.translate('ViewManager', 'Meta+Shift+E'))) |
1426 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+Shift+E")) |
|
1427 ) |
1263 else: |
1428 else: |
1264 act.setShortcut(QKeySequence( |
1429 act.setShortcut( |
1265 QCoreApplication.translate('ViewManager', 'Shift+End'))) |
1430 QKeySequence(QCoreApplication.translate("ViewManager", "Shift+End")) |
|
1431 ) |
1266 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND) |
1432 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND) |
1267 act.triggered.connect(self.esm.map) |
1433 act.triggered.connect(self.esm.map) |
1268 self.editActions.append(act) |
1434 self.editActions.append(act) |
1269 |
1435 |
1270 act = EricAction( |
1436 act = EricAction( |
1271 QCoreApplication.translate( |
1437 QCoreApplication.translate( |
1272 'ViewManager', |
1438 "ViewManager", "Extend selection up one paragraph" |
1273 'Extend selection up one paragraph'), |
1439 ), |
1274 QCoreApplication.translate( |
1440 QCoreApplication.translate( |
1275 'ViewManager', |
1441 "ViewManager", "Extend selection up one paragraph" |
1276 'Extend selection up one paragraph'), |
1442 ), |
1277 QKeySequence(QCoreApplication.translate('ViewManager', |
1443 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Shift+Up")), |
1278 'Alt+Shift+Up')), |
1444 0, |
1279 0, self.editorActGrp, 'vm_edit_extend_selection_up_para') |
1445 self.editorActGrp, |
|
1446 "vm_edit_extend_selection_up_para", |
|
1447 ) |
1280 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND) |
1448 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND) |
1281 act.triggered.connect(self.esm.map) |
1449 act.triggered.connect(self.esm.map) |
1282 self.editActions.append(act) |
1450 self.editActions.append(act) |
1283 |
1451 |
1284 act = EricAction( |
1452 act = EricAction( |
1285 QCoreApplication.translate( |
1453 QCoreApplication.translate( |
1286 'ViewManager', 'Extend selection down one paragraph'), |
1454 "ViewManager", "Extend selection down one paragraph" |
1287 QCoreApplication.translate( |
1455 ), |
1288 'ViewManager', 'Extend selection down one paragraph'), |
1456 QCoreApplication.translate( |
1289 QKeySequence(QCoreApplication.translate('ViewManager', |
1457 "ViewManager", "Extend selection down one paragraph" |
1290 'Alt+Shift+Down')), |
1458 ), |
1291 0, |
1459 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Shift+Down")), |
1292 self.editorActGrp, 'vm_edit_extend_selection_down_para') |
1460 0, |
|
1461 self.editorActGrp, |
|
1462 "vm_edit_extend_selection_down_para", |
|
1463 ) |
1293 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND) |
1464 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND) |
1294 act.triggered.connect(self.esm.map) |
1465 act.triggered.connect(self.esm.map) |
1295 self.editActions.append(act) |
1466 self.editActions.append(act) |
1296 |
1467 |
1297 act = EricAction( |
1468 act = EricAction( |
1298 QCoreApplication.translate( |
1469 QCoreApplication.translate("ViewManager", "Extend selection up one page"), |
1299 'ViewManager', |
1470 QCoreApplication.translate("ViewManager", "Extend selection up one page"), |
1300 'Extend selection up one page'), |
1471 QKeySequence(QCoreApplication.translate("ViewManager", "Shift+PgUp")), |
1301 QCoreApplication.translate( |
1472 0, |
1302 'ViewManager', |
1473 self.editorActGrp, |
1303 'Extend selection up one page'), |
1474 "vm_edit_extend_selection_up_page", |
1304 QKeySequence(QCoreApplication.translate('ViewManager', |
1475 ) |
1305 'Shift+PgUp')), |
|
1306 0, self.editorActGrp, 'vm_edit_extend_selection_up_page') |
|
1307 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND) |
1476 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND) |
1308 act.triggered.connect(self.esm.map) |
1477 act.triggered.connect(self.esm.map) |
1309 self.editActions.append(act) |
1478 self.editActions.append(act) |
1310 |
1479 |
1311 act = EricAction( |
1480 act = EricAction( |
1312 QCoreApplication.translate( |
1481 QCoreApplication.translate("ViewManager", "Extend selection down one page"), |
1313 'ViewManager', |
1482 QCoreApplication.translate("ViewManager", "Extend selection down one page"), |
1314 'Extend selection down one page'), |
1483 QKeySequence(QCoreApplication.translate("ViewManager", "Shift+PgDown")), |
1315 QCoreApplication.translate( |
1484 0, |
1316 'ViewManager', |
1485 self.editorActGrp, |
1317 'Extend selection down one page'), |
1486 "vm_edit_extend_selection_down_page", |
1318 QKeySequence(QCoreApplication.translate('ViewManager', |
1487 ) |
1319 'Shift+PgDown')), |
|
1320 0, self.editorActGrp, 'vm_edit_extend_selection_down_page') |
|
1321 if isMacPlatform(): |
1488 if isMacPlatform(): |
1322 act.setAlternateShortcut(QKeySequence( |
1489 act.setAlternateShortcut( |
1323 QCoreApplication.translate('ViewManager', 'Meta+Shift+V'))) |
1490 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+Shift+V")) |
|
1491 ) |
1324 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND) |
1492 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND) |
1325 act.triggered.connect(self.esm.map) |
1493 act.triggered.connect(self.esm.map) |
1326 self.editActions.append(act) |
1494 self.editActions.append(act) |
1327 |
1495 |
1328 act = EricAction( |
1496 act = EricAction( |
1329 QCoreApplication.translate( |
1497 QCoreApplication.translate( |
1330 'ViewManager', 'Extend selection to start of document'), |
1498 "ViewManager", "Extend selection to start of document" |
1331 QCoreApplication.translate( |
1499 ), |
1332 'ViewManager', 'Extend selection to start of document'), |
1500 QCoreApplication.translate( |
1333 0, 0, |
1501 "ViewManager", "Extend selection to start of document" |
1334 self.editorActGrp, 'vm_edit_extend_selection_start_text') |
1502 ), |
|
1503 0, |
|
1504 0, |
|
1505 self.editorActGrp, |
|
1506 "vm_edit_extend_selection_start_text", |
|
1507 ) |
1335 if isMacPlatform(): |
1508 if isMacPlatform(): |
1336 act.setShortcut(QKeySequence( |
1509 act.setShortcut( |
1337 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Up'))) |
1510 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Shift+Up")) |
|
1511 ) |
1338 else: |
1512 else: |
1339 act.setShortcut(QKeySequence( |
1513 act.setShortcut( |
1340 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Home'))) |
1514 QKeySequence( |
|
1515 QCoreApplication.translate("ViewManager", "Ctrl+Shift+Home") |
|
1516 ) |
|
1517 ) |
1341 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTARTEXTEND) |
1518 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTARTEXTEND) |
1342 act.triggered.connect(self.esm.map) |
1519 act.triggered.connect(self.esm.map) |
1343 self.editActions.append(act) |
1520 self.editActions.append(act) |
1344 |
1521 |
1345 act = EricAction( |
1522 act = EricAction( |
1346 QCoreApplication.translate( |
1523 QCoreApplication.translate( |
1347 'ViewManager', 'Extend selection to end of document'), |
1524 "ViewManager", "Extend selection to end of document" |
1348 QCoreApplication.translate( |
1525 ), |
1349 'ViewManager', 'Extend selection to end of document'), |
1526 QCoreApplication.translate( |
1350 0, 0, |
1527 "ViewManager", "Extend selection to end of document" |
1351 self.editorActGrp, 'vm_edit_extend_selection_end_text') |
1528 ), |
|
1529 0, |
|
1530 0, |
|
1531 self.editorActGrp, |
|
1532 "vm_edit_extend_selection_end_text", |
|
1533 ) |
1352 if isMacPlatform(): |
1534 if isMacPlatform(): |
1353 act.setShortcut(QKeySequence( |
1535 act.setShortcut( |
1354 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Down'))) |
1536 QKeySequence( |
|
1537 QCoreApplication.translate("ViewManager", "Ctrl+Shift+Down") |
|
1538 ) |
|
1539 ) |
1355 else: |
1540 else: |
1356 act.setShortcut(QKeySequence( |
1541 act.setShortcut( |
1357 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+End'))) |
1542 QKeySequence( |
|
1543 QCoreApplication.translate("ViewManager", "Ctrl+Shift+End") |
|
1544 ) |
|
1545 ) |
1358 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND) |
1546 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND) |
1359 act.triggered.connect(self.esm.map) |
1547 act.triggered.connect(self.esm.map) |
1360 self.editActions.append(act) |
1548 self.editActions.append(act) |
1361 |
1549 |
1362 act = EricAction( |
1550 act = EricAction( |
1363 QCoreApplication.translate('ViewManager', |
1551 QCoreApplication.translate("ViewManager", "Delete previous character"), |
1364 'Delete previous character'), |
1552 QCoreApplication.translate("ViewManager", "Delete previous character"), |
1365 QCoreApplication.translate('ViewManager', |
1553 QKeySequence(QCoreApplication.translate("ViewManager", "Backspace")), |
1366 'Delete previous character'), |
1554 0, |
1367 QKeySequence(QCoreApplication.translate('ViewManager', |
1555 self.editorActGrp, |
1368 'Backspace')), |
1556 "vm_edit_delete_previous_char", |
1369 0, self.editorActGrp, 'vm_edit_delete_previous_char') |
1557 ) |
1370 if isMacPlatform(): |
1558 if isMacPlatform(): |
1371 act.setAlternateShortcut(QKeySequence( |
1559 act.setAlternateShortcut( |
1372 QCoreApplication.translate('ViewManager', 'Meta+H'))) |
1560 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+H")) |
|
1561 ) |
1373 else: |
1562 else: |
1374 act.setAlternateShortcut(QKeySequence( |
1563 act.setAlternateShortcut( |
1375 QCoreApplication.translate('ViewManager', 'Shift+Backspace'))) |
1564 QKeySequence( |
|
1565 QCoreApplication.translate("ViewManager", "Shift+Backspace") |
|
1566 ) |
|
1567 ) |
1376 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK) |
1568 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK) |
1377 act.triggered.connect(self.esm.map) |
1569 act.triggered.connect(self.esm.map) |
1378 self.editActions.append(act) |
1570 self.editActions.append(act) |
1379 |
1571 |
1380 act = EricAction( |
1572 act = EricAction( |
1381 QCoreApplication.translate( |
1573 QCoreApplication.translate( |
1382 'ViewManager', |
1574 "ViewManager", "Delete previous character if not at start of line" |
1383 'Delete previous character if not at start of line'), |
1575 ), |
1384 QCoreApplication.translate( |
1576 QCoreApplication.translate( |
1385 'ViewManager', |
1577 "ViewManager", "Delete previous character if not at start of line" |
1386 'Delete previous character if not at start of line'), |
1578 ), |
1387 0, 0, |
1579 0, |
1388 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start') |
1580 0, |
|
1581 self.editorActGrp, |
|
1582 "vm_edit_delet_previous_char_not_line_start", |
|
1583 ) |
1389 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE) |
1584 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE) |
1390 act.triggered.connect(self.esm.map) |
1585 act.triggered.connect(self.esm.map) |
1391 self.editActions.append(act) |
1586 self.editActions.append(act) |
1392 |
1587 |
1393 act = EricAction( |
1588 act = EricAction( |
1394 QCoreApplication.translate('ViewManager', |
1589 QCoreApplication.translate("ViewManager", "Delete current character"), |
1395 'Delete current character'), |
1590 QCoreApplication.translate("ViewManager", "Delete current character"), |
1396 QCoreApplication.translate('ViewManager', |
1591 QKeySequence(QCoreApplication.translate("ViewManager", "Del")), |
1397 'Delete current character'), |
1592 0, |
1398 QKeySequence(QCoreApplication.translate('ViewManager', 'Del')), 0, |
1593 self.editorActGrp, |
1399 self.editorActGrp, 'vm_edit_delete_current_char') |
1594 "vm_edit_delete_current_char", |
|
1595 ) |
1400 if isMacPlatform(): |
1596 if isMacPlatform(): |
1401 act.setAlternateShortcut(QKeySequence( |
1597 act.setAlternateShortcut( |
1402 QCoreApplication.translate('ViewManager', 'Meta+D'))) |
1598 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+D")) |
|
1599 ) |
1403 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR) |
1600 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR) |
1404 act.triggered.connect(self.esm.map) |
1601 act.triggered.connect(self.esm.map) |
1405 self.editActions.append(act) |
1602 self.editActions.append(act) |
1406 |
1603 |
1407 act = EricAction( |
1604 act = EricAction( |
1408 QCoreApplication.translate('ViewManager', 'Delete word to left'), |
1605 QCoreApplication.translate("ViewManager", "Delete word to left"), |
1409 QCoreApplication.translate('ViewManager', 'Delete word to left'), |
1606 QCoreApplication.translate("ViewManager", "Delete word to left"), |
1410 QKeySequence(QCoreApplication.translate('ViewManager', |
1607 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Backspace")), |
1411 'Ctrl+Backspace')), |
1608 0, |
1412 0, self.editorActGrp, 'vm_edit_delete_word_left') |
1609 self.editorActGrp, |
|
1610 "vm_edit_delete_word_left", |
|
1611 ) |
1413 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT) |
1612 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT) |
1414 act.triggered.connect(self.esm.map) |
1613 act.triggered.connect(self.esm.map) |
1415 self.editActions.append(act) |
1614 self.editActions.append(act) |
1416 |
1615 |
1417 act = EricAction( |
1616 act = EricAction( |
1418 QCoreApplication.translate('ViewManager', 'Delete word to right'), |
1617 QCoreApplication.translate("ViewManager", "Delete word to right"), |
1419 QCoreApplication.translate('ViewManager', 'Delete word to right'), |
1618 QCoreApplication.translate("ViewManager", "Delete word to right"), |
1420 QKeySequence(QCoreApplication.translate('ViewManager', |
1619 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Del")), |
1421 'Ctrl+Del')), |
1620 0, |
1422 0, self.editorActGrp, 'vm_edit_delete_word_right') |
1621 self.editorActGrp, |
|
1622 "vm_edit_delete_word_right", |
|
1623 ) |
1423 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT) |
1624 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT) |
1424 act.triggered.connect(self.esm.map) |
1625 act.triggered.connect(self.esm.map) |
1425 self.editActions.append(act) |
1626 self.editActions.append(act) |
1426 |
1627 |
1427 act = EricAction( |
1628 act = EricAction( |
1428 QCoreApplication.translate('ViewManager', 'Delete line to left'), |
1629 QCoreApplication.translate("ViewManager", "Delete line to left"), |
1429 QCoreApplication.translate('ViewManager', 'Delete line to left'), |
1630 QCoreApplication.translate("ViewManager", "Delete line to left"), |
1430 QKeySequence(QCoreApplication.translate('ViewManager', |
1631 QKeySequence( |
1431 'Ctrl+Shift+Backspace')), |
1632 QCoreApplication.translate("ViewManager", "Ctrl+Shift+Backspace") |
1432 0, self.editorActGrp, 'vm_edit_delete_line_left') |
1633 ), |
|
1634 0, |
|
1635 self.editorActGrp, |
|
1636 "vm_edit_delete_line_left", |
|
1637 ) |
1433 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT) |
1638 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT) |
1434 act.triggered.connect(self.esm.map) |
1639 act.triggered.connect(self.esm.map) |
1435 self.editActions.append(act) |
1640 self.editActions.append(act) |
1436 |
1641 |
1437 act = EricAction( |
1642 act = EricAction( |
1438 QCoreApplication.translate('ViewManager', 'Delete line to right'), |
1643 QCoreApplication.translate("ViewManager", "Delete line to right"), |
1439 QCoreApplication.translate('ViewManager', 'Delete line to right'), |
1644 QCoreApplication.translate("ViewManager", "Delete line to right"), |
1440 0, 0, |
1645 0, |
1441 self.editorActGrp, 'vm_edit_delete_line_right') |
1646 0, |
|
1647 self.editorActGrp, |
|
1648 "vm_edit_delete_line_right", |
|
1649 ) |
1442 if isMacPlatform(): |
1650 if isMacPlatform(): |
1443 act.setShortcut(QKeySequence( |
1651 act.setShortcut( |
1444 QCoreApplication.translate('ViewManager', 'Meta+K'))) |
1652 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+K")) |
|
1653 ) |
1445 else: |
1654 else: |
1446 act.setShortcut(QKeySequence( |
1655 act.setShortcut( |
1447 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Del'))) |
1656 QKeySequence( |
|
1657 QCoreApplication.translate("ViewManager", "Ctrl+Shift+Del") |
|
1658 ) |
|
1659 ) |
1448 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT) |
1660 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT) |
1449 act.triggered.connect(self.esm.map) |
1661 act.triggered.connect(self.esm.map) |
1450 self.editActions.append(act) |
1662 self.editActions.append(act) |
1451 |
1663 |
1452 act = EricAction( |
1664 act = EricAction( |
1453 QCoreApplication.translate('ViewManager', 'Insert new line'), |
1665 QCoreApplication.translate("ViewManager", "Insert new line"), |
1454 QCoreApplication.translate('ViewManager', 'Insert new line'), |
1666 QCoreApplication.translate("ViewManager", "Insert new line"), |
1455 QKeySequence(QCoreApplication.translate('ViewManager', 'Return')), |
1667 QKeySequence(QCoreApplication.translate("ViewManager", "Return")), |
1456 QKeySequence(QCoreApplication.translate('ViewManager', 'Enter')), |
1668 QKeySequence(QCoreApplication.translate("ViewManager", "Enter")), |
1457 self.editorActGrp, 'vm_edit_insert_line') |
1669 self.editorActGrp, |
|
1670 "vm_edit_insert_line", |
|
1671 ) |
1458 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE) |
1672 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE) |
1459 act.triggered.connect(self.esm.map) |
1673 act.triggered.connect(self.esm.map) |
1460 self.editActions.append(act) |
1674 self.editActions.append(act) |
1461 |
1675 |
1462 act = EricAction( |
1676 act = EricAction( |
1463 QCoreApplication.translate('ViewManager', 'Delete current line'), |
1677 QCoreApplication.translate("ViewManager", "Delete current line"), |
1464 QCoreApplication.translate('ViewManager', 'Delete current line'), |
1678 QCoreApplication.translate("ViewManager", "Delete current line"), |
1465 QKeySequence(QCoreApplication.translate('ViewManager', |
1679 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Shift+L")), |
1466 'Ctrl+Shift+L')), |
1680 0, |
1467 0, self.editorActGrp, 'vm_edit_delete_current_line') |
1681 self.editorActGrp, |
|
1682 "vm_edit_delete_current_line", |
|
1683 ) |
1468 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE) |
1684 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE) |
1469 act.triggered.connect(self.esm.map) |
1685 act.triggered.connect(self.esm.map) |
1470 self.editActions.append(act) |
1686 self.editActions.append(act) |
1471 |
1687 |
1472 act = EricAction( |
1688 act = EricAction( |
1473 QCoreApplication.translate('ViewManager', |
1689 QCoreApplication.translate("ViewManager", "Duplicate current line"), |
1474 'Duplicate current line'), |
1690 QCoreApplication.translate("ViewManager", "Duplicate current line"), |
1475 QCoreApplication.translate('ViewManager', |
1691 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+D")), |
1476 'Duplicate current line'), |
1692 0, |
1477 QKeySequence(QCoreApplication.translate('ViewManager', 'Ctrl+D')), |
1693 self.editorActGrp, |
1478 0, self.editorActGrp, 'vm_edit_duplicate_current_line') |
1694 "vm_edit_duplicate_current_line", |
|
1695 ) |
1479 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE) |
1696 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE) |
1480 act.triggered.connect(self.esm.map) |
1697 act.triggered.connect(self.esm.map) |
1481 self.editActions.append(act) |
1698 self.editActions.append(act) |
1482 |
1699 |
1483 act = EricAction( |
1700 act = EricAction( |
1484 QCoreApplication.translate( |
1701 QCoreApplication.translate( |
1485 'ViewManager', |
1702 "ViewManager", "Swap current and previous lines" |
1486 'Swap current and previous lines'), |
1703 ), |
1487 QCoreApplication.translate( |
1704 QCoreApplication.translate( |
1488 'ViewManager', |
1705 "ViewManager", "Swap current and previous lines" |
1489 'Swap current and previous lines'), |
1706 ), |
1490 QKeySequence(QCoreApplication.translate('ViewManager', 'Ctrl+T')), |
1707 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+T")), |
1491 0, self.editorActGrp, 'vm_edit_swap_current_previous_line') |
1708 0, |
|
1709 self.editorActGrp, |
|
1710 "vm_edit_swap_current_previous_line", |
|
1711 ) |
1492 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE) |
1712 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE) |
1493 act.triggered.connect(self.esm.map) |
1713 act.triggered.connect(self.esm.map) |
1494 self.editActions.append(act) |
1714 self.editActions.append(act) |
1495 |
1715 |
1496 act = EricAction( |
1716 act = EricAction( |
1497 QCoreApplication.translate('ViewManager', |
1717 QCoreApplication.translate("ViewManager", "Reverse selected lines"), |
1498 'Reverse selected lines'), |
1718 QCoreApplication.translate("ViewManager", "Reverse selected lines"), |
1499 QCoreApplication.translate('ViewManager', |
1719 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+Alt+R")), |
1500 'Reverse selected lines'), |
1720 0, |
1501 QKeySequence(QCoreApplication.translate('ViewManager', |
1721 self.editorActGrp, |
1502 'Meta+Alt+R')), |
1722 "vm_edit_reverse selected_lines", |
1503 0, self.editorActGrp, 'vm_edit_reverse selected_lines') |
1723 ) |
1504 self.esm.setMapping(act, QsciScintilla.SCI_LINEREVERSE) |
1724 self.esm.setMapping(act, QsciScintilla.SCI_LINEREVERSE) |
1505 act.triggered.connect(self.esm.map) |
1725 act.triggered.connect(self.esm.map) |
1506 self.editActions.append(act) |
1726 self.editActions.append(act) |
1507 |
1727 |
1508 act = EricAction( |
1728 act = EricAction( |
1509 QCoreApplication.translate('ViewManager', 'Cut current line'), |
1729 QCoreApplication.translate("ViewManager", "Cut current line"), |
1510 QCoreApplication.translate('ViewManager', 'Cut current line'), |
1730 QCoreApplication.translate("ViewManager", "Cut current line"), |
1511 QKeySequence(QCoreApplication.translate('ViewManager', |
1731 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Shift+L")), |
1512 'Alt+Shift+L')), |
1732 0, |
1513 0, self.editorActGrp, 'vm_edit_cut_current_line') |
1733 self.editorActGrp, |
|
1734 "vm_edit_cut_current_line", |
|
1735 ) |
1514 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT) |
1736 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT) |
1515 act.triggered.connect(self.esm.map) |
1737 act.triggered.connect(self.esm.map) |
1516 self.editActions.append(act) |
1738 self.editActions.append(act) |
1517 |
1739 |
1518 act = EricAction( |
1740 act = EricAction( |
1519 QCoreApplication.translate('ViewManager', 'Copy current line'), |
1741 QCoreApplication.translate("ViewManager", "Copy current line"), |
1520 QCoreApplication.translate('ViewManager', 'Copy current line'), |
1742 QCoreApplication.translate("ViewManager", "Copy current line"), |
1521 QKeySequence(QCoreApplication.translate('ViewManager', |
1743 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Shift+T")), |
1522 'Ctrl+Shift+T')), |
1744 0, |
1523 0, self.editorActGrp, 'vm_edit_copy_current_line') |
1745 self.editorActGrp, |
|
1746 "vm_edit_copy_current_line", |
|
1747 ) |
1524 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY) |
1748 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY) |
1525 act.triggered.connect(self.esm.map) |
1749 act.triggered.connect(self.esm.map) |
1526 self.editActions.append(act) |
1750 self.editActions.append(act) |
1527 |
1751 |
1528 act = EricAction( |
1752 act = EricAction( |
1529 QCoreApplication.translate('ViewManager', |
1753 QCoreApplication.translate("ViewManager", "Toggle insert/overtype"), |
1530 'Toggle insert/overtype'), |
1754 QCoreApplication.translate("ViewManager", "Toggle insert/overtype"), |
1531 QCoreApplication.translate('ViewManager', |
1755 QKeySequence(QCoreApplication.translate("ViewManager", "Ins")), |
1532 'Toggle insert/overtype'), |
1756 0, |
1533 QKeySequence(QCoreApplication.translate('ViewManager', 'Ins')), 0, |
1757 self.editorActGrp, |
1534 self.editorActGrp, 'vm_edit_toggle_insert_overtype') |
1758 "vm_edit_toggle_insert_overtype", |
|
1759 ) |
1535 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE) |
1760 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE) |
1536 act.triggered.connect(self.esm.map) |
1761 act.triggered.connect(self.esm.map) |
1537 self.editActions.append(act) |
1762 self.editActions.append(act) |
1538 |
1763 |
1539 act = EricAction( |
1764 act = EricAction( |
1540 QCoreApplication.translate( |
1765 QCoreApplication.translate( |
1541 'ViewManager', |
1766 "ViewManager", "Convert selection to lower case" |
1542 'Convert selection to lower case'), |
1767 ), |
1543 QCoreApplication.translate( |
1768 QCoreApplication.translate( |
1544 'ViewManager', |
1769 "ViewManager", "Convert selection to lower case" |
1545 'Convert selection to lower case'), |
1770 ), |
1546 QKeySequence(QCoreApplication.translate('ViewManager', |
1771 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Shift+U")), |
1547 'Alt+Shift+U')), |
1772 0, |
1548 0, self.editorActGrp, 'vm_edit_convert_selection_lower') |
1773 self.editorActGrp, |
|
1774 "vm_edit_convert_selection_lower", |
|
1775 ) |
1549 self.esm.setMapping(act, QsciScintilla.SCI_LOWERCASE) |
1776 self.esm.setMapping(act, QsciScintilla.SCI_LOWERCASE) |
1550 act.triggered.connect(self.esm.map) |
1777 act.triggered.connect(self.esm.map) |
1551 self.editActions.append(act) |
1778 self.editActions.append(act) |
1552 |
1779 |
1553 act = EricAction( |
1780 act = EricAction( |
1554 QCoreApplication.translate( |
1781 QCoreApplication.translate( |
1555 'ViewManager', |
1782 "ViewManager", "Convert selection to upper case" |
1556 'Convert selection to upper case'), |
1783 ), |
1557 QCoreApplication.translate( |
1784 QCoreApplication.translate( |
1558 'ViewManager', |
1785 "ViewManager", "Convert selection to upper case" |
1559 'Convert selection to upper case'), |
1786 ), |
1560 QKeySequence(QCoreApplication.translate('ViewManager', |
1787 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Shift+U")), |
1561 'Ctrl+Shift+U')), |
1788 0, |
1562 0, self.editorActGrp, 'vm_edit_convert_selection_upper') |
1789 self.editorActGrp, |
|
1790 "vm_edit_convert_selection_upper", |
|
1791 ) |
1563 self.esm.setMapping(act, QsciScintilla.SCI_UPPERCASE) |
1792 self.esm.setMapping(act, QsciScintilla.SCI_UPPERCASE) |
1564 act.triggered.connect(self.esm.map) |
1793 act.triggered.connect(self.esm.map) |
1565 self.editActions.append(act) |
1794 self.editActions.append(act) |
1566 |
1795 |
1567 act = EricAction( |
1796 act = EricAction( |
1568 QCoreApplication.translate( |
1797 QCoreApplication.translate("ViewManager", "Move to end of display line"), |
1569 'ViewManager', 'Move to end of display line'), |
1798 QCoreApplication.translate("ViewManager", "Move to end of display line"), |
1570 QCoreApplication.translate( |
1799 0, |
1571 'ViewManager', 'Move to end of display line'), |
1800 0, |
1572 0, 0, |
1801 self.editorActGrp, |
1573 self.editorActGrp, 'vm_edit_move_end_displayed_line') |
1802 "vm_edit_move_end_displayed_line", |
|
1803 ) |
1574 if isMacPlatform(): |
1804 if isMacPlatform(): |
1575 act.setShortcut(QKeySequence( |
1805 act.setShortcut( |
1576 QCoreApplication.translate('ViewManager', 'Ctrl+Right'))) |
1806 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Right")) |
|
1807 ) |
1577 else: |
1808 else: |
1578 act.setShortcut(QKeySequence( |
1809 act.setShortcut( |
1579 QCoreApplication.translate('ViewManager', 'Alt+End'))) |
1810 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+End")) |
|
1811 ) |
1580 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY) |
1812 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY) |
1581 act.triggered.connect(self.esm.map) |
1813 act.triggered.connect(self.esm.map) |
1582 self.editActions.append(act) |
1814 self.editActions.append(act) |
1583 |
1815 |
1584 act = EricAction( |
1816 act = EricAction( |
1585 QCoreApplication.translate( |
1817 QCoreApplication.translate( |
1586 'ViewManager', |
1818 "ViewManager", "Extend selection to end of display line" |
1587 'Extend selection to end of display line'), |
1819 ), |
1588 QCoreApplication.translate( |
1820 QCoreApplication.translate( |
1589 'ViewManager', |
1821 "ViewManager", "Extend selection to end of display line" |
1590 'Extend selection to end of display line'), |
1822 ), |
1591 0, 0, |
1823 0, |
1592 self.editorActGrp, 'vm_edit_extend_selection_end_displayed_line') |
1824 0, |
|
1825 self.editorActGrp, |
|
1826 "vm_edit_extend_selection_end_displayed_line", |
|
1827 ) |
1593 if isMacPlatform(): |
1828 if isMacPlatform(): |
1594 act.setShortcut(QKeySequence( |
1829 act.setShortcut( |
1595 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) |
1830 QKeySequence( |
|
1831 QCoreApplication.translate("ViewManager", "Ctrl+Shift+Right") |
|
1832 ) |
|
1833 ) |
1596 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND) |
1834 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND) |
1597 act.triggered.connect(self.esm.map) |
1835 act.triggered.connect(self.esm.map) |
1598 self.editActions.append(act) |
1836 self.editActions.append(act) |
1599 |
1837 |
1600 act = EricAction( |
1838 act = EricAction( |
1601 QCoreApplication.translate('ViewManager', 'Formfeed'), |
1839 QCoreApplication.translate("ViewManager", "Formfeed"), |
1602 QCoreApplication.translate('ViewManager', 'Formfeed'), |
1840 QCoreApplication.translate("ViewManager", "Formfeed"), |
1603 0, 0, |
1841 0, |
1604 self.editorActGrp, 'vm_edit_formfeed') |
1842 0, |
|
1843 self.editorActGrp, |
|
1844 "vm_edit_formfeed", |
|
1845 ) |
1605 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) |
1846 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) |
1606 act.triggered.connect(self.esm.map) |
1847 act.triggered.connect(self.esm.map) |
1607 self.editActions.append(act) |
1848 self.editActions.append(act) |
1608 |
1849 |
1609 act = EricAction( |
1850 act = EricAction( |
1610 QCoreApplication.translate('ViewManager', 'Escape'), |
1851 QCoreApplication.translate("ViewManager", "Escape"), |
1611 QCoreApplication.translate('ViewManager', 'Escape'), |
1852 QCoreApplication.translate("ViewManager", "Escape"), |
1612 QKeySequence(QCoreApplication.translate('ViewManager', 'Esc')), 0, |
1853 QKeySequence(QCoreApplication.translate("ViewManager", "Esc")), |
1613 self.editorActGrp, 'vm_edit_escape') |
1854 0, |
|
1855 self.editorActGrp, |
|
1856 "vm_edit_escape", |
|
1857 ) |
1614 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL) |
1858 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL) |
1615 act.triggered.connect(self.esm.map) |
1859 act.triggered.connect(self.esm.map) |
1616 self.editActions.append(act) |
1860 self.editActions.append(act) |
1617 |
1861 |
1618 act = EricAction( |
1862 act = EricAction( |
1619 QCoreApplication.translate( |
1863 QCoreApplication.translate( |
1620 'ViewManager', |
1864 "ViewManager", "Extend rectangular selection down one line" |
1621 'Extend rectangular selection down one line'), |
1865 ), |
1622 QCoreApplication.translate( |
1866 QCoreApplication.translate( |
1623 'ViewManager', |
1867 "ViewManager", "Extend rectangular selection down one line" |
1624 'Extend rectangular selection down one line'), |
1868 ), |
1625 QKeySequence(QCoreApplication.translate('ViewManager', |
1869 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Ctrl+Down")), |
1626 'Alt+Ctrl+Down')), |
1870 0, |
1627 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_line') |
1871 self.editorActGrp, |
|
1872 "vm_edit_extend_rect_selection_down_line", |
|
1873 ) |
1628 if isMacPlatform(): |
1874 if isMacPlatform(): |
1629 act.setAlternateShortcut(QKeySequence( |
1875 act.setAlternateShortcut( |
1630 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+N'))) |
1876 QKeySequence( |
|
1877 QCoreApplication.translate("ViewManager", "Meta+Alt+Shift+N") |
|
1878 ) |
|
1879 ) |
1631 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND) |
1880 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND) |
1632 act.triggered.connect(self.esm.map) |
1881 act.triggered.connect(self.esm.map) |
1633 self.editActions.append(act) |
1882 self.editActions.append(act) |
1634 |
1883 |
1635 act = EricAction( |
1884 act = EricAction( |
1636 QCoreApplication.translate( |
1885 QCoreApplication.translate( |
1637 'ViewManager', |
1886 "ViewManager", "Extend rectangular selection up one line" |
1638 'Extend rectangular selection up one line'), |
1887 ), |
1639 QCoreApplication.translate( |
1888 QCoreApplication.translate( |
1640 'ViewManager', |
1889 "ViewManager", "Extend rectangular selection up one line" |
1641 'Extend rectangular selection up one line'), |
1890 ), |
1642 QKeySequence(QCoreApplication.translate('ViewManager', |
1891 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Ctrl+Up")), |
1643 'Alt+Ctrl+Up')), |
1892 0, |
1644 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_line') |
1893 self.editorActGrp, |
|
1894 "vm_edit_extend_rect_selection_up_line", |
|
1895 ) |
1645 if isMacPlatform(): |
1896 if isMacPlatform(): |
1646 act.setAlternateShortcut(QKeySequence( |
1897 act.setAlternateShortcut( |
1647 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+P'))) |
1898 QKeySequence( |
|
1899 QCoreApplication.translate("ViewManager", "Meta+Alt+Shift+P") |
|
1900 ) |
|
1901 ) |
1648 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND) |
1902 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND) |
1649 act.triggered.connect(self.esm.map) |
1903 act.triggered.connect(self.esm.map) |
1650 self.editActions.append(act) |
1904 self.editActions.append(act) |
1651 |
1905 |
1652 act = EricAction( |
1906 act = EricAction( |
1653 QCoreApplication.translate( |
1907 QCoreApplication.translate( |
1654 'ViewManager', |
1908 "ViewManager", "Extend rectangular selection left one character" |
1655 'Extend rectangular selection left one character'), |
1909 ), |
1656 QCoreApplication.translate( |
1910 QCoreApplication.translate( |
1657 'ViewManager', |
1911 "ViewManager", "Extend rectangular selection left one character" |
1658 'Extend rectangular selection left one character'), |
1912 ), |
1659 QKeySequence(QCoreApplication.translate('ViewManager', |
1913 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Ctrl+Left")), |
1660 'Alt+Ctrl+Left')), |
1914 0, |
1661 0, self.editorActGrp, 'vm_edit_extend_rect_selection_left_char') |
1915 self.editorActGrp, |
|
1916 "vm_edit_extend_rect_selection_left_char", |
|
1917 ) |
1662 if isMacPlatform(): |
1918 if isMacPlatform(): |
1663 act.setAlternateShortcut(QKeySequence( |
1919 act.setAlternateShortcut( |
1664 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+B'))) |
1920 QKeySequence( |
|
1921 QCoreApplication.translate("ViewManager", "Meta+Alt+Shift+B") |
|
1922 ) |
|
1923 ) |
1665 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND) |
1924 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND) |
1666 act.triggered.connect(self.esm.map) |
1925 act.triggered.connect(self.esm.map) |
1667 self.editActions.append(act) |
1926 self.editActions.append(act) |
1668 |
1927 |
1669 act = EricAction( |
1928 act = EricAction( |
1670 QCoreApplication.translate( |
1929 QCoreApplication.translate( |
1671 'ViewManager', |
1930 "ViewManager", "Extend rectangular selection right one character" |
1672 'Extend rectangular selection right one character'), |
1931 ), |
1673 QCoreApplication.translate( |
1932 QCoreApplication.translate( |
1674 'ViewManager', |
1933 "ViewManager", "Extend rectangular selection right one character" |
1675 'Extend rectangular selection right one character'), |
1934 ), |
1676 QKeySequence(QCoreApplication.translate('ViewManager', |
1935 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Ctrl+Right")), |
1677 'Alt+Ctrl+Right')), |
1936 0, |
1678 0, self.editorActGrp, 'vm_edit_extend_rect_selection_right_char') |
1937 self.editorActGrp, |
|
1938 "vm_edit_extend_rect_selection_right_char", |
|
1939 ) |
1679 if isMacPlatform(): |
1940 if isMacPlatform(): |
1680 act.setAlternateShortcut(QKeySequence( |
1941 act.setAlternateShortcut( |
1681 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+F'))) |
1942 QKeySequence( |
|
1943 QCoreApplication.translate("ViewManager", "Meta+Alt+Shift+F") |
|
1944 ) |
|
1945 ) |
1682 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND) |
1946 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND) |
1683 act.triggered.connect(self.esm.map) |
1947 act.triggered.connect(self.esm.map) |
1684 self.editActions.append(act) |
1948 self.editActions.append(act) |
1685 |
1949 |
1686 act = EricAction( |
1950 act = EricAction( |
1687 QCoreApplication.translate( |
1951 QCoreApplication.translate( |
1688 'ViewManager', |
1952 "ViewManager", |
1689 'Extend rectangular selection to first' |
1953 "Extend rectangular selection to first" |
1690 ' visible character in document line'), |
1954 " visible character in document line", |
1691 QCoreApplication.translate( |
1955 ), |
1692 'ViewManager', |
1956 QCoreApplication.translate( |
1693 'Extend rectangular selection to first' |
1957 "ViewManager", |
1694 ' visible character in document line'), |
1958 "Extend rectangular selection to first" |
1695 0, 0, |
1959 " visible character in document line", |
1696 self.editorActGrp, |
1960 ), |
1697 'vm_edit_extend_rect_selection_first_visible_char') |
1961 0, |
|
1962 0, |
|
1963 self.editorActGrp, |
|
1964 "vm_edit_extend_rect_selection_first_visible_char", |
|
1965 ) |
1698 if not isMacPlatform(): |
1966 if not isMacPlatform(): |
1699 act.setShortcut(QKeySequence( |
1967 act.setShortcut( |
1700 QCoreApplication.translate('ViewManager', 'Alt+Shift+Home'))) |
1968 QKeySequence( |
|
1969 QCoreApplication.translate("ViewManager", "Alt+Shift+Home") |
|
1970 ) |
|
1971 ) |
1701 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND) |
1972 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND) |
1702 act.triggered.connect(self.esm.map) |
1973 act.triggered.connect(self.esm.map) |
1703 self.editActions.append(act) |
1974 self.editActions.append(act) |
1704 |
1975 |
1705 act = EricAction( |
1976 act = EricAction( |
1706 QCoreApplication.translate( |
1977 QCoreApplication.translate( |
1707 'ViewManager', |
1978 "ViewManager", "Extend rectangular selection to end of document line" |
1708 'Extend rectangular selection to end of document line'), |
1979 ), |
1709 QCoreApplication.translate( |
1980 QCoreApplication.translate( |
1710 'ViewManager', |
1981 "ViewManager", "Extend rectangular selection to end of document line" |
1711 'Extend rectangular selection to end of document line'), |
1982 ), |
1712 0, 0, |
1983 0, |
1713 self.editorActGrp, 'vm_edit_extend_rect_selection_end_line') |
1984 0, |
|
1985 self.editorActGrp, |
|
1986 "vm_edit_extend_rect_selection_end_line", |
|
1987 ) |
1714 if isMacPlatform(): |
1988 if isMacPlatform(): |
1715 act.setShortcut(QKeySequence( |
1989 act.setShortcut( |
1716 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+E'))) |
1990 QKeySequence( |
|
1991 QCoreApplication.translate("ViewManager", "Meta+Alt+Shift+E") |
|
1992 ) |
|
1993 ) |
1717 else: |
1994 else: |
1718 act.setShortcut(QKeySequence( |
1995 act.setShortcut( |
1719 QCoreApplication.translate('ViewManager', 'Alt+Shift+End'))) |
1996 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Shift+End")) |
|
1997 ) |
1720 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND) |
1998 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND) |
1721 act.triggered.connect(self.esm.map) |
1999 act.triggered.connect(self.esm.map) |
1722 self.editActions.append(act) |
2000 self.editActions.append(act) |
1723 |
2001 |
1724 act = EricAction( |
2002 act = EricAction( |
1725 QCoreApplication.translate( |
2003 QCoreApplication.translate( |
1726 'ViewManager', |
2004 "ViewManager", "Extend rectangular selection up one page" |
1727 'Extend rectangular selection up one page'), |
2005 ), |
1728 QCoreApplication.translate( |
2006 QCoreApplication.translate( |
1729 'ViewManager', |
2007 "ViewManager", "Extend rectangular selection up one page" |
1730 'Extend rectangular selection up one page'), |
2008 ), |
1731 QKeySequence(QCoreApplication.translate('ViewManager', |
2009 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Shift+PgUp")), |
1732 'Alt+Shift+PgUp')), |
2010 0, |
1733 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_page') |
2011 self.editorActGrp, |
|
2012 "vm_edit_extend_rect_selection_up_page", |
|
2013 ) |
1734 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND) |
2014 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND) |
1735 act.triggered.connect(self.esm.map) |
2015 act.triggered.connect(self.esm.map) |
1736 self.editActions.append(act) |
2016 self.editActions.append(act) |
1737 |
2017 |
1738 act = EricAction( |
2018 act = EricAction( |
1739 QCoreApplication.translate( |
2019 QCoreApplication.translate( |
1740 'ViewManager', |
2020 "ViewManager", "Extend rectangular selection down one page" |
1741 'Extend rectangular selection down one page'), |
2021 ), |
1742 QCoreApplication.translate( |
2022 QCoreApplication.translate( |
1743 'ViewManager', |
2023 "ViewManager", "Extend rectangular selection down one page" |
1744 'Extend rectangular selection down one page'), |
2024 ), |
1745 QKeySequence(QCoreApplication.translate('ViewManager', |
2025 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Shift+PgDown")), |
1746 'Alt+Shift+PgDown')), |
2026 0, |
1747 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_page') |
2027 self.editorActGrp, |
|
2028 "vm_edit_extend_rect_selection_down_page", |
|
2029 ) |
1748 if isMacPlatform(): |
2030 if isMacPlatform(): |
1749 act.setAlternateShortcut(QKeySequence( |
2031 act.setAlternateShortcut( |
1750 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+V'))) |
2032 QKeySequence( |
|
2033 QCoreApplication.translate("ViewManager", "Meta+Alt+Shift+V") |
|
2034 ) |
|
2035 ) |
1751 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND) |
2036 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND) |
1752 act.triggered.connect(self.esm.map) |
2037 act.triggered.connect(self.esm.map) |
1753 self.editActions.append(act) |
2038 self.editActions.append(act) |
1754 |
2039 |
1755 act = EricAction( |
2040 act = EricAction( |
1756 QCoreApplication.translate( |
2041 QCoreApplication.translate("ViewManager", "Duplicate current selection"), |
1757 'ViewManager', |
2042 QCoreApplication.translate("ViewManager", "Duplicate current selection"), |
1758 'Duplicate current selection'), |
2043 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Shift+D")), |
1759 QCoreApplication.translate( |
2044 0, |
1760 'ViewManager', |
2045 self.editorActGrp, |
1761 'Duplicate current selection'), |
2046 "vm_edit_duplicate_current_selection", |
1762 QKeySequence(QCoreApplication.translate('ViewManager', |
2047 ) |
1763 'Ctrl+Shift+D')), |
|
1764 0, self.editorActGrp, 'vm_edit_duplicate_current_selection') |
|
1765 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) |
2048 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) |
1766 act.triggered.connect(self.esm.map) |
2049 act.triggered.connect(self.esm.map) |
1767 self.editActions.append(act) |
2050 self.editActions.append(act) |
1768 |
2051 |
1769 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"): |
2052 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"): |
1770 act = EricAction( |
2053 act = EricAction( |
1771 QCoreApplication.translate( |
2054 QCoreApplication.translate( |
1772 'ViewManager', 'Scroll to start of document'), |
2055 "ViewManager", "Scroll to start of document" |
1773 QCoreApplication.translate( |
2056 ), |
1774 'ViewManager', 'Scroll to start of document'), |
2057 QCoreApplication.translate( |
1775 0, 0, |
2058 "ViewManager", "Scroll to start of document" |
1776 self.editorActGrp, 'vm_edit_scroll_start_text') |
2059 ), |
|
2060 0, |
|
2061 0, |
|
2062 self.editorActGrp, |
|
2063 "vm_edit_scroll_start_text", |
|
2064 ) |
1777 if isMacPlatform(): |
2065 if isMacPlatform(): |
1778 act.setShortcut(QKeySequence( |
2066 act.setShortcut( |
1779 QCoreApplication.translate('ViewManager', 'Home'))) |
2067 QKeySequence(QCoreApplication.translate("ViewManager", "Home")) |
|
2068 ) |
1780 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOSTART) |
2069 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOSTART) |
1781 act.triggered.connect(self.esm.map) |
2070 act.triggered.connect(self.esm.map) |
1782 self.editActions.append(act) |
2071 self.editActions.append(act) |
1783 |
2072 |
1784 if hasattr(QsciScintilla, "SCI_SCROLLTOEND"): |
2073 if hasattr(QsciScintilla, "SCI_SCROLLTOEND"): |
1785 act = EricAction( |
2074 act = EricAction( |
1786 QCoreApplication.translate( |
2075 QCoreApplication.translate("ViewManager", "Scroll to end of document"), |
1787 'ViewManager', 'Scroll to end of document'), |
2076 QCoreApplication.translate("ViewManager", "Scroll to end of document"), |
1788 QCoreApplication.translate( |
2077 0, |
1789 'ViewManager', 'Scroll to end of document'), |
2078 0, |
1790 0, 0, |
2079 self.editorActGrp, |
1791 self.editorActGrp, 'vm_edit_scroll_end_text') |
2080 "vm_edit_scroll_end_text", |
|
2081 ) |
1792 if isMacPlatform(): |
2082 if isMacPlatform(): |
1793 act.setShortcut(QKeySequence( |
2083 act.setShortcut( |
1794 QCoreApplication.translate('ViewManager', 'End'))) |
2084 QKeySequence(QCoreApplication.translate("ViewManager", "End")) |
|
2085 ) |
1795 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOEND) |
2086 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOEND) |
1796 act.triggered.connect(self.esm.map) |
2087 act.triggered.connect(self.esm.map) |
1797 self.editActions.append(act) |
2088 self.editActions.append(act) |
1798 |
2089 |
1799 if hasattr(QsciScintilla, "SCI_VERTICALCENTRECARET"): |
2090 if hasattr(QsciScintilla, "SCI_VERTICALCENTRECARET"): |
1800 act = EricAction( |
2091 act = EricAction( |
1801 QCoreApplication.translate( |
2092 QCoreApplication.translate( |
1802 'ViewManager', 'Scroll vertically to center current line'), |
2093 "ViewManager", "Scroll vertically to center current line" |
1803 QCoreApplication.translate( |
2094 ), |
1804 'ViewManager', 'Scroll vertically to center current line'), |
2095 QCoreApplication.translate( |
1805 0, 0, |
2096 "ViewManager", "Scroll vertically to center current line" |
1806 self.editorActGrp, 'vm_edit_scroll_vertically_center') |
2097 ), |
|
2098 0, |
|
2099 0, |
|
2100 self.editorActGrp, |
|
2101 "vm_edit_scroll_vertically_center", |
|
2102 ) |
1807 if isMacPlatform(): |
2103 if isMacPlatform(): |
1808 act.setShortcut(QKeySequence( |
2104 act.setShortcut( |
1809 QCoreApplication.translate('ViewManager', 'Meta+L'))) |
2105 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+L")) |
|
2106 ) |
1810 self.esm.setMapping(act, QsciScintilla.SCI_VERTICALCENTRECARET) |
2107 self.esm.setMapping(act, QsciScintilla.SCI_VERTICALCENTRECARET) |
1811 act.triggered.connect(self.esm.map) |
2108 act.triggered.connect(self.esm.map) |
1812 self.editActions.append(act) |
2109 self.editActions.append(act) |
1813 |
2110 |
1814 if hasattr(QsciScintilla, "SCI_WORDRIGHTEND"): |
2111 if hasattr(QsciScintilla, "SCI_WORDRIGHTEND"): |
1815 act = EricAction( |
2112 act = EricAction( |
1816 QCoreApplication.translate( |
2113 QCoreApplication.translate("ViewManager", "Move to end of next word"), |
1817 'ViewManager', 'Move to end of next word'), |
2114 QCoreApplication.translate("ViewManager", "Move to end of next word"), |
1818 QCoreApplication.translate( |
2115 0, |
1819 'ViewManager', 'Move to end of next word'), |
2116 0, |
1820 0, 0, |
2117 self.editorActGrp, |
1821 self.editorActGrp, 'vm_edit_move_end_next_word') |
2118 "vm_edit_move_end_next_word", |
|
2119 ) |
1822 if isMacPlatform(): |
2120 if isMacPlatform(): |
1823 act.setShortcut(QKeySequence( |
2121 act.setShortcut( |
1824 QCoreApplication.translate('ViewManager', 'Alt+Right'))) |
2122 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Right")) |
|
2123 ) |
1825 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEND) |
2124 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEND) |
1826 act.triggered.connect(self.esm.map) |
2125 act.triggered.connect(self.esm.map) |
1827 self.editActions.append(act) |
2126 self.editActions.append(act) |
1828 |
2127 |
1829 if hasattr(QsciScintilla, "SCI_WORDRIGHTENDEXTEND"): |
2128 if hasattr(QsciScintilla, "SCI_WORDRIGHTENDEXTEND"): |
1830 act = EricAction( |
2129 act = EricAction( |
1831 QCoreApplication.translate( |
2130 QCoreApplication.translate( |
1832 'ViewManager', 'Extend selection to end of next word'), |
2131 "ViewManager", "Extend selection to end of next word" |
1833 QCoreApplication.translate( |
2132 ), |
1834 'ViewManager', 'Extend selection to end of next word'), |
2133 QCoreApplication.translate( |
1835 0, 0, |
2134 "ViewManager", "Extend selection to end of next word" |
1836 self.editorActGrp, 'vm_edit_select_end_next_word') |
2135 ), |
|
2136 0, |
|
2137 0, |
|
2138 self.editorActGrp, |
|
2139 "vm_edit_select_end_next_word", |
|
2140 ) |
1837 if isMacPlatform(): |
2141 if isMacPlatform(): |
1838 act.setShortcut(QKeySequence( |
2142 act.setShortcut( |
1839 QCoreApplication.translate('ViewManager', |
2143 QKeySequence( |
1840 'Alt+Shift+Right'))) |
2144 QCoreApplication.translate("ViewManager", "Alt+Shift+Right") |
|
2145 ) |
|
2146 ) |
1841 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTENDEXTEND) |
2147 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTENDEXTEND) |
1842 act.triggered.connect(self.esm.map) |
2148 act.triggered.connect(self.esm.map) |
1843 self.editActions.append(act) |
2149 self.editActions.append(act) |
1844 |
2150 |
1845 if hasattr(QsciScintilla, "SCI_WORDLEFTEND"): |
2151 if hasattr(QsciScintilla, "SCI_WORDLEFTEND"): |
1846 act = EricAction( |
2152 act = EricAction( |
1847 QCoreApplication.translate( |
2153 QCoreApplication.translate( |
1848 'ViewManager', 'Move to end of previous word'), |
2154 "ViewManager", "Move to end of previous word" |
1849 QCoreApplication.translate( |
2155 ), |
1850 'ViewManager', 'Move to end of previous word'), |
2156 QCoreApplication.translate( |
1851 0, 0, |
2157 "ViewManager", "Move to end of previous word" |
1852 self.editorActGrp, 'vm_edit_move_end_previous_word') |
2158 ), |
|
2159 0, |
|
2160 0, |
|
2161 self.editorActGrp, |
|
2162 "vm_edit_move_end_previous_word", |
|
2163 ) |
1853 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEND) |
2164 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEND) |
1854 act.triggered.connect(self.esm.map) |
2165 act.triggered.connect(self.esm.map) |
1855 self.editActions.append(act) |
2166 self.editActions.append(act) |
1856 |
2167 |
1857 if hasattr(QsciScintilla, "SCI_WORDLEFTENDEXTEND"): |
2168 if hasattr(QsciScintilla, "SCI_WORDLEFTENDEXTEND"): |
1858 act = EricAction( |
2169 act = EricAction( |
1859 QCoreApplication.translate( |
2170 QCoreApplication.translate( |
1860 'ViewManager', 'Extend selection to end of previous word'), |
2171 "ViewManager", "Extend selection to end of previous word" |
1861 QCoreApplication.translate( |
2172 ), |
1862 'ViewManager', 'Extend selection to end of previous word'), |
2173 QCoreApplication.translate( |
1863 0, 0, |
2174 "ViewManager", "Extend selection to end of previous word" |
1864 self.editorActGrp, 'vm_edit_select_end_previous_word') |
2175 ), |
|
2176 0, |
|
2177 0, |
|
2178 self.editorActGrp, |
|
2179 "vm_edit_select_end_previous_word", |
|
2180 ) |
1865 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTENDEXTEND) |
2181 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTENDEXTEND) |
1866 act.triggered.connect(self.esm.map) |
2182 act.triggered.connect(self.esm.map) |
1867 self.editActions.append(act) |
2183 self.editActions.append(act) |
1868 |
2184 |
1869 if hasattr(QsciScintilla, "SCI_HOME"): |
2185 if hasattr(QsciScintilla, "SCI_HOME"): |
1870 act = EricAction( |
2186 act = EricAction( |
1871 QCoreApplication.translate( |
2187 QCoreApplication.translate( |
1872 'ViewManager', 'Move to start of document line'), |
2188 "ViewManager", "Move to start of document line" |
1873 QCoreApplication.translate( |
2189 ), |
1874 'ViewManager', 'Move to start of document line'), |
2190 QCoreApplication.translate( |
1875 0, 0, |
2191 "ViewManager", "Move to start of document line" |
1876 self.editorActGrp, 'vm_edit_move_start_document_line') |
2192 ), |
|
2193 0, |
|
2194 0, |
|
2195 self.editorActGrp, |
|
2196 "vm_edit_move_start_document_line", |
|
2197 ) |
1877 if isMacPlatform(): |
2198 if isMacPlatform(): |
1878 act.setShortcut(QKeySequence( |
2199 act.setShortcut( |
1879 QCoreApplication.translate('ViewManager', 'Meta+A'))) |
2200 QKeySequence(QCoreApplication.translate("ViewManager", "Meta+A")) |
|
2201 ) |
1880 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
2202 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
1881 act.triggered.connect(self.esm.map) |
2203 act.triggered.connect(self.esm.map) |
1882 self.editActions.append(act) |
2204 self.editActions.append(act) |
1883 |
2205 |
1884 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"): |
2206 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"): |
1885 act = EricAction( |
2207 act = EricAction( |
1886 QCoreApplication.translate( |
2208 QCoreApplication.translate( |
1887 'ViewManager', |
2209 "ViewManager", "Extend selection to start of document line" |
1888 'Extend selection to start of document line'), |
2210 ), |
1889 QCoreApplication.translate( |
2211 QCoreApplication.translate( |
1890 'ViewManager', |
2212 "ViewManager", "Extend selection to start of document line" |
1891 'Extend selection to start of document line'), |
2213 ), |
1892 0, 0, |
2214 0, |
|
2215 0, |
1893 self.editorActGrp, |
2216 self.editorActGrp, |
1894 'vm_edit_extend_selection_start_document_line') |
2217 "vm_edit_extend_selection_start_document_line", |
|
2218 ) |
1895 if isMacPlatform(): |
2219 if isMacPlatform(): |
1896 act.setShortcut(QKeySequence( |
2220 act.setShortcut( |
1897 QCoreApplication.translate('ViewManager', 'Meta+Shift+A'))) |
2221 QKeySequence( |
|
2222 QCoreApplication.translate("ViewManager", "Meta+Shift+A") |
|
2223 ) |
|
2224 ) |
1898 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
2225 self.esm.setMapping(act, QsciScintilla.SCI_HOME) |
1899 act.triggered.connect(self.esm.map) |
2226 act.triggered.connect(self.esm.map) |
1900 self.editActions.append(act) |
2227 self.editActions.append(act) |
1901 |
2228 |
1902 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"): |
2229 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"): |
1903 act = EricAction( |
2230 act = EricAction( |
1904 QCoreApplication.translate( |
2231 QCoreApplication.translate( |
1905 'ViewManager', |
2232 "ViewManager", |
1906 'Extend rectangular selection to start of document line'), |
2233 "Extend rectangular selection to start of document line", |
1907 QCoreApplication.translate( |
2234 ), |
1908 'ViewManager', |
2235 QCoreApplication.translate( |
1909 'Extend rectangular selection to start of document line'), |
2236 "ViewManager", |
1910 0, 0, |
2237 "Extend rectangular selection to start of document line", |
1911 self.editorActGrp, 'vm_edit_select_rect_start_line') |
2238 ), |
|
2239 0, |
|
2240 0, |
|
2241 self.editorActGrp, |
|
2242 "vm_edit_select_rect_start_line", |
|
2243 ) |
1912 if isMacPlatform(): |
2244 if isMacPlatform(): |
1913 act.setShortcut(QKeySequence( |
2245 act.setShortcut( |
1914 QCoreApplication.translate('ViewManager', |
2246 QKeySequence( |
1915 'Meta+Alt+Shift+A'))) |
2247 QCoreApplication.translate("ViewManager", "Meta+Alt+Shift+A") |
|
2248 ) |
|
2249 ) |
1916 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND) |
2250 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND) |
1917 act.triggered.connect(self.esm.map) |
2251 act.triggered.connect(self.esm.map) |
1918 self.editActions.append(act) |
2252 self.editActions.append(act) |
1919 |
2253 |
1920 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"): |
2254 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"): |
1921 act = EricAction( |
2255 act = EricAction( |
1922 QCoreApplication.translate( |
2256 QCoreApplication.translate( |
1923 'ViewManager', |
2257 "ViewManager", "Extend selection to start of display line" |
1924 'Extend selection to start of display line'), |
2258 ), |
1925 QCoreApplication.translate( |
2259 QCoreApplication.translate( |
1926 'ViewManager', |
2260 "ViewManager", "Extend selection to start of display line" |
1927 'Extend selection to start of display line'), |
2261 ), |
1928 0, 0, |
2262 0, |
|
2263 0, |
1929 self.editorActGrp, |
2264 self.editorActGrp, |
1930 'vm_edit_extend_selection_start_display_line') |
2265 "vm_edit_extend_selection_start_display_line", |
|
2266 ) |
1931 if isMacPlatform(): |
2267 if isMacPlatform(): |
1932 act.setShortcut(QKeySequence( |
2268 act.setShortcut( |
1933 QCoreApplication.translate('ViewManager', |
2269 QKeySequence( |
1934 'Ctrl+Shift+Left'))) |
2270 QCoreApplication.translate("ViewManager", "Ctrl+Shift+Left") |
|
2271 ) |
|
2272 ) |
1935 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND) |
2273 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND) |
1936 act.triggered.connect(self.esm.map) |
2274 act.triggered.connect(self.esm.map) |
1937 self.editActions.append(act) |
2275 self.editActions.append(act) |
1938 |
2276 |
1939 if hasattr(QsciScintilla, "SCI_HOMEWRAP"): |
2277 if hasattr(QsciScintilla, "SCI_HOMEWRAP"): |
1940 act = EricAction( |
2278 act = EricAction( |
1941 QCoreApplication.translate( |
2279 QCoreApplication.translate( |
1942 'ViewManager', |
2280 "ViewManager", "Move to start of display or document line" |
1943 'Move to start of display or document line'), |
2281 ), |
1944 QCoreApplication.translate( |
2282 QCoreApplication.translate( |
1945 'ViewManager', |
2283 "ViewManager", "Move to start of display or document line" |
1946 'Move to start of display or document line'), |
2284 ), |
1947 0, 0, |
2285 0, |
1948 self.editorActGrp, 'vm_edit_move_start_display_document_line') |
2286 0, |
|
2287 self.editorActGrp, |
|
2288 "vm_edit_move_start_display_document_line", |
|
2289 ) |
1949 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP) |
2290 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP) |
1950 act.triggered.connect(self.esm.map) |
2291 act.triggered.connect(self.esm.map) |
1951 self.editActions.append(act) |
2292 self.editActions.append(act) |
1952 |
2293 |
1953 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"): |
2294 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"): |
1954 act = EricAction( |
2295 act = EricAction( |
1955 QCoreApplication.translate( |
2296 QCoreApplication.translate( |
1956 'ViewManager', |
2297 "ViewManager", |
1957 'Extend selection to start of display or document line'), |
2298 "Extend selection to start of display or document line", |
1958 QCoreApplication.translate( |
2299 ), |
1959 'ViewManager', |
2300 QCoreApplication.translate( |
1960 'Extend selection to start of display or document line'), |
2301 "ViewManager", |
1961 0, 0, |
2302 "Extend selection to start of display or document line", |
|
2303 ), |
|
2304 0, |
|
2305 0, |
1962 self.editorActGrp, |
2306 self.editorActGrp, |
1963 'vm_edit_extend_selection_start_display_document_line') |
2307 "vm_edit_extend_selection_start_display_document_line", |
|
2308 ) |
1964 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND) |
2309 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND) |
1965 act.triggered.connect(self.esm.map) |
2310 act.triggered.connect(self.esm.map) |
1966 self.editActions.append(act) |
2311 self.editActions.append(act) |
1967 |
2312 |
1968 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"): |
2313 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"): |
1969 act = EricAction( |
2314 act = EricAction( |
1970 QCoreApplication.translate( |
2315 QCoreApplication.translate( |
1971 'ViewManager', |
2316 "ViewManager", |
1972 'Move to first visible character in display' |
2317 "Move to first visible character in display" " or document line", |
1973 ' or document line'), |
2318 ), |
1974 QCoreApplication.translate( |
2319 QCoreApplication.translate( |
1975 'ViewManager', |
2320 "ViewManager", |
1976 'Move to first visible character in display' |
2321 "Move to first visible character in display" " or document line", |
1977 ' or document line'), |
2322 ), |
1978 0, 0, |
2323 0, |
|
2324 0, |
1979 self.editorActGrp, |
2325 self.editorActGrp, |
1980 'vm_edit_move_first_visible_char_document_line') |
2326 "vm_edit_move_first_visible_char_document_line", |
|
2327 ) |
1981 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAP) |
2328 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAP) |
1982 act.triggered.connect(self.esm.map) |
2329 act.triggered.connect(self.esm.map) |
1983 self.editActions.append(act) |
2330 self.editActions.append(act) |
1984 |
2331 |
1985 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"): |
2332 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"): |
1986 act = EricAction( |
2333 act = EricAction( |
1987 QCoreApplication.translate( |
2334 QCoreApplication.translate( |
1988 'ViewManager', |
2335 "ViewManager", |
1989 'Extend selection to first visible character in' |
2336 "Extend selection to first visible character in" |
1990 ' display or document line'), |
2337 " display or document line", |
1991 QCoreApplication.translate( |
2338 ), |
1992 'ViewManager', |
2339 QCoreApplication.translate( |
1993 'Extend selection to first visible character in' |
2340 "ViewManager", |
1994 ' display or document line'), |
2341 "Extend selection to first visible character in" |
1995 0, 0, |
2342 " display or document line", |
|
2343 ), |
|
2344 0, |
|
2345 0, |
1996 self.editorActGrp, |
2346 self.editorActGrp, |
1997 'vm_edit_extend_selection_first_visible_char_document_line') |
2347 "vm_edit_extend_selection_first_visible_char_document_line", |
|
2348 ) |
1998 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAPEXTEND) |
2349 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAPEXTEND) |
1999 act.triggered.connect(self.esm.map) |
2350 act.triggered.connect(self.esm.map) |
2000 self.editActions.append(act) |
2351 self.editActions.append(act) |
2001 |
2352 |
2002 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"): |
2353 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"): |
2003 act = EricAction( |
2354 act = EricAction( |
2004 QCoreApplication.translate( |
2355 QCoreApplication.translate( |
2005 'ViewManager', |
2356 "ViewManager", "Move to end of display or document line" |
2006 'Move to end of display or document line'), |
2357 ), |
2007 QCoreApplication.translate( |
2358 QCoreApplication.translate( |
2008 'ViewManager', |
2359 "ViewManager", "Move to end of display or document line" |
2009 'Move to end of display or document line'), |
2360 ), |
2010 0, 0, |
2361 0, |
2011 self.editorActGrp, 'vm_edit_end_start_display_document_line') |
2362 0, |
|
2363 self.editorActGrp, |
|
2364 "vm_edit_end_start_display_document_line", |
|
2365 ) |
2012 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP) |
2366 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP) |
2013 act.triggered.connect(self.esm.map) |
2367 act.triggered.connect(self.esm.map) |
2014 self.editActions.append(act) |
2368 self.editActions.append(act) |
2015 |
2369 |
2016 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"): |
2370 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"): |
2017 act = EricAction( |
2371 act = EricAction( |
2018 QCoreApplication.translate( |
2372 QCoreApplication.translate( |
2019 'ViewManager', |
2373 "ViewManager", "Extend selection to end of display or document line" |
2020 'Extend selection to end of display or document line'), |
2374 ), |
2021 QCoreApplication.translate( |
2375 QCoreApplication.translate( |
2022 'ViewManager', |
2376 "ViewManager", "Extend selection to end of display or document line" |
2023 'Extend selection to end of display or document line'), |
2377 ), |
2024 0, 0, |
2378 0, |
|
2379 0, |
2025 self.editorActGrp, |
2380 self.editorActGrp, |
2026 'vm_edit_extend_selection_end_display_document_line') |
2381 "vm_edit_extend_selection_end_display_document_line", |
|
2382 ) |
2027 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAPEXTEND) |
2383 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAPEXTEND) |
2028 act.triggered.connect(self.esm.map) |
2384 act.triggered.connect(self.esm.map) |
2029 self.editActions.append(act) |
2385 self.editActions.append(act) |
2030 |
2386 |
2031 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"): |
2387 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"): |
2032 act = EricAction( |
2388 act = EricAction( |
2033 QCoreApplication.translate( |
2389 QCoreApplication.translate("ViewManager", "Stuttered move up one page"), |
2034 'ViewManager', 'Stuttered move up one page'), |
2390 QCoreApplication.translate("ViewManager", "Stuttered move up one page"), |
2035 QCoreApplication.translate( |
2391 0, |
2036 'ViewManager', 'Stuttered move up one page'), |
2392 0, |
2037 0, 0, |
2393 self.editorActGrp, |
2038 self.editorActGrp, 'vm_edit_stuttered_move_up_page') |
2394 "vm_edit_stuttered_move_up_page", |
|
2395 ) |
2039 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP) |
2396 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP) |
2040 act.triggered.connect(self.esm.map) |
2397 act.triggered.connect(self.esm.map) |
2041 self.editActions.append(act) |
2398 self.editActions.append(act) |
2042 |
2399 |
2043 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"): |
2400 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"): |
2044 act = EricAction( |
2401 act = EricAction( |
2045 QCoreApplication.translate( |
2402 QCoreApplication.translate( |
2046 'ViewManager', |
2403 "ViewManager", "Stuttered extend selection up one page" |
2047 'Stuttered extend selection up one page'), |
2404 ), |
2048 QCoreApplication.translate( |
2405 QCoreApplication.translate( |
2049 'ViewManager', |
2406 "ViewManager", "Stuttered extend selection up one page" |
2050 'Stuttered extend selection up one page'), |
2407 ), |
2051 0, 0, |
2408 0, |
|
2409 0, |
2052 self.editorActGrp, |
2410 self.editorActGrp, |
2053 'vm_edit_stuttered_extend_selection_up_page') |
2411 "vm_edit_stuttered_extend_selection_up_page", |
|
2412 ) |
2054 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUPEXTEND) |
2413 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUPEXTEND) |
2055 act.triggered.connect(self.esm.map) |
2414 act.triggered.connect(self.esm.map) |
2056 self.editActions.append(act) |
2415 self.editActions.append(act) |
2057 |
2416 |
2058 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"): |
2417 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"): |
2059 act = EricAction( |
2418 act = EricAction( |
2060 QCoreApplication.translate( |
2419 QCoreApplication.translate( |
2061 'ViewManager', 'Stuttered move down one page'), |
2420 "ViewManager", "Stuttered move down one page" |
2062 QCoreApplication.translate( |
2421 ), |
2063 'ViewManager', 'Stuttered move down one page'), |
2422 QCoreApplication.translate( |
2064 0, 0, |
2423 "ViewManager", "Stuttered move down one page" |
2065 self.editorActGrp, 'vm_edit_stuttered_move_down_page') |
2424 ), |
|
2425 0, |
|
2426 0, |
|
2427 self.editorActGrp, |
|
2428 "vm_edit_stuttered_move_down_page", |
|
2429 ) |
2066 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN) |
2430 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN) |
2067 act.triggered.connect(self.esm.map) |
2431 act.triggered.connect(self.esm.map) |
2068 self.editActions.append(act) |
2432 self.editActions.append(act) |
2069 |
2433 |
2070 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"): |
2434 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"): |
2071 act = EricAction( |
2435 act = EricAction( |
2072 QCoreApplication.translate( |
2436 QCoreApplication.translate( |
2073 'ViewManager', |
2437 "ViewManager", "Stuttered extend selection down one page" |
2074 'Stuttered extend selection down one page'), |
2438 ), |
2075 QCoreApplication.translate( |
2439 QCoreApplication.translate( |
2076 'ViewManager', |
2440 "ViewManager", "Stuttered extend selection down one page" |
2077 'Stuttered extend selection down one page'), |
2441 ), |
2078 0, 0, |
2442 0, |
|
2443 0, |
2079 self.editorActGrp, |
2444 self.editorActGrp, |
2080 'vm_edit_stuttered_extend_selection_down_page') |
2445 "vm_edit_stuttered_extend_selection_down_page", |
|
2446 ) |
2081 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND) |
2447 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND) |
2082 act.triggered.connect(self.esm.map) |
2448 act.triggered.connect(self.esm.map) |
2083 self.editActions.append(act) |
2449 self.editActions.append(act) |
2084 |
2450 |
2085 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"): |
2451 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"): |
2086 act = EricAction( |
2452 act = EricAction( |
2087 QCoreApplication.translate( |
2453 QCoreApplication.translate( |
2088 'ViewManager', |
2454 "ViewManager", "Delete right to end of next word" |
2089 'Delete right to end of next word'), |
2455 ), |
2090 QCoreApplication.translate( |
2456 QCoreApplication.translate( |
2091 'ViewManager', |
2457 "ViewManager", "Delete right to end of next word" |
2092 'Delete right to end of next word'), |
2458 ), |
2093 0, 0, |
2459 0, |
2094 self.editorActGrp, 'vm_edit_delete_right_end_next_word') |
2460 0, |
|
2461 self.editorActGrp, |
|
2462 "vm_edit_delete_right_end_next_word", |
|
2463 ) |
2095 if isMacPlatform(): |
2464 if isMacPlatform(): |
2096 act.setShortcut(QKeySequence( |
2465 act.setShortcut( |
2097 QCoreApplication.translate('ViewManager', 'Alt+Del'))) |
2466 QKeySequence(QCoreApplication.translate("ViewManager", "Alt+Del")) |
|
2467 ) |
2098 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND) |
2468 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND) |
2099 act.triggered.connect(self.esm.map) |
2469 act.triggered.connect(self.esm.map) |
2100 self.editActions.append(act) |
2470 self.editActions.append(act) |
2101 |
2471 |
2102 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"): |
2472 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"): |
2103 act = EricAction( |
2473 act = EricAction( |
2104 QCoreApplication.translate( |
2474 QCoreApplication.translate( |
2105 'ViewManager', |
2475 "ViewManager", "Move selected lines up one line" |
2106 'Move selected lines up one line'), |
2476 ), |
2107 QCoreApplication.translate( |
2477 QCoreApplication.translate( |
2108 'ViewManager', |
2478 "ViewManager", "Move selected lines up one line" |
2109 'Move selected lines up one line'), |
2479 ), |
2110 0, 0, |
2480 0, |
2111 self.editorActGrp, 'vm_edit_move_selection_up_one_line') |
2481 0, |
|
2482 self.editorActGrp, |
|
2483 "vm_edit_move_selection_up_one_line", |
|
2484 ) |
2112 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP) |
2485 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP) |
2113 act.triggered.connect(self.esm.map) |
2486 act.triggered.connect(self.esm.map) |
2114 self.editActions.append(act) |
2487 self.editActions.append(act) |
2115 |
2488 |
2116 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"): |
2489 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"): |
2117 act = EricAction( |
2490 act = EricAction( |
2118 QCoreApplication.translate( |
2491 QCoreApplication.translate( |
2119 'ViewManager', |
2492 "ViewManager", "Move selected lines down one line" |
2120 'Move selected lines down one line'), |
2493 ), |
2121 QCoreApplication.translate( |
2494 QCoreApplication.translate( |
2122 'ViewManager', |
2495 "ViewManager", "Move selected lines down one line" |
2123 'Move selected lines down one line'), |
2496 ), |
2124 0, 0, |
2497 0, |
2125 self.editorActGrp, 'vm_edit_move_selection_down_one_line') |
2498 0, |
|
2499 self.editorActGrp, |
|
2500 "vm_edit_move_selection_down_one_line", |
|
2501 ) |
2126 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN) |
2502 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN) |
2127 act.triggered.connect(self.esm.map) |
2503 act.triggered.connect(self.esm.map) |
2128 self.editActions.append(act) |
2504 self.editActions.append(act) |
2129 |
2505 |
2130 act = EricAction( |
2506 act = EricAction( |
2131 QCoreApplication.translate( |
2507 QCoreApplication.translate("ViewManager", "Duplicate current selection"), |
2132 'ViewManager', |
2508 QCoreApplication.translate("ViewManager", "Duplicate current selection"), |
2133 'Duplicate current selection'), |
2509 QKeySequence(QCoreApplication.translate("ViewManager", "Ctrl+Shift+D")), |
2134 QCoreApplication.translate( |
2510 0, |
2135 'ViewManager', |
2511 self.editorActGrp, |
2136 'Duplicate current selection'), |
2512 "vm_edit_duplicate_current_selection", |
2137 QKeySequence(QCoreApplication.translate('ViewManager', |
2513 ) |
2138 'Ctrl+Shift+D')), |
|
2139 0, self.editorActGrp, 'vm_edit_duplicate_current_selection') |
|
2140 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) |
2514 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) |
2141 act.triggered.connect(self.esm.map) |
2515 act.triggered.connect(self.esm.map) |
2142 self.editActions.append(act) |
2516 self.editActions.append(act) |
2143 |
2517 |
2144 self.__textEdit.addActions(self.editorActGrp.actions()) |
2518 self.__textEdit.addActions(self.editorActGrp.actions()) |
2145 |
2519 |
2146 def __createSearchActions(self): |
2520 def __createSearchActions(self): |
2147 """ |
2521 """ |
2148 Private method defining the user interface actions for the search |
2522 Private method defining the user interface actions for the search |
2149 commands. |
2523 commands. |
2150 """ |
2524 """ |
2151 self.searchAct = EricAction( |
2525 self.searchAct = EricAction( |
2152 QCoreApplication.translate('ViewManager', 'Search'), |
2526 QCoreApplication.translate("ViewManager", "Search"), |
2153 UI.PixmapCache.getIcon("find"), |
2527 UI.PixmapCache.getIcon("find"), |
2154 QCoreApplication.translate('ViewManager', '&Search...'), |
2528 QCoreApplication.translate("ViewManager", "&Search..."), |
2155 QKeySequence(QCoreApplication.translate( |
2529 QKeySequence( |
2156 'ViewManager', "Ctrl+F", "Search|Search")), |
2530 QCoreApplication.translate("ViewManager", "Ctrl+F", "Search|Search") |
2157 0, |
2531 ), |
2158 self, 'vm_search') |
2532 0, |
|
2533 self, |
|
2534 "vm_search", |
|
2535 ) |
2159 self.searchAct.setStatusTip( |
2536 self.searchAct.setStatusTip( |
2160 QCoreApplication.translate('ViewManager', 'Search for a text')) |
2537 QCoreApplication.translate("ViewManager", "Search for a text") |
2161 self.searchAct.setWhatsThis(QCoreApplication.translate( |
2538 ) |
2162 'ViewManager', |
2539 self.searchAct.setWhatsThis( |
2163 """<b>Search</b>""" |
2540 QCoreApplication.translate( |
2164 """<p>Search for some text in the current editor. A""" |
2541 "ViewManager", |
2165 """ dialog is shown to enter the searchtext and options""" |
2542 """<b>Search</b>""" |
2166 """ for the search.</p>""" |
2543 """<p>Search for some text in the current editor. A""" |
2167 )) |
2544 """ dialog is shown to enter the searchtext and options""" |
|
2545 """ for the search.</p>""", |
|
2546 ) |
|
2547 ) |
2168 self.searchAct.triggered.connect(self.showSearchWidget) |
2548 self.searchAct.triggered.connect(self.showSearchWidget) |
2169 self.searchActions.append(self.searchAct) |
2549 self.searchActions.append(self.searchAct) |
2170 |
2550 |
2171 self.searchNextAct = EricAction( |
2551 self.searchNextAct = EricAction( |
2172 QCoreApplication.translate('ViewManager', 'Search next'), |
2552 QCoreApplication.translate("ViewManager", "Search next"), |
2173 UI.PixmapCache.getIcon("findNext"), |
2553 UI.PixmapCache.getIcon("findNext"), |
2174 QCoreApplication.translate('ViewManager', 'Search &next'), |
2554 QCoreApplication.translate("ViewManager", "Search &next"), |
2175 QKeySequence(QCoreApplication.translate( |
2555 QKeySequence( |
2176 'ViewManager', "F3", "Search|Search next")), |
2556 QCoreApplication.translate("ViewManager", "F3", "Search|Search next") |
2177 0, |
2557 ), |
2178 self, 'vm_search_next') |
2558 0, |
2179 self.searchNextAct.setStatusTip(QCoreApplication.translate( |
2559 self, |
2180 'ViewManager', 'Search next occurrence of text')) |
2560 "vm_search_next", |
2181 self.searchNextAct.setWhatsThis(QCoreApplication.translate( |
2561 ) |
2182 'ViewManager', |
2562 self.searchNextAct.setStatusTip( |
2183 """<b>Search next</b>""" |
2563 QCoreApplication.translate("ViewManager", "Search next occurrence of text") |
2184 """<p>Search the next occurrence of some text in the current""" |
2564 ) |
2185 """ editor. The previously entered searchtext and options are""" |
2565 self.searchNextAct.setWhatsThis( |
2186 """ reused.</p>""" |
2566 QCoreApplication.translate( |
2187 )) |
2567 "ViewManager", |
|
2568 """<b>Search next</b>""" |
|
2569 """<p>Search the next occurrence of some text in the current""" |
|
2570 """ editor. The previously entered searchtext and options are""" |
|
2571 """ reused.</p>""", |
|
2572 ) |
|
2573 ) |
2188 self.searchNextAct.triggered.connect(self.__searchNext) |
2574 self.searchNextAct.triggered.connect(self.__searchNext) |
2189 self.searchActions.append(self.searchNextAct) |
2575 self.searchActions.append(self.searchNextAct) |
2190 |
2576 |
2191 self.searchPrevAct = EricAction( |
2577 self.searchPrevAct = EricAction( |
2192 QCoreApplication.translate('ViewManager', 'Search previous'), |
2578 QCoreApplication.translate("ViewManager", "Search previous"), |
2193 UI.PixmapCache.getIcon("findPrev"), |
2579 UI.PixmapCache.getIcon("findPrev"), |
2194 QCoreApplication.translate('ViewManager', 'Search &previous'), |
2580 QCoreApplication.translate("ViewManager", "Search &previous"), |
2195 QKeySequence(QCoreApplication.translate( |
2581 QKeySequence( |
2196 'ViewManager', "Shift+F3", "Search|Search previous")), |
2582 QCoreApplication.translate( |
2197 0, |
2583 "ViewManager", "Shift+F3", "Search|Search previous" |
2198 self, 'vm_search_previous') |
2584 ) |
2199 self.searchPrevAct.setStatusTip(QCoreApplication.translate( |
2585 ), |
2200 'ViewManager', 'Search previous occurrence of text')) |
2586 0, |
2201 self.searchPrevAct.setWhatsThis(QCoreApplication.translate( |
2587 self, |
2202 'ViewManager', |
2588 "vm_search_previous", |
2203 """<b>Search previous</b>""" |
2589 ) |
2204 """<p>Search the previous occurrence of some text in the""" |
2590 self.searchPrevAct.setStatusTip( |
2205 """ current editor. The previously entered searchtext and""" |
2591 QCoreApplication.translate( |
2206 """ options are reused.</p>""" |
2592 "ViewManager", "Search previous occurrence of text" |
2207 )) |
2593 ) |
|
2594 ) |
|
2595 self.searchPrevAct.setWhatsThis( |
|
2596 QCoreApplication.translate( |
|
2597 "ViewManager", |
|
2598 """<b>Search previous</b>""" |
|
2599 """<p>Search the previous occurrence of some text in the""" |
|
2600 """ current editor. The previously entered searchtext and""" |
|
2601 """ options are reused.</p>""", |
|
2602 ) |
|
2603 ) |
2208 self.searchPrevAct.triggered.connect(self.__searchPrev) |
2604 self.searchPrevAct.triggered.connect(self.__searchPrev) |
2209 self.searchActions.append(self.searchPrevAct) |
2605 self.searchActions.append(self.searchPrevAct) |
2210 |
2606 |
2211 self.searchClearMarkersAct = EricAction( |
2607 self.searchClearMarkersAct = EricAction( |
2212 QCoreApplication.translate('ViewManager', |
2608 QCoreApplication.translate("ViewManager", "Clear search markers"), |
2213 'Clear search markers'), |
|
2214 UI.PixmapCache.getIcon("findClear"), |
2609 UI.PixmapCache.getIcon("findClear"), |
2215 QCoreApplication.translate('ViewManager', 'Clear search markers'), |
2610 QCoreApplication.translate("ViewManager", "Clear search markers"), |
2216 QKeySequence(QCoreApplication.translate( |
2611 QKeySequence( |
2217 'ViewManager', "Ctrl+3", "Search|Clear search markers")), |
2612 QCoreApplication.translate( |
2218 0, |
2613 "ViewManager", "Ctrl+3", "Search|Clear search markers" |
2219 self, 'vm_clear_search_markers') |
2614 ) |
2220 self.searchClearMarkersAct.setStatusTip(QCoreApplication.translate( |
2615 ), |
2221 'ViewManager', 'Clear all displayed search markers')) |
2616 0, |
2222 self.searchClearMarkersAct.setWhatsThis(QCoreApplication.translate( |
2617 self, |
2223 'ViewManager', |
2618 "vm_clear_search_markers", |
2224 """<b>Clear search markers</b>""" |
2619 ) |
2225 """<p>Clear all displayed search markers.</p>""" |
2620 self.searchClearMarkersAct.setStatusTip( |
2226 )) |
2621 QCoreApplication.translate( |
2227 self.searchClearMarkersAct.triggered.connect( |
2622 "ViewManager", "Clear all displayed search markers" |
2228 self.__searchClearMarkers) |
2623 ) |
|
2624 ) |
|
2625 self.searchClearMarkersAct.setWhatsThis( |
|
2626 QCoreApplication.translate( |
|
2627 "ViewManager", |
|
2628 """<b>Clear search markers</b>""" |
|
2629 """<p>Clear all displayed search markers.</p>""", |
|
2630 ) |
|
2631 ) |
|
2632 self.searchClearMarkersAct.triggered.connect(self.__searchClearMarkers) |
2229 self.searchActions.append(self.searchClearMarkersAct) |
2633 self.searchActions.append(self.searchClearMarkersAct) |
2230 |
2634 |
2231 self.replaceAct = EricAction( |
2635 self.replaceAct = EricAction( |
2232 QCoreApplication.translate('ViewManager', 'Replace'), |
2636 QCoreApplication.translate("ViewManager", "Replace"), |
2233 QCoreApplication.translate('ViewManager', '&Replace...'), |
2637 QCoreApplication.translate("ViewManager", "&Replace..."), |
2234 QKeySequence(QCoreApplication.translate( |
2638 QKeySequence( |
2235 'ViewManager', "Ctrl+R", "Search|Replace")), |
2639 QCoreApplication.translate("ViewManager", "Ctrl+R", "Search|Replace") |
2236 0, |
2640 ), |
2237 self, 'vm_search_replace') |
2641 0, |
2238 self.replaceAct.setStatusTip(QCoreApplication.translate( |
2642 self, |
2239 'ViewManager', 'Replace some text')) |
2643 "vm_search_replace", |
2240 self.replaceAct.setWhatsThis(QCoreApplication.translate( |
2644 ) |
2241 'ViewManager', |
2645 self.replaceAct.setStatusTip( |
2242 """<b>Replace</b>""" |
2646 QCoreApplication.translate("ViewManager", "Replace some text") |
2243 """<p>Search for some text in the current editor and replace""" |
2647 ) |
2244 """ it. A dialog is shown to enter the searchtext, the""" |
2648 self.replaceAct.setWhatsThis( |
2245 """ replacement text and options for the search and replace.</p>""" |
2649 QCoreApplication.translate( |
2246 )) |
2650 "ViewManager", |
|
2651 """<b>Replace</b>""" |
|
2652 """<p>Search for some text in the current editor and replace""" |
|
2653 """ it. A dialog is shown to enter the searchtext, the""" |
|
2654 """ replacement text and options for the search and replace.</p>""", |
|
2655 ) |
|
2656 ) |
2247 self.replaceAct.triggered.connect(self.showReplaceWidget) |
2657 self.replaceAct.triggered.connect(self.showReplaceWidget) |
2248 self.searchActions.append(self.replaceAct) |
2658 self.searchActions.append(self.replaceAct) |
2249 |
2659 |
2250 self.replaceAndSearchAct = EricAction( |
2660 self.replaceAndSearchAct = EricAction( |
2251 QCoreApplication.translate( |
2661 QCoreApplication.translate("ViewManager", "Replace and Search"), |
2252 'ViewManager', 'Replace and Search'), |
|
2253 UI.PixmapCache.getIcon("editReplaceSearch"), |
2662 UI.PixmapCache.getIcon("editReplaceSearch"), |
2254 QCoreApplication.translate( |
2663 QCoreApplication.translate("ViewManager", "Replace and Search"), |
2255 'ViewManager', 'Replace and Search'), |
2664 QKeySequence( |
2256 QKeySequence(QCoreApplication.translate( |
2665 QCoreApplication.translate( |
2257 'ViewManager', "Meta+R", "Search|Replace and Search")), |
2666 "ViewManager", "Meta+R", "Search|Replace and Search" |
2258 0, |
2667 ) |
2259 self, 'vm_replace_search') |
2668 ), |
2260 self.replaceAndSearchAct.setStatusTip(QCoreApplication.translate( |
2669 0, |
2261 'ViewManager', |
2670 self, |
2262 'Replace the found text and search the next occurrence')) |
2671 "vm_replace_search", |
2263 self.replaceAndSearchAct.setWhatsThis(QCoreApplication.translate( |
2672 ) |
2264 'ViewManager', |
2673 self.replaceAndSearchAct.setStatusTip( |
2265 """<b>Replace and Search</b>""" |
2674 QCoreApplication.translate( |
2266 """<p>Replace the found occurrence of text in the current""" |
2675 "ViewManager", "Replace the found text and search the next occurrence" |
2267 """ editor and search for the next one. The previously entered""" |
2676 ) |
2268 """ search text and options are reused.</p>""" |
2677 ) |
2269 )) |
2678 self.replaceAndSearchAct.setWhatsThis( |
2270 self.replaceAndSearchAct.triggered.connect( |
2679 QCoreApplication.translate( |
2271 self.__replaceWidget.replaceSearch) |
2680 "ViewManager", |
|
2681 """<b>Replace and Search</b>""" |
|
2682 """<p>Replace the found occurrence of text in the current""" |
|
2683 """ editor and search for the next one. The previously entered""" |
|
2684 """ search text and options are reused.</p>""", |
|
2685 ) |
|
2686 ) |
|
2687 self.replaceAndSearchAct.triggered.connect(self.__replaceWidget.replaceSearch) |
2272 self.searchActions.append(self.replaceAndSearchAct) |
2688 self.searchActions.append(self.replaceAndSearchAct) |
2273 |
2689 |
2274 self.replaceSelectionAct = EricAction( |
2690 self.replaceSelectionAct = EricAction( |
2275 QCoreApplication.translate( |
2691 QCoreApplication.translate("ViewManager", "Replace Occurrence"), |
2276 'ViewManager', 'Replace Occurrence'), |
|
2277 UI.PixmapCache.getIcon("editReplace"), |
2692 UI.PixmapCache.getIcon("editReplace"), |
2278 QCoreApplication.translate( |
2693 QCoreApplication.translate("ViewManager", "Replace Occurrence"), |
2279 'ViewManager', 'Replace Occurrence'), |
2694 QKeySequence( |
2280 QKeySequence(QCoreApplication.translate( |
2695 QCoreApplication.translate( |
2281 'ViewManager', "Ctrl+Meta+R", "Search|Replace Occurrence")), |
2696 "ViewManager", "Ctrl+Meta+R", "Search|Replace Occurrence" |
2282 0, |
2697 ) |
2283 self, 'vm_replace_occurrence') |
2698 ), |
2284 self.replaceSelectionAct.setStatusTip(QCoreApplication.translate( |
2699 0, |
2285 'ViewManager', 'Replace the found text')) |
2700 self, |
2286 self.replaceSelectionAct.setWhatsThis(QCoreApplication.translate( |
2701 "vm_replace_occurrence", |
2287 'ViewManager', |
2702 ) |
2288 """<b>Replace Occurrence</b>""" |
2703 self.replaceSelectionAct.setStatusTip( |
2289 """<p>Replace the found occurrence of the search text in the""" |
2704 QCoreApplication.translate("ViewManager", "Replace the found text") |
2290 """ current editor.</p>""" |
2705 ) |
2291 )) |
2706 self.replaceSelectionAct.setWhatsThis( |
2292 self.replaceSelectionAct.triggered.connect( |
2707 QCoreApplication.translate( |
2293 self.__replaceWidget.replace) |
2708 "ViewManager", |
|
2709 """<b>Replace Occurrence</b>""" |
|
2710 """<p>Replace the found occurrence of the search text in the""" |
|
2711 """ current editor.</p>""", |
|
2712 ) |
|
2713 ) |
|
2714 self.replaceSelectionAct.triggered.connect(self.__replaceWidget.replace) |
2294 self.searchActions.append(self.replaceSelectionAct) |
2715 self.searchActions.append(self.replaceSelectionAct) |
2295 |
2716 |
2296 self.replaceAllAct = EricAction( |
2717 self.replaceAllAct = EricAction( |
2297 QCoreApplication.translate( |
2718 QCoreApplication.translate("ViewManager", "Replace All"), |
2298 'ViewManager', 'Replace All'), |
|
2299 UI.PixmapCache.getIcon("editReplaceAll"), |
2719 UI.PixmapCache.getIcon("editReplaceAll"), |
2300 QCoreApplication.translate( |
2720 QCoreApplication.translate("ViewManager", "Replace All"), |
2301 'ViewManager', 'Replace All'), |
2721 QKeySequence( |
2302 QKeySequence(QCoreApplication.translate( |
2722 QCoreApplication.translate( |
2303 'ViewManager', "Shift+Meta+R", "Search|Replace All")), |
2723 "ViewManager", "Shift+Meta+R", "Search|Replace All" |
2304 0, |
2724 ) |
2305 self, 'vm_replace_all') |
2725 ), |
2306 self.replaceAllAct.setStatusTip(QCoreApplication.translate( |
2726 0, |
2307 'ViewManager', 'Replace search text occurrences')) |
2727 self, |
2308 self.replaceAllAct.setWhatsThis(QCoreApplication.translate( |
2728 "vm_replace_all", |
2309 'ViewManager', |
2729 ) |
2310 """<b>Replace All</b>""" |
2730 self.replaceAllAct.setStatusTip( |
2311 """<p>Replace all occurrences of the search text in the current""" |
2731 QCoreApplication.translate("ViewManager", "Replace search text occurrences") |
2312 """ editor.</p>""" |
2732 ) |
2313 )) |
2733 self.replaceAllAct.setWhatsThis( |
2314 self.replaceAllAct.triggered.connect( |
2734 QCoreApplication.translate( |
2315 self.__replaceWidget.replaceAll) |
2735 "ViewManager", |
|
2736 """<b>Replace All</b>""" |
|
2737 """<p>Replace all occurrences of the search text in the current""" |
|
2738 """ editor.</p>""", |
|
2739 ) |
|
2740 ) |
|
2741 self.replaceAllAct.triggered.connect(self.__replaceWidget.replaceAll) |
2316 self.searchActions.append(self.replaceAllAct) |
2742 self.searchActions.append(self.replaceAllAct) |
2317 |
2743 |
2318 def __createViewActions(self): |
2744 def __createViewActions(self): |
2319 """ |
2745 """ |
2320 Private method to create the View actions. |
2746 Private method to create the View actions. |
2321 """ |
2747 """ |
2322 self.zoomInAct = EricAction( |
2748 self.zoomInAct = EricAction( |
2323 QCoreApplication.translate('ViewManager', 'Zoom in'), |
2749 QCoreApplication.translate("ViewManager", "Zoom in"), |
2324 UI.PixmapCache.getIcon("zoomIn"), |
2750 UI.PixmapCache.getIcon("zoomIn"), |
2325 QCoreApplication.translate('ViewManager', 'Zoom &in'), |
2751 QCoreApplication.translate("ViewManager", "Zoom &in"), |
2326 QKeySequence(QCoreApplication.translate( |
2752 QKeySequence( |
2327 'ViewManager', "Ctrl++", "View|Zoom in")), |
2753 QCoreApplication.translate("ViewManager", "Ctrl++", "View|Zoom in") |
2328 QKeySequence(QCoreApplication.translate( |
2754 ), |
2329 'ViewManager', "Zoom In", "View|Zoom in")), |
2755 QKeySequence( |
2330 self, 'vm_view_zoom_in') |
2756 QCoreApplication.translate("ViewManager", "Zoom In", "View|Zoom in") |
2331 self.zoomInAct.setStatusTip(QCoreApplication.translate( |
2757 ), |
2332 'ViewManager', 'Zoom in on the text')) |
2758 self, |
2333 self.zoomInAct.setWhatsThis(QCoreApplication.translate( |
2759 "vm_view_zoom_in", |
2334 'ViewManager', |
2760 ) |
2335 """<b>Zoom in</b>""" |
2761 self.zoomInAct.setStatusTip( |
2336 """<p>Zoom in on the text. This makes the text bigger.</p>""" |
2762 QCoreApplication.translate("ViewManager", "Zoom in on the text") |
2337 )) |
2763 ) |
|
2764 self.zoomInAct.setWhatsThis( |
|
2765 QCoreApplication.translate( |
|
2766 "ViewManager", |
|
2767 """<b>Zoom in</b>""" |
|
2768 """<p>Zoom in on the text. This makes the text bigger.</p>""", |
|
2769 ) |
|
2770 ) |
2338 self.zoomInAct.triggered.connect(self.__zoomIn) |
2771 self.zoomInAct.triggered.connect(self.__zoomIn) |
2339 self.viewActions.append(self.zoomInAct) |
2772 self.viewActions.append(self.zoomInAct) |
2340 |
2773 |
2341 self.zoomOutAct = EricAction( |
2774 self.zoomOutAct = EricAction( |
2342 QCoreApplication.translate('ViewManager', 'Zoom out'), |
2775 QCoreApplication.translate("ViewManager", "Zoom out"), |
2343 UI.PixmapCache.getIcon("zoomOut"), |
2776 UI.PixmapCache.getIcon("zoomOut"), |
2344 QCoreApplication.translate('ViewManager', 'Zoom &out'), |
2777 QCoreApplication.translate("ViewManager", "Zoom &out"), |
2345 QKeySequence(QCoreApplication.translate( |
2778 QKeySequence( |
2346 'ViewManager', "Ctrl+-", "View|Zoom out")), |
2779 QCoreApplication.translate("ViewManager", "Ctrl+-", "View|Zoom out") |
2347 QKeySequence(QCoreApplication.translate( |
2780 ), |
2348 'ViewManager', "Zoom Out", "View|Zoom out")), |
2781 QKeySequence( |
2349 self, 'vm_view_zoom_out') |
2782 QCoreApplication.translate("ViewManager", "Zoom Out", "View|Zoom out") |
2350 self.zoomOutAct.setStatusTip(QCoreApplication.translate( |
2783 ), |
2351 'ViewManager', 'Zoom out on the text')) |
2784 self, |
2352 self.zoomOutAct.setWhatsThis(QCoreApplication.translate( |
2785 "vm_view_zoom_out", |
2353 'ViewManager', |
2786 ) |
2354 """<b>Zoom out</b>""" |
2787 self.zoomOutAct.setStatusTip( |
2355 """<p>Zoom out on the text. This makes the text smaller.</p>""" |
2788 QCoreApplication.translate("ViewManager", "Zoom out on the text") |
2356 )) |
2789 ) |
|
2790 self.zoomOutAct.setWhatsThis( |
|
2791 QCoreApplication.translate( |
|
2792 "ViewManager", |
|
2793 """<b>Zoom out</b>""" |
|
2794 """<p>Zoom out on the text. This makes the text smaller.</p>""", |
|
2795 ) |
|
2796 ) |
2357 self.zoomOutAct.triggered.connect(self.__zoomOut) |
2797 self.zoomOutAct.triggered.connect(self.__zoomOut) |
2358 self.viewActions.append(self.zoomOutAct) |
2798 self.viewActions.append(self.zoomOutAct) |
2359 |
2799 |
2360 self.zoomResetAct = EricAction( |
2800 self.zoomResetAct = EricAction( |
2361 QCoreApplication.translate('ViewManager', 'Zoom reset'), |
2801 QCoreApplication.translate("ViewManager", "Zoom reset"), |
2362 UI.PixmapCache.getIcon("zoomReset"), |
2802 UI.PixmapCache.getIcon("zoomReset"), |
2363 QCoreApplication.translate('ViewManager', 'Zoom &reset'), |
2803 QCoreApplication.translate("ViewManager", "Zoom &reset"), |
2364 QKeySequence(QCoreApplication.translate( |
2804 QKeySequence( |
2365 'ViewManager', "Ctrl+0", "View|Zoom reset")), |
2805 QCoreApplication.translate("ViewManager", "Ctrl+0", "View|Zoom reset") |
2366 0, |
2806 ), |
2367 self, 'vm_view_zoom_reset') |
2807 0, |
2368 self.zoomResetAct.setStatusTip(QCoreApplication.translate( |
2808 self, |
2369 'ViewManager', 'Reset the zoom of the text')) |
2809 "vm_view_zoom_reset", |
2370 self.zoomResetAct.setWhatsThis(QCoreApplication.translate( |
2810 ) |
2371 'ViewManager', |
2811 self.zoomResetAct.setStatusTip( |
2372 """<b>Zoom reset</b>""" |
2812 QCoreApplication.translate("ViewManager", "Reset the zoom of the text") |
2373 """<p>Reset the zoom of the text. """ |
2813 ) |
2374 """This sets the zoom factor to 100%.</p>""" |
2814 self.zoomResetAct.setWhatsThis( |
2375 )) |
2815 QCoreApplication.translate( |
|
2816 "ViewManager", |
|
2817 """<b>Zoom reset</b>""" |
|
2818 """<p>Reset the zoom of the text. """ |
|
2819 """This sets the zoom factor to 100%.</p>""", |
|
2820 ) |
|
2821 ) |
2376 self.zoomResetAct.triggered.connect(self.__zoomReset) |
2822 self.zoomResetAct.triggered.connect(self.__zoomReset) |
2377 self.viewActions.append(self.zoomResetAct) |
2823 self.viewActions.append(self.zoomResetAct) |
2378 |
2824 |
2379 self.zoomToAct = EricAction( |
2825 self.zoomToAct = EricAction( |
2380 QCoreApplication.translate('ViewManager', 'Zoom'), |
2826 QCoreApplication.translate("ViewManager", "Zoom"), |
2381 UI.PixmapCache.getIcon("zoomTo"), |
2827 UI.PixmapCache.getIcon("zoomTo"), |
2382 QCoreApplication.translate('ViewManager', '&Zoom'), |
2828 QCoreApplication.translate("ViewManager", "&Zoom"), |
2383 0, 0, |
2829 0, |
2384 self, 'vm_view_zoom') |
2830 0, |
2385 self.zoomToAct.setStatusTip(QCoreApplication.translate( |
2831 self, |
2386 'ViewManager', 'Zoom the text')) |
2832 "vm_view_zoom", |
2387 self.zoomToAct.setWhatsThis(QCoreApplication.translate( |
2833 ) |
2388 'ViewManager', |
2834 self.zoomToAct.setStatusTip( |
2389 """<b>Zoom</b>""" |
2835 QCoreApplication.translate("ViewManager", "Zoom the text") |
2390 """<p>Zoom the text. This opens a dialog where the""" |
2836 ) |
2391 """ desired size can be entered.</p>""" |
2837 self.zoomToAct.setWhatsThis( |
2392 )) |
2838 QCoreApplication.translate( |
|
2839 "ViewManager", |
|
2840 """<b>Zoom</b>""" |
|
2841 """<p>Zoom the text. This opens a dialog where the""" |
|
2842 """ desired size can be entered.</p>""", |
|
2843 ) |
|
2844 ) |
2393 self.zoomToAct.triggered.connect(self.__zoom) |
2845 self.zoomToAct.triggered.connect(self.__zoom) |
2394 self.viewActions.append(self.zoomToAct) |
2846 self.viewActions.append(self.zoomToAct) |
2395 |
2847 |
2396 def __createHelpActions(self): |
2848 def __createHelpActions(self): |
2397 """ |
2849 """ |
2398 Private method to create the Help actions. |
2850 Private method to create the Help actions. |
2399 """ |
2851 """ |
2400 self.aboutAct = EricAction( |
2852 self.aboutAct = EricAction( |
2401 self.tr('About'), |
2853 self.tr("About"), self.tr("&About"), 0, 0, self, "about_eric" |
2402 self.tr('&About'), |
2854 ) |
2403 0, 0, self, 'about_eric') |
2855 self.aboutAct.setStatusTip(self.tr("Display information about this software")) |
2404 self.aboutAct.setStatusTip(self.tr( |
2856 self.aboutAct.setWhatsThis( |
2405 'Display information about this software')) |
2857 self.tr( |
2406 self.aboutAct.setWhatsThis(self.tr( |
2858 """<b>About</b>""" |
2407 """<b>About</b>""" |
2859 """<p>Display some information about this software.</p>""" |
2408 """<p>Display some information about this software.</p>""")) |
2860 ) |
|
2861 ) |
2409 self.aboutAct.triggered.connect(self.__about) |
2862 self.aboutAct.triggered.connect(self.__about) |
2410 self.helpActions.append(self.aboutAct) |
2863 self.helpActions.append(self.aboutAct) |
2411 |
2864 |
2412 self.aboutQtAct = EricAction( |
2865 self.aboutQtAct = EricAction( |
2413 self.tr('About Qt'), |
2866 self.tr("About Qt"), self.tr("About &Qt"), 0, 0, self, "about_qt" |
2414 self.tr('About &Qt'), |
2867 ) |
2415 0, 0, self, 'about_qt') |
|
2416 self.aboutQtAct.setStatusTip( |
2868 self.aboutQtAct.setStatusTip( |
2417 self.tr('Display information about the Qt toolkit')) |
2869 self.tr("Display information about the Qt toolkit") |
2418 self.aboutQtAct.setWhatsThis(self.tr( |
2870 ) |
2419 """<b>About Qt</b>""" |
2871 self.aboutQtAct.setWhatsThis( |
2420 """<p>Display some information about the Qt toolkit.</p>""" |
2872 self.tr( |
2421 )) |
2873 """<b>About Qt</b>""" |
|
2874 """<p>Display some information about the Qt toolkit.</p>""" |
|
2875 ) |
|
2876 ) |
2422 self.aboutQtAct.triggered.connect(self.__aboutQt) |
2877 self.aboutQtAct.triggered.connect(self.__aboutQt) |
2423 self.helpActions.append(self.aboutQtAct) |
2878 self.helpActions.append(self.aboutQtAct) |
2424 |
2879 |
2425 self.whatsThisAct = EricAction( |
2880 self.whatsThisAct = EricAction( |
2426 self.tr('What\'s This?'), |
2881 self.tr("What's This?"), |
2427 UI.PixmapCache.getIcon("whatsThis"), |
2882 UI.PixmapCache.getIcon("whatsThis"), |
2428 self.tr('&What\'s This?'), |
2883 self.tr("&What's This?"), |
2429 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")), |
2884 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")), |
2430 0, self, 'help_help_whats_this') |
2885 0, |
2431 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help')) |
2886 self, |
2432 self.whatsThisAct.setWhatsThis(self.tr( |
2887 "help_help_whats_this", |
2433 """<b>Display context sensitive help</b>""" |
2888 ) |
2434 """<p>In What's This? mode, the mouse cursor shows an arrow""" |
2889 self.whatsThisAct.setStatusTip(self.tr("Context sensitive help")) |
2435 """ with a question mark, and you can click on the interface""" |
2890 self.whatsThisAct.setWhatsThis( |
2436 """ elements to get a short description of what they do and""" |
2891 self.tr( |
2437 """ how to use them. In dialogs, this feature can be""" |
2892 """<b>Display context sensitive help</b>""" |
2438 """ accessed using the context help button in the titlebar.""" |
2893 """<p>In What's This? mode, the mouse cursor shows an arrow""" |
2439 """</p>""" |
2894 """ with a question mark, and you can click on the interface""" |
2440 )) |
2895 """ elements to get a short description of what they do and""" |
|
2896 """ how to use them. In dialogs, this feature can be""" |
|
2897 """ accessed using the context help button in the titlebar.""" |
|
2898 """</p>""" |
|
2899 ) |
|
2900 ) |
2441 self.whatsThisAct.triggered.connect(self.__whatsThis) |
2901 self.whatsThisAct.triggered.connect(self.__whatsThis) |
2442 self.helpActions.append(self.whatsThisAct) |
2902 self.helpActions.append(self.whatsThisAct) |
2443 |
2903 |
2444 def __createConfigActions(self): |
2904 def __createConfigActions(self): |
2445 """ |
2905 """ |
2446 Private method to create the Settings actions. |
2906 Private method to create the Settings actions. |
2447 """ |
2907 """ |
2448 self.prefAct = EricAction( |
2908 self.prefAct = EricAction( |
2449 self.tr('Preferences'), |
2909 self.tr("Preferences"), |
2450 UI.PixmapCache.getIcon("configure"), |
2910 UI.PixmapCache.getIcon("configure"), |
2451 self.tr('&Preferences...'), |
2911 self.tr("&Preferences..."), |
2452 0, 0, self, 'hexEditor_settings_preferences') |
2912 0, |
2453 self.prefAct.setStatusTip(self.tr( |
2913 0, |
2454 'Set the prefered configuration')) |
2914 self, |
2455 self.prefAct.setWhatsThis(self.tr( |
2915 "hexEditor_settings_preferences", |
2456 """<b>Preferences</b>""" |
2916 ) |
2457 """<p>Set the configuration items of the application""" |
2917 self.prefAct.setStatusTip(self.tr("Set the prefered configuration")) |
2458 """ with your prefered values.</p>""" |
2918 self.prefAct.setWhatsThis( |
2459 )) |
2919 self.tr( |
|
2920 """<b>Preferences</b>""" |
|
2921 """<p>Set the configuration items of the application""" |
|
2922 """ with your prefered values.</p>""" |
|
2923 ) |
|
2924 ) |
2460 self.prefAct.triggered.connect(self.__showPreferences) |
2925 self.prefAct.triggered.connect(self.__showPreferences) |
2461 self.prefAct.setMenuRole(QAction.MenuRole.PreferencesRole) |
2926 self.prefAct.setMenuRole(QAction.MenuRole.PreferencesRole) |
2462 self.configActions.append(self.prefAct) |
2927 self.configActions.append(self.prefAct) |
2463 |
2928 |
2464 def __createMenus(self): |
2929 def __createMenus(self): |
2465 """ |
2930 """ |
2466 Private method to create the menus of the menu bar. |
2931 Private method to create the menus of the menu bar. |
2467 """ |
2932 """ |
2468 self.fileMenu = self.menuBar().addMenu(self.tr("&File")) |
2933 self.fileMenu = self.menuBar().addMenu(self.tr("&File")) |
2530 filetb.addSeparator() |
2995 filetb.addSeparator() |
2531 filetb.addAction(self.printPreviewAct) |
2996 filetb.addAction(self.printPreviewAct) |
2532 filetb.addAction(self.printAct) |
2997 filetb.addAction(self.printAct) |
2533 filetb.addSeparator() |
2998 filetb.addSeparator() |
2534 filetb.addAction(self.closeAct) |
2999 filetb.addAction(self.closeAct) |
2535 |
3000 |
2536 edittb = self.addToolBar(self.tr("Edit")) |
3001 edittb = self.addToolBar(self.tr("Edit")) |
2537 edittb.setIconSize(UI.Config.ToolBarIconSize) |
3002 edittb.setIconSize(UI.Config.ToolBarIconSize) |
2538 edittb.addAction(self.undoAct) |
3003 edittb.addAction(self.undoAct) |
2539 edittb.addAction(self.redoAct) |
3004 edittb.addAction(self.redoAct) |
2540 edittb.addSeparator() |
3005 edittb.addSeparator() |
2541 edittb.addAction(self.cutAct) |
3006 edittb.addAction(self.cutAct) |
2542 edittb.addAction(self.copyAct) |
3007 edittb.addAction(self.copyAct) |
2543 edittb.addAction(self.pasteAct) |
3008 edittb.addAction(self.pasteAct) |
2544 edittb.addAction(self.deleteAct) |
3009 edittb.addAction(self.deleteAct) |
2545 |
3010 |
2546 findtb = self.addToolBar(self.tr("Search")) |
3011 findtb = self.addToolBar(self.tr("Search")) |
2547 findtb.setIconSize(UI.Config.ToolBarIconSize) |
3012 findtb.setIconSize(UI.Config.ToolBarIconSize) |
2548 findtb.addAction(self.searchAct) |
3013 findtb.addAction(self.searchAct) |
2549 findtb.addAction(self.searchNextAct) |
3014 findtb.addAction(self.searchNextAct) |
2550 findtb.addAction(self.searchPrevAct) |
3015 findtb.addAction(self.searchPrevAct) |
2551 findtb.addAction(self.searchClearMarkersAct) |
3016 findtb.addAction(self.searchClearMarkersAct) |
2552 |
3017 |
2553 viewtb = self.addToolBar(self.tr("View")) |
3018 viewtb = self.addToolBar(self.tr("View")) |
2554 viewtb.setIconSize(UI.Config.ToolBarIconSize) |
3019 viewtb.setIconSize(UI.Config.ToolBarIconSize) |
2555 viewtb.addAction(self.zoomInAct) |
3020 viewtb.addAction(self.zoomInAct) |
2556 viewtb.addAction(self.zoomOutAct) |
3021 viewtb.addAction(self.zoomOutAct) |
2557 viewtb.addAction(self.zoomResetAct) |
3022 viewtb.addAction(self.zoomResetAct) |
2558 viewtb.addAction(self.zoomToAct) |
3023 viewtb.addAction(self.zoomToAct) |
2559 |
3024 |
2560 settingstb = self.addToolBar(self.tr("Settings")) |
3025 settingstb = self.addToolBar(self.tr("Settings")) |
2561 settingstb.setIconSize(UI.Config.ToolBarIconSize) |
3026 settingstb.setIconSize(UI.Config.ToolBarIconSize) |
2562 settingstb.addAction(self.prefAct) |
3027 settingstb.addAction(self.prefAct) |
2563 |
3028 |
2564 helptb = self.addToolBar(self.tr("Help")) |
3029 helptb = self.addToolBar(self.tr("Help")) |
2565 helptb.setIconSize(UI.Config.ToolBarIconSize) |
3030 helptb.setIconSize(UI.Config.ToolBarIconSize) |
2566 helptb.addAction(self.whatsThisAct) |
3031 helptb.addAction(self.whatsThisAct) |
2567 |
3032 |
2568 def __createStatusBar(self): |
3033 def __createStatusBar(self): |
2569 """ |
3034 """ |
2570 Private method to initialize the status bar. |
3035 Private method to initialize the status bar. |
2571 """ |
3036 """ |
2572 self.__statusBar = self.statusBar() |
3037 self.__statusBar = self.statusBar() |
2573 self.__statusBar.setSizeGripEnabled(True) |
3038 self.__statusBar.setSizeGripEnabled(True) |
2574 |
3039 |
2575 self.sbLanguage = EricClickableLabel(self.__statusBar) |
3040 self.sbLanguage = EricClickableLabel(self.__statusBar) |
2576 self.__statusBar.addPermanentWidget(self.sbLanguage) |
3041 self.__statusBar.addPermanentWidget(self.sbLanguage) |
2577 self.sbLanguage.setWhatsThis(self.tr( |
3042 self.sbLanguage.setWhatsThis( |
2578 """<p>This part of the status bar displays the""" |
3043 self.tr( |
2579 """ editor language.</p>""" |
3044 """<p>This part of the status bar displays the""" |
2580 )) |
3045 """ editor language.</p>""" |
|
3046 ) |
|
3047 ) |
2581 self.sbLanguage.clicked.connect(self.__showLanguagesMenu) |
3048 self.sbLanguage.clicked.connect(self.__showLanguagesMenu) |
2582 |
3049 |
2583 self.sbWritable = QLabel(self.__statusBar) |
3050 self.sbWritable = QLabel(self.__statusBar) |
2584 self.__statusBar.addPermanentWidget(self.sbWritable) |
3051 self.__statusBar.addPermanentWidget(self.sbWritable) |
2585 self.sbWritable.setWhatsThis(self.tr( |
3052 self.sbWritable.setWhatsThis( |
2586 """<p>This part of the status bar displays an indication of the""" |
3053 self.tr( |
2587 """ editors files writability.</p>""" |
3054 """<p>This part of the status bar displays an indication of the""" |
2588 )) |
3055 """ editors files writability.</p>""" |
|
3056 ) |
|
3057 ) |
2589 |
3058 |
2590 self.sbLine = QLabel(self.__statusBar) |
3059 self.sbLine = QLabel(self.__statusBar) |
2591 self.__statusBar.addPermanentWidget(self.sbLine) |
3060 self.__statusBar.addPermanentWidget(self.sbLine) |
2592 self.sbLine.setWhatsThis(self.tr( |
3061 self.sbLine.setWhatsThis( |
2593 """<p>This part of the status bar displays the line number of""" |
3062 self.tr( |
2594 """ the editor.</p>""" |
3063 """<p>This part of the status bar displays the line number of""" |
2595 )) |
3064 """ the editor.</p>""" |
|
3065 ) |
|
3066 ) |
2596 |
3067 |
2597 self.sbPos = QLabel(self.__statusBar) |
3068 self.sbPos = QLabel(self.__statusBar) |
2598 self.__statusBar.addPermanentWidget(self.sbPos) |
3069 self.__statusBar.addPermanentWidget(self.sbPos) |
2599 self.sbPos.setWhatsThis(self.tr( |
3070 self.sbPos.setWhatsThis( |
2600 """<p>This part of the status bar displays the cursor position""" |
3071 self.tr( |
2601 """ of the editor.</p>""" |
3072 """<p>This part of the status bar displays the cursor position""" |
2602 )) |
3073 """ of the editor.</p>""" |
2603 |
3074 ) |
|
3075 ) |
|
3076 |
2604 self.sbZoom = EricZoomWidget( |
3077 self.sbZoom = EricZoomWidget( |
2605 UI.PixmapCache.getPixmap("zoomOut"), |
3078 UI.PixmapCache.getPixmap("zoomOut"), |
2606 UI.PixmapCache.getPixmap("zoomIn"), |
3079 UI.PixmapCache.getPixmap("zoomIn"), |
2607 UI.PixmapCache.getPixmap("zoomReset"), |
3080 UI.PixmapCache.getPixmap("zoomReset"), |
2608 self.__statusBar) |
3081 self.__statusBar, |
|
3082 ) |
2609 self.__statusBar.addPermanentWidget(self.sbZoom) |
3083 self.__statusBar.addPermanentWidget(self.sbZoom) |
2610 self.sbZoom.setWhatsThis(self.tr( |
3084 self.sbZoom.setWhatsThis( |
2611 """<p>This part of the status bar allows zooming the editor.""" |
3085 self.tr( |
2612 """</p>""" |
3086 """<p>This part of the status bar allows zooming the editor.""" |
2613 )) |
3087 """</p>""" |
|
3088 ) |
|
3089 ) |
2614 self.sbZoom.valueChanged.connect(self.__zoomTo) |
3090 self.sbZoom.valueChanged.connect(self.__zoomTo) |
2615 |
3091 |
2616 self.__statusBar.showMessage(self.tr("Ready")) |
3092 self.__statusBar.showMessage(self.tr("Ready")) |
2617 |
3093 |
2618 def __showPreferences(self): |
3094 def __showPreferences(self): |
2619 """ |
3095 """ |
2620 Private slot to set the preferences. |
3096 Private slot to set the preferences. |
2621 """ |
3097 """ |
2622 from Preferences.ConfigurationDialog import ( |
3098 from Preferences.ConfigurationDialog import ( |
2623 ConfigurationDialog, ConfigurationMode |
3099 ConfigurationDialog, |
2624 ) |
3100 ConfigurationMode, |
|
3101 ) |
|
3102 |
2625 dlg = ConfigurationDialog( |
3103 dlg = ConfigurationDialog( |
2626 None, 'Configuration', True, fromEric=True, |
3104 None, |
2627 displayMode=ConfigurationMode.EDITORMODE) |
3105 "Configuration", |
|
3106 True, |
|
3107 fromEric=True, |
|
3108 displayMode=ConfigurationMode.EDITORMODE, |
|
3109 ) |
2628 dlg.preferencesChanged.connect(self.__preferencesChanged) |
3110 dlg.preferencesChanged.connect(self.__preferencesChanged) |
2629 dlg.show() |
3111 dlg.show() |
2630 dlg.showConfigurationPageByName("interfacePage") |
3112 dlg.showConfigurationPageByName("interfacePage") |
2631 dlg.exec() |
3113 dlg.exec() |
2632 QCoreApplication.processEvents() |
3114 QCoreApplication.processEvents() |
2633 if dlg.result() == QDialog.DialogCode.Accepted: |
3115 if dlg.result() == QDialog.DialogCode.Accepted: |
2634 dlg.setPreferences() |
3116 dlg.setPreferences() |
2635 Preferences.syncPreferences() |
3117 Preferences.syncPreferences() |
2636 self.__preferencesChanged() |
3118 self.__preferencesChanged() |
2637 |
3119 |
2638 @pyqtSlot() |
3120 @pyqtSlot() |
2639 def __preferencesChanged(self): |
3121 def __preferencesChanged(self): |
2640 """ |
3122 """ |
2641 Private slot to handle a configuration change. |
3123 Private slot to handle a configuration change. |
2642 """ |
3124 """ |
2643 self.__loadConfiguration() |
3125 self.__loadConfiguration() |
2644 |
3126 |
2645 self.__markOccurrencesTimer.setInterval( |
3127 self.__markOccurrencesTimer.setInterval( |
2646 Preferences.getEditor("MarkOccurrencesTimeout")) |
3128 Preferences.getEditor("MarkOccurrencesTimeout") |
2647 |
3129 ) |
|
3130 |
2648 @pyqtSlot() |
3131 @pyqtSlot() |
2649 def __loadConfiguration(self): |
3132 def __loadConfiguration(self): |
2650 """ |
3133 """ |
2651 Private slot to load the configuration. |
3134 Private slot to load the configuration. |
2652 """ |
3135 """ |
2653 self.__setTextDisplay() |
3136 self.__setTextDisplay() |
2654 self.__setMargins() |
3137 self.__setMargins() |
2655 self.__setEolMode() |
3138 self.__setEolMode() |
2656 |
3139 |
2657 def __readSettings(self): |
3140 def __readSettings(self): |
2658 """ |
3141 """ |
2659 Private method to read the settings remembered last time. |
3142 Private method to read the settings remembered last time. |
2660 """ |
3143 """ |
2661 settings = Preferences.getSettings() |
3144 settings = Preferences.getSettings() |
2662 pos = settings.value("MiniEditor/Position", QPoint(0, 0)) |
3145 pos = settings.value("MiniEditor/Position", QPoint(0, 0)) |
2663 size = settings.value("MiniEditor/Size", QSize(800, 600)) |
3146 size = settings.value("MiniEditor/Size", QSize(800, 600)) |
2664 self.resize(size) |
3147 self.resize(size) |
2665 self.move(pos) |
3148 self.move(pos) |
2666 |
3149 |
2667 def __writeSettings(self): |
3150 def __writeSettings(self): |
2668 """ |
3151 """ |
2669 Private method to write the settings for reuse. |
3152 Private method to write the settings for reuse. |
2670 """ |
3153 """ |
2671 settings = Preferences.getSettings() |
3154 settings = Preferences.getSettings() |
2672 settings.setValue("MiniEditor/Position", self.pos()) |
3155 settings.setValue("MiniEditor/Position", self.pos()) |
2673 settings.setValue("MiniEditor/Size", self.size()) |
3156 settings.setValue("MiniEditor/Size", self.size()) |
2674 |
3157 |
2675 def __maybeSave(self): |
3158 def __maybeSave(self): |
2676 """ |
3159 """ |
2677 Private method to ask the user to save the file, if it was modified. |
3160 Private method to ask the user to save the file, if it was modified. |
2678 |
3161 |
2679 @return flag indicating, if it is ok to continue (boolean) |
3162 @return flag indicating, if it is ok to continue (boolean) |
2680 """ |
3163 """ |
2681 if self.__textEdit.isModified(): |
3164 if self.__textEdit.isModified(): |
2682 ret = EricMessageBox.okToClearData( |
3165 ret = EricMessageBox.okToClearData( |
2683 self, |
3166 self, |
2684 self.tr("eric Mini Editor"), |
3167 self.tr("eric Mini Editor"), |
2685 self.tr("The document has unsaved changes."), |
3168 self.tr("The document has unsaved changes."), |
2686 self.__save) |
3169 self.__save, |
|
3170 ) |
2687 return ret |
3171 return ret |
2688 return True |
3172 return True |
2689 |
3173 |
2690 def __loadFile(self, fileName, filetype=None): |
3174 def __loadFile(self, fileName, filetype=None): |
2691 """ |
3175 """ |
2692 Private method to load the given file. |
3176 Private method to load the given file. |
2693 |
3177 |
2694 @param fileName name of the file to load (string) |
3178 @param fileName name of the file to load (string) |
2695 @param filetype type of the source file (string) |
3179 @param filetype type of the source file (string) |
2696 """ |
3180 """ |
2697 self.__loadEditorConfig(fileName=fileName) |
3181 self.__loadEditorConfig(fileName=fileName) |
2698 |
3182 |
2699 try: |
3183 try: |
2700 with EricOverrideCursor(): |
3184 with EricOverrideCursor(): |
2701 encoding = self.__getEditorConfig("DefaultEncoding", |
3185 encoding = self.__getEditorConfig("DefaultEncoding", nodefault=True) |
2702 nodefault=True) |
|
2703 if encoding: |
3186 if encoding: |
2704 txt, self.encoding = Utilities.readEncodedFileWithEncoding( |
3187 txt, self.encoding = Utilities.readEncodedFileWithEncoding( |
2705 fileName, encoding) |
3188 fileName, encoding |
|
3189 ) |
2706 else: |
3190 else: |
2707 txt, self.encoding = Utilities.readEncodedFile(fileName) |
3191 txt, self.encoding = Utilities.readEncodedFile(fileName) |
2708 except (UnicodeDecodeError, OSError) as why: |
3192 except (UnicodeDecodeError, OSError) as why: |
2709 EricMessageBox.critical( |
3193 EricMessageBox.critical( |
2710 self, self.tr('Open File'), |
3194 self, |
2711 self.tr('<p>The file <b>{0}</b> could not be opened.</p>' |
3195 self.tr("Open File"), |
2712 '<p>Reason: {1}</p>') |
3196 self.tr( |
2713 .format(fileName, str(why))) |
3197 "<p>The file <b>{0}</b> could not be opened.</p>" |
|
3198 "<p>Reason: {1}</p>" |
|
3199 ).format(fileName, str(why)), |
|
3200 ) |
2714 return |
3201 return |
2715 |
3202 |
2716 with EricOverrideCursor(): |
3203 with EricOverrideCursor(): |
2717 self.__textEdit.setText(txt) |
3204 self.__textEdit.setText(txt) |
2718 |
3205 |
2719 if filetype is None: |
3206 if filetype is None: |
2720 self.filetype = "" |
3207 self.filetype = "" |
2721 else: |
3208 else: |
2722 self.filetype = filetype |
3209 self.filetype = filetype |
2723 self.__setCurrentFile(fileName) |
3210 self.__setCurrentFile(fileName) |
2724 |
3211 |
2725 self.__textEdit.setModified(False) |
3212 self.__textEdit.setModified(False) |
2726 self.setWindowModified(False) |
3213 self.setWindowModified(False) |
2727 |
3214 |
2728 self.__convertTabs() |
3215 self.__convertTabs() |
2729 |
3216 |
2730 eolMode = self.__getEditorConfig("EOLMode", nodefault=True) |
3217 eolMode = self.__getEditorConfig("EOLMode", nodefault=True) |
2731 if eolMode is None: |
3218 if eolMode is None: |
2732 fileEol = self.__textEdit.detectEolString(txt) |
3219 fileEol = self.__textEdit.detectEolString(txt) |
2733 self.__textEdit.setEolModeByEolString(fileEol) |
3220 self.__textEdit.setEolModeByEolString(fileEol) |
2734 else: |
3221 else: |
2735 self.__textEdit.convertEols(eolMode) |
3222 self.__textEdit.convertEols(eolMode) |
2736 |
3223 |
2737 self.__statusBar.showMessage(self.tr("File loaded"), 2000) |
3224 self.__statusBar.showMessage(self.tr("File loaded"), 2000) |
2738 |
3225 |
2739 def __convertTabs(self): |
3226 def __convertTabs(self): |
2740 """ |
3227 """ |
2741 Private slot to convert tabulators to spaces. |
3228 Private slot to convert tabulators to spaces. |
2742 """ |
3229 """ |
2743 if ( |
3230 if ( |
2744 (not self.__getEditorConfig("TabForIndentation")) and |
3231 (not self.__getEditorConfig("TabForIndentation")) |
2745 Preferences.getEditor("ConvertTabsOnLoad") and |
3232 and Preferences.getEditor("ConvertTabsOnLoad") |
2746 not (self.lexer_ and |
3233 and not (self.lexer_ and self.lexer_.alwaysKeepTabs()) |
2747 self.lexer_.alwaysKeepTabs()) |
|
2748 ): |
3234 ): |
2749 txt = self.__textEdit.text() |
3235 txt = self.__textEdit.text() |
2750 txtExpanded = txt.expandtabs(self.__getEditorConfig("TabWidth")) |
3236 txtExpanded = txt.expandtabs(self.__getEditorConfig("TabWidth")) |
2751 if txtExpanded != txt: |
3237 if txtExpanded != txt: |
2752 self.__textEdit.beginUndoAction() |
3238 self.__textEdit.beginUndoAction() |
2753 self.__textEdit.setText(txt) |
3239 self.__textEdit.setText(txt) |
2754 self.__textEdit.endUndoAction() |
3240 self.__textEdit.endUndoAction() |
2755 |
3241 |
2756 self.__textEdit.setModified(True) |
3242 self.__textEdit.setModified(True) |
2757 self.setWindowModified(True) |
3243 self.setWindowModified(True) |
2758 |
3244 |
2759 def __saveFile(self, fileName): |
3245 def __saveFile(self, fileName): |
2760 """ |
3246 """ |
2761 Private method to save to the given file. |
3247 Private method to save to the given file. |
2762 |
3248 |
2763 @param fileName name of the file to save to |
3249 @param fileName name of the file to save to |
2764 @type str |
3250 @type str |
2765 @return flag indicating success |
3251 @return flag indicating success |
2766 @rtype bool |
3252 @rtype bool |
2767 """ |
3253 """ |
2768 res = self.__writeFile(fileName) |
3254 res = self.__writeFile(fileName) |
2769 |
3255 |
2770 if res: |
3256 if res: |
2771 self.editorSaved.emit() |
3257 self.editorSaved.emit() |
2772 self.__setCurrentFile(fileName) |
3258 self.__setCurrentFile(fileName) |
2773 |
3259 |
2774 self.__checkActions() |
3260 self.__checkActions() |
2775 |
3261 |
2776 return res |
3262 return res |
2777 |
3263 |
2778 def __writeFile(self, fileName): |
3264 def __writeFile(self, fileName): |
2779 """ |
3265 """ |
2780 Private method to write the current editor text to a file. |
3266 Private method to write the current editor text to a file. |
2781 |
3267 |
2782 @param fileName name of the file to be written to |
3268 @param fileName name of the file to be written to |
2783 @type str |
3269 @type str |
2784 @return flag indicating success |
3270 @return flag indicating success |
2785 @rtype bool |
3271 @rtype bool |
2786 """ |
3272 """ |
2787 config = self.__loadEditorConfigObject(fileName) |
3273 config = self.__loadEditorConfigObject(fileName) |
2788 |
3274 |
2789 eol = self.__getEditorConfig("EOLMode", nodefault=True, config=config) |
3275 eol = self.__getEditorConfig("EOLMode", nodefault=True, config=config) |
2790 if eol is not None: |
3276 if eol is not None: |
2791 self.__textEdit.convertEols(eol) |
3277 self.__textEdit.convertEols(eol) |
2792 |
3278 |
2793 if self.__getEditorConfig("StripTrailingWhitespace", config=config): |
3279 if self.__getEditorConfig("StripTrailingWhitespace", config=config): |
2794 self.__textEdit.removeTrailingWhitespace() |
3280 self.__textEdit.removeTrailingWhitespace() |
2795 |
3281 |
2796 txt = self.__textEdit.text() |
3282 txt = self.__textEdit.text() |
2797 |
3283 |
2798 if self.__getEditorConfig("InsertFinalNewline", config=config): |
3284 if self.__getEditorConfig("InsertFinalNewline", config=config): |
2799 eol = self.__textEdit.getLineSeparator() |
3285 eol = self.__textEdit.getLineSeparator() |
2800 if eol: |
3286 if eol: |
2801 if len(txt) >= len(eol): |
3287 if len(txt) >= len(eol): |
2802 if txt[-len(eol):] != eol: |
3288 if txt[-len(eol) :] != eol: |
2803 txt += eol |
3289 txt += eol |
2804 else: |
3290 else: |
2805 txt += eol |
3291 txt += eol |
2806 |
3292 |
2807 # now write text to the file |
3293 # now write text to the file |
2808 try: |
3294 try: |
2809 with EricOverrideCursor(): |
3295 with EricOverrideCursor(): |
2810 editorConfigEncoding = self.__getEditorConfig( |
3296 editorConfigEncoding = self.__getEditorConfig( |
2811 "DefaultEncoding", nodefault=True, config=config) |
3297 "DefaultEncoding", nodefault=True, config=config |
|
3298 ) |
2812 self.encoding = Utilities.writeEncodedFile( |
3299 self.encoding = Utilities.writeEncodedFile( |
2813 fileName, txt, self.encoding, |
3300 fileName, txt, self.encoding, forcedEncoding=editorConfigEncoding |
2814 forcedEncoding=editorConfigEncoding) |
3301 ) |
2815 except (OSError, Utilities.CodingError, UnicodeError) as why: |
3302 except (OSError, Utilities.CodingError, UnicodeError) as why: |
2816 EricMessageBox.critical( |
3303 EricMessageBox.critical( |
2817 self, self.tr('Save File'), |
3304 self, |
2818 self.tr('<p>The file <b>{0}</b> could not be saved.<br/>' |
3305 self.tr("Save File"), |
2819 'Reason: {1}</p>') |
3306 self.tr( |
2820 .format(fileName, str(why))) |
3307 "<p>The file <b>{0}</b> could not be saved.<br/>" "Reason: {1}</p>" |
|
3308 ).format(fileName, str(why)), |
|
3309 ) |
2821 return False |
3310 return False |
2822 |
3311 |
2823 self.__statusBar.showMessage(self.tr("File saved"), 2000) |
3312 self.__statusBar.showMessage(self.tr("File saved"), 2000) |
2824 |
3313 |
2825 return True |
3314 return True |
2826 |
3315 |
2827 def setWindowModified(self, modified): |
3316 def setWindowModified(self, modified): |
2828 """ |
3317 """ |
2829 Public method to set the window modification status. |
3318 Public method to set the window modification status. |
2830 |
3319 |
2831 @param modified flag indicating the modification status |
3320 @param modified flag indicating the modification status |
2832 @type bool |
3321 @type bool |
2833 """ |
3322 """ |
2834 if "[*]" not in self.windowTitle(): |
3323 if "[*]" not in self.windowTitle(): |
2835 self.setWindowTitle(self.tr("[*] - {0}") |
3324 self.setWindowTitle(self.tr("[*] - {0}").format(self.tr("Mini Editor"))) |
2836 .format(self.tr("Mini Editor"))) |
|
2837 super().setWindowModified(modified) |
3325 super().setWindowModified(modified) |
2838 |
3326 |
2839 def __setCurrentFile(self, fileName): |
3327 def __setCurrentFile(self, fileName): |
2840 """ |
3328 """ |
2841 Private method to register the file name of the current file. |
3329 Private method to register the file name of the current file. |
2842 |
3330 |
2843 @param fileName name of the file to register (string) |
3331 @param fileName name of the file to register (string) |
2844 """ |
3332 """ |
2845 self.__curFile = fileName |
3333 self.__curFile = fileName |
2846 |
3334 |
2847 shownName = ( |
3335 shownName = ( |
2848 self.tr("Untitled") |
3336 self.tr("Untitled") |
2849 if not self.__curFile else |
3337 if not self.__curFile |
2850 self.__strippedName(self.__curFile) |
3338 else self.__strippedName(self.__curFile) |
2851 ) |
3339 ) |
2852 |
3340 |
2853 self.setWindowTitle(self.tr("{0}[*] - {1}") |
3341 self.setWindowTitle( |
2854 .format(shownName, self.tr("Mini Editor"))) |
3342 self.tr("{0}[*] - {1}").format(shownName, self.tr("Mini Editor")) |
2855 |
3343 ) |
|
3344 |
2856 self.__textEdit.setModified(False) |
3345 self.__textEdit.setModified(False) |
2857 self.setWindowModified(False) |
3346 self.setWindowModified(False) |
2858 |
3347 |
2859 self.setLanguage(self.__bindName(self.__textEdit.text(0))) |
3348 self.setLanguage(self.__bindName(self.__textEdit.text(0))) |
2860 |
3349 |
2861 self.__loadEditorConfig() |
3350 self.__loadEditorConfig() |
2862 |
3351 |
2863 def getFileName(self): |
3352 def getFileName(self): |
2864 """ |
3353 """ |
2865 Public method to return the name of the file being displayed. |
3354 Public method to return the name of the file being displayed. |
2866 |
3355 |
2867 @return filename of the displayed file (string) |
3356 @return filename of the displayed file (string) |
2868 """ |
3357 """ |
2869 return self.__curFile |
3358 return self.__curFile |
2870 |
3359 |
2871 def __strippedName(self, fullFileName): |
3360 def __strippedName(self, fullFileName): |
2872 """ |
3361 """ |
2873 Private method to return the filename part of the given path. |
3362 Private method to return the filename part of the given path. |
2874 |
3363 |
2875 @param fullFileName full pathname of the given file (string) |
3364 @param fullFileName full pathname of the given file (string) |
2876 @return filename part (string) |
3365 @return filename part (string) |
2877 """ |
3366 """ |
2878 return pathlib.Path(fullFileName).name |
3367 return pathlib.Path(fullFileName).name |
2879 |
3368 |
2880 def __modificationChanged(self, m): |
3369 def __modificationChanged(self, m): |
2881 """ |
3370 """ |
2882 Private slot to handle the modificationChanged signal. |
3371 Private slot to handle the modificationChanged signal. |
2883 |
3372 |
2884 @param m modification status |
3373 @param m modification status |
2885 """ |
3374 """ |
2886 self.setWindowModified(m) |
3375 self.setWindowModified(m) |
2887 self.__checkActions() |
3376 self.__checkActions() |
2888 |
3377 |
2889 def __cursorPositionChanged(self, line, pos): |
3378 def __cursorPositionChanged(self, line, pos): |
2890 """ |
3379 """ |
2891 Private slot to handle the cursorPositionChanged signal. |
3380 Private slot to handle the cursorPositionChanged signal. |
2892 |
3381 |
2893 @param line line number of the cursor |
3382 @param line line number of the cursor |
2894 @param pos position in line of the cursor |
3383 @param pos position in line of the cursor |
2895 """ |
3384 """ |
2896 lang = self.getLanguage() |
3385 lang = self.getLanguage() |
2897 self.__setSbFile(line + 1, pos, lang) |
3386 self.__setSbFile(line + 1, pos, lang) |
2898 |
3387 |
2899 if Preferences.getEditor("MarkOccurrencesEnabled"): |
3388 if Preferences.getEditor("MarkOccurrencesEnabled"): |
2900 self.__markOccurrencesTimer.stop() |
3389 self.__markOccurrencesTimer.stop() |
2901 self.__markOccurrencesTimer.start() |
3390 self.__markOccurrencesTimer.start() |
2902 |
3391 |
2903 if self.__lastLine != line: |
3392 if self.__lastLine != line: |
2904 self.cursorLineChanged.emit(line) |
3393 self.cursorLineChanged.emit(line) |
2905 self.__lastLine = line |
3394 self.__lastLine = line |
2906 |
3395 |
2907 def __undo(self): |
3396 def __undo(self): |
2908 """ |
3397 """ |
2909 Private method to undo the last recorded change. |
3398 Private method to undo the last recorded change. |
2910 """ |
3399 """ |
2911 self.__textEdit.undo() |
3400 self.__textEdit.undo() |
2912 self.__checkActions() |
3401 self.__checkActions() |
2913 |
3402 |
2914 def __redo(self): |
3403 def __redo(self): |
2915 """ |
3404 """ |
2916 Private method to redo the last recorded change. |
3405 Private method to redo the last recorded change. |
2917 """ |
3406 """ |
2918 self.__textEdit.redo() |
3407 self.__textEdit.redo() |
2919 self.__checkActions() |
3408 self.__checkActions() |
2920 |
3409 |
2921 def __selectAll(self): |
3410 def __selectAll(self): |
2922 """ |
3411 """ |
2923 Private slot handling the select all context menu action. |
3412 Private slot handling the select all context menu action. |
2924 """ |
3413 """ |
2925 self.__textEdit.selectAll(True) |
3414 self.__textEdit.selectAll(True) |
2926 |
3415 |
2927 def __deselectAll(self): |
3416 def __deselectAll(self): |
2928 """ |
3417 """ |
2929 Private slot handling the deselect all context menu action. |
3418 Private slot handling the deselect all context menu action. |
2930 """ |
3419 """ |
2931 self.__textEdit.selectAll(False) |
3420 self.__textEdit.selectAll(False) |
2932 |
3421 |
2933 def __setMargins(self): |
3422 def __setMargins(self): |
2934 """ |
3423 """ |
2935 Private method to configure the margins. |
3424 Private method to configure the margins. |
2936 """ |
3425 """ |
2937 # set the settings for all margins |
3426 # set the settings for all margins |
2938 self.__textEdit.setMarginsFont( |
3427 self.__textEdit.setMarginsFont(Preferences.getEditorOtherFonts("MarginsFont")) |
2939 Preferences.getEditorOtherFonts("MarginsFont")) |
|
2940 self.__textEdit.setMarginsForegroundColor( |
3428 self.__textEdit.setMarginsForegroundColor( |
2941 Preferences.getEditorColour("MarginsForeground")) |
3429 Preferences.getEditorColour("MarginsForeground") |
|
3430 ) |
2942 self.__textEdit.setMarginsBackgroundColor( |
3431 self.__textEdit.setMarginsBackgroundColor( |
2943 Preferences.getEditorColour("MarginsBackground")) |
3432 Preferences.getEditorColour("MarginsBackground") |
2944 |
3433 ) |
|
3434 |
2945 # set margin 0 settings |
3435 # set margin 0 settings |
2946 linenoMargin = Preferences.getEditor("LinenoMargin") |
3436 linenoMargin = Preferences.getEditor("LinenoMargin") |
2947 self.__textEdit.setMarginLineNumbers(0, linenoMargin) |
3437 self.__textEdit.setMarginLineNumbers(0, linenoMargin) |
2948 if linenoMargin: |
3438 if linenoMargin: |
2949 self.__resizeLinenoMargin() |
3439 self.__resizeLinenoMargin() |
2950 else: |
3440 else: |
2951 self.__textEdit.setMarginWidth(0, 16) |
3441 self.__textEdit.setMarginWidth(0, 16) |
2952 |
3442 |
2953 # set margin 1 settings |
3443 # set margin 1 settings |
2954 self.__textEdit.setMarginWidth(1, 0) |
3444 self.__textEdit.setMarginWidth(1, 0) |
2955 |
3445 |
2956 # set margin 2 settings |
3446 # set margin 2 settings |
2957 self.__textEdit.setMarginWidth(2, 16) |
3447 self.__textEdit.setMarginWidth(2, 16) |
2958 if Preferences.getEditor("FoldingMargin"): |
3448 if Preferences.getEditor("FoldingMargin"): |
2959 folding = Preferences.getEditor("FoldingStyle") |
3449 folding = Preferences.getEditor("FoldingStyle") |
2960 self.__textEdit.setFolding(folding) |
3450 self.__textEdit.setFolding(folding) |
2961 self.__textEdit.setFoldMarginColors( |
3451 self.__textEdit.setFoldMarginColors( |
2962 Preferences.getEditorColour("FoldmarginBackground"), |
3452 Preferences.getEditorColour("FoldmarginBackground"), |
2963 Preferences.getEditorColour("FoldmarginBackground")) |
3453 Preferences.getEditorColour("FoldmarginBackground"), |
|
3454 ) |
2964 self.__textEdit.setFoldMarkersColors( |
3455 self.__textEdit.setFoldMarkersColors( |
2965 Preferences.getEditorColour("FoldMarkersForeground"), |
3456 Preferences.getEditorColour("FoldMarkersForeground"), |
2966 Preferences.getEditorColour("FoldMarkersBackground")) |
3457 Preferences.getEditorColour("FoldMarkersBackground"), |
|
3458 ) |
2967 else: |
3459 else: |
2968 self.__textEdit.setFolding( |
3460 self.__textEdit.setFolding(QsciScintilla.FoldStyle.NoFoldStyle.value) |
2969 QsciScintilla.FoldStyle.NoFoldStyle.value) |
3461 |
2970 |
|
2971 def __resizeLinenoMargin(self): |
3462 def __resizeLinenoMargin(self): |
2972 """ |
3463 """ |
2973 Private slot to resize the line numbers margin. |
3464 Private slot to resize the line numbers margin. |
2974 """ |
3465 """ |
2975 linenoMargin = Preferences.getEditor("LinenoMargin") |
3466 linenoMargin = Preferences.getEditor("LinenoMargin") |
2976 if linenoMargin: |
3467 if linenoMargin: |
2977 self.__textEdit.setMarginWidth( |
3468 self.__textEdit.setMarginWidth( |
2978 0, '8' * (len(str(self.__textEdit.lines())) + 1)) |
3469 0, "8" * (len(str(self.__textEdit.lines())) + 1) |
2979 |
3470 ) |
|
3471 |
2980 def __setTabAndIndent(self): |
3472 def __setTabAndIndent(self): |
2981 """ |
3473 """ |
2982 Private method to set indentation size and style and tab width. |
3474 Private method to set indentation size and style and tab width. |
2983 """ |
3475 """ |
2984 self.__textEdit.setTabWidth(self.__getEditorConfig("TabWidth")) |
3476 self.__textEdit.setTabWidth(self.__getEditorConfig("TabWidth")) |
2985 self.__textEdit.setIndentationWidth( |
3477 self.__textEdit.setIndentationWidth(self.__getEditorConfig("IndentWidth")) |
2986 self.__getEditorConfig("IndentWidth")) |
|
2987 if self.lexer_ and self.lexer_.alwaysKeepTabs(): |
3478 if self.lexer_ and self.lexer_.alwaysKeepTabs(): |
2988 self.__textEdit.setIndentationsUseTabs(True) |
3479 self.__textEdit.setIndentationsUseTabs(True) |
2989 else: |
3480 else: |
2990 self.__textEdit.setIndentationsUseTabs( |
3481 self.__textEdit.setIndentationsUseTabs( |
2991 self.__getEditorConfig("TabForIndentation")) |
3482 self.__getEditorConfig("TabForIndentation") |
2992 |
3483 ) |
|
3484 |
2993 def __setTextDisplay(self): |
3485 def __setTextDisplay(self): |
2994 """ |
3486 """ |
2995 Private method to configure the text display. |
3487 Private method to configure the text display. |
2996 """ |
3488 """ |
2997 self.__setTabAndIndent() |
3489 self.__setTabAndIndent() |
2998 |
3490 |
2999 self.__textEdit.setTabIndents(Preferences.getEditor("TabIndents")) |
3491 self.__textEdit.setTabIndents(Preferences.getEditor("TabIndents")) |
3000 self.__textEdit.setBackspaceUnindents( |
3492 self.__textEdit.setBackspaceUnindents(Preferences.getEditor("TabIndents")) |
3001 Preferences.getEditor("TabIndents")) |
3493 self.__textEdit.setIndentationGuides(Preferences.getEditor("IndentationGuides")) |
3002 self.__textEdit.setIndentationGuides( |
|
3003 Preferences.getEditor("IndentationGuides")) |
|
3004 self.__textEdit.setIndentationGuidesBackgroundColor( |
3494 self.__textEdit.setIndentationGuidesBackgroundColor( |
3005 Preferences.getEditorColour("IndentationGuidesBackground")) |
3495 Preferences.getEditorColour("IndentationGuidesBackground") |
|
3496 ) |
3006 self.__textEdit.setIndentationGuidesForegroundColor( |
3497 self.__textEdit.setIndentationGuidesForegroundColor( |
3007 Preferences.getEditorColour("IndentationGuidesForeground")) |
3498 Preferences.getEditorColour("IndentationGuidesForeground") |
|
3499 ) |
3008 if Preferences.getEditor("ShowWhitespace"): |
3500 if Preferences.getEditor("ShowWhitespace"): |
3009 self.__textEdit.setWhitespaceVisibility( |
3501 self.__textEdit.setWhitespaceVisibility( |
3010 QsciScintilla.WhitespaceVisibility.WsVisible) |
3502 QsciScintilla.WhitespaceVisibility.WsVisible |
|
3503 ) |
3011 self.__textEdit.setWhitespaceForegroundColor( |
3504 self.__textEdit.setWhitespaceForegroundColor( |
3012 Preferences.getEditorColour("WhitespaceForeground")) |
3505 Preferences.getEditorColour("WhitespaceForeground") |
|
3506 ) |
3013 self.__textEdit.setWhitespaceBackgroundColor( |
3507 self.__textEdit.setWhitespaceBackgroundColor( |
3014 Preferences.getEditorColour("WhitespaceBackground")) |
3508 Preferences.getEditorColour("WhitespaceBackground") |
3015 self.__textEdit.setWhitespaceSize( |
3509 ) |
3016 Preferences.getEditor("WhitespaceSize")) |
3510 self.__textEdit.setWhitespaceSize(Preferences.getEditor("WhitespaceSize")) |
3017 else: |
3511 else: |
3018 self.__textEdit.setWhitespaceVisibility( |
3512 self.__textEdit.setWhitespaceVisibility( |
3019 QsciScintilla.WhitespaceVisibility.WsInvisible) |
3513 QsciScintilla.WhitespaceVisibility.WsInvisible |
|
3514 ) |
3020 self.__textEdit.setEolVisibility(Preferences.getEditor("ShowEOL")) |
3515 self.__textEdit.setEolVisibility(Preferences.getEditor("ShowEOL")) |
3021 self.__textEdit.setAutoIndent(Preferences.getEditor("AutoIndentation")) |
3516 self.__textEdit.setAutoIndent(Preferences.getEditor("AutoIndentation")) |
3022 if Preferences.getEditor("BraceHighlighting"): |
3517 if Preferences.getEditor("BraceHighlighting"): |
3023 self.__textEdit.setBraceMatching( |
3518 self.__textEdit.setBraceMatching(QsciScintilla.BraceMatch.SloppyBraceMatch) |
3024 QsciScintilla.BraceMatch.SloppyBraceMatch) |
|
3025 else: |
3519 else: |
3026 self.__textEdit.setBraceMatching( |
3520 self.__textEdit.setBraceMatching(QsciScintilla.BraceMatch.NoBraceMatch) |
3027 QsciScintilla.BraceMatch.NoBraceMatch) |
|
3028 self.__textEdit.setMatchedBraceForegroundColor( |
3521 self.__textEdit.setMatchedBraceForegroundColor( |
3029 Preferences.getEditorColour("MatchingBrace")) |
3522 Preferences.getEditorColour("MatchingBrace") |
|
3523 ) |
3030 self.__textEdit.setMatchedBraceBackgroundColor( |
3524 self.__textEdit.setMatchedBraceBackgroundColor( |
3031 Preferences.getEditorColour("MatchingBraceBack")) |
3525 Preferences.getEditorColour("MatchingBraceBack") |
|
3526 ) |
3032 self.__textEdit.setUnmatchedBraceForegroundColor( |
3527 self.__textEdit.setUnmatchedBraceForegroundColor( |
3033 Preferences.getEditorColour("NonmatchingBrace")) |
3528 Preferences.getEditorColour("NonmatchingBrace") |
|
3529 ) |
3034 self.__textEdit.setUnmatchedBraceBackgroundColor( |
3530 self.__textEdit.setUnmatchedBraceBackgroundColor( |
3035 Preferences.getEditorColour("NonmatchingBraceBack")) |
3531 Preferences.getEditorColour("NonmatchingBraceBack") |
|
3532 ) |
3036 if Preferences.getEditor("CustomSelectionColours"): |
3533 if Preferences.getEditor("CustomSelectionColours"): |
3037 self.__textEdit.setSelectionBackgroundColor( |
3534 self.__textEdit.setSelectionBackgroundColor( |
3038 Preferences.getEditorColour("SelectionBackground")) |
3535 Preferences.getEditorColour("SelectionBackground") |
|
3536 ) |
3039 else: |
3537 else: |
3040 self.__textEdit.setSelectionBackgroundColor( |
3538 self.__textEdit.setSelectionBackgroundColor( |
3041 QApplication.palette().color(QPalette.ColorRole.Highlight)) |
3539 QApplication.palette().color(QPalette.ColorRole.Highlight) |
|
3540 ) |
3042 if Preferences.getEditor("ColourizeSelText"): |
3541 if Preferences.getEditor("ColourizeSelText"): |
3043 self.__textEdit.resetSelectionForegroundColor() |
3542 self.__textEdit.resetSelectionForegroundColor() |
3044 elif Preferences.getEditor("CustomSelectionColours"): |
3543 elif Preferences.getEditor("CustomSelectionColours"): |
3045 self.__textEdit.setSelectionForegroundColor( |
3544 self.__textEdit.setSelectionForegroundColor( |
3046 Preferences.getEditorColour("SelectionForeground")) |
3545 Preferences.getEditorColour("SelectionForeground") |
|
3546 ) |
3047 else: |
3547 else: |
3048 self.__textEdit.setSelectionForegroundColor( |
3548 self.__textEdit.setSelectionForegroundColor( |
3049 QApplication.palette().color( |
3549 QApplication.palette().color(QPalette.ColorRole.HighlightedText) |
3050 QPalette.ColorRole.HighlightedText)) |
3550 ) |
3051 self.__textEdit.setSelectionToEol( |
3551 self.__textEdit.setSelectionToEol(Preferences.getEditor("ExtendSelectionToEol")) |
3052 Preferences.getEditor("ExtendSelectionToEol")) |
|
3053 self.__textEdit.setCaretForegroundColor( |
3552 self.__textEdit.setCaretForegroundColor( |
3054 Preferences.getEditorColour("CaretForeground")) |
3553 Preferences.getEditorColour("CaretForeground") |
|
3554 ) |
3055 self.__textEdit.setCaretLineBackgroundColor( |
3555 self.__textEdit.setCaretLineBackgroundColor( |
3056 Preferences.getEditorColour("CaretLineBackground")) |
3556 Preferences.getEditorColour("CaretLineBackground") |
3057 self.__textEdit.setCaretLineVisible( |
3557 ) |
3058 Preferences.getEditor("CaretLineVisible")) |
3558 self.__textEdit.setCaretLineVisible(Preferences.getEditor("CaretLineVisible")) |
3059 self.__textEdit.setCaretLineAlwaysVisible( |
3559 self.__textEdit.setCaretLineAlwaysVisible( |
3060 Preferences.getEditor("CaretLineAlwaysVisible")) |
3560 Preferences.getEditor("CaretLineAlwaysVisible") |
|
3561 ) |
3061 self.caretWidth = Preferences.getEditor("CaretWidth") |
3562 self.caretWidth = Preferences.getEditor("CaretWidth") |
3062 self.__textEdit.setCaretWidth(self.caretWidth) |
3563 self.__textEdit.setCaretWidth(self.caretWidth) |
3063 self.caretLineFrameWidth = Preferences.getEditor("CaretLineFrameWidth") |
3564 self.caretLineFrameWidth = Preferences.getEditor("CaretLineFrameWidth") |
3064 self.__textEdit.setCaretLineFrameWidth(self.caretLineFrameWidth) |
3565 self.__textEdit.setCaretLineFrameWidth(self.caretLineFrameWidth) |
3065 self.useMonospaced = Preferences.getEditor("UseMonospacedFont") |
3566 self.useMonospaced = Preferences.getEditor("UseMonospacedFont") |