QScintilla/MiniEditor.py

changeset 3656
441956d8fce5
parent 3642
1a6f8d9b63a5
child 3670
f0cb7579c0b4
equal deleted inserted replaced
3654:ffeb85cdc72d 3656:441956d8fce5
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 import os 12 import os
13 import re 13 import re
14 14
15 from PyQt4.QtCore import QSignalMapper, QPoint, QTimer, QFileInfo, \ 15 from PyQt5.QtCore import QSignalMapper, QPoint, QTimer, QFileInfo, \
16 pyqtSignal, QSize, QRegExp, Qt 16 pyqtSignal, QSize, QRegExp, Qt, QCoreApplication
17 from PyQt4.QtGui import QWidget, QCursor, QPrinter, QKeySequence, \ 17 from PyQt5.QtGui import QCursor, QKeySequence, QPalette, QFont
18 QPrintDialog, QWhatsThis, QActionGroup, QDialog, QAbstractPrintDialog, \ 18 from PyQt5.QtWidgets import QWidget, QWhatsThis, QActionGroup, QDialog, \
19 QInputDialog, QApplication, QMenu, QPalette, QFont, QVBoxLayout, QLabel 19 QInputDialog, QApplication, QMenu, QVBoxLayout, QLabel
20 from PyQt4.Qsci import QsciScintilla 20 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog, QAbstractPrintDialog
21 from PyQt5.Qsci import QsciScintilla
21 22
22 from E5Gui.E5Action import E5Action, createActionGroup 23 from E5Gui.E5Action import E5Action, createActionGroup
23 from E5Gui import E5MessageBox, E5FileDialog 24 from E5Gui import E5MessageBox, E5FileDialog
24 from E5Gui.E5MainWindow import E5MainWindow 25 from E5Gui.E5MainWindow import E5MainWindow
25 26
451 self.fileActions.append(self.printAct) 452 self.fileActions.append(self.printAct)
452 453
453 self.printPreviewAct = E5Action( 454 self.printPreviewAct = E5Action(
454 self.tr('Print Preview'), 455 self.tr('Print Preview'),
455 UI.PixmapCache.getIcon("printPreview.png"), 456 UI.PixmapCache.getIcon("printPreview.png"),
456 QApplication.translate('ViewManager', 'Print Preview'), 457 QCoreApplication.translate('ViewManager', 'Print Preview'),
457 0, 0, self, 'vm_file_print_preview') 458 0, 0, self, 'vm_file_print_preview')
458 self.printPreviewAct.setStatusTip(self.tr( 459 self.printPreviewAct.setStatusTip(self.tr(
459 'Print preview of the current file')) 460 'Print preview of the current file'))
460 self.printPreviewAct.setWhatsThis(self.tr( 461 self.printPreviewAct.setWhatsThis(self.tr(
461 """<b>Print Preview</b>""" 462 """<b>Print Preview</b>"""
574 self.esm.mapped[int].connect(self.__textEdit.editorCommand) 575 self.esm.mapped[int].connect(self.__textEdit.editorCommand)
575 576
576 self.editorActGrp = createActionGroup(self) 577 self.editorActGrp = createActionGroup(self)
577 578
578 act = E5Action( 579 act = E5Action(
579 QApplication.translate('ViewManager', 'Move left one character'), 580 QCoreApplication.translate('ViewManager',
580 QApplication.translate('ViewManager', 'Move left one character'), 581 'Move left one character'),
581 QKeySequence(QApplication.translate('ViewManager', 'Left')), 0, 582 QCoreApplication.translate('ViewManager',
583 'Move left one character'),
584 QKeySequence(QCoreApplication.translate('ViewManager', 'Left')), 0,
582 self.editorActGrp, 'vm_edit_move_left_char') 585 self.editorActGrp, 'vm_edit_move_left_char')
583 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT) 586 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT)
584 if isMacPlatform(): 587 if isMacPlatform():
585 act.setAlternateShortcut(QKeySequence( 588 act.setAlternateShortcut(QKeySequence(
586 QApplication.translate('ViewManager', 'Meta+B'))) 589 QCoreApplication.translate('ViewManager', 'Meta+B')))
587 act.triggered.connect(self.esm.map) 590 act.triggered.connect(self.esm.map)
588 self.editActions.append(act) 591 self.editActions.append(act)
589 592
590 act = E5Action( 593 act = E5Action(
591 QApplication.translate('ViewManager', 'Move right one character'), 594 QCoreApplication.translate('ViewManager',
592 QApplication.translate('ViewManager', 'Move right one character'), 595 'Move right one character'),
593 QKeySequence(QApplication.translate('ViewManager', 'Right')), 0, 596 QCoreApplication.translate('ViewManager',
594 self.editorActGrp, 'vm_edit_move_right_char') 597 'Move right one character'),
598 QKeySequence(QCoreApplication.translate('ViewManager', 'Right')),
599 0, self.editorActGrp, 'vm_edit_move_right_char')
595 if isMacPlatform(): 600 if isMacPlatform():
596 act.setAlternateShortcut(QKeySequence( 601 act.setAlternateShortcut(QKeySequence(
597 QApplication.translate('ViewManager', 'Meta+F'))) 602 QCoreApplication.translate('ViewManager', 'Meta+F')))
598 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT) 603 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT)
599 act.triggered.connect(self.esm.map) 604 act.triggered.connect(self.esm.map)
600 self.editActions.append(act) 605 self.editActions.append(act)
601 606
602 act = E5Action( 607 act = E5Action(
603 QApplication.translate('ViewManager', 'Move up one line'), 608 QCoreApplication.translate('ViewManager', 'Move up one line'),
604 QApplication.translate('ViewManager', 'Move up one line'), 609 QCoreApplication.translate('ViewManager', 'Move up one line'),
605 QKeySequence(QApplication.translate('ViewManager', 'Up')), 0, 610 QKeySequence(QCoreApplication.translate('ViewManager', 'Up')), 0,
606 self.editorActGrp, 'vm_edit_move_up_line') 611 self.editorActGrp, 'vm_edit_move_up_line')
607 if isMacPlatform(): 612 if isMacPlatform():
608 act.setAlternateShortcut(QKeySequence( 613 act.setAlternateShortcut(QKeySequence(
609 QApplication.translate('ViewManager', 'Meta+P'))) 614 QCoreApplication.translate('ViewManager', 'Meta+P')))
610 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP) 615 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP)
611 act.triggered.connect(self.esm.map) 616 act.triggered.connect(self.esm.map)
612 self.editActions.append(act) 617 self.editActions.append(act)
613 618
614 act = E5Action( 619 act = E5Action(
615 QApplication.translate('ViewManager', 'Move down one line'), 620 QCoreApplication.translate('ViewManager', 'Move down one line'),
616 QApplication.translate('ViewManager', 'Move down one line'), 621 QCoreApplication.translate('ViewManager', 'Move down one line'),
617 QKeySequence(QApplication.translate('ViewManager', 'Down')), 0, 622 QKeySequence(QCoreApplication.translate('ViewManager', 'Down')), 0,
618 self.editorActGrp, 'vm_edit_move_down_line') 623 self.editorActGrp, 'vm_edit_move_down_line')
619 if isMacPlatform(): 624 if isMacPlatform():
620 act.setAlternateShortcut(QKeySequence( 625 act.setAlternateShortcut(QKeySequence(
621 QApplication.translate('ViewManager', 'Meta+N'))) 626 QCoreApplication.translate('ViewManager', 'Meta+N')))
622 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN) 627 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN)
623 act.triggered.connect(self.esm.map) 628 act.triggered.connect(self.esm.map)
624 self.editActions.append(act) 629 self.editActions.append(act)
625 630
626 act = E5Action( 631 act = E5Action(
627 QApplication.translate('ViewManager', 'Move left one word part'), 632 QCoreApplication.translate('ViewManager',
628 QApplication.translate('ViewManager', 'Move left one word part'), 633 'Move left one word part'),
634 QCoreApplication.translate('ViewManager',
635 'Move left one word part'),
629 0, 0, 636 0, 0,
630 self.editorActGrp, 'vm_edit_move_left_word_part') 637 self.editorActGrp, 'vm_edit_move_left_word_part')
631 if not isMacPlatform(): 638 if not isMacPlatform():
632 act.setShortcut(QKeySequence( 639 act.setShortcut(QKeySequence(
633 QApplication.translate('ViewManager', 'Alt+Left'))) 640 QCoreApplication.translate('ViewManager', 'Alt+Left')))
634 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT) 641 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT)
635 act.triggered.connect(self.esm.map) 642 act.triggered.connect(self.esm.map)
636 self.editActions.append(act) 643 self.editActions.append(act)
637 644
638 act = E5Action( 645 act = E5Action(
639 QApplication.translate('ViewManager', 'Move right one word part'), 646 QCoreApplication.translate('ViewManager',
640 QApplication.translate('ViewManager', 'Move right one word part'), 647 'Move right one word part'),
648 QCoreApplication.translate('ViewManager',
649 'Move right one word part'),
641 0, 0, 650 0, 0,
642 self.editorActGrp, 'vm_edit_move_right_word_part') 651 self.editorActGrp, 'vm_edit_move_right_word_part')
643 if not isMacPlatform(): 652 if not isMacPlatform():
644 act.setShortcut(QKeySequence( 653 act.setShortcut(QKeySequence(
645 QApplication.translate('ViewManager', 'Alt+Right'))) 654 QCoreApplication.translate('ViewManager', 'Alt+Right')))
646 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT) 655 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT)
647 act.triggered.connect(self.esm.map) 656 act.triggered.connect(self.esm.map)
648 self.editActions.append(act) 657 self.editActions.append(act)
649 658
650 act = E5Action( 659 act = E5Action(
651 QApplication.translate('ViewManager', 'Move left one word'), 660 QCoreApplication.translate('ViewManager', 'Move left one word'),
652 QApplication.translate('ViewManager', 'Move left one word'), 661 QCoreApplication.translate('ViewManager', 'Move left one word'),
653 0, 0, 662 0, 0,
654 self.editorActGrp, 'vm_edit_move_left_word') 663 self.editorActGrp, 'vm_edit_move_left_word')
655 if isMacPlatform(): 664 if isMacPlatform():
656 act.setShortcut(QKeySequence( 665 act.setShortcut(QKeySequence(
657 QApplication.translate('ViewManager', 'Alt+Left'))) 666 QCoreApplication.translate('ViewManager', 'Alt+Left')))
658 else: 667 else:
659 act.setShortcut(QKeySequence( 668 act.setShortcut(QKeySequence(
660 QApplication.translate('ViewManager', 'Ctrl+Left'))) 669 QCoreApplication.translate('ViewManager', 'Ctrl+Left')))
661 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT) 670 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT)
662 act.triggered.connect(self.esm.map) 671 act.triggered.connect(self.esm.map)
663 self.editActions.append(act) 672 self.editActions.append(act)
664 673
665 act = E5Action( 674 act = E5Action(
666 QApplication.translate('ViewManager', 'Move right one word'), 675 QCoreApplication.translate('ViewManager', 'Move right one word'),
667 QApplication.translate('ViewManager', 'Move right one word'), 676 QCoreApplication.translate('ViewManager', 'Move right one word'),
668 0, 0, 677 0, 0,
669 self.editorActGrp, 'vm_edit_move_right_word') 678 self.editorActGrp, 'vm_edit_move_right_word')
670 if isMacPlatform(): 679 if isMacPlatform():
671 act.setShortcut(QKeySequence( 680 act.setShortcut(QKeySequence(
672 QApplication.translate('ViewManager', 'Alt+Right'))) 681 QCoreApplication.translate('ViewManager', 'Alt+Right')))
673 else: 682 else:
674 act.setShortcut(QKeySequence( 683 act.setShortcut(QKeySequence(
675 QApplication.translate('ViewManager', 'Ctrl+Right'))) 684 QCoreApplication.translate('ViewManager', 'Ctrl+Right')))
676 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT) 685 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT)
677 act.triggered.connect(self.esm.map) 686 act.triggered.connect(self.esm.map)
678 self.editActions.append(act) 687 self.editActions.append(act)
679 688
680 act = E5Action( 689 act = E5Action(
681 QApplication.translate( 690 QCoreApplication.translate(
682 'ViewManager', 691 'ViewManager',
683 'Move to first visible character in document line'), 692 'Move to first visible character in document line'),
684 QApplication.translate( 693 QCoreApplication.translate(
685 'ViewManager', 694 'ViewManager',
686 'Move to first visible character in document line'), 695 'Move to first visible character in document line'),
687 0, 0, 696 0, 0,
688 self.editorActGrp, 'vm_edit_move_first_visible_char') 697 self.editorActGrp, 'vm_edit_move_first_visible_char')
689 if not isMacPlatform(): 698 if not isMacPlatform():
690 act.setShortcut(QKeySequence( 699 act.setShortcut(QKeySequence(
691 QApplication.translate('ViewManager', 'Home'))) 700 QCoreApplication.translate('ViewManager', 'Home')))
692 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME) 701 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME)
693 act.triggered.connect(self.esm.map) 702 act.triggered.connect(self.esm.map)
694 self.editActions.append(act) 703 self.editActions.append(act)
695 704
696 act = E5Action( 705 act = E5Action(
697 QApplication.translate( 706 QCoreApplication.translate(
698 'ViewManager', 707 'ViewManager',
699 'Move to start of display line'), 708 'Move to start of display line'),
700 QApplication.translate( 709 QCoreApplication.translate(
701 'ViewManager', 710 'ViewManager',
702 'Move to start of display line'), 711 'Move to start of display line'),
703 0, 0, 712 0, 0,
704 self.editorActGrp, 'vm_edit_move_start_line') 713 self.editorActGrp, 'vm_edit_move_start_line')
705 if isMacPlatform(): 714 if isMacPlatform():
706 act.setShortcut(QKeySequence( 715 act.setShortcut(QKeySequence(
707 QApplication.translate('ViewManager', 'Ctrl+Left'))) 716 QCoreApplication.translate('ViewManager', 'Ctrl+Left')))
708 else: 717 else:
709 act.setShortcut(QKeySequence( 718 act.setShortcut(QKeySequence(
710 QApplication.translate('ViewManager', 'Alt+Home'))) 719 QCoreApplication.translate('ViewManager', 'Alt+Home')))
711 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAY) 720 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAY)
712 act.triggered.connect(self.esm.map) 721 act.triggered.connect(self.esm.map)
713 self.editActions.append(act) 722 self.editActions.append(act)
714 723
715 act = E5Action( 724 act = E5Action(
716 QApplication.translate( 725 QCoreApplication.translate(
717 'ViewManager', 726 'ViewManager',
718 'Move to end of document line'), 727 'Move to end of document line'),
719 QApplication.translate( 728 QCoreApplication.translate(
720 'ViewManager', 729 'ViewManager',
721 'Move to end of document line'), 730 'Move to end of document line'),
722 0, 0, 731 0, 0,
723 self.editorActGrp, 'vm_edit_move_end_line') 732 self.editorActGrp, 'vm_edit_move_end_line')
724 if isMacPlatform(): 733 if isMacPlatform():
725 act.setShortcut(QKeySequence( 734 act.setShortcut(QKeySequence(
726 QApplication.translate('ViewManager', 'Meta+E'))) 735 QCoreApplication.translate('ViewManager', 'Meta+E')))
727 else: 736 else:
728 act.setShortcut(QKeySequence( 737 act.setShortcut(QKeySequence(
729 QApplication.translate('ViewManager', 'End'))) 738 QCoreApplication.translate('ViewManager', 'End')))
730 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND) 739 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND)
731 act.triggered.connect(self.esm.map) 740 act.triggered.connect(self.esm.map)
732 self.editActions.append(act) 741 self.editActions.append(act)
733 742
734 act = E5Action( 743 act = E5Action(
735 QApplication.translate('ViewManager', 'Scroll view down one line'), 744 QCoreApplication.translate('ViewManager',
736 QApplication.translate('ViewManager', 'Scroll view down one line'), 745 'Scroll view down one line'),
737 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Down')), 746 QCoreApplication.translate('ViewManager',
747 'Scroll view down one line'),
748 QKeySequence(QCoreApplication.translate('ViewManager',
749 'Ctrl+Down')),
738 0, self.editorActGrp, 'vm_edit_scroll_down_line') 750 0, self.editorActGrp, 'vm_edit_scroll_down_line')
739 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN) 751 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN)
740 act.triggered.connect(self.esm.map) 752 act.triggered.connect(self.esm.map)
741 self.editActions.append(act) 753 self.editActions.append(act)
742 754
743 act = E5Action( 755 act = E5Action(
744 QApplication.translate('ViewManager', 'Scroll view up one line'), 756 QCoreApplication.translate('ViewManager',
745 QApplication.translate('ViewManager', 'Scroll view up one line'), 757 'Scroll view up one line'),
746 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Up')), 0, 758 QCoreApplication.translate('ViewManager',
747 self.editorActGrp, 'vm_edit_scroll_up_line') 759 'Scroll view up one line'),
760 QKeySequence(QCoreApplication.translate('ViewManager', 'Ctrl+Up')),
761 0, self.editorActGrp, 'vm_edit_scroll_up_line')
748 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP) 762 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP)
749 act.triggered.connect(self.esm.map) 763 act.triggered.connect(self.esm.map)
750 self.editActions.append(act) 764 self.editActions.append(act)
751 765
752 act = E5Action( 766 act = E5Action(
753 QApplication.translate('ViewManager', 'Move up one paragraph'), 767 QCoreApplication.translate('ViewManager', 'Move up one paragraph'),
754 QApplication.translate('ViewManager', 'Move up one paragraph'), 768 QCoreApplication.translate('ViewManager', 'Move up one paragraph'),
755 QKeySequence(QApplication.translate('ViewManager', 'Alt+Up')), 0, 769 QKeySequence(QCoreApplication.translate('ViewManager', 'Alt+Up')),
756 self.editorActGrp, 'vm_edit_move_up_para') 770 0, self.editorActGrp, 'vm_edit_move_up_para')
757 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP) 771 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP)
758 act.triggered.connect(self.esm.map) 772 act.triggered.connect(self.esm.map)
759 self.editActions.append(act) 773 self.editActions.append(act)
760 774
761 act = E5Action( 775 act = E5Action(
762 QApplication.translate('ViewManager', 'Move down one paragraph'), 776 QCoreApplication.translate('ViewManager',
763 QApplication.translate('ViewManager', 'Move down one paragraph'), 777 'Move down one paragraph'),
764 QKeySequence(QApplication.translate('ViewManager', 'Alt+Down')), 0, 778 QCoreApplication.translate('ViewManager',
765 self.editorActGrp, 'vm_edit_move_down_para') 779 'Move down one paragraph'),
780 QKeySequence(QCoreApplication.translate('ViewManager',
781 'Alt+Down')),
782 0, self.editorActGrp, 'vm_edit_move_down_para')
766 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN) 783 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN)
767 act.triggered.connect(self.esm.map) 784 act.triggered.connect(self.esm.map)
768 self.editActions.append(act) 785 self.editActions.append(act)
769 786
770 act = E5Action( 787 act = E5Action(
771 QApplication.translate('ViewManager', 'Move up one page'), 788 QCoreApplication.translate('ViewManager', 'Move up one page'),
772 QApplication.translate('ViewManager', 'Move up one page'), 789 QCoreApplication.translate('ViewManager', 'Move up one page'),
773 QKeySequence(QApplication.translate('ViewManager', 'PgUp')), 0, 790 QKeySequence(QCoreApplication.translate('ViewManager', 'PgUp')), 0,
774 self.editorActGrp, 'vm_edit_move_up_page') 791 self.editorActGrp, 'vm_edit_move_up_page')
775 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP) 792 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP)
776 act.triggered.connect(self.esm.map) 793 act.triggered.connect(self.esm.map)
777 self.editActions.append(act) 794 self.editActions.append(act)
778 795
779 act = E5Action( 796 act = E5Action(
780 QApplication.translate('ViewManager', 'Move down one page'), 797 QCoreApplication.translate('ViewManager', 'Move down one page'),
781 QApplication.translate('ViewManager', 'Move down one page'), 798 QCoreApplication.translate('ViewManager', 'Move down one page'),
782 QKeySequence(QApplication.translate('ViewManager', 'PgDown')), 0, 799 QKeySequence(QCoreApplication.translate('ViewManager', 'PgDown')),
783 self.editorActGrp, 'vm_edit_move_down_page') 800 0, self.editorActGrp, 'vm_edit_move_down_page')
784 if isMacPlatform(): 801 if isMacPlatform():
785 act.setAlternateShortcut(QKeySequence( 802 act.setAlternateShortcut(QKeySequence(
786 QApplication.translate('ViewManager', 'Meta+V'))) 803 QCoreApplication.translate('ViewManager', 'Meta+V')))
787 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN) 804 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN)
788 act.triggered.connect(self.esm.map) 805 act.triggered.connect(self.esm.map)
789 self.editActions.append(act) 806 self.editActions.append(act)
790 807
791 act = E5Action( 808 act = E5Action(
792 QApplication.translate('ViewManager', 'Move to start of document'), 809 QCoreApplication.translate('ViewManager',
793 QApplication.translate('ViewManager', 'Move to start of document'), 810 'Move to start of document'),
811 QCoreApplication.translate('ViewManager',
812 'Move to start of document'),
794 0, 0, 813 0, 0,
795 self.editorActGrp, 'vm_edit_move_start_text') 814 self.editorActGrp, 'vm_edit_move_start_text')
796 if isMacPlatform(): 815 if isMacPlatform():
797 act.setShortcut(QKeySequence( 816 act.setShortcut(QKeySequence(
798 QApplication.translate('ViewManager', 'Ctrl+Up'))) 817 QCoreApplication.translate('ViewManager', 'Ctrl+Up')))
799 else: 818 else:
800 act.setShortcut(QKeySequence( 819 act.setShortcut(QKeySequence(
801 QApplication.translate('ViewManager', 'Ctrl+Home'))) 820 QCoreApplication.translate('ViewManager', 'Ctrl+Home')))
802 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART) 821 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART)
803 act.triggered.connect(self.esm.map) 822 act.triggered.connect(self.esm.map)
804 self.editActions.append(act) 823 self.editActions.append(act)
805 824
806 act = E5Action( 825 act = E5Action(
807 QApplication.translate('ViewManager', 'Move to end of document'), 826 QCoreApplication.translate('ViewManager',
808 QApplication.translate('ViewManager', 'Move to end of document'), 827 'Move to end of document'),
828 QCoreApplication.translate('ViewManager',
829 'Move to end of document'),
809 0, 0, 830 0, 0,
810 self.editorActGrp, 'vm_edit_move_end_text') 831 self.editorActGrp, 'vm_edit_move_end_text')
811 if isMacPlatform(): 832 if isMacPlatform():
812 act.setShortcut(QKeySequence( 833 act.setShortcut(QKeySequence(
813 QApplication.translate('ViewManager', 'Ctrl+Down'))) 834 QCoreApplication.translate('ViewManager', 'Ctrl+Down')))
814 else: 835 else:
815 act.setShortcut(QKeySequence( 836 act.setShortcut(QKeySequence(
816 QApplication.translate('ViewManager', 'Ctrl+End'))) 837 QCoreApplication.translate('ViewManager', 'Ctrl+End')))
817 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND) 838 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND)
818 act.triggered.connect(self.esm.map) 839 act.triggered.connect(self.esm.map)
819 self.editActions.append(act) 840 self.editActions.append(act)
820 841
821 act = E5Action( 842 act = E5Action(
822 QApplication.translate('ViewManager', 'Indent one level'), 843 QCoreApplication.translate('ViewManager', 'Indent one level'),
823 QApplication.translate('ViewManager', 'Indent one level'), 844 QCoreApplication.translate('ViewManager', 'Indent one level'),
824 QKeySequence(QApplication.translate('ViewManager', 'Tab')), 0, 845 QKeySequence(QCoreApplication.translate('ViewManager', 'Tab')), 0,
825 self.editorActGrp, 'vm_edit_indent_one_level') 846 self.editorActGrp, 'vm_edit_indent_one_level')
826 self.esm.setMapping(act, QsciScintilla.SCI_TAB) 847 self.esm.setMapping(act, QsciScintilla.SCI_TAB)
827 act.triggered.connect(self.esm.map) 848 act.triggered.connect(self.esm.map)
828 self.editActions.append(act) 849 self.editActions.append(act)
829 850
830 act = E5Action( 851 act = E5Action(
831 QApplication.translate('ViewManager', 'Unindent one level'), 852 QCoreApplication.translate('ViewManager', 'Unindent one level'),
832 QApplication.translate('ViewManager', 'Unindent one level'), 853 QCoreApplication.translate('ViewManager', 'Unindent one level'),
833 QKeySequence(QApplication.translate('ViewManager', 'Shift+Tab')), 854 QKeySequence(QCoreApplication.translate('ViewManager',
855 'Shift+Tab')),
834 0, self.editorActGrp, 'vm_edit_unindent_one_level') 856 0, self.editorActGrp, 'vm_edit_unindent_one_level')
835 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB) 857 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB)
836 act.triggered.connect(self.esm.map) 858 act.triggered.connect(self.esm.map)
837 self.editActions.append(act) 859 self.editActions.append(act)
838 860
839 act = E5Action( 861 act = E5Action(
840 QApplication.translate( 862 QCoreApplication.translate(
841 'ViewManager', 'Extend selection left one character'), 863 'ViewManager', 'Extend selection left one character'),
842 QApplication.translate( 864 QCoreApplication.translate(
843 'ViewManager', 865 'ViewManager',
844 'Extend selection left one character'), 866 'Extend selection left one character'),
845 QKeySequence(QApplication.translate('ViewManager', 'Shift+Left')), 867 QKeySequence(QCoreApplication.translate('ViewManager',
868 'Shift+Left')),
846 0, self.editorActGrp, 'vm_edit_extend_selection_left_char') 869 0, self.editorActGrp, 'vm_edit_extend_selection_left_char')
847 if isMacPlatform(): 870 if isMacPlatform():
848 act.setAlternateShortcut(QKeySequence( 871 act.setAlternateShortcut(QKeySequence(
849 QApplication.translate('ViewManager', 'Meta+Shift+B'))) 872 QCoreApplication.translate('ViewManager', 'Meta+Shift+B')))
850 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND) 873 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND)
851 act.triggered.connect(self.esm.map) 874 act.triggered.connect(self.esm.map)
852 self.editActions.append(act) 875 self.editActions.append(act)
853 876
854 act = E5Action( 877 act = E5Action(
855 QApplication.translate( 878 QCoreApplication.translate(
856 'ViewManager', 879 'ViewManager',
857 'Extend selection right one character'), 880 'Extend selection right one character'),
858 QApplication.translate( 881 QCoreApplication.translate(
859 'ViewManager', 882 'ViewManager',
860 'Extend selection right one character'), 883 'Extend selection right one character'),
861 QKeySequence(QApplication.translate('ViewManager', 'Shift+Right')), 884 QKeySequence(QCoreApplication.translate('ViewManager',
885 'Shift+Right')),
862 0, self.editorActGrp, 'vm_edit_extend_selection_right_char') 886 0, self.editorActGrp, 'vm_edit_extend_selection_right_char')
863 if isMacPlatform(): 887 if isMacPlatform():
864 act.setAlternateShortcut(QKeySequence( 888 act.setAlternateShortcut(QKeySequence(
865 QApplication.translate('ViewManager', 'Meta+Shift+F'))) 889 QCoreApplication.translate('ViewManager', 'Meta+Shift+F')))
866 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND) 890 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND)
867 act.triggered.connect(self.esm.map) 891 act.triggered.connect(self.esm.map)
868 self.editActions.append(act) 892 self.editActions.append(act)
869 893
870 act = E5Action( 894 act = E5Action(
871 QApplication.translate( 895 QCoreApplication.translate(
872 'ViewManager', 896 'ViewManager',
873 'Extend selection up one line'), 897 'Extend selection up one line'),
874 QApplication.translate( 898 QCoreApplication.translate(
875 'ViewManager', 899 'ViewManager',
876 'Extend selection up one line'), 900 'Extend selection up one line'),
877 QKeySequence(QApplication.translate('ViewManager', 'Shift+Up')), 0, 901 QKeySequence(QCoreApplication.translate('ViewManager',
878 self.editorActGrp, 'vm_edit_extend_selection_up_line') 902 'Shift+Up')),
903 0, self.editorActGrp, 'vm_edit_extend_selection_up_line')
879 if isMacPlatform(): 904 if isMacPlatform():
880 act.setAlternateShortcut(QKeySequence( 905 act.setAlternateShortcut(QKeySequence(
881 QApplication.translate('ViewManager', 'Meta+Shift+P'))) 906 QCoreApplication.translate('ViewManager', 'Meta+Shift+P')))
882 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND) 907 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND)
883 act.triggered.connect(self.esm.map) 908 act.triggered.connect(self.esm.map)
884 self.editActions.append(act) 909 self.editActions.append(act)
885 910
886 act = E5Action( 911 act = E5Action(
887 QApplication.translate( 912 QCoreApplication.translate(
888 'ViewManager', 913 'ViewManager',
889 'Extend selection down one line'), 914 'Extend selection down one line'),
890 QApplication.translate( 915 QCoreApplication.translate(
891 'ViewManager', 916 'ViewManager',
892 'Extend selection down one line'), 917 'Extend selection down one line'),
893 QKeySequence(QApplication.translate('ViewManager', 'Shift+Down')), 918 QKeySequence(QCoreApplication.translate('ViewManager',
919 'Shift+Down')),
894 0, self.editorActGrp, 'vm_edit_extend_selection_down_line') 920 0, self.editorActGrp, 'vm_edit_extend_selection_down_line')
895 if isMacPlatform(): 921 if isMacPlatform():
896 act.setAlternateShortcut(QKeySequence( 922 act.setAlternateShortcut(QKeySequence(
897 QApplication.translate('ViewManager', 'Meta+Shift+N'))) 923 QCoreApplication.translate('ViewManager', 'Meta+Shift+N')))
898 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND) 924 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND)
899 act.triggered.connect(self.esm.map) 925 act.triggered.connect(self.esm.map)
900 self.editActions.append(act) 926 self.editActions.append(act)
901 927
902 act = E5Action( 928 act = E5Action(
903 QApplication.translate( 929 QCoreApplication.translate(
904 'ViewManager', 930 'ViewManager',
905 'Extend selection left one word part'), 931 'Extend selection left one word part'),
906 QApplication.translate( 932 QCoreApplication.translate(
907 'ViewManager', 933 'ViewManager',
908 'Extend selection left one word part'), 934 'Extend selection left one word part'),
909 0, 0, 935 0, 0,
910 self.editorActGrp, 'vm_edit_extend_selection_left_word_part') 936 self.editorActGrp, 'vm_edit_extend_selection_left_word_part')
911 if not isMacPlatform(): 937 if not isMacPlatform():
912 act.setShortcut(QKeySequence( 938 act.setShortcut(QKeySequence(
913 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) 939 QCoreApplication.translate('ViewManager', 'Alt+Shift+Left')))
914 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND) 940 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND)
915 act.triggered.connect(self.esm.map) 941 act.triggered.connect(self.esm.map)
916 self.editActions.append(act) 942 self.editActions.append(act)
917 943
918 act = E5Action( 944 act = E5Action(
919 QApplication.translate( 945 QCoreApplication.translate(
920 'ViewManager', 946 'ViewManager',
921 'Extend selection right one word part'), 947 'Extend selection right one word part'),
922 QApplication.translate( 948 QCoreApplication.translate(
923 'ViewManager', 949 'ViewManager',
924 'Extend selection right one word part'), 950 'Extend selection right one word part'),
925 0, 0, 951 0, 0,
926 self.editorActGrp, 'vm_edit_extend_selection_right_word_part') 952 self.editorActGrp, 'vm_edit_extend_selection_right_word_part')
927 if not isMacPlatform(): 953 if not isMacPlatform():
928 act.setShortcut(QKeySequence( 954 act.setShortcut(QKeySequence(
929 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) 955 QCoreApplication.translate('ViewManager', 'Alt+Shift+Right')))
930 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND) 956 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND)
931 act.triggered.connect(self.esm.map) 957 act.triggered.connect(self.esm.map)
932 self.editActions.append(act) 958 self.editActions.append(act)
933 959
934 act = E5Action( 960 act = E5Action(
935 QApplication.translate( 961 QCoreApplication.translate(
936 'ViewManager', 'Extend selection left one word'), 962 'ViewManager', 'Extend selection left one word'),
937 QApplication.translate( 963 QCoreApplication.translate(
938 'ViewManager', 'Extend selection left one word'), 964 'ViewManager', 'Extend selection left one word'),
939 0, 0, 965 0, 0,
940 self.editorActGrp, 'vm_edit_extend_selection_left_word') 966 self.editorActGrp, 'vm_edit_extend_selection_left_word')
941 if isMacPlatform(): 967 if isMacPlatform():
942 act.setShortcut(QKeySequence( 968 act.setShortcut(QKeySequence(
943 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) 969 QCoreApplication.translate('ViewManager', 'Alt+Shift+Left')))
944 else: 970 else:
945 act.setShortcut(QKeySequence( 971 act.setShortcut(QKeySequence(
946 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) 972 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Left')))
947 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND) 973 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND)
948 act.triggered.connect(self.esm.map) 974 act.triggered.connect(self.esm.map)
949 self.editActions.append(act) 975 self.editActions.append(act)
950 976
951 act = E5Action( 977 act = E5Action(
952 QApplication.translate( 978 QCoreApplication.translate(
953 'ViewManager', 'Extend selection right one word'), 979 'ViewManager', 'Extend selection right one word'),
954 QApplication.translate( 980 QCoreApplication.translate(
955 'ViewManager', 'Extend selection right one word'), 981 'ViewManager', 'Extend selection right one word'),
956 0, 0, 982 0, 0,
957 self.editorActGrp, 'vm_edit_extend_selection_right_word') 983 self.editorActGrp, 'vm_edit_extend_selection_right_word')
958 if isMacPlatform(): 984 if isMacPlatform():
959 act.setShortcut(QKeySequence( 985 act.setShortcut(QKeySequence(
960 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) 986 QCoreApplication.translate('ViewManager', 'Alt+Shift+Right')))
961 else: 987 else:
962 act.setShortcut(QKeySequence( 988 act.setShortcut(QKeySequence(
963 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) 989 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Right')))
964 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND) 990 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND)
965 act.triggered.connect(self.esm.map) 991 act.triggered.connect(self.esm.map)
966 self.editActions.append(act) 992 self.editActions.append(act)
967 993
968 act = E5Action( 994 act = E5Action(
969 QApplication.translate( 995 QCoreApplication.translate(
970 'ViewManager', 996 'ViewManager',
971 'Extend selection to first visible character in document' 997 'Extend selection to first visible character in document'
972 ' line'), 998 ' line'),
973 QApplication.translate( 999 QCoreApplication.translate(
974 'ViewManager', 1000 'ViewManager',
975 'Extend selection to first visible character in document' 1001 'Extend selection to first visible character in document'
976 ' line'), 1002 ' line'),
977 0, 0, 1003 0, 0,
978 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char') 1004 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char')
979 if not isMacPlatform(): 1005 if not isMacPlatform():
980 act.setShortcut(QKeySequence( 1006 act.setShortcut(QKeySequence(
981 QApplication.translate('ViewManager', 'Shift+Home'))) 1007 QCoreApplication.translate('ViewManager', 'Shift+Home')))
982 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND) 1008 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND)
983 act.triggered.connect(self.esm.map) 1009 act.triggered.connect(self.esm.map)
984 self.editActions.append(act) 1010 self.editActions.append(act)
985 1011
986 act = E5Action( 1012 act = E5Action(
987 QApplication.translate( 1013 QCoreApplication.translate(
988 'ViewManager', 'Extend selection to end of document line'), 1014 'ViewManager', 'Extend selection to end of document line'),
989 QApplication.translate( 1015 QCoreApplication.translate(
990 'ViewManager', 'Extend selection to end of document line'), 1016 'ViewManager', 'Extend selection to end of document line'),
991 0, 0, 1017 0, 0,
992 self.editorActGrp, 'vm_edit_extend_selection_end_line') 1018 self.editorActGrp, 'vm_edit_extend_selection_end_line')
993 if isMacPlatform(): 1019 if isMacPlatform():
994 act.setShortcut(QKeySequence( 1020 act.setShortcut(QKeySequence(
995 QApplication.translate('ViewManager', 'Meta+Shift+E'))) 1021 QCoreApplication.translate('ViewManager', 'Meta+Shift+E')))
996 else: 1022 else:
997 act.setShortcut(QKeySequence( 1023 act.setShortcut(QKeySequence(
998 QApplication.translate('ViewManager', 'Shift+End'))) 1024 QCoreApplication.translate('ViewManager', 'Shift+End')))
999 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND) 1025 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND)
1000 act.triggered.connect(self.esm.map) 1026 act.triggered.connect(self.esm.map)
1001 self.editActions.append(act) 1027 self.editActions.append(act)
1002 1028
1003 act = E5Action( 1029 act = E5Action(
1004 QApplication.translate( 1030 QCoreApplication.translate(
1005 'ViewManager', 1031 'ViewManager',
1006 'Extend selection up one paragraph'), 1032 'Extend selection up one paragraph'),
1007 QApplication.translate( 1033 QCoreApplication.translate(
1008 'ViewManager', 1034 'ViewManager',
1009 'Extend selection up one paragraph'), 1035 'Extend selection up one paragraph'),
1010 QKeySequence(QApplication.translate('ViewManager', 1036 QKeySequence(QCoreApplication.translate('ViewManager',
1011 'Alt+Shift+Up')), 1037 'Alt+Shift+Up')),
1012 0, self.editorActGrp, 'vm_edit_extend_selection_up_para') 1038 0, self.editorActGrp, 'vm_edit_extend_selection_up_para')
1013 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND) 1039 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND)
1014 act.triggered.connect(self.esm.map) 1040 act.triggered.connect(self.esm.map)
1015 self.editActions.append(act) 1041 self.editActions.append(act)
1016 1042
1017 act = E5Action( 1043 act = E5Action(
1018 QApplication.translate( 1044 QCoreApplication.translate(
1019 'ViewManager', 'Extend selection down one paragraph'), 1045 'ViewManager', 'Extend selection down one paragraph'),
1020 QApplication.translate( 1046 QCoreApplication.translate(
1021 'ViewManager', 'Extend selection down one paragraph'), 1047 'ViewManager', 'Extend selection down one paragraph'),
1022 QKeySequence(QApplication.translate('ViewManager', 1048 QKeySequence(QCoreApplication.translate('ViewManager',
1023 'Alt+Shift+Down')), 1049 'Alt+Shift+Down')),
1024 0, 1050 0,
1025 self.editorActGrp, 'vm_edit_extend_selection_down_para') 1051 self.editorActGrp, 'vm_edit_extend_selection_down_para')
1026 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND) 1052 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND)
1027 act.triggered.connect(self.esm.map) 1053 act.triggered.connect(self.esm.map)
1028 self.editActions.append(act) 1054 self.editActions.append(act)
1029 1055
1030 act = E5Action( 1056 act = E5Action(
1031 QApplication.translate( 1057 QCoreApplication.translate(
1032 'ViewManager', 1058 'ViewManager',
1033 'Extend selection up one page'), 1059 'Extend selection up one page'),
1034 QApplication.translate( 1060 QCoreApplication.translate(
1035 'ViewManager', 1061 'ViewManager',
1036 'Extend selection up one page'), 1062 'Extend selection up one page'),
1037 QKeySequence(QApplication.translate('ViewManager', 'Shift+PgUp')), 1063 QKeySequence(QCoreApplication.translate('ViewManager',
1064 'Shift+PgUp')),
1038 0, self.editorActGrp, 'vm_edit_extend_selection_up_page') 1065 0, self.editorActGrp, 'vm_edit_extend_selection_up_page')
1039 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND) 1066 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND)
1040 act.triggered.connect(self.esm.map) 1067 act.triggered.connect(self.esm.map)
1041 self.editActions.append(act) 1068 self.editActions.append(act)
1042 1069
1043 act = E5Action( 1070 act = E5Action(
1044 QApplication.translate( 1071 QCoreApplication.translate(
1045 'ViewManager', 1072 'ViewManager',
1046 'Extend selection down one page'), 1073 'Extend selection down one page'),
1047 QApplication.translate( 1074 QCoreApplication.translate(
1048 'ViewManager', 1075 'ViewManager',
1049 'Extend selection down one page'), 1076 'Extend selection down one page'),
1050 QKeySequence(QApplication.translate('ViewManager', 1077 QKeySequence(QCoreApplication.translate('ViewManager',
1051 'Shift+PgDown')), 1078 'Shift+PgDown')),
1052 0, self.editorActGrp, 'vm_edit_extend_selection_down_page') 1079 0, self.editorActGrp, 'vm_edit_extend_selection_down_page')
1053 if isMacPlatform(): 1080 if isMacPlatform():
1054 act.setAlternateShortcut(QKeySequence( 1081 act.setAlternateShortcut(QKeySequence(
1055 QApplication.translate('ViewManager', 'Meta+Shift+V'))) 1082 QCoreApplication.translate('ViewManager', 'Meta+Shift+V')))
1056 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND) 1083 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND)
1057 act.triggered.connect(self.esm.map) 1084 act.triggered.connect(self.esm.map)
1058 self.editActions.append(act) 1085 self.editActions.append(act)
1059 1086
1060 act = E5Action( 1087 act = E5Action(
1061 QApplication.translate( 1088 QCoreApplication.translate(
1062 'ViewManager', 'Extend selection to start of document'), 1089 'ViewManager', 'Extend selection to start of document'),
1063 QApplication.translate( 1090 QCoreApplication.translate(
1064 'ViewManager', 'Extend selection to start of document'), 1091 'ViewManager', 'Extend selection to start of document'),
1065 0, 0, 1092 0, 0,
1066 self.editorActGrp, 'vm_edit_extend_selection_start_text') 1093 self.editorActGrp, 'vm_edit_extend_selection_start_text')
1067 if isMacPlatform(): 1094 if isMacPlatform():
1068 act.setShortcut(QKeySequence( 1095 act.setShortcut(QKeySequence(
1069 QApplication.translate('ViewManager', 'Ctrl+Shift+Up'))) 1096 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Up')))
1070 else: 1097 else:
1071 act.setShortcut(QKeySequence( 1098 act.setShortcut(QKeySequence(
1072 QApplication.translate('ViewManager', 'Ctrl+Shift+Home'))) 1099 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Home')))
1073 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTARTEXTEND) 1100 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTARTEXTEND)
1074 act.triggered.connect(self.esm.map) 1101 act.triggered.connect(self.esm.map)
1075 self.editActions.append(act) 1102 self.editActions.append(act)
1076 1103
1077 act = E5Action( 1104 act = E5Action(
1078 QApplication.translate( 1105 QCoreApplication.translate(
1079 'ViewManager', 'Extend selection to end of document'), 1106 'ViewManager', 'Extend selection to end of document'),
1080 QApplication.translate( 1107 QCoreApplication.translate(
1081 'ViewManager', 'Extend selection to end of document'), 1108 'ViewManager', 'Extend selection to end of document'),
1082 0, 0, 1109 0, 0,
1083 self.editorActGrp, 'vm_edit_extend_selection_end_text') 1110 self.editorActGrp, 'vm_edit_extend_selection_end_text')
1084 if isMacPlatform(): 1111 if isMacPlatform():
1085 act.setShortcut(QKeySequence( 1112 act.setShortcut(QKeySequence(
1086 QApplication.translate('ViewManager', 'Ctrl+Shift+Down'))) 1113 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Down')))
1087 else: 1114 else:
1088 act.setShortcut(QKeySequence( 1115 act.setShortcut(QKeySequence(
1089 QApplication.translate('ViewManager', 'Ctrl+Shift+End'))) 1116 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+End')))
1090 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND) 1117 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND)
1091 act.triggered.connect(self.esm.map) 1118 act.triggered.connect(self.esm.map)
1092 self.editActions.append(act) 1119 self.editActions.append(act)
1093 1120
1094 act = E5Action( 1121 act = E5Action(
1095 QApplication.translate( 1122 QCoreApplication.translate('ViewManager',
1096 'ViewManager', 1123 'Delete previous character'),
1097 'Delete previous character'), 1124 QCoreApplication.translate('ViewManager',
1098 QApplication.translate('ViewManager', 'Delete previous character'), 1125 'Delete previous character'),
1099 QKeySequence(QApplication.translate('ViewManager', 'Backspace')), 1126 QKeySequence(QCoreApplication.translate('ViewManager',
1127 'Backspace')),
1100 0, self.editorActGrp, 'vm_edit_delete_previous_char') 1128 0, self.editorActGrp, 'vm_edit_delete_previous_char')
1101 if isMacPlatform(): 1129 if isMacPlatform():
1102 act.setAlternateShortcut(QKeySequence( 1130 act.setAlternateShortcut(QKeySequence(
1103 QApplication.translate('ViewManager', 'Meta+H'))) 1131 QCoreApplication.translate('ViewManager', 'Meta+H')))
1104 else: 1132 else:
1105 act.setAlternateShortcut(QKeySequence( 1133 act.setAlternateShortcut(QKeySequence(
1106 QApplication.translate('ViewManager', 'Shift+Backspace'))) 1134 QCoreApplication.translate('ViewManager', 'Shift+Backspace')))
1107 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK) 1135 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK)
1108 act.triggered.connect(self.esm.map) 1136 act.triggered.connect(self.esm.map)
1109 self.editActions.append(act) 1137 self.editActions.append(act)
1110 1138
1111 act = E5Action( 1139 act = E5Action(
1112 QApplication.translate( 1140 QCoreApplication.translate(
1113 'ViewManager', 1141 'ViewManager',
1114 'Delete previous character if not at start of line'), 1142 'Delete previous character if not at start of line'),
1115 QApplication.translate( 1143 QCoreApplication.translate(
1116 'ViewManager', 1144 'ViewManager',
1117 'Delete previous character if not at start of line'), 1145 'Delete previous character if not at start of line'),
1118 0, 0, 1146 0, 0,
1119 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start') 1147 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start')
1120 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE) 1148 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE)
1121 act.triggered.connect(self.esm.map) 1149 act.triggered.connect(self.esm.map)
1122 self.editActions.append(act) 1150 self.editActions.append(act)
1123 1151
1124 act = E5Action( 1152 act = E5Action(
1125 QApplication.translate('ViewManager', 'Delete current character'), 1153 QCoreApplication.translate('ViewManager',
1126 QApplication.translate('ViewManager', 'Delete current character'), 1154 'Delete current character'),
1127 QKeySequence(QApplication.translate('ViewManager', 'Del')), 0, 1155 QCoreApplication.translate('ViewManager',
1156 'Delete current character'),
1157 QKeySequence(QCoreApplication.translate('ViewManager', 'Del')), 0,
1128 self.editorActGrp, 'vm_edit_delete_current_char') 1158 self.editorActGrp, 'vm_edit_delete_current_char')
1129 if isMacPlatform(): 1159 if isMacPlatform():
1130 act.setAlternateShortcut(QKeySequence( 1160 act.setAlternateShortcut(QKeySequence(
1131 QApplication.translate('ViewManager', 'Meta+D'))) 1161 QCoreApplication.translate('ViewManager', 'Meta+D')))
1132 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR) 1162 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR)
1133 act.triggered.connect(self.esm.map) 1163 act.triggered.connect(self.esm.map)
1134 self.editActions.append(act) 1164 self.editActions.append(act)
1135 1165
1136 act = E5Action( 1166 act = E5Action(
1137 QApplication.translate('ViewManager', 'Delete word to left'), 1167 QCoreApplication.translate('ViewManager', 'Delete word to left'),
1138 QApplication.translate('ViewManager', 'Delete word to left'), 1168 QCoreApplication.translate('ViewManager', 'Delete word to left'),
1139 QKeySequence(QApplication.translate('ViewManager', 1169 QKeySequence(QCoreApplication.translate('ViewManager',
1140 'Ctrl+Backspace')), 1170 'Ctrl+Backspace')),
1141 0, self.editorActGrp, 'vm_edit_delete_word_left') 1171 0, self.editorActGrp, 'vm_edit_delete_word_left')
1142 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT) 1172 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT)
1143 act.triggered.connect(self.esm.map) 1173 act.triggered.connect(self.esm.map)
1144 self.editActions.append(act) 1174 self.editActions.append(act)
1145 1175
1146 act = E5Action( 1176 act = E5Action(
1147 QApplication.translate('ViewManager', 'Delete word to right'), 1177 QCoreApplication.translate('ViewManager', 'Delete word to right'),
1148 QApplication.translate('ViewManager', 'Delete word to right'), 1178 QCoreApplication.translate('ViewManager', 'Delete word to right'),
1149 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Del')), 0, 1179 QKeySequence(QCoreApplication.translate('ViewManager',
1150 self.editorActGrp, 'vm_edit_delete_word_right') 1180 'Ctrl+Del')),
1181 0, self.editorActGrp, 'vm_edit_delete_word_right')
1151 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT) 1182 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT)
1152 act.triggered.connect(self.esm.map) 1183 act.triggered.connect(self.esm.map)
1153 self.editActions.append(act) 1184 self.editActions.append(act)
1154 1185
1155 act = E5Action( 1186 act = E5Action(
1156 QApplication.translate('ViewManager', 'Delete line to left'), 1187 QCoreApplication.translate('ViewManager', 'Delete line to left'),
1157 QApplication.translate('ViewManager', 'Delete line to left'), 1188 QCoreApplication.translate('ViewManager', 'Delete line to left'),
1158 QKeySequence(QApplication.translate('ViewManager', 1189 QKeySequence(QCoreApplication.translate('ViewManager',
1159 'Ctrl+Shift+Backspace')), 1190 'Ctrl+Shift+Backspace')),
1160 0, self.editorActGrp, 'vm_edit_delete_line_left') 1191 0, self.editorActGrp, 'vm_edit_delete_line_left')
1161 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT) 1192 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT)
1162 act.triggered.connect(self.esm.map) 1193 act.triggered.connect(self.esm.map)
1163 self.editActions.append(act) 1194 self.editActions.append(act)
1164 1195
1165 act = E5Action( 1196 act = E5Action(
1166 QApplication.translate('ViewManager', 'Delete line to right'), 1197 QCoreApplication.translate('ViewManager', 'Delete line to right'),
1167 QApplication.translate('ViewManager', 'Delete line to right'), 1198 QCoreApplication.translate('ViewManager', 'Delete line to right'),
1168 0, 0, 1199 0, 0,
1169 self.editorActGrp, 'vm_edit_delete_line_right') 1200 self.editorActGrp, 'vm_edit_delete_line_right')
1170 if isMacPlatform(): 1201 if isMacPlatform():
1171 act.setShortcut(QKeySequence( 1202 act.setShortcut(QKeySequence(
1172 QApplication.translate('ViewManager', 'Meta+K'))) 1203 QCoreApplication.translate('ViewManager', 'Meta+K')))
1173 else: 1204 else:
1174 act.setShortcut(QKeySequence( 1205 act.setShortcut(QKeySequence(
1175 QApplication.translate('ViewManager', 'Ctrl+Shift+Del'))) 1206 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Del')))
1176 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT) 1207 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT)
1177 act.triggered.connect(self.esm.map) 1208 act.triggered.connect(self.esm.map)
1178 self.editActions.append(act) 1209 self.editActions.append(act)
1179 1210
1180 act = E5Action( 1211 act = E5Action(
1181 QApplication.translate('ViewManager', 'Insert new line'), 1212 QCoreApplication.translate('ViewManager', 'Insert new line'),
1182 QApplication.translate('ViewManager', 'Insert new line'), 1213 QCoreApplication.translate('ViewManager', 'Insert new line'),
1183 QKeySequence(QApplication.translate('ViewManager', 'Return')), 1214 QKeySequence(QCoreApplication.translate('ViewManager', 'Return')),
1184 QKeySequence(QApplication.translate('ViewManager', 'Enter')), 1215 QKeySequence(QCoreApplication.translate('ViewManager', 'Enter')),
1185 self.editorActGrp, 'vm_edit_insert_line') 1216 self.editorActGrp, 'vm_edit_insert_line')
1186 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE) 1217 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE)
1187 act.triggered.connect(self.esm.map) 1218 act.triggered.connect(self.esm.map)
1188 self.editActions.append(act) 1219 self.editActions.append(act)
1189 1220
1190 act = E5Action( 1221 act = E5Action(
1191 QApplication.translate('ViewManager', 'Delete current line'), 1222 QCoreApplication.translate('ViewManager', 'Delete current line'),
1192 QApplication.translate('ViewManager', 'Delete current line'), 1223 QCoreApplication.translate('ViewManager', 'Delete current line'),
1193 QKeySequence(QApplication.translate('ViewManager', 1224 QKeySequence(QCoreApplication.translate('ViewManager',
1194 'Ctrl+Shift+L')), 1225 'Ctrl+Shift+L')),
1195 0, self.editorActGrp, 'vm_edit_delete_current_line') 1226 0, self.editorActGrp, 'vm_edit_delete_current_line')
1196 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE) 1227 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE)
1197 act.triggered.connect(self.esm.map) 1228 act.triggered.connect(self.esm.map)
1198 self.editActions.append(act) 1229 self.editActions.append(act)
1199 1230
1200 act = E5Action( 1231 act = E5Action(
1201 QApplication.translate('ViewManager', 'Duplicate current line'), 1232 QCoreApplication.translate('ViewManager',
1202 QApplication.translate('ViewManager', 'Duplicate current line'), 1233 'Duplicate current line'),
1203 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+D')), 0, 1234 QCoreApplication.translate('ViewManager',
1204 self.editorActGrp, 'vm_edit_duplicate_current_line') 1235 'Duplicate current line'),
1236 QKeySequence(QCoreApplication.translate('ViewManager', 'Ctrl+D')),
1237 0, self.editorActGrp, 'vm_edit_duplicate_current_line')
1205 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE) 1238 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE)
1206 act.triggered.connect(self.esm.map) 1239 act.triggered.connect(self.esm.map)
1207 self.editActions.append(act) 1240 self.editActions.append(act)
1208 1241
1209 act = E5Action( 1242 act = E5Action(
1210 QApplication.translate( 1243 QCoreApplication.translate(
1211 'ViewManager', 1244 'ViewManager',
1212 'Swap current and previous lines'), 1245 'Swap current and previous lines'),
1213 QApplication.translate( 1246 QCoreApplication.translate(
1214 'ViewManager', 1247 'ViewManager',
1215 'Swap current and previous lines'), 1248 'Swap current and previous lines'),
1216 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+T')), 0, 1249 QKeySequence(QCoreApplication.translate('ViewManager', 'Ctrl+T')),
1217 self.editorActGrp, 'vm_edit_swap_current_previous_line') 1250 0, self.editorActGrp, 'vm_edit_swap_current_previous_line')
1218 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE) 1251 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE)
1219 act.triggered.connect(self.esm.map) 1252 act.triggered.connect(self.esm.map)
1220 self.editActions.append(act) 1253 self.editActions.append(act)
1221 1254
1222 act = E5Action( 1255 act = E5Action(
1223 QApplication.translate('ViewManager', 'Cut current line'), 1256 QCoreApplication.translate('ViewManager', 'Cut current line'),
1224 QApplication.translate('ViewManager', 'Cut current line'), 1257 QCoreApplication.translate('ViewManager', 'Cut current line'),
1225 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+L')), 1258 QKeySequence(QCoreApplication.translate('ViewManager',
1259 'Alt+Shift+L')),
1226 0, self.editorActGrp, 'vm_edit_cut_current_line') 1260 0, self.editorActGrp, 'vm_edit_cut_current_line')
1227 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT) 1261 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT)
1228 act.triggered.connect(self.esm.map) 1262 act.triggered.connect(self.esm.map)
1229 self.editActions.append(act) 1263 self.editActions.append(act)
1230 1264
1231 act = E5Action( 1265 act = E5Action(
1232 QApplication.translate('ViewManager', 'Copy current line'), 1266 QCoreApplication.translate('ViewManager', 'Copy current line'),
1233 QApplication.translate('ViewManager', 'Copy current line'), 1267 QCoreApplication.translate('ViewManager', 'Copy current line'),
1234 QKeySequence(QApplication.translate('ViewManager', 1268 QKeySequence(QCoreApplication.translate('ViewManager',
1235 'Ctrl+Shift+T')), 1269 'Ctrl+Shift+T')),
1236 0, self.editorActGrp, 'vm_edit_copy_current_line') 1270 0, self.editorActGrp, 'vm_edit_copy_current_line')
1237 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY) 1271 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY)
1238 act.triggered.connect(self.esm.map) 1272 act.triggered.connect(self.esm.map)
1239 self.editActions.append(act) 1273 self.editActions.append(act)
1240 1274
1241 act = E5Action( 1275 act = E5Action(
1242 QApplication.translate('ViewManager', 'Toggle insert/overtype'), 1276 QCoreApplication.translate('ViewManager',
1243 QApplication.translate('ViewManager', 'Toggle insert/overtype'), 1277 'Toggle insert/overtype'),
1244 QKeySequence(QApplication.translate('ViewManager', 'Ins')), 0, 1278 QCoreApplication.translate('ViewManager',
1279 'Toggle insert/overtype'),
1280 QKeySequence(QCoreApplication.translate('ViewManager', 'Ins')), 0,
1245 self.editorActGrp, 'vm_edit_toggle_insert_overtype') 1281 self.editorActGrp, 'vm_edit_toggle_insert_overtype')
1246 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE) 1282 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE)
1247 act.triggered.connect(self.esm.map) 1283 act.triggered.connect(self.esm.map)
1248 self.editActions.append(act) 1284 self.editActions.append(act)
1249 1285
1250 act = E5Action( 1286 act = E5Action(
1251 QApplication.translate( 1287 QCoreApplication.translate(
1252 'ViewManager', 1288 'ViewManager',
1253 'Convert selection to lower case'), 1289 'Convert selection to lower case'),
1254 QApplication.translate( 1290 QCoreApplication.translate(
1255 'ViewManager', 1291 'ViewManager',
1256 'Convert selection to lower case'), 1292 'Convert selection to lower case'),
1257 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')), 1293 QKeySequence(QCoreApplication.translate('ViewManager',
1294 'Alt+Shift+U')),
1258 0, self.editorActGrp, 'vm_edit_convert_selection_lower') 1295 0, self.editorActGrp, 'vm_edit_convert_selection_lower')
1259 self.esm.setMapping(act, QsciScintilla.SCI_LOWERCASE) 1296 self.esm.setMapping(act, QsciScintilla.SCI_LOWERCASE)
1260 act.triggered.connect(self.esm.map) 1297 act.triggered.connect(self.esm.map)
1261 self.editActions.append(act) 1298 self.editActions.append(act)
1262 1299
1263 act = E5Action( 1300 act = E5Action(
1264 QApplication.translate( 1301 QCoreApplication.translate(
1265 'ViewManager', 1302 'ViewManager',
1266 'Convert selection to upper case'), 1303 'Convert selection to upper case'),
1267 QApplication.translate( 1304 QCoreApplication.translate(
1268 'ViewManager', 1305 'ViewManager',
1269 'Convert selection to upper case'), 1306 'Convert selection to upper case'),
1270 QKeySequence(QApplication.translate('ViewManager', 1307 QKeySequence(QCoreApplication.translate('ViewManager',
1271 'Ctrl+Shift+U')), 1308 'Ctrl+Shift+U')),
1272 0, self.editorActGrp, 'vm_edit_convert_selection_upper') 1309 0, self.editorActGrp, 'vm_edit_convert_selection_upper')
1273 self.esm.setMapping(act, QsciScintilla.SCI_UPPERCASE) 1310 self.esm.setMapping(act, QsciScintilla.SCI_UPPERCASE)
1274 act.triggered.connect(self.esm.map) 1311 act.triggered.connect(self.esm.map)
1275 self.editActions.append(act) 1312 self.editActions.append(act)
1276 1313
1277 act = E5Action( 1314 act = E5Action(
1278 QApplication.translate( 1315 QCoreApplication.translate(
1279 'ViewManager', 'Move to end of display line'), 1316 'ViewManager', 'Move to end of display line'),
1280 QApplication.translate( 1317 QCoreApplication.translate(
1281 'ViewManager', 'Move to end of display line'), 1318 'ViewManager', 'Move to end of display line'),
1282 0, 0, 1319 0, 0,
1283 self.editorActGrp, 'vm_edit_move_end_displayed_line') 1320 self.editorActGrp, 'vm_edit_move_end_displayed_line')
1284 if isMacPlatform(): 1321 if isMacPlatform():
1285 act.setShortcut(QKeySequence( 1322 act.setShortcut(QKeySequence(
1286 QApplication.translate('ViewManager', 'Ctrl+Right'))) 1323 QCoreApplication.translate('ViewManager', 'Ctrl+Right')))
1287 else: 1324 else:
1288 act.setShortcut(QKeySequence( 1325 act.setShortcut(QKeySequence(
1289 QApplication.translate('ViewManager', 'Alt+End'))) 1326 QCoreApplication.translate('ViewManager', 'Alt+End')))
1290 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY) 1327 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY)
1291 act.triggered.connect(self.esm.map) 1328 act.triggered.connect(self.esm.map)
1292 self.editActions.append(act) 1329 self.editActions.append(act)
1293 1330
1294 act = E5Action( 1331 act = E5Action(
1295 QApplication.translate( 1332 QCoreApplication.translate(
1296 'ViewManager', 1333 'ViewManager',
1297 'Extend selection to end of display line'), 1334 'Extend selection to end of display line'),
1298 QApplication.translate( 1335 QCoreApplication.translate(
1299 'ViewManager', 1336 'ViewManager',
1300 'Extend selection to end of display line'), 1337 'Extend selection to end of display line'),
1301 0, 0, 1338 0, 0,
1302 self.editorActGrp, 'vm_edit_extend_selection_end_displayed_line') 1339 self.editorActGrp, 'vm_edit_extend_selection_end_displayed_line')
1303 if isMacPlatform(): 1340 if isMacPlatform():
1304 act.setShortcut(QKeySequence( 1341 act.setShortcut(QKeySequence(
1305 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) 1342 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Right')))
1306 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND) 1343 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND)
1307 act.triggered.connect(self.esm.map) 1344 act.triggered.connect(self.esm.map)
1308 self.editActions.append(act) 1345 self.editActions.append(act)
1309 1346
1310 act = E5Action( 1347 act = E5Action(
1311 QApplication.translate('ViewManager', 'Formfeed'), 1348 QCoreApplication.translate('ViewManager', 'Formfeed'),
1312 QApplication.translate('ViewManager', 'Formfeed'), 1349 QCoreApplication.translate('ViewManager', 'Formfeed'),
1313 0, 0, 1350 0, 0,
1314 self.editorActGrp, 'vm_edit_formfeed') 1351 self.editorActGrp, 'vm_edit_formfeed')
1315 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) 1352 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED)
1316 act.triggered.connect(self.esm.map) 1353 act.triggered.connect(self.esm.map)
1317 self.editActions.append(act) 1354 self.editActions.append(act)
1318 1355
1319 act = E5Action( 1356 act = E5Action(
1320 QApplication.translate('ViewManager', 'Escape'), 1357 QCoreApplication.translate('ViewManager', 'Escape'),
1321 QApplication.translate('ViewManager', 'Escape'), 1358 QCoreApplication.translate('ViewManager', 'Escape'),
1322 QKeySequence(QApplication.translate('ViewManager', 'Esc')), 0, 1359 QKeySequence(QCoreApplication.translate('ViewManager', 'Esc')), 0,
1323 self.editorActGrp, 'vm_edit_escape') 1360 self.editorActGrp, 'vm_edit_escape')
1324 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL) 1361 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL)
1325 act.triggered.connect(self.esm.map) 1362 act.triggered.connect(self.esm.map)
1326 self.editActions.append(act) 1363 self.editActions.append(act)
1327 1364
1328 act = E5Action( 1365 act = E5Action(
1329 QApplication.translate( 1366 QCoreApplication.translate(
1330 'ViewManager', 1367 'ViewManager',
1331 'Extend rectangular selection down one line'), 1368 'Extend rectangular selection down one line'),
1332 QApplication.translate( 1369 QCoreApplication.translate(
1333 'ViewManager', 1370 'ViewManager',
1334 'Extend rectangular selection down one line'), 1371 'Extend rectangular selection down one line'),
1335 QKeySequence(QApplication.translate('ViewManager', 1372 QKeySequence(QCoreApplication.translate('ViewManager',
1336 'Alt+Ctrl+Down')), 1373 'Alt+Ctrl+Down')),
1337 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_line') 1374 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_line')
1338 if isMacPlatform(): 1375 if isMacPlatform():
1339 act.setAlternateShortcut(QKeySequence( 1376 act.setAlternateShortcut(QKeySequence(
1340 QApplication.translate('ViewManager', 'Meta+Alt+Shift+N'))) 1377 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+N')))
1341 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND) 1378 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND)
1342 act.triggered.connect(self.esm.map) 1379 act.triggered.connect(self.esm.map)
1343 self.editActions.append(act) 1380 self.editActions.append(act)
1344 1381
1345 act = E5Action( 1382 act = E5Action(
1346 QApplication.translate( 1383 QCoreApplication.translate(
1347 'ViewManager', 1384 'ViewManager',
1348 'Extend rectangular selection up one line'), 1385 'Extend rectangular selection up one line'),
1349 QApplication.translate( 1386 QCoreApplication.translate(
1350 'ViewManager', 1387 'ViewManager',
1351 'Extend rectangular selection up one line'), 1388 'Extend rectangular selection up one line'),
1352 QKeySequence(QApplication.translate('ViewManager', 'Alt+Ctrl+Up')), 1389 QKeySequence(QCoreApplication.translate('ViewManager',
1390 'Alt+Ctrl+Up')),
1353 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_line') 1391 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_line')
1354 if isMacPlatform(): 1392 if isMacPlatform():
1355 act.setAlternateShortcut(QKeySequence( 1393 act.setAlternateShortcut(QKeySequence(
1356 QApplication.translate('ViewManager', 'Meta+Alt+Shift+P'))) 1394 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+P')))
1357 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND) 1395 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND)
1358 act.triggered.connect(self.esm.map) 1396 act.triggered.connect(self.esm.map)
1359 self.editActions.append(act) 1397 self.editActions.append(act)
1360 1398
1361 act = E5Action( 1399 act = E5Action(
1362 QApplication.translate( 1400 QCoreApplication.translate(
1363 'ViewManager', 1401 'ViewManager',
1364 'Extend rectangular selection left one character'), 1402 'Extend rectangular selection left one character'),
1365 QApplication.translate( 1403 QCoreApplication.translate(
1366 'ViewManager', 1404 'ViewManager',
1367 'Extend rectangular selection left one character'), 1405 'Extend rectangular selection left one character'),
1368 QKeySequence(QApplication.translate('ViewManager', 1406 QKeySequence(QCoreApplication.translate('ViewManager',
1369 'Alt+Ctrl+Left')), 1407 'Alt+Ctrl+Left')),
1370 0, self.editorActGrp, 'vm_edit_extend_rect_selection_left_char') 1408 0, self.editorActGrp, 'vm_edit_extend_rect_selection_left_char')
1371 if isMacPlatform(): 1409 if isMacPlatform():
1372 act.setAlternateShortcut(QKeySequence( 1410 act.setAlternateShortcut(QKeySequence(
1373 QApplication.translate('ViewManager', 'Meta+Alt+Shift+B'))) 1411 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+B')))
1374 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND) 1412 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND)
1375 act.triggered.connect(self.esm.map) 1413 act.triggered.connect(self.esm.map)
1376 self.editActions.append(act) 1414 self.editActions.append(act)
1377 1415
1378 act = E5Action( 1416 act = E5Action(
1379 QApplication.translate( 1417 QCoreApplication.translate(
1380 'ViewManager', 1418 'ViewManager',
1381 'Extend rectangular selection right one character'), 1419 'Extend rectangular selection right one character'),
1382 QApplication.translate( 1420 QCoreApplication.translate(
1383 'ViewManager', 1421 'ViewManager',
1384 'Extend rectangular selection right one character'), 1422 'Extend rectangular selection right one character'),
1385 QKeySequence(QApplication.translate('ViewManager', 1423 QKeySequence(QCoreApplication.translate('ViewManager',
1386 'Alt+Ctrl+Right')), 1424 'Alt+Ctrl+Right')),
1387 0, self.editorActGrp, 'vm_edit_extend_rect_selection_right_char') 1425 0, self.editorActGrp, 'vm_edit_extend_rect_selection_right_char')
1388 if isMacPlatform(): 1426 if isMacPlatform():
1389 act.setAlternateShortcut(QKeySequence( 1427 act.setAlternateShortcut(QKeySequence(
1390 QApplication.translate('ViewManager', 'Meta+Alt+Shift+F'))) 1428 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+F')))
1391 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND) 1429 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND)
1392 act.triggered.connect(self.esm.map) 1430 act.triggered.connect(self.esm.map)
1393 self.editActions.append(act) 1431 self.editActions.append(act)
1394 1432
1395 act = E5Action( 1433 act = E5Action(
1396 QApplication.translate( 1434 QCoreApplication.translate(
1397 'ViewManager', 1435 'ViewManager',
1398 'Extend rectangular selection to first' 1436 'Extend rectangular selection to first'
1399 ' visible character in document line'), 1437 ' visible character in document line'),
1400 QApplication.translate( 1438 QCoreApplication.translate(
1401 'ViewManager', 1439 'ViewManager',
1402 'Extend rectangular selection to first' 1440 'Extend rectangular selection to first'
1403 ' visible character in document line'), 1441 ' visible character in document line'),
1404 0, 0, 1442 0, 0,
1405 self.editorActGrp, 1443 self.editorActGrp,
1406 'vm_edit_extend_rect_selection_first_visible_char') 1444 'vm_edit_extend_rect_selection_first_visible_char')
1407 if not isMacPlatform(): 1445 if not isMacPlatform():
1408 act.setShortcut(QKeySequence( 1446 act.setShortcut(QKeySequence(
1409 QApplication.translate('ViewManager', 'Alt+Shift+Home'))) 1447 QCoreApplication.translate('ViewManager', 'Alt+Shift+Home')))
1410 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND) 1448 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND)
1411 act.triggered.connect(self.esm.map) 1449 act.triggered.connect(self.esm.map)
1412 self.editActions.append(act) 1450 self.editActions.append(act)
1413 1451
1414 act = E5Action( 1452 act = E5Action(
1415 QApplication.translate( 1453 QCoreApplication.translate(
1416 'ViewManager', 1454 'ViewManager',
1417 'Extend rectangular selection to end of document line'), 1455 'Extend rectangular selection to end of document line'),
1418 QApplication.translate( 1456 QCoreApplication.translate(
1419 'ViewManager', 1457 'ViewManager',
1420 'Extend rectangular selection to end of document line'), 1458 'Extend rectangular selection to end of document line'),
1421 0, 0, 1459 0, 0,
1422 self.editorActGrp, 'vm_edit_extend_rect_selection_end_line') 1460 self.editorActGrp, 'vm_edit_extend_rect_selection_end_line')
1423 if isMacPlatform(): 1461 if isMacPlatform():
1424 act.setShortcut(QKeySequence( 1462 act.setShortcut(QKeySequence(
1425 QApplication.translate('ViewManager', 'Meta+Alt+Shift+E'))) 1463 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+E')))
1426 else: 1464 else:
1427 act.setShortcut(QKeySequence( 1465 act.setShortcut(QKeySequence(
1428 QApplication.translate('ViewManager', 'Alt+Shift+End'))) 1466 QCoreApplication.translate('ViewManager', 'Alt+Shift+End')))
1429 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND) 1467 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND)
1430 act.triggered.connect(self.esm.map) 1468 act.triggered.connect(self.esm.map)
1431 self.editActions.append(act) 1469 self.editActions.append(act)
1432 1470
1433 act = E5Action( 1471 act = E5Action(
1434 QApplication.translate( 1472 QCoreApplication.translate(
1435 'ViewManager', 1473 'ViewManager',
1436 'Extend rectangular selection up one page'), 1474 'Extend rectangular selection up one page'),
1437 QApplication.translate( 1475 QCoreApplication.translate(
1438 'ViewManager', 1476 'ViewManager',
1439 'Extend rectangular selection up one page'), 1477 'Extend rectangular selection up one page'),
1440 QKeySequence(QApplication.translate('ViewManager', 1478 QKeySequence(QCoreApplication.translate('ViewManager',
1441 'Alt+Shift+PgUp')), 1479 'Alt+Shift+PgUp')),
1442 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_page') 1480 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_page')
1443 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND) 1481 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND)
1444 act.triggered.connect(self.esm.map) 1482 act.triggered.connect(self.esm.map)
1445 self.editActions.append(act) 1483 self.editActions.append(act)
1446 1484
1447 act = E5Action( 1485 act = E5Action(
1448 QApplication.translate( 1486 QCoreApplication.translate(
1449 'ViewManager', 1487 'ViewManager',
1450 'Extend rectangular selection down one page'), 1488 'Extend rectangular selection down one page'),
1451 QApplication.translate( 1489 QCoreApplication.translate(
1452 'ViewManager', 1490 'ViewManager',
1453 'Extend rectangular selection down one page'), 1491 'Extend rectangular selection down one page'),
1454 QKeySequence(QApplication.translate('ViewManager', 1492 QKeySequence(QCoreApplication.translate('ViewManager',
1455 'Alt+Shift+PgDown')), 1493 'Alt+Shift+PgDown')),
1456 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_page') 1494 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_page')
1457 if isMacPlatform(): 1495 if isMacPlatform():
1458 act.setAlternateShortcut(QKeySequence( 1496 act.setAlternateShortcut(QKeySequence(
1459 QApplication.translate('ViewManager', 'Meta+Alt+Shift+V'))) 1497 QCoreApplication.translate('ViewManager', 'Meta+Alt+Shift+V')))
1460 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND) 1498 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND)
1461 act.triggered.connect(self.esm.map) 1499 act.triggered.connect(self.esm.map)
1462 self.editActions.append(act) 1500 self.editActions.append(act)
1463 1501
1464 act = E5Action( 1502 act = E5Action(
1465 QApplication.translate( 1503 QCoreApplication.translate(
1466 'ViewManager', 1504 'ViewManager',
1467 'Duplicate current selection'), 1505 'Duplicate current selection'),
1468 QApplication.translate( 1506 QCoreApplication.translate(
1469 'ViewManager', 1507 'ViewManager',
1470 'Duplicate current selection'), 1508 'Duplicate current selection'),
1471 QKeySequence(QApplication.translate('ViewManager', 1509 QKeySequence(QCoreApplication.translate('ViewManager',
1472 'Ctrl+Shift+D')), 1510 'Ctrl+Shift+D')),
1473 0, self.editorActGrp, 'vm_edit_duplicate_current_selection') 1511 0, self.editorActGrp, 'vm_edit_duplicate_current_selection')
1474 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) 1512 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE)
1475 act.triggered.connect(self.esm.map) 1513 act.triggered.connect(self.esm.map)
1476 self.editActions.append(act) 1514 self.editActions.append(act)
1477 1515
1478 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"): 1516 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"):
1479 act = E5Action( 1517 act = E5Action(
1480 QApplication.translate( 1518 QCoreApplication.translate(
1481 'ViewManager', 'Scroll to start of document'), 1519 'ViewManager', 'Scroll to start of document'),
1482 QApplication.translate( 1520 QCoreApplication.translate(
1483 'ViewManager', 'Scroll to start of document'), 1521 'ViewManager', 'Scroll to start of document'),
1484 0, 0, 1522 0, 0,
1485 self.editorActGrp, 'vm_edit_scroll_start_text') 1523 self.editorActGrp, 'vm_edit_scroll_start_text')
1486 if isMacPlatform(): 1524 if isMacPlatform():
1487 act.setShortcut(QKeySequence( 1525 act.setShortcut(QKeySequence(
1488 QApplication.translate('ViewManager', 'Home'))) 1526 QCoreApplication.translate('ViewManager', 'Home')))
1489 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOSTART) 1527 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOSTART)
1490 act.triggered.connect(self.esm.map) 1528 act.triggered.connect(self.esm.map)
1491 self.editActions.append(act) 1529 self.editActions.append(act)
1492 1530
1493 if hasattr(QsciScintilla, "SCI_SCROLLTOEND"): 1531 if hasattr(QsciScintilla, "SCI_SCROLLTOEND"):
1494 act = E5Action( 1532 act = E5Action(
1495 QApplication.translate( 1533 QCoreApplication.translate(
1496 'ViewManager', 'Scroll to end of document'), 1534 'ViewManager', 'Scroll to end of document'),
1497 QApplication.translate( 1535 QCoreApplication.translate(
1498 'ViewManager', 'Scroll to end of document'), 1536 'ViewManager', 'Scroll to end of document'),
1499 0, 0, 1537 0, 0,
1500 self.editorActGrp, 'vm_edit_scroll_end_text') 1538 self.editorActGrp, 'vm_edit_scroll_end_text')
1501 if isMacPlatform(): 1539 if isMacPlatform():
1502 act.setShortcut(QKeySequence( 1540 act.setShortcut(QKeySequence(
1503 QApplication.translate('ViewManager', 'End'))) 1541 QCoreApplication.translate('ViewManager', 'End')))
1504 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOEND) 1542 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOEND)
1505 act.triggered.connect(self.esm.map) 1543 act.triggered.connect(self.esm.map)
1506 self.editActions.append(act) 1544 self.editActions.append(act)
1507 1545
1508 if hasattr(QsciScintilla, "SCI_VERTICALCENTRECARET"): 1546 if hasattr(QsciScintilla, "SCI_VERTICALCENTRECARET"):
1509 act = E5Action( 1547 act = E5Action(
1510 QApplication.translate( 1548 QCoreApplication.translate(
1511 'ViewManager', 'Scroll vertically to center current line'), 1549 'ViewManager', 'Scroll vertically to center current line'),
1512 QApplication.translate( 1550 QCoreApplication.translate(
1513 'ViewManager', 'Scroll vertically to center current line'), 1551 'ViewManager', 'Scroll vertically to center current line'),
1514 0, 0, 1552 0, 0,
1515 self.editorActGrp, 'vm_edit_scroll_vertically_center') 1553 self.editorActGrp, 'vm_edit_scroll_vertically_center')
1516 if isMacPlatform(): 1554 if isMacPlatform():
1517 act.setShortcut(QKeySequence( 1555 act.setShortcut(QKeySequence(
1518 QApplication.translate('ViewManager', 'Meta+L'))) 1556 QCoreApplication.translate('ViewManager', 'Meta+L')))
1519 self.esm.setMapping(act, QsciScintilla.SCI_VERTICALCENTRECARET) 1557 self.esm.setMapping(act, QsciScintilla.SCI_VERTICALCENTRECARET)
1520 act.triggered.connect(self.esm.map) 1558 act.triggered.connect(self.esm.map)
1521 self.editActions.append(act) 1559 self.editActions.append(act)
1522 1560
1523 if hasattr(QsciScintilla, "SCI_WORDRIGHTEND"): 1561 if hasattr(QsciScintilla, "SCI_WORDRIGHTEND"):
1524 act = E5Action( 1562 act = E5Action(
1525 QApplication.translate( 1563 QCoreApplication.translate(
1526 'ViewManager', 'Move to end of next word'), 1564 'ViewManager', 'Move to end of next word'),
1527 QApplication.translate( 1565 QCoreApplication.translate(
1528 'ViewManager', 'Move to end of next word'), 1566 'ViewManager', 'Move to end of next word'),
1529 0, 0, 1567 0, 0,
1530 self.editorActGrp, 'vm_edit_move_end_next_word') 1568 self.editorActGrp, 'vm_edit_move_end_next_word')
1531 if isMacPlatform(): 1569 if isMacPlatform():
1532 act.setShortcut(QKeySequence( 1570 act.setShortcut(QKeySequence(
1533 QApplication.translate('ViewManager', 'Alt+Right'))) 1571 QCoreApplication.translate('ViewManager', 'Alt+Right')))
1534 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEND) 1572 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEND)
1535 act.triggered.connect(self.esm.map) 1573 act.triggered.connect(self.esm.map)
1536 self.editActions.append(act) 1574 self.editActions.append(act)
1537 1575
1538 if hasattr(QsciScintilla, "SCI_WORDRIGHTENDEXTEND"): 1576 if hasattr(QsciScintilla, "SCI_WORDRIGHTENDEXTEND"):
1539 act = E5Action( 1577 act = E5Action(
1540 QApplication.translate( 1578 QCoreApplication.translate(
1541 'ViewManager', 'Extend selection to end of next word'), 1579 'ViewManager', 'Extend selection to end of next word'),
1542 QApplication.translate( 1580 QCoreApplication.translate(
1543 'ViewManager', 'Extend selection to end of next word'), 1581 'ViewManager', 'Extend selection to end of next word'),
1544 0, 0, 1582 0, 0,
1545 self.editorActGrp, 'vm_edit_select_end_next_word') 1583 self.editorActGrp, 'vm_edit_select_end_next_word')
1546 if isMacPlatform(): 1584 if isMacPlatform():
1547 act.setShortcut(QKeySequence( 1585 act.setShortcut(QKeySequence(
1548 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) 1586 QCoreApplication.translate('ViewManager',
1587 'Alt+Shift+Right')))
1549 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTENDEXTEND) 1588 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTENDEXTEND)
1550 act.triggered.connect(self.esm.map) 1589 act.triggered.connect(self.esm.map)
1551 self.editActions.append(act) 1590 self.editActions.append(act)
1552 1591
1553 if hasattr(QsciScintilla, "SCI_WORDLEFTEND"): 1592 if hasattr(QsciScintilla, "SCI_WORDLEFTEND"):
1554 act = E5Action( 1593 act = E5Action(
1555 QApplication.translate( 1594 QCoreApplication.translate(
1556 'ViewManager', 'Move to end of previous word'), 1595 'ViewManager', 'Move to end of previous word'),
1557 QApplication.translate( 1596 QCoreApplication.translate(
1558 'ViewManager', 'Move to end of previous word'), 1597 'ViewManager', 'Move to end of previous word'),
1559 0, 0, 1598 0, 0,
1560 self.editorActGrp, 'vm_edit_move_end_previous_word') 1599 self.editorActGrp, 'vm_edit_move_end_previous_word')
1561 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEND) 1600 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEND)
1562 act.triggered.connect(self.esm.map) 1601 act.triggered.connect(self.esm.map)
1563 self.editActions.append(act) 1602 self.editActions.append(act)
1564 1603
1565 if hasattr(QsciScintilla, "SCI_WORDLEFTENDEXTEND"): 1604 if hasattr(QsciScintilla, "SCI_WORDLEFTENDEXTEND"):
1566 act = E5Action( 1605 act = E5Action(
1567 QApplication.translate( 1606 QCoreApplication.translate(
1568 'ViewManager', 'Extend selection to end of previous word'), 1607 'ViewManager', 'Extend selection to end of previous word'),
1569 QApplication.translate( 1608 QCoreApplication.translate(
1570 'ViewManager', 'Extend selection to end of previous word'), 1609 'ViewManager', 'Extend selection to end of previous word'),
1571 0, 0, 1610 0, 0,
1572 self.editorActGrp, 'vm_edit_select_end_previous_word') 1611 self.editorActGrp, 'vm_edit_select_end_previous_word')
1573 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTENDEXTEND) 1612 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTENDEXTEND)
1574 act.triggered.connect(self.esm.map) 1613 act.triggered.connect(self.esm.map)
1575 self.editActions.append(act) 1614 self.editActions.append(act)
1576 1615
1577 if hasattr(QsciScintilla, "SCI_HOME"): 1616 if hasattr(QsciScintilla, "SCI_HOME"):
1578 act = E5Action( 1617 act = E5Action(
1579 QApplication.translate( 1618 QCoreApplication.translate(
1580 'ViewManager', 'Move to start of document line'), 1619 'ViewManager', 'Move to start of document line'),
1581 QApplication.translate( 1620 QCoreApplication.translate(
1582 'ViewManager', 'Move to start of document line'), 1621 'ViewManager', 'Move to start of document line'),
1583 0, 0, 1622 0, 0,
1584 self.editorActGrp, 'vm_edit_move_start_document_line') 1623 self.editorActGrp, 'vm_edit_move_start_document_line')
1585 if isMacPlatform(): 1624 if isMacPlatform():
1586 act.setShortcut(QKeySequence( 1625 act.setShortcut(QKeySequence(
1587 QApplication.translate('ViewManager', 'Meta+A'))) 1626 QCoreApplication.translate('ViewManager', 'Meta+A')))
1588 self.esm.setMapping(act, QsciScintilla.SCI_HOME) 1627 self.esm.setMapping(act, QsciScintilla.SCI_HOME)
1589 act.triggered.connect(self.esm.map) 1628 act.triggered.connect(self.esm.map)
1590 self.editActions.append(act) 1629 self.editActions.append(act)
1591 1630
1592 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"): 1631 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"):
1593 act = E5Action( 1632 act = E5Action(
1594 QApplication.translate( 1633 QCoreApplication.translate(
1595 'ViewManager', 1634 'ViewManager',
1596 'Extend selection to start of document line'), 1635 'Extend selection to start of document line'),
1597 QApplication.translate( 1636 QCoreApplication.translate(
1598 'ViewManager', 1637 'ViewManager',
1599 'Extend selection to start of document line'), 1638 'Extend selection to start of document line'),
1600 0, 0, 1639 0, 0,
1601 self.editorActGrp, 1640 self.editorActGrp,
1602 'vm_edit_extend_selection_start_document_line') 1641 'vm_edit_extend_selection_start_document_line')
1603 if isMacPlatform(): 1642 if isMacPlatform():
1604 act.setShortcut(QKeySequence( 1643 act.setShortcut(QKeySequence(
1605 QApplication.translate('ViewManager', 'Meta+Shift+A'))) 1644 QCoreApplication.translate('ViewManager', 'Meta+Shift+A')))
1606 self.esm.setMapping(act, QsciScintilla.SCI_HOME) 1645 self.esm.setMapping(act, QsciScintilla.SCI_HOME)
1607 act.triggered.connect(self.esm.map) 1646 act.triggered.connect(self.esm.map)
1608 self.editActions.append(act) 1647 self.editActions.append(act)
1609 1648
1610 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"): 1649 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"):
1611 act = E5Action( 1650 act = E5Action(
1612 QApplication.translate( 1651 QCoreApplication.translate(
1613 'ViewManager', 1652 'ViewManager',
1614 'Extend rectangular selection to start of document line'), 1653 'Extend rectangular selection to start of document line'),
1615 QApplication.translate( 1654 QCoreApplication.translate(
1616 'ViewManager', 1655 'ViewManager',
1617 'Extend rectangular selection to start of document line'), 1656 'Extend rectangular selection to start of document line'),
1618 0, 0, 1657 0, 0,
1619 self.editorActGrp, 'vm_edit_select_rect_start_line') 1658 self.editorActGrp, 'vm_edit_select_rect_start_line')
1620 if isMacPlatform(): 1659 if isMacPlatform():
1621 act.setShortcut(QKeySequence( 1660 act.setShortcut(QKeySequence(
1622 QApplication.translate('ViewManager', 'Meta+Alt+Shift+A'))) 1661 QCoreApplication.translate('ViewManager',
1662 'Meta+Alt+Shift+A')))
1623 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND) 1663 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND)
1624 act.triggered.connect(self.esm.map) 1664 act.triggered.connect(self.esm.map)
1625 self.editActions.append(act) 1665 self.editActions.append(act)
1626 1666
1627 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"): 1667 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"):
1628 act = E5Action( 1668 act = E5Action(
1629 QApplication.translate( 1669 QCoreApplication.translate(
1630 'ViewManager', 1670 'ViewManager',
1631 'Extend selection to start of display line'), 1671 'Extend selection to start of display line'),
1632 QApplication.translate( 1672 QCoreApplication.translate(
1633 'ViewManager', 1673 'ViewManager',
1634 'Extend selection to start of display line'), 1674 'Extend selection to start of display line'),
1635 0, 0, 1675 0, 0,
1636 self.editorActGrp, 1676 self.editorActGrp,
1637 'vm_edit_extend_selection_start_display_line') 1677 'vm_edit_extend_selection_start_display_line')
1638 if isMacPlatform(): 1678 if isMacPlatform():
1639 act.setShortcut(QKeySequence( 1679 act.setShortcut(QKeySequence(
1640 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) 1680 QCoreApplication.translate('ViewManager',
1681 'Ctrl+Shift+Left')))
1641 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND) 1682 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND)
1642 act.triggered.connect(self.esm.map) 1683 act.triggered.connect(self.esm.map)
1643 self.editActions.append(act) 1684 self.editActions.append(act)
1644 1685
1645 if hasattr(QsciScintilla, "SCI_HOMEWRAP"): 1686 if hasattr(QsciScintilla, "SCI_HOMEWRAP"):
1646 act = E5Action( 1687 act = E5Action(
1647 QApplication.translate( 1688 QCoreApplication.translate(
1648 'ViewManager', 1689 'ViewManager',
1649 'Move to start of display or document line'), 1690 'Move to start of display or document line'),
1650 QApplication.translate( 1691 QCoreApplication.translate(
1651 'ViewManager', 1692 'ViewManager',
1652 'Move to start of display or document line'), 1693 'Move to start of display or document line'),
1653 0, 0, 1694 0, 0,
1654 self.editorActGrp, 'vm_edit_move_start_display_document_line') 1695 self.editorActGrp, 'vm_edit_move_start_display_document_line')
1655 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP) 1696 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP)
1656 act.triggered.connect(self.esm.map) 1697 act.triggered.connect(self.esm.map)
1657 self.editActions.append(act) 1698 self.editActions.append(act)
1658 1699
1659 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"): 1700 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"):
1660 act = E5Action( 1701 act = E5Action(
1661 QApplication.translate( 1702 QCoreApplication.translate(
1662 'ViewManager', 1703 'ViewManager',
1663 'Extend selection to start of display or document line'), 1704 'Extend selection to start of display or document line'),
1664 QApplication.translate( 1705 QCoreApplication.translate(
1665 'ViewManager', 1706 'ViewManager',
1666 'Extend selection to start of display or document line'), 1707 'Extend selection to start of display or document line'),
1667 0, 0, 1708 0, 0,
1668 self.editorActGrp, 1709 self.editorActGrp,
1669 'vm_edit_extend_selection_start_display_document_line') 1710 'vm_edit_extend_selection_start_display_document_line')
1671 act.triggered.connect(self.esm.map) 1712 act.triggered.connect(self.esm.map)
1672 self.editActions.append(act) 1713 self.editActions.append(act)
1673 1714
1674 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"): 1715 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"):
1675 act = E5Action( 1716 act = E5Action(
1676 QApplication.translate( 1717 QCoreApplication.translate(
1677 'ViewManager', 1718 'ViewManager',
1678 'Move to first visible character in display' 1719 'Move to first visible character in display'
1679 ' or document line'), 1720 ' or document line'),
1680 QApplication.translate( 1721 QCoreApplication.translate(
1681 'ViewManager', 1722 'ViewManager',
1682 'Move to first visible character in display' 1723 'Move to first visible character in display'
1683 ' or document line'), 1724 ' or document line'),
1684 0, 0, 1725 0, 0,
1685 self.editorActGrp, 1726 self.editorActGrp,
1688 act.triggered.connect(self.esm.map) 1729 act.triggered.connect(self.esm.map)
1689 self.editActions.append(act) 1730 self.editActions.append(act)
1690 1731
1691 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"): 1732 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"):
1692 act = E5Action( 1733 act = E5Action(
1693 QApplication.translate( 1734 QCoreApplication.translate(
1694 'ViewManager', 1735 'ViewManager',
1695 'Extend selection to first visible character in' 1736 'Extend selection to first visible character in'
1696 ' display or document line'), 1737 ' display or document line'),
1697 QApplication.translate( 1738 QCoreApplication.translate(
1698 'ViewManager', 1739 'ViewManager',
1699 'Extend selection to first visible character in' 1740 'Extend selection to first visible character in'
1700 ' display or document line'), 1741 ' display or document line'),
1701 0, 0, 1742 0, 0,
1702 self.editorActGrp, 1743 self.editorActGrp,
1705 act.triggered.connect(self.esm.map) 1746 act.triggered.connect(self.esm.map)
1706 self.editActions.append(act) 1747 self.editActions.append(act)
1707 1748
1708 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"): 1749 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"):
1709 act = E5Action( 1750 act = E5Action(
1710 QApplication.translate( 1751 QCoreApplication.translate(
1711 'ViewManager', 1752 'ViewManager',
1712 'Move to end of display or document line'), 1753 'Move to end of display or document line'),
1713 QApplication.translate( 1754 QCoreApplication.translate(
1714 'ViewManager', 1755 'ViewManager',
1715 'Move to end of display or document line'), 1756 'Move to end of display or document line'),
1716 0, 0, 1757 0, 0,
1717 self.editorActGrp, 'vm_edit_end_start_display_document_line') 1758 self.editorActGrp, 'vm_edit_end_start_display_document_line')
1718 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP) 1759 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP)
1719 act.triggered.connect(self.esm.map) 1760 act.triggered.connect(self.esm.map)
1720 self.editActions.append(act) 1761 self.editActions.append(act)
1721 1762
1722 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"): 1763 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"):
1723 act = E5Action( 1764 act = E5Action(
1724 QApplication.translate( 1765 QCoreApplication.translate(
1725 'ViewManager', 1766 'ViewManager',
1726 'Extend selection to end of display or document line'), 1767 'Extend selection to end of display or document line'),
1727 QApplication.translate( 1768 QCoreApplication.translate(
1728 'ViewManager', 1769 'ViewManager',
1729 'Extend selection to end of display or document line'), 1770 'Extend selection to end of display or document line'),
1730 0, 0, 1771 0, 0,
1731 self.editorActGrp, 1772 self.editorActGrp,
1732 'vm_edit_extend_selection_end_display_document_line') 1773 'vm_edit_extend_selection_end_display_document_line')
1734 act.triggered.connect(self.esm.map) 1775 act.triggered.connect(self.esm.map)
1735 self.editActions.append(act) 1776 self.editActions.append(act)
1736 1777
1737 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"): 1778 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"):
1738 act = E5Action( 1779 act = E5Action(
1739 QApplication.translate( 1780 QCoreApplication.translate(
1740 'ViewManager', 'Stuttered move up one page'), 1781 'ViewManager', 'Stuttered move up one page'),
1741 QApplication.translate( 1782 QCoreApplication.translate(
1742 'ViewManager', 'Stuttered move up one page'), 1783 'ViewManager', 'Stuttered move up one page'),
1743 0, 0, 1784 0, 0,
1744 self.editorActGrp, 'vm_edit_stuttered_move_up_page') 1785 self.editorActGrp, 'vm_edit_stuttered_move_up_page')
1745 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP) 1786 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP)
1746 act.triggered.connect(self.esm.map) 1787 act.triggered.connect(self.esm.map)
1747 self.editActions.append(act) 1788 self.editActions.append(act)
1748 1789
1749 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"): 1790 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"):
1750 act = E5Action( 1791 act = E5Action(
1751 QApplication.translate( 1792 QCoreApplication.translate(
1752 'ViewManager', 1793 'ViewManager',
1753 'Stuttered extend selection up one page'), 1794 'Stuttered extend selection up one page'),
1754 QApplication.translate( 1795 QCoreApplication.translate(
1755 'ViewManager', 1796 'ViewManager',
1756 'Stuttered extend selection up one page'), 1797 'Stuttered extend selection up one page'),
1757 0, 0, 1798 0, 0,
1758 self.editorActGrp, 1799 self.editorActGrp,
1759 'vm_edit_stuttered_extend_selection_up_page') 1800 'vm_edit_stuttered_extend_selection_up_page')
1761 act.triggered.connect(self.esm.map) 1802 act.triggered.connect(self.esm.map)
1762 self.editActions.append(act) 1803 self.editActions.append(act)
1763 1804
1764 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"): 1805 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"):
1765 act = E5Action( 1806 act = E5Action(
1766 QApplication.translate( 1807 QCoreApplication.translate(
1767 'ViewManager', 'Stuttered move down one page'), 1808 'ViewManager', 'Stuttered move down one page'),
1768 QApplication.translate( 1809 QCoreApplication.translate(
1769 'ViewManager', 'Stuttered move down one page'), 1810 'ViewManager', 'Stuttered move down one page'),
1770 0, 0, 1811 0, 0,
1771 self.editorActGrp, 'vm_edit_stuttered_move_down_page') 1812 self.editorActGrp, 'vm_edit_stuttered_move_down_page')
1772 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN) 1813 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN)
1773 act.triggered.connect(self.esm.map) 1814 act.triggered.connect(self.esm.map)
1774 self.editActions.append(act) 1815 self.editActions.append(act)
1775 1816
1776 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"): 1817 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"):
1777 act = E5Action( 1818 act = E5Action(
1778 QApplication.translate( 1819 QCoreApplication.translate(
1779 'ViewManager', 1820 'ViewManager',
1780 'Stuttered extend selection down one page'), 1821 'Stuttered extend selection down one page'),
1781 QApplication.translate( 1822 QCoreApplication.translate(
1782 'ViewManager', 1823 'ViewManager',
1783 'Stuttered extend selection down one page'), 1824 'Stuttered extend selection down one page'),
1784 0, 0, 1825 0, 0,
1785 self.editorActGrp, 1826 self.editorActGrp,
1786 'vm_edit_stuttered_extend_selection_down_page') 1827 'vm_edit_stuttered_extend_selection_down_page')
1788 act.triggered.connect(self.esm.map) 1829 act.triggered.connect(self.esm.map)
1789 self.editActions.append(act) 1830 self.editActions.append(act)
1790 1831
1791 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"): 1832 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"):
1792 act = E5Action( 1833 act = E5Action(
1793 QApplication.translate( 1834 QCoreApplication.translate(
1794 'ViewManager', 1835 'ViewManager',
1795 'Delete right to end of next word'), 1836 'Delete right to end of next word'),
1796 QApplication.translate( 1837 QCoreApplication.translate(
1797 'ViewManager', 1838 'ViewManager',
1798 'Delete right to end of next word'), 1839 'Delete right to end of next word'),
1799 0, 0, 1840 0, 0,
1800 self.editorActGrp, 'vm_edit_delete_right_end_next_word') 1841 self.editorActGrp, 'vm_edit_delete_right_end_next_word')
1801 if isMacPlatform(): 1842 if isMacPlatform():
1802 act.setShortcut(QKeySequence( 1843 act.setShortcut(QKeySequence(
1803 QApplication.translate('ViewManager', 'Alt+Del'))) 1844 QCoreApplication.translate('ViewManager', 'Alt+Del')))
1804 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND) 1845 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND)
1805 act.triggered.connect(self.esm.map) 1846 act.triggered.connect(self.esm.map)
1806 self.editActions.append(act) 1847 self.editActions.append(act)
1807 1848
1808 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"): 1849 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"):
1809 act = E5Action( 1850 act = E5Action(
1810 QApplication.translate( 1851 QCoreApplication.translate(
1811 'ViewManager', 1852 'ViewManager',
1812 'Move selected lines up one line'), 1853 'Move selected lines up one line'),
1813 QApplication.translate( 1854 QCoreApplication.translate(
1814 'ViewManager', 1855 'ViewManager',
1815 'Move selected lines up one line'), 1856 'Move selected lines up one line'),
1816 0, 0, 1857 0, 0,
1817 self.editorActGrp, 'vm_edit_move_selection_up_one_line') 1858 self.editorActGrp, 'vm_edit_move_selection_up_one_line')
1818 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP) 1859 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP)
1819 act.triggered.connect(self.esm.map) 1860 act.triggered.connect(self.esm.map)
1820 self.editActions.append(act) 1861 self.editActions.append(act)
1821 1862
1822 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"): 1863 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"):
1823 act = E5Action( 1864 act = E5Action(
1824 QApplication.translate( 1865 QCoreApplication.translate(
1825 'ViewManager', 1866 'ViewManager',
1826 'Move selected lines down one line'), 1867 'Move selected lines down one line'),
1827 QApplication.translate( 1868 QCoreApplication.translate(
1828 'ViewManager', 1869 'ViewManager',
1829 'Move selected lines down one line'), 1870 'Move selected lines down one line'),
1830 0, 0, 1871 0, 0,
1831 self.editorActGrp, 'vm_edit_move_selection_down_one_line') 1872 self.editorActGrp, 'vm_edit_move_selection_down_one_line')
1832 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN) 1873 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN)
1833 act.triggered.connect(self.esm.map) 1874 act.triggered.connect(self.esm.map)
1834 self.editActions.append(act) 1875 self.editActions.append(act)
1835 1876
1836 act = E5Action( 1877 act = E5Action(
1837 QApplication.translate( 1878 QCoreApplication.translate(
1838 'ViewManager', 1879 'ViewManager',
1839 'Duplicate current selection'), 1880 'Duplicate current selection'),
1840 QApplication.translate( 1881 QCoreApplication.translate(
1841 'ViewManager', 1882 'ViewManager',
1842 'Duplicate current selection'), 1883 'Duplicate current selection'),
1843 QKeySequence(QApplication.translate('ViewManager', 1884 QKeySequence(QCoreApplication.translate('ViewManager',
1844 'Ctrl+Shift+D')), 1885 'Ctrl+Shift+D')),
1845 0, self.editorActGrp, 'vm_edit_duplicate_current_selection') 1886 0, self.editorActGrp, 'vm_edit_duplicate_current_selection')
1846 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) 1887 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE)
1847 act.triggered.connect(self.esm.map) 1888 act.triggered.connect(self.esm.map)
1848 self.editActions.append(act) 1889 self.editActions.append(act)
1849 1890
1853 """ 1894 """
1854 Private method defining the user interface actions for the search 1895 Private method defining the user interface actions for the search
1855 commands. 1896 commands.
1856 """ 1897 """
1857 self.searchAct = E5Action( 1898 self.searchAct = E5Action(
1858 QApplication.translate('ViewManager', 'Search'), 1899 QCoreApplication.translate('ViewManager', 'Search'),
1859 UI.PixmapCache.getIcon("find.png"), 1900 UI.PixmapCache.getIcon("find.png"),
1860 QApplication.translate('ViewManager', '&Search...'), 1901 QCoreApplication.translate('ViewManager', '&Search...'),
1861 QKeySequence(QApplication.translate( 1902 QKeySequence(QCoreApplication.translate(
1862 'ViewManager', "Ctrl+F", "Search|Search")), 1903 'ViewManager', "Ctrl+F", "Search|Search")),
1863 0, 1904 0,
1864 self, 'vm_search') 1905 self, 'vm_search')
1865 self.searchAct.setStatusTip( 1906 self.searchAct.setStatusTip(
1866 QApplication.translate('ViewManager', 'Search for a text')) 1907 QCoreApplication.translate('ViewManager', 'Search for a text'))
1867 self.searchAct.setWhatsThis(QApplication.translate( 1908 self.searchAct.setWhatsThis(QCoreApplication.translate(
1868 'ViewManager', 1909 'ViewManager',
1869 """<b>Search</b>""" 1910 """<b>Search</b>"""
1870 """<p>Search for some text in the current editor. A""" 1911 """<p>Search for some text in the current editor. A"""
1871 """ dialog is shown to enter the searchtext and options""" 1912 """ dialog is shown to enter the searchtext and options"""
1872 """ for the search.</p>""" 1913 """ for the search.</p>"""
1873 )) 1914 ))
1874 self.searchAct.triggered.connect(self.__search) 1915 self.searchAct.triggered.connect(self.__search)
1875 self.searchActions.append(self.searchAct) 1916 self.searchActions.append(self.searchAct)
1876 1917
1877 self.searchNextAct = E5Action( 1918 self.searchNextAct = E5Action(
1878 QApplication.translate('ViewManager', 'Search next'), 1919 QCoreApplication.translate('ViewManager', 'Search next'),
1879 UI.PixmapCache.getIcon("findNext.png"), 1920 UI.PixmapCache.getIcon("findNext.png"),
1880 QApplication.translate('ViewManager', 'Search &next'), 1921 QCoreApplication.translate('ViewManager', 'Search &next'),
1881 QKeySequence(QApplication.translate( 1922 QKeySequence(QCoreApplication.translate(
1882 'ViewManager', "F3", "Search|Search next")), 1923 'ViewManager', "F3", "Search|Search next")),
1883 0, 1924 0,
1884 self, 'vm_search_next') 1925 self, 'vm_search_next')
1885 self.searchNextAct.setStatusTip(QApplication.translate( 1926 self.searchNextAct.setStatusTip(QCoreApplication.translate(
1886 'ViewManager', 'Search next occurrence of text')) 1927 'ViewManager', 'Search next occurrence of text'))
1887 self.searchNextAct.setWhatsThis(QApplication.translate( 1928 self.searchNextAct.setWhatsThis(QCoreApplication.translate(
1888 'ViewManager', 1929 'ViewManager',
1889 """<b>Search next</b>""" 1930 """<b>Search next</b>"""
1890 """<p>Search the next occurrence of some text in the current""" 1931 """<p>Search the next occurrence of some text in the current"""
1891 """ editor. The previously entered searchtext and options are""" 1932 """ editor. The previously entered searchtext and options are"""
1892 """ reused.</p>""" 1933 """ reused.</p>"""
1893 )) 1934 ))
1894 self.searchNextAct.triggered.connect(self.searchDlg.findNext) 1935 self.searchNextAct.triggered.connect(self.searchDlg.findNext)
1895 self.searchActions.append(self.searchNextAct) 1936 self.searchActions.append(self.searchNextAct)
1896 1937
1897 self.searchPrevAct = E5Action( 1938 self.searchPrevAct = E5Action(
1898 QApplication.translate('ViewManager', 'Search previous'), 1939 QCoreApplication.translate('ViewManager', 'Search previous'),
1899 UI.PixmapCache.getIcon("findPrev.png"), 1940 UI.PixmapCache.getIcon("findPrev.png"),
1900 QApplication.translate('ViewManager', 'Search &previous'), 1941 QCoreApplication.translate('ViewManager', 'Search &previous'),
1901 QKeySequence(QApplication.translate( 1942 QKeySequence(QCoreApplication.translate(
1902 'ViewManager', "Shift+F3", "Search|Search previous")), 1943 'ViewManager', "Shift+F3", "Search|Search previous")),
1903 0, 1944 0,
1904 self, 'vm_search_previous') 1945 self, 'vm_search_previous')
1905 self.searchPrevAct.setStatusTip(QApplication.translate( 1946 self.searchPrevAct.setStatusTip(QCoreApplication.translate(
1906 'ViewManager', 'Search previous occurrence of text')) 1947 'ViewManager', 'Search previous occurrence of text'))
1907 self.searchPrevAct.setWhatsThis(QApplication.translate( 1948 self.searchPrevAct.setWhatsThis(QCoreApplication.translate(
1908 'ViewManager', 1949 'ViewManager',
1909 """<b>Search previous</b>""" 1950 """<b>Search previous</b>"""
1910 """<p>Search the previous occurrence of some text in the""" 1951 """<p>Search the previous occurrence of some text in the"""
1911 """ current editor. The previously entered searchtext and""" 1952 """ current editor. The previously entered searchtext and"""
1912 """ options are reused.</p>""" 1953 """ options are reused.</p>"""
1913 )) 1954 ))
1914 self.searchPrevAct.triggered.connect(self.searchDlg.findPrev) 1955 self.searchPrevAct.triggered.connect(self.searchDlg.findPrev)
1915 self.searchActions.append(self.searchPrevAct) 1956 self.searchActions.append(self.searchPrevAct)
1916 1957
1917 self.searchClearMarkersAct = E5Action( 1958 self.searchClearMarkersAct = E5Action(
1918 QApplication.translate('ViewManager', 1959 QCoreApplication.translate('ViewManager',
1919 'Clear search markers'), 1960 'Clear search markers'),
1920 UI.PixmapCache.getIcon("findClear.png"), 1961 UI.PixmapCache.getIcon("findClear.png"),
1921 QApplication.translate('ViewManager', 'Clear search markers'), 1962 QCoreApplication.translate('ViewManager', 'Clear search markers'),
1922 QKeySequence(QApplication.translate( 1963 QKeySequence(QCoreApplication.translate(
1923 'ViewManager', "Ctrl+3", "Search|Clear search markers")), 1964 'ViewManager', "Ctrl+3", "Search|Clear search markers")),
1924 0, 1965 0,
1925 self, 'vm_clear_search_markers') 1966 self, 'vm_clear_search_markers')
1926 self.searchClearMarkersAct.setStatusTip(QApplication.translate( 1967 self.searchClearMarkersAct.setStatusTip(QCoreApplication.translate(
1927 'ViewManager', 'Clear all displayed search markers')) 1968 'ViewManager', 'Clear all displayed search markers'))
1928 self.searchClearMarkersAct.setWhatsThis(QApplication.translate( 1969 self.searchClearMarkersAct.setWhatsThis(QCoreApplication.translate(
1929 'ViewManager', 1970 'ViewManager',
1930 """<b>Clear search markers</b>""" 1971 """<b>Clear search markers</b>"""
1931 """<p>Clear all displayed search markers.</p>""" 1972 """<p>Clear all displayed search markers.</p>"""
1932 )) 1973 ))
1933 self.searchClearMarkersAct.triggered.connect( 1974 self.searchClearMarkersAct.triggered.connect(
1934 self.__searchClearMarkers) 1975 self.__searchClearMarkers)
1935 self.searchActions.append(self.searchClearMarkersAct) 1976 self.searchActions.append(self.searchClearMarkersAct)
1936 1977
1937 self.replaceAct = E5Action( 1978 self.replaceAct = E5Action(
1938 QApplication.translate('ViewManager', 'Replace'), 1979 QCoreApplication.translate('ViewManager', 'Replace'),
1939 QApplication.translate('ViewManager', '&Replace...'), 1980 QCoreApplication.translate('ViewManager', '&Replace...'),
1940 QKeySequence(QApplication.translate( 1981 QKeySequence(QCoreApplication.translate(
1941 'ViewManager', "Ctrl+R", "Search|Replace")), 1982 'ViewManager', "Ctrl+R", "Search|Replace")),
1942 0, 1983 0,
1943 self, 'vm_search_replace') 1984 self, 'vm_search_replace')
1944 self.replaceAct.setStatusTip(QApplication.translate( 1985 self.replaceAct.setStatusTip(QCoreApplication.translate(
1945 'ViewManager', 'Replace some text')) 1986 'ViewManager', 'Replace some text'))
1946 self.replaceAct.setWhatsThis(QApplication.translate( 1987 self.replaceAct.setWhatsThis(QCoreApplication.translate(
1947 'ViewManager', 1988 'ViewManager',
1948 """<b>Replace</b>""" 1989 """<b>Replace</b>"""
1949 """<p>Search for some text in the current editor and replace""" 1990 """<p>Search for some text in the current editor and replace"""
1950 """ it. A dialog is shown to enter the searchtext, the""" 1991 """ it. A dialog is shown to enter the searchtext, the"""
1951 """ replacement text and options for the search and replace.</p>""" 1992 """ replacement text and options for the search and replace.</p>"""
2511 2552
2512 def __printPreviewFile(self): 2553 def __printPreviewFile(self):
2513 """ 2554 """
2514 Private slot to show a print preview of the text. 2555 Private slot to show a print preview of the text.
2515 """ 2556 """
2516 from PyQt4.QtGui import QPrintPreviewDialog 2557 from PyQt5.QtPrintSupport import QPrintPreviewDialog
2517 from .Printer import Printer 2558 from .Printer import Printer
2518 2559
2519 printer = Printer(mode=QPrinter.HighResolution) 2560 printer = Printer(mode=QPrinter.HighResolution)
2520 if self.__curFile: 2561 if self.__curFile:
2521 printer.setDocName(QFileInfo(self.__curFile).fileName()) 2562 printer.setDocName(QFileInfo(self.__curFile).fileName())

eric ide

mercurial