QScintilla/MiniEditor.py

changeset 3345
071afe8be2a1
parent 3201
0f115f6db6cb
child 3484
645c12de6b0c
equal deleted inserted replaced
3343:f7a6d271bb40 3345:071afe8be2a1
371 self.newAct.setStatusTip(self.tr('Open an empty editor window')) 371 self.newAct.setStatusTip(self.tr('Open an empty editor window'))
372 self.newAct.setWhatsThis(self.tr( 372 self.newAct.setWhatsThis(self.tr(
373 """<b>New</b>""" 373 """<b>New</b>"""
374 """<p>An empty editor window will be created.</p>""" 374 """<p>An empty editor window will be created.</p>"""
375 )) 375 ))
376 self.newAct.triggered[()].connect(self.__newFile) 376 self.newAct.triggered.connect(self.__newFile)
377 self.fileActions.append(self.newAct) 377 self.fileActions.append(self.newAct)
378 378
379 self.openAct = E5Action( 379 self.openAct = E5Action(
380 self.tr('Open'), 380 self.tr('Open'),
381 UI.PixmapCache.getIcon("open.png"), 381 UI.PixmapCache.getIcon("open.png"),
385 self.openAct.setStatusTip(self.tr('Open a file')) 385 self.openAct.setStatusTip(self.tr('Open a file'))
386 self.openAct.setWhatsThis(self.tr( 386 self.openAct.setWhatsThis(self.tr(
387 """<b>Open a file</b>""" 387 """<b>Open a file</b>"""
388 """<p>You will be asked for the name of a file to be opened.</p>""" 388 """<p>You will be asked for the name of a file to be opened.</p>"""
389 )) 389 ))
390 self.openAct.triggered[()].connect(self.__open) 390 self.openAct.triggered.connect(self.__open)
391 self.fileActions.append(self.openAct) 391 self.fileActions.append(self.openAct)
392 392
393 self.saveAct = E5Action( 393 self.saveAct = E5Action(
394 self.tr('Save'), 394 self.tr('Save'),
395 UI.PixmapCache.getIcon("fileSave.png"), 395 UI.PixmapCache.getIcon("fileSave.png"),
399 self.saveAct.setStatusTip(self.tr('Save the current file')) 399 self.saveAct.setStatusTip(self.tr('Save the current file'))
400 self.saveAct.setWhatsThis(self.tr( 400 self.saveAct.setWhatsThis(self.tr(
401 """<b>Save File</b>""" 401 """<b>Save File</b>"""
402 """<p>Save the contents of current editor window.</p>""" 402 """<p>Save the contents of current editor window.</p>"""
403 )) 403 ))
404 self.saveAct.triggered[()].connect(self.__save) 404 self.saveAct.triggered.connect(self.__save)
405 self.fileActions.append(self.saveAct) 405 self.fileActions.append(self.saveAct)
406 406
407 self.saveAsAct = E5Action( 407 self.saveAsAct = E5Action(
408 self.tr('Save as'), 408 self.tr('Save as'),
409 UI.PixmapCache.getIcon("fileSaveAs.png"), 409 UI.PixmapCache.getIcon("fileSaveAs.png"),
415 self.saveAsAct.setWhatsThis(self.tr( 415 self.saveAsAct.setWhatsThis(self.tr(
416 """<b>Save File as</b>""" 416 """<b>Save File as</b>"""
417 """<p>Save the contents of current editor window to a new file.""" 417 """<p>Save the contents of current editor window to a new file."""
418 """ The file can be entered in a file selection dialog.</p>""" 418 """ The file can be entered in a file selection dialog.</p>"""
419 )) 419 ))
420 self.saveAsAct.triggered[()].connect(self.__saveAs) 420 self.saveAsAct.triggered.connect(self.__saveAs)
421 self.fileActions.append(self.saveAsAct) 421 self.fileActions.append(self.saveAsAct)
422 422
423 self.closeAct = E5Action( 423 self.closeAct = E5Action(
424 self.tr('Close'), 424 self.tr('Close'),
425 UI.PixmapCache.getIcon("close.png"), 425 UI.PixmapCache.getIcon("close.png"),
429 self.closeAct.setStatusTip(self.tr('Close the editor window')) 429 self.closeAct.setStatusTip(self.tr('Close the editor window'))
430 self.closeAct.setWhatsThis(self.tr( 430 self.closeAct.setWhatsThis(self.tr(
431 """<b>Close Window</b>""" 431 """<b>Close Window</b>"""
432 """<p>Close the current window.</p>""" 432 """<p>Close the current window.</p>"""
433 )) 433 ))
434 self.closeAct.triggered[()].connect(self.close) 434 self.closeAct.triggered.connect(self.close)
435 self.fileActions.append(self.closeAct) 435 self.fileActions.append(self.closeAct)
436 436
437 self.printAct = E5Action( 437 self.printAct = E5Action(
438 self.tr('Print'), 438 self.tr('Print'),
439 UI.PixmapCache.getIcon("print.png"), 439 UI.PixmapCache.getIcon("print.png"),
443 self.printAct.setStatusTip(self.tr('Print the current file')) 443 self.printAct.setStatusTip(self.tr('Print the current file'))
444 self.printAct.setWhatsThis(self.tr( 444 self.printAct.setWhatsThis(self.tr(
445 """<b>Print File</b>""" 445 """<b>Print File</b>"""
446 """<p>Print the contents of the current file.</p>""" 446 """<p>Print the contents of the current file.</p>"""
447 )) 447 ))
448 self.printAct.triggered[()].connect(self.__printFile) 448 self.printAct.triggered.connect(self.__printFile)
449 self.fileActions.append(self.printAct) 449 self.fileActions.append(self.printAct)
450 450
451 self.printPreviewAct = E5Action( 451 self.printPreviewAct = E5Action(
452 self.tr('Print Preview'), 452 self.tr('Print Preview'),
453 UI.PixmapCache.getIcon("printPreview.png"), 453 UI.PixmapCache.getIcon("printPreview.png"),
457 'Print preview of the current file')) 457 'Print preview of the current file'))
458 self.printPreviewAct.setWhatsThis(self.tr( 458 self.printPreviewAct.setWhatsThis(self.tr(
459 """<b>Print Preview</b>""" 459 """<b>Print Preview</b>"""
460 """<p>Print preview of the current file.</p>""" 460 """<p>Print preview of the current file.</p>"""
461 )) 461 ))
462 self.printPreviewAct.triggered[()].connect(self.__printPreviewFile) 462 self.printPreviewAct.triggered.connect(self.__printPreviewFile)
463 self.fileActions.append(self.printPreviewAct) 463 self.fileActions.append(self.printPreviewAct)
464 464
465 def __createEditActions(self): 465 def __createEditActions(self):
466 """ 466 """
467 Private method to create the Edit actions. 467 Private method to create the Edit actions.
476 self.undoAct.setStatusTip(self.tr('Undo the last change')) 476 self.undoAct.setStatusTip(self.tr('Undo the last change'))
477 self.undoAct.setWhatsThis(self.tr( 477 self.undoAct.setWhatsThis(self.tr(
478 """<b>Undo</b>""" 478 """<b>Undo</b>"""
479 """<p>Undo the last change done in the current editor.</p>""" 479 """<p>Undo the last change done in the current editor.</p>"""
480 )) 480 ))
481 self.undoAct.triggered[()].connect(self.__undo) 481 self.undoAct.triggered.connect(self.__undo)
482 self.editActions.append(self.undoAct) 482 self.editActions.append(self.undoAct)
483 483
484 self.redoAct = E5Action( 484 self.redoAct = E5Action(
485 self.tr('Redo'), 485 self.tr('Redo'),
486 UI.PixmapCache.getIcon("editRedo.png"), 486 UI.PixmapCache.getIcon("editRedo.png"),
490 self.redoAct.setStatusTip(self.tr('Redo the last change')) 490 self.redoAct.setStatusTip(self.tr('Redo the last change'))
491 self.redoAct.setWhatsThis(self.tr( 491 self.redoAct.setWhatsThis(self.tr(
492 """<b>Redo</b>""" 492 """<b>Redo</b>"""
493 """<p>Redo the last change done in the current editor.</p>""" 493 """<p>Redo the last change done in the current editor.</p>"""
494 )) 494 ))
495 self.redoAct.triggered[()].connect(self.__redo) 495 self.redoAct.triggered.connect(self.__redo)
496 self.editActions.append(self.redoAct) 496 self.editActions.append(self.redoAct)
497 497
498 self.cutAct = E5Action( 498 self.cutAct = E5Action(
499 self.tr('Cut'), 499 self.tr('Cut'),
500 UI.PixmapCache.getIcon("editCut.png"), 500 UI.PixmapCache.getIcon("editCut.png"),
506 self.cutAct.setWhatsThis(self.tr( 506 self.cutAct.setWhatsThis(self.tr(
507 """<b>Cut</b>""" 507 """<b>Cut</b>"""
508 """<p>Cut the selected text of the current editor to the""" 508 """<p>Cut the selected text of the current editor to the"""
509 """ clipboard.</p>""" 509 """ clipboard.</p>"""
510 )) 510 ))
511 self.cutAct.triggered[()].connect(self.__textEdit.cut) 511 self.cutAct.triggered.connect(self.__textEdit.cut)
512 self.editActions.append(self.cutAct) 512 self.editActions.append(self.cutAct)
513 513
514 self.copyAct = E5Action( 514 self.copyAct = E5Action(
515 self.tr('Copy'), 515 self.tr('Copy'),
516 UI.PixmapCache.getIcon("editCopy.png"), 516 UI.PixmapCache.getIcon("editCopy.png"),
522 self.copyAct.setWhatsThis(self.tr( 522 self.copyAct.setWhatsThis(self.tr(
523 """<b>Copy</b>""" 523 """<b>Copy</b>"""
524 """<p>Copy the selected text of the current editor to the""" 524 """<p>Copy the selected text of the current editor to the"""
525 """ clipboard.</p>""" 525 """ clipboard.</p>"""
526 )) 526 ))
527 self.copyAct.triggered[()].connect(self.__textEdit.copy) 527 self.copyAct.triggered.connect(self.__textEdit.copy)
528 self.editActions.append(self.copyAct) 528 self.editActions.append(self.copyAct)
529 529
530 self.pasteAct = E5Action( 530 self.pasteAct = E5Action(
531 self.tr('Paste'), 531 self.tr('Paste'),
532 UI.PixmapCache.getIcon("editPaste.png"), 532 UI.PixmapCache.getIcon("editPaste.png"),
539 self.pasteAct.setWhatsThis(self.tr( 539 self.pasteAct.setWhatsThis(self.tr(
540 """<b>Paste</b>""" 540 """<b>Paste</b>"""
541 """<p>Paste the last cut/copied text from the clipboard to""" 541 """<p>Paste the last cut/copied text from the clipboard to"""
542 """ the current editor.</p>""" 542 """ the current editor.</p>"""
543 )) 543 ))
544 self.pasteAct.triggered[()].connect(self.__textEdit.paste) 544 self.pasteAct.triggered.connect(self.__textEdit.paste)
545 self.editActions.append(self.pasteAct) 545 self.editActions.append(self.pasteAct)
546 546
547 self.deleteAct = E5Action( 547 self.deleteAct = E5Action(
548 self.tr('Clear'), 548 self.tr('Clear'),
549 UI.PixmapCache.getIcon("editDelete.png"), 549 UI.PixmapCache.getIcon("editDelete.png"),
554 self.deleteAct.setStatusTip(self.tr('Clear all text')) 554 self.deleteAct.setStatusTip(self.tr('Clear all text'))
555 self.deleteAct.setWhatsThis(self.tr( 555 self.deleteAct.setWhatsThis(self.tr(
556 """<b>Clear</b>""" 556 """<b>Clear</b>"""
557 """<p>Delete all text of the current editor.</p>""" 557 """<p>Delete all text of the current editor.</p>"""
558 )) 558 ))
559 self.deleteAct.triggered[()].connect(self.__textEdit.clear) 559 self.deleteAct.triggered.connect(self.__textEdit.clear)
560 self.editActions.append(self.deleteAct) 560 self.editActions.append(self.deleteAct)
561 561
562 self.cutAct.setEnabled(False) 562 self.cutAct.setEnabled(False)
563 self.copyAct.setEnabled(False) 563 self.copyAct.setEnabled(False)
564 self.__textEdit.copyAvailable.connect(self.cutAct.setEnabled) 564 self.__textEdit.copyAvailable.connect(self.cutAct.setEnabled)
580 self.editorActGrp, 'vm_edit_move_left_char') 580 self.editorActGrp, 'vm_edit_move_left_char')
581 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT) 581 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT)
582 if isMacPlatform(): 582 if isMacPlatform():
583 act.setAlternateShortcut(QKeySequence( 583 act.setAlternateShortcut(QKeySequence(
584 QApplication.translate('ViewManager', 'Meta+B'))) 584 QApplication.translate('ViewManager', 'Meta+B')))
585 act.triggered[()].connect(self.esm.map) 585 act.triggered.connect(self.esm.map)
586 self.editActions.append(act) 586 self.editActions.append(act)
587 587
588 act = E5Action( 588 act = E5Action(
589 QApplication.translate('ViewManager', 'Move right one character'), 589 QApplication.translate('ViewManager', 'Move right one character'),
590 QApplication.translate('ViewManager', 'Move right one character'), 590 QApplication.translate('ViewManager', 'Move right one character'),
592 self.editorActGrp, 'vm_edit_move_right_char') 592 self.editorActGrp, 'vm_edit_move_right_char')
593 if isMacPlatform(): 593 if isMacPlatform():
594 act.setAlternateShortcut(QKeySequence( 594 act.setAlternateShortcut(QKeySequence(
595 QApplication.translate('ViewManager', 'Meta+F'))) 595 QApplication.translate('ViewManager', 'Meta+F')))
596 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT) 596 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT)
597 act.triggered[()].connect(self.esm.map) 597 act.triggered.connect(self.esm.map)
598 self.editActions.append(act) 598 self.editActions.append(act)
599 599
600 act = E5Action( 600 act = E5Action(
601 QApplication.translate('ViewManager', 'Move up one line'), 601 QApplication.translate('ViewManager', 'Move up one line'),
602 QApplication.translate('ViewManager', 'Move up one line'), 602 QApplication.translate('ViewManager', 'Move up one line'),
604 self.editorActGrp, 'vm_edit_move_up_line') 604 self.editorActGrp, 'vm_edit_move_up_line')
605 if isMacPlatform(): 605 if isMacPlatform():
606 act.setAlternateShortcut(QKeySequence( 606 act.setAlternateShortcut(QKeySequence(
607 QApplication.translate('ViewManager', 'Meta+P'))) 607 QApplication.translate('ViewManager', 'Meta+P')))
608 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP) 608 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP)
609 act.triggered[()].connect(self.esm.map) 609 act.triggered.connect(self.esm.map)
610 self.editActions.append(act) 610 self.editActions.append(act)
611 611
612 act = E5Action( 612 act = E5Action(
613 QApplication.translate('ViewManager', 'Move down one line'), 613 QApplication.translate('ViewManager', 'Move down one line'),
614 QApplication.translate('ViewManager', 'Move down one line'), 614 QApplication.translate('ViewManager', 'Move down one line'),
616 self.editorActGrp, 'vm_edit_move_down_line') 616 self.editorActGrp, 'vm_edit_move_down_line')
617 if isMacPlatform(): 617 if isMacPlatform():
618 act.setAlternateShortcut(QKeySequence( 618 act.setAlternateShortcut(QKeySequence(
619 QApplication.translate('ViewManager', 'Meta+N'))) 619 QApplication.translate('ViewManager', 'Meta+N')))
620 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN) 620 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN)
621 act.triggered[()].connect(self.esm.map) 621 act.triggered.connect(self.esm.map)
622 self.editActions.append(act) 622 self.editActions.append(act)
623 623
624 act = E5Action( 624 act = E5Action(
625 QApplication.translate('ViewManager', 'Move left one word part'), 625 QApplication.translate('ViewManager', 'Move left one word part'),
626 QApplication.translate('ViewManager', 'Move left one word part'), 626 QApplication.translate('ViewManager', 'Move left one word part'),
628 self.editorActGrp, 'vm_edit_move_left_word_part') 628 self.editorActGrp, 'vm_edit_move_left_word_part')
629 if not isMacPlatform(): 629 if not isMacPlatform():
630 act.setShortcut(QKeySequence( 630 act.setShortcut(QKeySequence(
631 QApplication.translate('ViewManager', 'Alt+Left'))) 631 QApplication.translate('ViewManager', 'Alt+Left')))
632 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT) 632 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT)
633 act.triggered[()].connect(self.esm.map) 633 act.triggered.connect(self.esm.map)
634 self.editActions.append(act) 634 self.editActions.append(act)
635 635
636 act = E5Action( 636 act = E5Action(
637 QApplication.translate('ViewManager', 'Move right one word part'), 637 QApplication.translate('ViewManager', 'Move right one word part'),
638 QApplication.translate('ViewManager', 'Move right one word part'), 638 QApplication.translate('ViewManager', 'Move right one word part'),
640 self.editorActGrp, 'vm_edit_move_right_word_part') 640 self.editorActGrp, 'vm_edit_move_right_word_part')
641 if not isMacPlatform(): 641 if not isMacPlatform():
642 act.setShortcut(QKeySequence( 642 act.setShortcut(QKeySequence(
643 QApplication.translate('ViewManager', 'Alt+Right'))) 643 QApplication.translate('ViewManager', 'Alt+Right')))
644 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT) 644 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT)
645 act.triggered[()].connect(self.esm.map) 645 act.triggered.connect(self.esm.map)
646 self.editActions.append(act) 646 self.editActions.append(act)
647 647
648 act = E5Action( 648 act = E5Action(
649 QApplication.translate('ViewManager', 'Move left one word'), 649 QApplication.translate('ViewManager', 'Move left one word'),
650 QApplication.translate('ViewManager', 'Move left one word'), 650 QApplication.translate('ViewManager', 'Move left one word'),
655 QApplication.translate('ViewManager', 'Alt+Left'))) 655 QApplication.translate('ViewManager', 'Alt+Left')))
656 else: 656 else:
657 act.setShortcut(QKeySequence( 657 act.setShortcut(QKeySequence(
658 QApplication.translate('ViewManager', 'Ctrl+Left'))) 658 QApplication.translate('ViewManager', 'Ctrl+Left')))
659 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT) 659 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT)
660 act.triggered[()].connect(self.esm.map) 660 act.triggered.connect(self.esm.map)
661 self.editActions.append(act) 661 self.editActions.append(act)
662 662
663 act = E5Action( 663 act = E5Action(
664 QApplication.translate('ViewManager', 'Move right one word'), 664 QApplication.translate('ViewManager', 'Move right one word'),
665 QApplication.translate('ViewManager', 'Move right one word'), 665 QApplication.translate('ViewManager', 'Move right one word'),
670 QApplication.translate('ViewManager', 'Alt+Right'))) 670 QApplication.translate('ViewManager', 'Alt+Right')))
671 else: 671 else:
672 act.setShortcut(QKeySequence( 672 act.setShortcut(QKeySequence(
673 QApplication.translate('ViewManager', 'Ctrl+Right'))) 673 QApplication.translate('ViewManager', 'Ctrl+Right')))
674 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT) 674 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT)
675 act.triggered[()].connect(self.esm.map) 675 act.triggered.connect(self.esm.map)
676 self.editActions.append(act) 676 self.editActions.append(act)
677 677
678 act = E5Action( 678 act = E5Action(
679 QApplication.translate( 679 QApplication.translate(
680 'ViewManager', 680 'ViewManager',
686 self.editorActGrp, 'vm_edit_move_first_visible_char') 686 self.editorActGrp, 'vm_edit_move_first_visible_char')
687 if not isMacPlatform(): 687 if not isMacPlatform():
688 act.setShortcut(QKeySequence( 688 act.setShortcut(QKeySequence(
689 QApplication.translate('ViewManager', 'Home'))) 689 QApplication.translate('ViewManager', 'Home')))
690 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME) 690 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME)
691 act.triggered[()].connect(self.esm.map) 691 act.triggered.connect(self.esm.map)
692 self.editActions.append(act) 692 self.editActions.append(act)
693 693
694 act = E5Action( 694 act = E5Action(
695 QApplication.translate( 695 QApplication.translate(
696 'ViewManager', 696 'ViewManager',
705 QApplication.translate('ViewManager', 'Ctrl+Left'))) 705 QApplication.translate('ViewManager', 'Ctrl+Left')))
706 else: 706 else:
707 act.setShortcut(QKeySequence( 707 act.setShortcut(QKeySequence(
708 QApplication.translate('ViewManager', 'Alt+Home'))) 708 QApplication.translate('ViewManager', 'Alt+Home')))
709 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAY) 709 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAY)
710 act.triggered[()].connect(self.esm.map) 710 act.triggered.connect(self.esm.map)
711 self.editActions.append(act) 711 self.editActions.append(act)
712 712
713 act = E5Action( 713 act = E5Action(
714 QApplication.translate( 714 QApplication.translate(
715 'ViewManager', 715 'ViewManager',
724 QApplication.translate('ViewManager', 'Meta+E'))) 724 QApplication.translate('ViewManager', 'Meta+E')))
725 else: 725 else:
726 act.setShortcut(QKeySequence( 726 act.setShortcut(QKeySequence(
727 QApplication.translate('ViewManager', 'End'))) 727 QApplication.translate('ViewManager', 'End')))
728 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND) 728 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND)
729 act.triggered[()].connect(self.esm.map) 729 act.triggered.connect(self.esm.map)
730 self.editActions.append(act) 730 self.editActions.append(act)
731 731
732 act = E5Action( 732 act = E5Action(
733 QApplication.translate('ViewManager', 'Scroll view down one line'), 733 QApplication.translate('ViewManager', 'Scroll view down one line'),
734 QApplication.translate('ViewManager', 'Scroll view down one line'), 734 QApplication.translate('ViewManager', 'Scroll view down one line'),
735 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Down')), 735 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Down')),
736 0, self.editorActGrp, 'vm_edit_scroll_down_line') 736 0, self.editorActGrp, 'vm_edit_scroll_down_line')
737 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN) 737 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN)
738 act.triggered[()].connect(self.esm.map) 738 act.triggered.connect(self.esm.map)
739 self.editActions.append(act) 739 self.editActions.append(act)
740 740
741 act = E5Action( 741 act = E5Action(
742 QApplication.translate('ViewManager', 'Scroll view up one line'), 742 QApplication.translate('ViewManager', 'Scroll view up one line'),
743 QApplication.translate('ViewManager', 'Scroll view up one line'), 743 QApplication.translate('ViewManager', 'Scroll view up one line'),
744 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Up')), 0, 744 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Up')), 0,
745 self.editorActGrp, 'vm_edit_scroll_up_line') 745 self.editorActGrp, 'vm_edit_scroll_up_line')
746 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP) 746 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP)
747 act.triggered[()].connect(self.esm.map) 747 act.triggered.connect(self.esm.map)
748 self.editActions.append(act) 748 self.editActions.append(act)
749 749
750 act = E5Action( 750 act = E5Action(
751 QApplication.translate('ViewManager', 'Move up one paragraph'), 751 QApplication.translate('ViewManager', 'Move up one paragraph'),
752 QApplication.translate('ViewManager', 'Move up one paragraph'), 752 QApplication.translate('ViewManager', 'Move up one paragraph'),
753 QKeySequence(QApplication.translate('ViewManager', 'Alt+Up')), 0, 753 QKeySequence(QApplication.translate('ViewManager', 'Alt+Up')), 0,
754 self.editorActGrp, 'vm_edit_move_up_para') 754 self.editorActGrp, 'vm_edit_move_up_para')
755 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP) 755 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP)
756 act.triggered[()].connect(self.esm.map) 756 act.triggered.connect(self.esm.map)
757 self.editActions.append(act) 757 self.editActions.append(act)
758 758
759 act = E5Action( 759 act = E5Action(
760 QApplication.translate('ViewManager', 'Move down one paragraph'), 760 QApplication.translate('ViewManager', 'Move down one paragraph'),
761 QApplication.translate('ViewManager', 'Move down one paragraph'), 761 QApplication.translate('ViewManager', 'Move down one paragraph'),
762 QKeySequence(QApplication.translate('ViewManager', 'Alt+Down')), 0, 762 QKeySequence(QApplication.translate('ViewManager', 'Alt+Down')), 0,
763 self.editorActGrp, 'vm_edit_move_down_para') 763 self.editorActGrp, 'vm_edit_move_down_para')
764 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN) 764 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN)
765 act.triggered[()].connect(self.esm.map) 765 act.triggered.connect(self.esm.map)
766 self.editActions.append(act) 766 self.editActions.append(act)
767 767
768 act = E5Action( 768 act = E5Action(
769 QApplication.translate('ViewManager', 'Move up one page'), 769 QApplication.translate('ViewManager', 'Move up one page'),
770 QApplication.translate('ViewManager', 'Move up one page'), 770 QApplication.translate('ViewManager', 'Move up one page'),
771 QKeySequence(QApplication.translate('ViewManager', 'PgUp')), 0, 771 QKeySequence(QApplication.translate('ViewManager', 'PgUp')), 0,
772 self.editorActGrp, 'vm_edit_move_up_page') 772 self.editorActGrp, 'vm_edit_move_up_page')
773 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP) 773 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP)
774 act.triggered[()].connect(self.esm.map) 774 act.triggered.connect(self.esm.map)
775 self.editActions.append(act) 775 self.editActions.append(act)
776 776
777 act = E5Action( 777 act = E5Action(
778 QApplication.translate('ViewManager', 'Move down one page'), 778 QApplication.translate('ViewManager', 'Move down one page'),
779 QApplication.translate('ViewManager', 'Move down one page'), 779 QApplication.translate('ViewManager', 'Move down one page'),
781 self.editorActGrp, 'vm_edit_move_down_page') 781 self.editorActGrp, 'vm_edit_move_down_page')
782 if isMacPlatform(): 782 if isMacPlatform():
783 act.setAlternateShortcut(QKeySequence( 783 act.setAlternateShortcut(QKeySequence(
784 QApplication.translate('ViewManager', 'Meta+V'))) 784 QApplication.translate('ViewManager', 'Meta+V')))
785 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN) 785 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN)
786 act.triggered[()].connect(self.esm.map) 786 act.triggered.connect(self.esm.map)
787 self.editActions.append(act) 787 self.editActions.append(act)
788 788
789 act = E5Action( 789 act = E5Action(
790 QApplication.translate('ViewManager', 'Move to start of document'), 790 QApplication.translate('ViewManager', 'Move to start of document'),
791 QApplication.translate('ViewManager', 'Move to start of document'), 791 QApplication.translate('ViewManager', 'Move to start of document'),
796 QApplication.translate('ViewManager', 'Ctrl+Up'))) 796 QApplication.translate('ViewManager', 'Ctrl+Up')))
797 else: 797 else:
798 act.setShortcut(QKeySequence( 798 act.setShortcut(QKeySequence(
799 QApplication.translate('ViewManager', 'Ctrl+Home'))) 799 QApplication.translate('ViewManager', 'Ctrl+Home')))
800 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART) 800 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART)
801 act.triggered[()].connect(self.esm.map) 801 act.triggered.connect(self.esm.map)
802 self.editActions.append(act) 802 self.editActions.append(act)
803 803
804 act = E5Action( 804 act = E5Action(
805 QApplication.translate('ViewManager', 'Move to end of document'), 805 QApplication.translate('ViewManager', 'Move to end of document'),
806 QApplication.translate('ViewManager', 'Move to end of document'), 806 QApplication.translate('ViewManager', 'Move to end of document'),
811 QApplication.translate('ViewManager', 'Ctrl+Down'))) 811 QApplication.translate('ViewManager', 'Ctrl+Down')))
812 else: 812 else:
813 act.setShortcut(QKeySequence( 813 act.setShortcut(QKeySequence(
814 QApplication.translate('ViewManager', 'Ctrl+End'))) 814 QApplication.translate('ViewManager', 'Ctrl+End')))
815 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND) 815 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND)
816 act.triggered[()].connect(self.esm.map) 816 act.triggered.connect(self.esm.map)
817 self.editActions.append(act) 817 self.editActions.append(act)
818 818
819 act = E5Action( 819 act = E5Action(
820 QApplication.translate('ViewManager', 'Indent one level'), 820 QApplication.translate('ViewManager', 'Indent one level'),
821 QApplication.translate('ViewManager', 'Indent one level'), 821 QApplication.translate('ViewManager', 'Indent one level'),
822 QKeySequence(QApplication.translate('ViewManager', 'Tab')), 0, 822 QKeySequence(QApplication.translate('ViewManager', 'Tab')), 0,
823 self.editorActGrp, 'vm_edit_indent_one_level') 823 self.editorActGrp, 'vm_edit_indent_one_level')
824 self.esm.setMapping(act, QsciScintilla.SCI_TAB) 824 self.esm.setMapping(act, QsciScintilla.SCI_TAB)
825 act.triggered[()].connect(self.esm.map) 825 act.triggered.connect(self.esm.map)
826 self.editActions.append(act) 826 self.editActions.append(act)
827 827
828 act = E5Action( 828 act = E5Action(
829 QApplication.translate('ViewManager', 'Unindent one level'), 829 QApplication.translate('ViewManager', 'Unindent one level'),
830 QApplication.translate('ViewManager', 'Unindent one level'), 830 QApplication.translate('ViewManager', 'Unindent one level'),
831 QKeySequence(QApplication.translate('ViewManager', 'Shift+Tab')), 831 QKeySequence(QApplication.translate('ViewManager', 'Shift+Tab')),
832 0, self.editorActGrp, 'vm_edit_unindent_one_level') 832 0, self.editorActGrp, 'vm_edit_unindent_one_level')
833 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB) 833 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB)
834 act.triggered[()].connect(self.esm.map) 834 act.triggered.connect(self.esm.map)
835 self.editActions.append(act) 835 self.editActions.append(act)
836 836
837 act = E5Action( 837 act = E5Action(
838 QApplication.translate( 838 QApplication.translate(
839 'ViewManager', 'Extend selection left one character'), 839 'ViewManager', 'Extend selection left one character'),
844 0, self.editorActGrp, 'vm_edit_extend_selection_left_char') 844 0, self.editorActGrp, 'vm_edit_extend_selection_left_char')
845 if isMacPlatform(): 845 if isMacPlatform():
846 act.setAlternateShortcut(QKeySequence( 846 act.setAlternateShortcut(QKeySequence(
847 QApplication.translate('ViewManager', 'Meta+Shift+B'))) 847 QApplication.translate('ViewManager', 'Meta+Shift+B')))
848 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND) 848 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND)
849 act.triggered[()].connect(self.esm.map) 849 act.triggered.connect(self.esm.map)
850 self.editActions.append(act) 850 self.editActions.append(act)
851 851
852 act = E5Action( 852 act = E5Action(
853 QApplication.translate( 853 QApplication.translate(
854 'ViewManager', 854 'ViewManager',
860 0, self.editorActGrp, 'vm_edit_extend_selection_right_char') 860 0, self.editorActGrp, 'vm_edit_extend_selection_right_char')
861 if isMacPlatform(): 861 if isMacPlatform():
862 act.setAlternateShortcut(QKeySequence( 862 act.setAlternateShortcut(QKeySequence(
863 QApplication.translate('ViewManager', 'Meta+Shift+F'))) 863 QApplication.translate('ViewManager', 'Meta+Shift+F')))
864 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND) 864 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND)
865 act.triggered[()].connect(self.esm.map) 865 act.triggered.connect(self.esm.map)
866 self.editActions.append(act) 866 self.editActions.append(act)
867 867
868 act = E5Action( 868 act = E5Action(
869 QApplication.translate( 869 QApplication.translate(
870 'ViewManager', 870 'ViewManager',
876 self.editorActGrp, 'vm_edit_extend_selection_up_line') 876 self.editorActGrp, 'vm_edit_extend_selection_up_line')
877 if isMacPlatform(): 877 if isMacPlatform():
878 act.setAlternateShortcut(QKeySequence( 878 act.setAlternateShortcut(QKeySequence(
879 QApplication.translate('ViewManager', 'Meta+Shift+P'))) 879 QApplication.translate('ViewManager', 'Meta+Shift+P')))
880 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND) 880 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND)
881 act.triggered[()].connect(self.esm.map) 881 act.triggered.connect(self.esm.map)
882 self.editActions.append(act) 882 self.editActions.append(act)
883 883
884 act = E5Action( 884 act = E5Action(
885 QApplication.translate( 885 QApplication.translate(
886 'ViewManager', 886 'ViewManager',
892 0, self.editorActGrp, 'vm_edit_extend_selection_down_line') 892 0, self.editorActGrp, 'vm_edit_extend_selection_down_line')
893 if isMacPlatform(): 893 if isMacPlatform():
894 act.setAlternateShortcut(QKeySequence( 894 act.setAlternateShortcut(QKeySequence(
895 QApplication.translate('ViewManager', 'Meta+Shift+N'))) 895 QApplication.translate('ViewManager', 'Meta+Shift+N')))
896 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND) 896 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND)
897 act.triggered[()].connect(self.esm.map) 897 act.triggered.connect(self.esm.map)
898 self.editActions.append(act) 898 self.editActions.append(act)
899 899
900 act = E5Action( 900 act = E5Action(
901 QApplication.translate( 901 QApplication.translate(
902 'ViewManager', 902 'ViewManager',
908 self.editorActGrp, 'vm_edit_extend_selection_left_word_part') 908 self.editorActGrp, 'vm_edit_extend_selection_left_word_part')
909 if not isMacPlatform(): 909 if not isMacPlatform():
910 act.setShortcut(QKeySequence( 910 act.setShortcut(QKeySequence(
911 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) 911 QApplication.translate('ViewManager', 'Alt+Shift+Left')))
912 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND) 912 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND)
913 act.triggered[()].connect(self.esm.map) 913 act.triggered.connect(self.esm.map)
914 self.editActions.append(act) 914 self.editActions.append(act)
915 915
916 act = E5Action( 916 act = E5Action(
917 QApplication.translate( 917 QApplication.translate(
918 'ViewManager', 918 'ViewManager',
924 self.editorActGrp, 'vm_edit_extend_selection_right_word_part') 924 self.editorActGrp, 'vm_edit_extend_selection_right_word_part')
925 if not isMacPlatform(): 925 if not isMacPlatform():
926 act.setShortcut(QKeySequence( 926 act.setShortcut(QKeySequence(
927 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) 927 QApplication.translate('ViewManager', 'Alt+Shift+Right')))
928 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND) 928 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND)
929 act.triggered[()].connect(self.esm.map) 929 act.triggered.connect(self.esm.map)
930 self.editActions.append(act) 930 self.editActions.append(act)
931 931
932 act = E5Action( 932 act = E5Action(
933 QApplication.translate( 933 QApplication.translate(
934 'ViewManager', 'Extend selection left one word'), 934 'ViewManager', 'Extend selection left one word'),
941 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) 941 QApplication.translate('ViewManager', 'Alt+Shift+Left')))
942 else: 942 else:
943 act.setShortcut(QKeySequence( 943 act.setShortcut(QKeySequence(
944 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) 944 QApplication.translate('ViewManager', 'Ctrl+Shift+Left')))
945 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND) 945 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND)
946 act.triggered[()].connect(self.esm.map) 946 act.triggered.connect(self.esm.map)
947 self.editActions.append(act) 947 self.editActions.append(act)
948 948
949 act = E5Action( 949 act = E5Action(
950 QApplication.translate( 950 QApplication.translate(
951 'ViewManager', 'Extend selection right one word'), 951 'ViewManager', 'Extend selection right one word'),
958 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) 958 QApplication.translate('ViewManager', 'Alt+Shift+Right')))
959 else: 959 else:
960 act.setShortcut(QKeySequence( 960 act.setShortcut(QKeySequence(
961 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) 961 QApplication.translate('ViewManager', 'Ctrl+Shift+Right')))
962 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND) 962 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND)
963 act.triggered[()].connect(self.esm.map) 963 act.triggered.connect(self.esm.map)
964 self.editActions.append(act) 964 self.editActions.append(act)
965 965
966 act = E5Action( 966 act = E5Action(
967 QApplication.translate( 967 QApplication.translate(
968 'ViewManager', 968 'ViewManager',
976 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char') 976 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char')
977 if not isMacPlatform(): 977 if not isMacPlatform():
978 act.setShortcut(QKeySequence( 978 act.setShortcut(QKeySequence(
979 QApplication.translate('ViewManager', 'Shift+Home'))) 979 QApplication.translate('ViewManager', 'Shift+Home')))
980 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND) 980 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND)
981 act.triggered[()].connect(self.esm.map) 981 act.triggered.connect(self.esm.map)
982 self.editActions.append(act) 982 self.editActions.append(act)
983 983
984 act = E5Action( 984 act = E5Action(
985 QApplication.translate( 985 QApplication.translate(
986 'ViewManager', 'Extend selection to end of document line'), 986 'ViewManager', 'Extend selection to end of document line'),
993 QApplication.translate('ViewManager', 'Meta+Shift+E'))) 993 QApplication.translate('ViewManager', 'Meta+Shift+E')))
994 else: 994 else:
995 act.setShortcut(QKeySequence( 995 act.setShortcut(QKeySequence(
996 QApplication.translate('ViewManager', 'Shift+End'))) 996 QApplication.translate('ViewManager', 'Shift+End')))
997 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND) 997 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND)
998 act.triggered[()].connect(self.esm.map) 998 act.triggered.connect(self.esm.map)
999 self.editActions.append(act) 999 self.editActions.append(act)
1000 1000
1001 act = E5Action( 1001 act = E5Action(
1002 QApplication.translate( 1002 QApplication.translate(
1003 'ViewManager', 1003 'ViewManager',
1007 'Extend selection up one paragraph'), 1007 'Extend selection up one paragraph'),
1008 QKeySequence(QApplication.translate('ViewManager', 1008 QKeySequence(QApplication.translate('ViewManager',
1009 'Alt+Shift+Up')), 1009 'Alt+Shift+Up')),
1010 0, self.editorActGrp, 'vm_edit_extend_selection_up_para') 1010 0, self.editorActGrp, 'vm_edit_extend_selection_up_para')
1011 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND) 1011 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND)
1012 act.triggered[()].connect(self.esm.map) 1012 act.triggered.connect(self.esm.map)
1013 self.editActions.append(act) 1013 self.editActions.append(act)
1014 1014
1015 act = E5Action( 1015 act = E5Action(
1016 QApplication.translate( 1016 QApplication.translate(
1017 'ViewManager', 'Extend selection down one paragraph'), 1017 'ViewManager', 'Extend selection down one paragraph'),
1020 QKeySequence(QApplication.translate('ViewManager', 1020 QKeySequence(QApplication.translate('ViewManager',
1021 'Alt+Shift+Down')), 1021 'Alt+Shift+Down')),
1022 0, 1022 0,
1023 self.editorActGrp, 'vm_edit_extend_selection_down_para') 1023 self.editorActGrp, 'vm_edit_extend_selection_down_para')
1024 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND) 1024 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND)
1025 act.triggered[()].connect(self.esm.map) 1025 act.triggered.connect(self.esm.map)
1026 self.editActions.append(act) 1026 self.editActions.append(act)
1027 1027
1028 act = E5Action( 1028 act = E5Action(
1029 QApplication.translate( 1029 QApplication.translate(
1030 'ViewManager', 1030 'ViewManager',
1033 'ViewManager', 1033 'ViewManager',
1034 'Extend selection up one page'), 1034 'Extend selection up one page'),
1035 QKeySequence(QApplication.translate('ViewManager', 'Shift+PgUp')), 1035 QKeySequence(QApplication.translate('ViewManager', 'Shift+PgUp')),
1036 0, self.editorActGrp, 'vm_edit_extend_selection_up_page') 1036 0, self.editorActGrp, 'vm_edit_extend_selection_up_page')
1037 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND) 1037 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND)
1038 act.triggered[()].connect(self.esm.map) 1038 act.triggered.connect(self.esm.map)
1039 self.editActions.append(act) 1039 self.editActions.append(act)
1040 1040
1041 act = E5Action( 1041 act = E5Action(
1042 QApplication.translate( 1042 QApplication.translate(
1043 'ViewManager', 1043 'ViewManager',
1050 0, self.editorActGrp, 'vm_edit_extend_selection_down_page') 1050 0, self.editorActGrp, 'vm_edit_extend_selection_down_page')
1051 if isMacPlatform(): 1051 if isMacPlatform():
1052 act.setAlternateShortcut(QKeySequence( 1052 act.setAlternateShortcut(QKeySequence(
1053 QApplication.translate('ViewManager', 'Meta+Shift+V'))) 1053 QApplication.translate('ViewManager', 'Meta+Shift+V')))
1054 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND) 1054 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND)
1055 act.triggered[()].connect(self.esm.map) 1055 act.triggered.connect(self.esm.map)
1056 self.editActions.append(act) 1056 self.editActions.append(act)
1057 1057
1058 act = E5Action( 1058 act = E5Action(
1059 QApplication.translate( 1059 QApplication.translate(
1060 'ViewManager', 'Extend selection to start of document'), 1060 'ViewManager', 'Extend selection to start of document'),
1067 QApplication.translate('ViewManager', 'Ctrl+Shift+Up'))) 1067 QApplication.translate('ViewManager', 'Ctrl+Shift+Up')))
1068 else: 1068 else:
1069 act.setShortcut(QKeySequence( 1069 act.setShortcut(QKeySequence(
1070 QApplication.translate('ViewManager', 'Ctrl+Shift+Home'))) 1070 QApplication.translate('ViewManager', 'Ctrl+Shift+Home')))
1071 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTARTEXTEND) 1071 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTARTEXTEND)
1072 act.triggered[()].connect(self.esm.map) 1072 act.triggered.connect(self.esm.map)
1073 self.editActions.append(act) 1073 self.editActions.append(act)
1074 1074
1075 act = E5Action( 1075 act = E5Action(
1076 QApplication.translate( 1076 QApplication.translate(
1077 'ViewManager', 'Extend selection to end of document'), 1077 'ViewManager', 'Extend selection to end of document'),
1084 QApplication.translate('ViewManager', 'Ctrl+Shift+Down'))) 1084 QApplication.translate('ViewManager', 'Ctrl+Shift+Down')))
1085 else: 1085 else:
1086 act.setShortcut(QKeySequence( 1086 act.setShortcut(QKeySequence(
1087 QApplication.translate('ViewManager', 'Ctrl+Shift+End'))) 1087 QApplication.translate('ViewManager', 'Ctrl+Shift+End')))
1088 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND) 1088 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND)
1089 act.triggered[()].connect(self.esm.map) 1089 act.triggered.connect(self.esm.map)
1090 self.editActions.append(act) 1090 self.editActions.append(act)
1091 1091
1092 act = E5Action( 1092 act = E5Action(
1093 QApplication.translate( 1093 QApplication.translate(
1094 'ViewManager', 1094 'ViewManager',
1101 QApplication.translate('ViewManager', 'Meta+H'))) 1101 QApplication.translate('ViewManager', 'Meta+H')))
1102 else: 1102 else:
1103 act.setAlternateShortcut(QKeySequence( 1103 act.setAlternateShortcut(QKeySequence(
1104 QApplication.translate('ViewManager', 'Shift+Backspace'))) 1104 QApplication.translate('ViewManager', 'Shift+Backspace')))
1105 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK) 1105 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK)
1106 act.triggered[()].connect(self.esm.map) 1106 act.triggered.connect(self.esm.map)
1107 self.editActions.append(act) 1107 self.editActions.append(act)
1108 1108
1109 act = E5Action( 1109 act = E5Action(
1110 QApplication.translate( 1110 QApplication.translate(
1111 'ViewManager', 1111 'ViewManager',
1114 'ViewManager', 1114 'ViewManager',
1115 'Delete previous character if not at start of line'), 1115 'Delete previous character if not at start of line'),
1116 0, 0, 1116 0, 0,
1117 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start') 1117 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start')
1118 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE) 1118 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE)
1119 act.triggered[()].connect(self.esm.map) 1119 act.triggered.connect(self.esm.map)
1120 self.editActions.append(act) 1120 self.editActions.append(act)
1121 1121
1122 act = E5Action( 1122 act = E5Action(
1123 QApplication.translate('ViewManager', 'Delete current character'), 1123 QApplication.translate('ViewManager', 'Delete current character'),
1124 QApplication.translate('ViewManager', 'Delete current character'), 1124 QApplication.translate('ViewManager', 'Delete current character'),
1126 self.editorActGrp, 'vm_edit_delete_current_char') 1126 self.editorActGrp, 'vm_edit_delete_current_char')
1127 if isMacPlatform(): 1127 if isMacPlatform():
1128 act.setAlternateShortcut(QKeySequence( 1128 act.setAlternateShortcut(QKeySequence(
1129 QApplication.translate('ViewManager', 'Meta+D'))) 1129 QApplication.translate('ViewManager', 'Meta+D')))
1130 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR) 1130 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR)
1131 act.triggered[()].connect(self.esm.map) 1131 act.triggered.connect(self.esm.map)
1132 self.editActions.append(act) 1132 self.editActions.append(act)
1133 1133
1134 act = E5Action( 1134 act = E5Action(
1135 QApplication.translate('ViewManager', 'Delete word to left'), 1135 QApplication.translate('ViewManager', 'Delete word to left'),
1136 QApplication.translate('ViewManager', 'Delete word to left'), 1136 QApplication.translate('ViewManager', 'Delete word to left'),
1137 QKeySequence(QApplication.translate('ViewManager', 1137 QKeySequence(QApplication.translate('ViewManager',
1138 'Ctrl+Backspace')), 1138 'Ctrl+Backspace')),
1139 0, self.editorActGrp, 'vm_edit_delete_word_left') 1139 0, self.editorActGrp, 'vm_edit_delete_word_left')
1140 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT) 1140 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT)
1141 act.triggered[()].connect(self.esm.map) 1141 act.triggered.connect(self.esm.map)
1142 self.editActions.append(act) 1142 self.editActions.append(act)
1143 1143
1144 act = E5Action( 1144 act = E5Action(
1145 QApplication.translate('ViewManager', 'Delete word to right'), 1145 QApplication.translate('ViewManager', 'Delete word to right'),
1146 QApplication.translate('ViewManager', 'Delete word to right'), 1146 QApplication.translate('ViewManager', 'Delete word to right'),
1147 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Del')), 0, 1147 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Del')), 0,
1148 self.editorActGrp, 'vm_edit_delete_word_right') 1148 self.editorActGrp, 'vm_edit_delete_word_right')
1149 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT) 1149 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT)
1150 act.triggered[()].connect(self.esm.map) 1150 act.triggered.connect(self.esm.map)
1151 self.editActions.append(act) 1151 self.editActions.append(act)
1152 1152
1153 act = E5Action( 1153 act = E5Action(
1154 QApplication.translate('ViewManager', 'Delete line to left'), 1154 QApplication.translate('ViewManager', 'Delete line to left'),
1155 QApplication.translate('ViewManager', 'Delete line to left'), 1155 QApplication.translate('ViewManager', 'Delete line to left'),
1156 QKeySequence(QApplication.translate('ViewManager', 1156 QKeySequence(QApplication.translate('ViewManager',
1157 'Ctrl+Shift+Backspace')), 1157 'Ctrl+Shift+Backspace')),
1158 0, self.editorActGrp, 'vm_edit_delete_line_left') 1158 0, self.editorActGrp, 'vm_edit_delete_line_left')
1159 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT) 1159 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT)
1160 act.triggered[()].connect(self.esm.map) 1160 act.triggered.connect(self.esm.map)
1161 self.editActions.append(act) 1161 self.editActions.append(act)
1162 1162
1163 act = E5Action( 1163 act = E5Action(
1164 QApplication.translate('ViewManager', 'Delete line to right'), 1164 QApplication.translate('ViewManager', 'Delete line to right'),
1165 QApplication.translate('ViewManager', 'Delete line to right'), 1165 QApplication.translate('ViewManager', 'Delete line to right'),
1170 QApplication.translate('ViewManager', 'Meta+K'))) 1170 QApplication.translate('ViewManager', 'Meta+K')))
1171 else: 1171 else:
1172 act.setShortcut(QKeySequence( 1172 act.setShortcut(QKeySequence(
1173 QApplication.translate('ViewManager', 'Ctrl+Shift+Del'))) 1173 QApplication.translate('ViewManager', 'Ctrl+Shift+Del')))
1174 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT) 1174 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT)
1175 act.triggered[()].connect(self.esm.map) 1175 act.triggered.connect(self.esm.map)
1176 self.editActions.append(act) 1176 self.editActions.append(act)
1177 1177
1178 act = E5Action( 1178 act = E5Action(
1179 QApplication.translate('ViewManager', 'Insert new line'), 1179 QApplication.translate('ViewManager', 'Insert new line'),
1180 QApplication.translate('ViewManager', 'Insert new line'), 1180 QApplication.translate('ViewManager', 'Insert new line'),
1181 QKeySequence(QApplication.translate('ViewManager', 'Return')), 1181 QKeySequence(QApplication.translate('ViewManager', 'Return')),
1182 QKeySequence(QApplication.translate('ViewManager', 'Enter')), 1182 QKeySequence(QApplication.translate('ViewManager', 'Enter')),
1183 self.editorActGrp, 'vm_edit_insert_line') 1183 self.editorActGrp, 'vm_edit_insert_line')
1184 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE) 1184 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE)
1185 act.triggered[()].connect(self.esm.map) 1185 act.triggered.connect(self.esm.map)
1186 self.editActions.append(act) 1186 self.editActions.append(act)
1187 1187
1188 act = E5Action( 1188 act = E5Action(
1189 QApplication.translate('ViewManager', 'Delete current line'), 1189 QApplication.translate('ViewManager', 'Delete current line'),
1190 QApplication.translate('ViewManager', 'Delete current line'), 1190 QApplication.translate('ViewManager', 'Delete current line'),
1191 QKeySequence(QApplication.translate('ViewManager', 1191 QKeySequence(QApplication.translate('ViewManager',
1192 'Ctrl+Shift+L')), 1192 'Ctrl+Shift+L')),
1193 0, self.editorActGrp, 'vm_edit_delete_current_line') 1193 0, self.editorActGrp, 'vm_edit_delete_current_line')
1194 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE) 1194 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE)
1195 act.triggered[()].connect(self.esm.map) 1195 act.triggered.connect(self.esm.map)
1196 self.editActions.append(act) 1196 self.editActions.append(act)
1197 1197
1198 act = E5Action( 1198 act = E5Action(
1199 QApplication.translate('ViewManager', 'Duplicate current line'), 1199 QApplication.translate('ViewManager', 'Duplicate current line'),
1200 QApplication.translate('ViewManager', 'Duplicate current line'), 1200 QApplication.translate('ViewManager', 'Duplicate current line'),
1201 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+D')), 0, 1201 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+D')), 0,
1202 self.editorActGrp, 'vm_edit_duplicate_current_line') 1202 self.editorActGrp, 'vm_edit_duplicate_current_line')
1203 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE) 1203 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE)
1204 act.triggered[()].connect(self.esm.map) 1204 act.triggered.connect(self.esm.map)
1205 self.editActions.append(act) 1205 self.editActions.append(act)
1206 1206
1207 act = E5Action( 1207 act = E5Action(
1208 QApplication.translate( 1208 QApplication.translate(
1209 'ViewManager', 1209 'ViewManager',
1212 'ViewManager', 1212 'ViewManager',
1213 'Swap current and previous lines'), 1213 'Swap current and previous lines'),
1214 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+T')), 0, 1214 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+T')), 0,
1215 self.editorActGrp, 'vm_edit_swap_current_previous_line') 1215 self.editorActGrp, 'vm_edit_swap_current_previous_line')
1216 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE) 1216 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE)
1217 act.triggered[()].connect(self.esm.map) 1217 act.triggered.connect(self.esm.map)
1218 self.editActions.append(act) 1218 self.editActions.append(act)
1219 1219
1220 act = E5Action( 1220 act = E5Action(
1221 QApplication.translate('ViewManager', 'Cut current line'), 1221 QApplication.translate('ViewManager', 'Cut current line'),
1222 QApplication.translate('ViewManager', 'Cut current line'), 1222 QApplication.translate('ViewManager', 'Cut current line'),
1223 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+L')), 1223 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+L')),
1224 0, self.editorActGrp, 'vm_edit_cut_current_line') 1224 0, self.editorActGrp, 'vm_edit_cut_current_line')
1225 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT) 1225 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT)
1226 act.triggered[()].connect(self.esm.map) 1226 act.triggered.connect(self.esm.map)
1227 self.editActions.append(act) 1227 self.editActions.append(act)
1228 1228
1229 act = E5Action( 1229 act = E5Action(
1230 QApplication.translate('ViewManager', 'Copy current line'), 1230 QApplication.translate('ViewManager', 'Copy current line'),
1231 QApplication.translate('ViewManager', 'Copy current line'), 1231 QApplication.translate('ViewManager', 'Copy current line'),
1232 QKeySequence(QApplication.translate('ViewManager', 1232 QKeySequence(QApplication.translate('ViewManager',
1233 'Ctrl+Shift+T')), 1233 'Ctrl+Shift+T')),
1234 0, self.editorActGrp, 'vm_edit_copy_current_line') 1234 0, self.editorActGrp, 'vm_edit_copy_current_line')
1235 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY) 1235 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY)
1236 act.triggered[()].connect(self.esm.map) 1236 act.triggered.connect(self.esm.map)
1237 self.editActions.append(act) 1237 self.editActions.append(act)
1238 1238
1239 act = E5Action( 1239 act = E5Action(
1240 QApplication.translate('ViewManager', 'Toggle insert/overtype'), 1240 QApplication.translate('ViewManager', 'Toggle insert/overtype'),
1241 QApplication.translate('ViewManager', 'Toggle insert/overtype'), 1241 QApplication.translate('ViewManager', 'Toggle insert/overtype'),
1242 QKeySequence(QApplication.translate('ViewManager', 'Ins')), 0, 1242 QKeySequence(QApplication.translate('ViewManager', 'Ins')), 0,
1243 self.editorActGrp, 'vm_edit_toggle_insert_overtype') 1243 self.editorActGrp, 'vm_edit_toggle_insert_overtype')
1244 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE) 1244 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE)
1245 act.triggered[()].connect(self.esm.map) 1245 act.triggered.connect(self.esm.map)
1246 self.editActions.append(act) 1246 self.editActions.append(act)
1247 1247
1248 act = E5Action( 1248 act = E5Action(
1249 QApplication.translate( 1249 QApplication.translate(
1250 'ViewManager', 1250 'ViewManager',
1253 'ViewManager', 1253 'ViewManager',
1254 'Convert selection to lower case'), 1254 'Convert selection to lower case'),
1255 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')), 1255 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')),
1256 0, self.editorActGrp, 'vm_edit_convert_selection_lower') 1256 0, self.editorActGrp, 'vm_edit_convert_selection_lower')
1257 self.esm.setMapping(act, QsciScintilla.SCI_LOWERCASE) 1257 self.esm.setMapping(act, QsciScintilla.SCI_LOWERCASE)
1258 act.triggered[()].connect(self.esm.map) 1258 act.triggered.connect(self.esm.map)
1259 self.editActions.append(act) 1259 self.editActions.append(act)
1260 1260
1261 act = E5Action( 1261 act = E5Action(
1262 QApplication.translate( 1262 QApplication.translate(
1263 'ViewManager', 1263 'ViewManager',
1267 'Convert selection to upper case'), 1267 'Convert selection to upper case'),
1268 QKeySequence(QApplication.translate('ViewManager', 1268 QKeySequence(QApplication.translate('ViewManager',
1269 'Ctrl+Shift+U')), 1269 'Ctrl+Shift+U')),
1270 0, self.editorActGrp, 'vm_edit_convert_selection_upper') 1270 0, self.editorActGrp, 'vm_edit_convert_selection_upper')
1271 self.esm.setMapping(act, QsciScintilla.SCI_UPPERCASE) 1271 self.esm.setMapping(act, QsciScintilla.SCI_UPPERCASE)
1272 act.triggered[()].connect(self.esm.map) 1272 act.triggered.connect(self.esm.map)
1273 self.editActions.append(act) 1273 self.editActions.append(act)
1274 1274
1275 act = E5Action( 1275 act = E5Action(
1276 QApplication.translate( 1276 QApplication.translate(
1277 'ViewManager', 'Move to end of display line'), 1277 'ViewManager', 'Move to end of display line'),
1284 QApplication.translate('ViewManager', 'Ctrl+Right'))) 1284 QApplication.translate('ViewManager', 'Ctrl+Right')))
1285 else: 1285 else:
1286 act.setShortcut(QKeySequence( 1286 act.setShortcut(QKeySequence(
1287 QApplication.translate('ViewManager', 'Alt+End'))) 1287 QApplication.translate('ViewManager', 'Alt+End')))
1288 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY) 1288 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY)
1289 act.triggered[()].connect(self.esm.map) 1289 act.triggered.connect(self.esm.map)
1290 self.editActions.append(act) 1290 self.editActions.append(act)
1291 1291
1292 act = E5Action( 1292 act = E5Action(
1293 QApplication.translate( 1293 QApplication.translate(
1294 'ViewManager', 1294 'ViewManager',
1300 self.editorActGrp, 'vm_edit_extend_selection_end_displayed_line') 1300 self.editorActGrp, 'vm_edit_extend_selection_end_displayed_line')
1301 if isMacPlatform(): 1301 if isMacPlatform():
1302 act.setShortcut(QKeySequence( 1302 act.setShortcut(QKeySequence(
1303 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) 1303 QApplication.translate('ViewManager', 'Ctrl+Shift+Right')))
1304 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND) 1304 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND)
1305 act.triggered[()].connect(self.esm.map) 1305 act.triggered.connect(self.esm.map)
1306 self.editActions.append(act) 1306 self.editActions.append(act)
1307 1307
1308 act = E5Action( 1308 act = E5Action(
1309 QApplication.translate('ViewManager', 'Formfeed'), 1309 QApplication.translate('ViewManager', 'Formfeed'),
1310 QApplication.translate('ViewManager', 'Formfeed'), 1310 QApplication.translate('ViewManager', 'Formfeed'),
1311 0, 0, 1311 0, 0,
1312 self.editorActGrp, 'vm_edit_formfeed') 1312 self.editorActGrp, 'vm_edit_formfeed')
1313 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) 1313 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED)
1314 act.triggered[()].connect(self.esm.map) 1314 act.triggered.connect(self.esm.map)
1315 self.editActions.append(act) 1315 self.editActions.append(act)
1316 1316
1317 act = E5Action( 1317 act = E5Action(
1318 QApplication.translate('ViewManager', 'Escape'), 1318 QApplication.translate('ViewManager', 'Escape'),
1319 QApplication.translate('ViewManager', 'Escape'), 1319 QApplication.translate('ViewManager', 'Escape'),
1320 QKeySequence(QApplication.translate('ViewManager', 'Esc')), 0, 1320 QKeySequence(QApplication.translate('ViewManager', 'Esc')), 0,
1321 self.editorActGrp, 'vm_edit_escape') 1321 self.editorActGrp, 'vm_edit_escape')
1322 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL) 1322 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL)
1323 act.triggered[()].connect(self.esm.map) 1323 act.triggered.connect(self.esm.map)
1324 self.editActions.append(act) 1324 self.editActions.append(act)
1325 1325
1326 act = E5Action( 1326 act = E5Action(
1327 QApplication.translate( 1327 QApplication.translate(
1328 'ViewManager', 1328 'ViewManager',
1335 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_line') 1335 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_line')
1336 if isMacPlatform(): 1336 if isMacPlatform():
1337 act.setAlternateShortcut(QKeySequence( 1337 act.setAlternateShortcut(QKeySequence(
1338 QApplication.translate('ViewManager', 'Meta+Alt+Shift+N'))) 1338 QApplication.translate('ViewManager', 'Meta+Alt+Shift+N')))
1339 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND) 1339 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND)
1340 act.triggered[()].connect(self.esm.map) 1340 act.triggered.connect(self.esm.map)
1341 self.editActions.append(act) 1341 self.editActions.append(act)
1342 1342
1343 act = E5Action( 1343 act = E5Action(
1344 QApplication.translate( 1344 QApplication.translate(
1345 'ViewManager', 1345 'ViewManager',
1351 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_line') 1351 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_line')
1352 if isMacPlatform(): 1352 if isMacPlatform():
1353 act.setAlternateShortcut(QKeySequence( 1353 act.setAlternateShortcut(QKeySequence(
1354 QApplication.translate('ViewManager', 'Meta+Alt+Shift+P'))) 1354 QApplication.translate('ViewManager', 'Meta+Alt+Shift+P')))
1355 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND) 1355 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND)
1356 act.triggered[()].connect(self.esm.map) 1356 act.triggered.connect(self.esm.map)
1357 self.editActions.append(act) 1357 self.editActions.append(act)
1358 1358
1359 act = E5Action( 1359 act = E5Action(
1360 QApplication.translate( 1360 QApplication.translate(
1361 'ViewManager', 1361 'ViewManager',
1368 0, self.editorActGrp, 'vm_edit_extend_rect_selection_left_char') 1368 0, self.editorActGrp, 'vm_edit_extend_rect_selection_left_char')
1369 if isMacPlatform(): 1369 if isMacPlatform():
1370 act.setAlternateShortcut(QKeySequence( 1370 act.setAlternateShortcut(QKeySequence(
1371 QApplication.translate('ViewManager', 'Meta+Alt+Shift+B'))) 1371 QApplication.translate('ViewManager', 'Meta+Alt+Shift+B')))
1372 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND) 1372 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND)
1373 act.triggered[()].connect(self.esm.map) 1373 act.triggered.connect(self.esm.map)
1374 self.editActions.append(act) 1374 self.editActions.append(act)
1375 1375
1376 act = E5Action( 1376 act = E5Action(
1377 QApplication.translate( 1377 QApplication.translate(
1378 'ViewManager', 1378 'ViewManager',
1385 0, self.editorActGrp, 'vm_edit_extend_rect_selection_right_char') 1385 0, self.editorActGrp, 'vm_edit_extend_rect_selection_right_char')
1386 if isMacPlatform(): 1386 if isMacPlatform():
1387 act.setAlternateShortcut(QKeySequence( 1387 act.setAlternateShortcut(QKeySequence(
1388 QApplication.translate('ViewManager', 'Meta+Alt+Shift+F'))) 1388 QApplication.translate('ViewManager', 'Meta+Alt+Shift+F')))
1389 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND) 1389 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND)
1390 act.triggered[()].connect(self.esm.map) 1390 act.triggered.connect(self.esm.map)
1391 self.editActions.append(act) 1391 self.editActions.append(act)
1392 1392
1393 act = E5Action( 1393 act = E5Action(
1394 QApplication.translate( 1394 QApplication.translate(
1395 'ViewManager', 1395 'ViewManager',
1404 'vm_edit_extend_rect_selection_first_visible_char') 1404 'vm_edit_extend_rect_selection_first_visible_char')
1405 if not isMacPlatform(): 1405 if not isMacPlatform():
1406 act.setShortcut(QKeySequence( 1406 act.setShortcut(QKeySequence(
1407 QApplication.translate('ViewManager', 'Alt+Shift+Home'))) 1407 QApplication.translate('ViewManager', 'Alt+Shift+Home')))
1408 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND) 1408 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND)
1409 act.triggered[()].connect(self.esm.map) 1409 act.triggered.connect(self.esm.map)
1410 self.editActions.append(act) 1410 self.editActions.append(act)
1411 1411
1412 act = E5Action( 1412 act = E5Action(
1413 QApplication.translate( 1413 QApplication.translate(
1414 'ViewManager', 1414 'ViewManager',
1423 QApplication.translate('ViewManager', 'Meta+Alt+Shift+E'))) 1423 QApplication.translate('ViewManager', 'Meta+Alt+Shift+E')))
1424 else: 1424 else:
1425 act.setShortcut(QKeySequence( 1425 act.setShortcut(QKeySequence(
1426 QApplication.translate('ViewManager', 'Alt+Shift+End'))) 1426 QApplication.translate('ViewManager', 'Alt+Shift+End')))
1427 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND) 1427 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND)
1428 act.triggered[()].connect(self.esm.map) 1428 act.triggered.connect(self.esm.map)
1429 self.editActions.append(act) 1429 self.editActions.append(act)
1430 1430
1431 act = E5Action( 1431 act = E5Action(
1432 QApplication.translate( 1432 QApplication.translate(
1433 'ViewManager', 1433 'ViewManager',
1437 'Extend rectangular selection up one page'), 1437 'Extend rectangular selection up one page'),
1438 QKeySequence(QApplication.translate('ViewManager', 1438 QKeySequence(QApplication.translate('ViewManager',
1439 'Alt+Shift+PgUp')), 1439 'Alt+Shift+PgUp')),
1440 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_page') 1440 0, self.editorActGrp, 'vm_edit_extend_rect_selection_up_page')
1441 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND) 1441 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND)
1442 act.triggered[()].connect(self.esm.map) 1442 act.triggered.connect(self.esm.map)
1443 self.editActions.append(act) 1443 self.editActions.append(act)
1444 1444
1445 act = E5Action( 1445 act = E5Action(
1446 QApplication.translate( 1446 QApplication.translate(
1447 'ViewManager', 1447 'ViewManager',
1454 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_page') 1454 0, self.editorActGrp, 'vm_edit_extend_rect_selection_down_page')
1455 if isMacPlatform(): 1455 if isMacPlatform():
1456 act.setAlternateShortcut(QKeySequence( 1456 act.setAlternateShortcut(QKeySequence(
1457 QApplication.translate('ViewManager', 'Meta+Alt+Shift+V'))) 1457 QApplication.translate('ViewManager', 'Meta+Alt+Shift+V')))
1458 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND) 1458 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND)
1459 act.triggered[()].connect(self.esm.map) 1459 act.triggered.connect(self.esm.map)
1460 self.editActions.append(act) 1460 self.editActions.append(act)
1461 1461
1462 act = E5Action( 1462 act = E5Action(
1463 QApplication.translate( 1463 QApplication.translate(
1464 'ViewManager', 1464 'ViewManager',
1468 'Duplicate current selection'), 1468 'Duplicate current selection'),
1469 QKeySequence(QApplication.translate('ViewManager', 1469 QKeySequence(QApplication.translate('ViewManager',
1470 'Ctrl+Shift+D')), 1470 'Ctrl+Shift+D')),
1471 0, self.editorActGrp, 'vm_edit_duplicate_current_selection') 1471 0, self.editorActGrp, 'vm_edit_duplicate_current_selection')
1472 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) 1472 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE)
1473 act.triggered[()].connect(self.esm.map) 1473 act.triggered.connect(self.esm.map)
1474 self.editActions.append(act) 1474 self.editActions.append(act)
1475 1475
1476 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"): 1476 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"):
1477 act = E5Action( 1477 act = E5Action(
1478 QApplication.translate( 1478 QApplication.translate(
1483 self.editorActGrp, 'vm_edit_scroll_start_text') 1483 self.editorActGrp, 'vm_edit_scroll_start_text')
1484 if isMacPlatform(): 1484 if isMacPlatform():
1485 act.setShortcut(QKeySequence( 1485 act.setShortcut(QKeySequence(
1486 QApplication.translate('ViewManager', 'Home'))) 1486 QApplication.translate('ViewManager', 'Home')))
1487 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOSTART) 1487 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOSTART)
1488 act.triggered[()].connect(self.esm.map) 1488 act.triggered.connect(self.esm.map)
1489 self.editActions.append(act) 1489 self.editActions.append(act)
1490 1490
1491 if hasattr(QsciScintilla, "SCI_SCROLLTOEND"): 1491 if hasattr(QsciScintilla, "SCI_SCROLLTOEND"):
1492 act = E5Action( 1492 act = E5Action(
1493 QApplication.translate( 1493 QApplication.translate(
1498 self.editorActGrp, 'vm_edit_scroll_end_text') 1498 self.editorActGrp, 'vm_edit_scroll_end_text')
1499 if isMacPlatform(): 1499 if isMacPlatform():
1500 act.setShortcut(QKeySequence( 1500 act.setShortcut(QKeySequence(
1501 QApplication.translate('ViewManager', 'End'))) 1501 QApplication.translate('ViewManager', 'End')))
1502 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOEND) 1502 self.esm.setMapping(act, QsciScintilla.SCI_SCROLLTOEND)
1503 act.triggered[()].connect(self.esm.map) 1503 act.triggered.connect(self.esm.map)
1504 self.editActions.append(act) 1504 self.editActions.append(act)
1505 1505
1506 if hasattr(QsciScintilla, "SCI_VERTICALCENTRECARET"): 1506 if hasattr(QsciScintilla, "SCI_VERTICALCENTRECARET"):
1507 act = E5Action( 1507 act = E5Action(
1508 QApplication.translate( 1508 QApplication.translate(
1513 self.editorActGrp, 'vm_edit_scroll_vertically_center') 1513 self.editorActGrp, 'vm_edit_scroll_vertically_center')
1514 if isMacPlatform(): 1514 if isMacPlatform():
1515 act.setShortcut(QKeySequence( 1515 act.setShortcut(QKeySequence(
1516 QApplication.translate('ViewManager', 'Meta+L'))) 1516 QApplication.translate('ViewManager', 'Meta+L')))
1517 self.esm.setMapping(act, QsciScintilla.SCI_VERTICALCENTRECARET) 1517 self.esm.setMapping(act, QsciScintilla.SCI_VERTICALCENTRECARET)
1518 act.triggered[()].connect(self.esm.map) 1518 act.triggered.connect(self.esm.map)
1519 self.editActions.append(act) 1519 self.editActions.append(act)
1520 1520
1521 if hasattr(QsciScintilla, "SCI_WORDRIGHTEND"): 1521 if hasattr(QsciScintilla, "SCI_WORDRIGHTEND"):
1522 act = E5Action( 1522 act = E5Action(
1523 QApplication.translate( 1523 QApplication.translate(
1528 self.editorActGrp, 'vm_edit_move_end_next_word') 1528 self.editorActGrp, 'vm_edit_move_end_next_word')
1529 if isMacPlatform(): 1529 if isMacPlatform():
1530 act.setShortcut(QKeySequence( 1530 act.setShortcut(QKeySequence(
1531 QApplication.translate('ViewManager', 'Alt+Right'))) 1531 QApplication.translate('ViewManager', 'Alt+Right')))
1532 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEND) 1532 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEND)
1533 act.triggered[()].connect(self.esm.map) 1533 act.triggered.connect(self.esm.map)
1534 self.editActions.append(act) 1534 self.editActions.append(act)
1535 1535
1536 if hasattr(QsciScintilla, "SCI_WORDRIGHTENDEXTEND"): 1536 if hasattr(QsciScintilla, "SCI_WORDRIGHTENDEXTEND"):
1537 act = E5Action( 1537 act = E5Action(
1538 QApplication.translate( 1538 QApplication.translate(
1543 self.editorActGrp, 'vm_edit_select_end_next_word') 1543 self.editorActGrp, 'vm_edit_select_end_next_word')
1544 if isMacPlatform(): 1544 if isMacPlatform():
1545 act.setShortcut(QKeySequence( 1545 act.setShortcut(QKeySequence(
1546 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) 1546 QApplication.translate('ViewManager', 'Alt+Shift+Right')))
1547 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTENDEXTEND) 1547 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTENDEXTEND)
1548 act.triggered[()].connect(self.esm.map) 1548 act.triggered.connect(self.esm.map)
1549 self.editActions.append(act) 1549 self.editActions.append(act)
1550 1550
1551 if hasattr(QsciScintilla, "SCI_WORDLEFTEND"): 1551 if hasattr(QsciScintilla, "SCI_WORDLEFTEND"):
1552 act = E5Action( 1552 act = E5Action(
1553 QApplication.translate( 1553 QApplication.translate(
1555 QApplication.translate( 1555 QApplication.translate(
1556 'ViewManager', 'Move to end of previous word'), 1556 'ViewManager', 'Move to end of previous word'),
1557 0, 0, 1557 0, 0,
1558 self.editorActGrp, 'vm_edit_move_end_previous_word') 1558 self.editorActGrp, 'vm_edit_move_end_previous_word')
1559 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEND) 1559 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEND)
1560 act.triggered[()].connect(self.esm.map) 1560 act.triggered.connect(self.esm.map)
1561 self.editActions.append(act) 1561 self.editActions.append(act)
1562 1562
1563 if hasattr(QsciScintilla, "SCI_WORDLEFTENDEXTEND"): 1563 if hasattr(QsciScintilla, "SCI_WORDLEFTENDEXTEND"):
1564 act = E5Action( 1564 act = E5Action(
1565 QApplication.translate( 1565 QApplication.translate(
1567 QApplication.translate( 1567 QApplication.translate(
1568 'ViewManager', 'Extend selection to end of previous word'), 1568 'ViewManager', 'Extend selection to end of previous word'),
1569 0, 0, 1569 0, 0,
1570 self.editorActGrp, 'vm_edit_select_end_previous_word') 1570 self.editorActGrp, 'vm_edit_select_end_previous_word')
1571 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTENDEXTEND) 1571 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTENDEXTEND)
1572 act.triggered[()].connect(self.esm.map) 1572 act.triggered.connect(self.esm.map)
1573 self.editActions.append(act) 1573 self.editActions.append(act)
1574 1574
1575 if hasattr(QsciScintilla, "SCI_HOME"): 1575 if hasattr(QsciScintilla, "SCI_HOME"):
1576 act = E5Action( 1576 act = E5Action(
1577 QApplication.translate( 1577 QApplication.translate(
1582 self.editorActGrp, 'vm_edit_move_start_document_line') 1582 self.editorActGrp, 'vm_edit_move_start_document_line')
1583 if isMacPlatform(): 1583 if isMacPlatform():
1584 act.setShortcut(QKeySequence( 1584 act.setShortcut(QKeySequence(
1585 QApplication.translate('ViewManager', 'Meta+A'))) 1585 QApplication.translate('ViewManager', 'Meta+A')))
1586 self.esm.setMapping(act, QsciScintilla.SCI_HOME) 1586 self.esm.setMapping(act, QsciScintilla.SCI_HOME)
1587 act.triggered[()].connect(self.esm.map) 1587 act.triggered.connect(self.esm.map)
1588 self.editActions.append(act) 1588 self.editActions.append(act)
1589 1589
1590 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"): 1590 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"):
1591 act = E5Action( 1591 act = E5Action(
1592 QApplication.translate( 1592 QApplication.translate(
1600 'vm_edit_extend_selection_start_document_line') 1600 'vm_edit_extend_selection_start_document_line')
1601 if isMacPlatform(): 1601 if isMacPlatform():
1602 act.setShortcut(QKeySequence( 1602 act.setShortcut(QKeySequence(
1603 QApplication.translate('ViewManager', 'Meta+Shift+A'))) 1603 QApplication.translate('ViewManager', 'Meta+Shift+A')))
1604 self.esm.setMapping(act, QsciScintilla.SCI_HOME) 1604 self.esm.setMapping(act, QsciScintilla.SCI_HOME)
1605 act.triggered[()].connect(self.esm.map) 1605 act.triggered.connect(self.esm.map)
1606 self.editActions.append(act) 1606 self.editActions.append(act)
1607 1607
1608 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"): 1608 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"):
1609 act = E5Action( 1609 act = E5Action(
1610 QApplication.translate( 1610 QApplication.translate(
1617 self.editorActGrp, 'vm_edit_select_rect_start_line') 1617 self.editorActGrp, 'vm_edit_select_rect_start_line')
1618 if isMacPlatform(): 1618 if isMacPlatform():
1619 act.setShortcut(QKeySequence( 1619 act.setShortcut(QKeySequence(
1620 QApplication.translate('ViewManager', 'Meta+Alt+Shift+A'))) 1620 QApplication.translate('ViewManager', 'Meta+Alt+Shift+A')))
1621 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND) 1621 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND)
1622 act.triggered[()].connect(self.esm.map) 1622 act.triggered.connect(self.esm.map)
1623 self.editActions.append(act) 1623 self.editActions.append(act)
1624 1624
1625 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"): 1625 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"):
1626 act = E5Action( 1626 act = E5Action(
1627 QApplication.translate( 1627 QApplication.translate(
1635 'vm_edit_extend_selection_start_display_line') 1635 'vm_edit_extend_selection_start_display_line')
1636 if isMacPlatform(): 1636 if isMacPlatform():
1637 act.setShortcut(QKeySequence( 1637 act.setShortcut(QKeySequence(
1638 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) 1638 QApplication.translate('ViewManager', 'Ctrl+Shift+Left')))
1639 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND) 1639 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND)
1640 act.triggered[()].connect(self.esm.map) 1640 act.triggered.connect(self.esm.map)
1641 self.editActions.append(act) 1641 self.editActions.append(act)
1642 1642
1643 if hasattr(QsciScintilla, "SCI_HOMEWRAP"): 1643 if hasattr(QsciScintilla, "SCI_HOMEWRAP"):
1644 act = E5Action( 1644 act = E5Action(
1645 QApplication.translate( 1645 QApplication.translate(
1649 'ViewManager', 1649 'ViewManager',
1650 'Move to start of display or document line'), 1650 'Move to start of display or document line'),
1651 0, 0, 1651 0, 0,
1652 self.editorActGrp, 'vm_edit_move_start_display_document_line') 1652 self.editorActGrp, 'vm_edit_move_start_display_document_line')
1653 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP) 1653 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP)
1654 act.triggered[()].connect(self.esm.map) 1654 act.triggered.connect(self.esm.map)
1655 self.editActions.append(act) 1655 self.editActions.append(act)
1656 1656
1657 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"): 1657 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"):
1658 act = E5Action( 1658 act = E5Action(
1659 QApplication.translate( 1659 QApplication.translate(
1664 'Extend selection to start of display or document line'), 1664 'Extend selection to start of display or document line'),
1665 0, 0, 1665 0, 0,
1666 self.editorActGrp, 1666 self.editorActGrp,
1667 'vm_edit_extend_selection_start_display_document_line') 1667 'vm_edit_extend_selection_start_display_document_line')
1668 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND) 1668 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND)
1669 act.triggered[()].connect(self.esm.map) 1669 act.triggered.connect(self.esm.map)
1670 self.editActions.append(act) 1670 self.editActions.append(act)
1671 1671
1672 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"): 1672 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"):
1673 act = E5Action( 1673 act = E5Action(
1674 QApplication.translate( 1674 QApplication.translate(
1681 ' or document line'), 1681 ' or document line'),
1682 0, 0, 1682 0, 0,
1683 self.editorActGrp, 1683 self.editorActGrp,
1684 'vm_edit_move_first_visible_char_document_line') 1684 'vm_edit_move_first_visible_char_document_line')
1685 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAP) 1685 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAP)
1686 act.triggered[()].connect(self.esm.map) 1686 act.triggered.connect(self.esm.map)
1687 self.editActions.append(act) 1687 self.editActions.append(act)
1688 1688
1689 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"): 1689 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"):
1690 act = E5Action( 1690 act = E5Action(
1691 QApplication.translate( 1691 QApplication.translate(
1698 ' display or document line'), 1698 ' display or document line'),
1699 0, 0, 1699 0, 0,
1700 self.editorActGrp, 1700 self.editorActGrp,
1701 'vm_edit_extend_selection_first_visible_char_document_line') 1701 'vm_edit_extend_selection_first_visible_char_document_line')
1702 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAPEXTEND) 1702 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAPEXTEND)
1703 act.triggered[()].connect(self.esm.map) 1703 act.triggered.connect(self.esm.map)
1704 self.editActions.append(act) 1704 self.editActions.append(act)
1705 1705
1706 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"): 1706 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"):
1707 act = E5Action( 1707 act = E5Action(
1708 QApplication.translate( 1708 QApplication.translate(
1712 'ViewManager', 1712 'ViewManager',
1713 'Move to end of display or document line'), 1713 'Move to end of display or document line'),
1714 0, 0, 1714 0, 0,
1715 self.editorActGrp, 'vm_edit_end_start_display_document_line') 1715 self.editorActGrp, 'vm_edit_end_start_display_document_line')
1716 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP) 1716 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP)
1717 act.triggered[()].connect(self.esm.map) 1717 act.triggered.connect(self.esm.map)
1718 self.editActions.append(act) 1718 self.editActions.append(act)
1719 1719
1720 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"): 1720 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"):
1721 act = E5Action( 1721 act = E5Action(
1722 QApplication.translate( 1722 QApplication.translate(
1727 'Extend selection to end of display or document line'), 1727 'Extend selection to end of display or document line'),
1728 0, 0, 1728 0, 0,
1729 self.editorActGrp, 1729 self.editorActGrp,
1730 'vm_edit_extend_selection_end_display_document_line') 1730 'vm_edit_extend_selection_end_display_document_line')
1731 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAPEXTEND) 1731 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAPEXTEND)
1732 act.triggered[()].connect(self.esm.map) 1732 act.triggered.connect(self.esm.map)
1733 self.editActions.append(act) 1733 self.editActions.append(act)
1734 1734
1735 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"): 1735 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"):
1736 act = E5Action( 1736 act = E5Action(
1737 QApplication.translate( 1737 QApplication.translate(
1739 QApplication.translate( 1739 QApplication.translate(
1740 'ViewManager', 'Stuttered move up one page'), 1740 'ViewManager', 'Stuttered move up one page'),
1741 0, 0, 1741 0, 0,
1742 self.editorActGrp, 'vm_edit_stuttered_move_up_page') 1742 self.editorActGrp, 'vm_edit_stuttered_move_up_page')
1743 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP) 1743 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP)
1744 act.triggered[()].connect(self.esm.map) 1744 act.triggered.connect(self.esm.map)
1745 self.editActions.append(act) 1745 self.editActions.append(act)
1746 1746
1747 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"): 1747 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"):
1748 act = E5Action( 1748 act = E5Action(
1749 QApplication.translate( 1749 QApplication.translate(
1754 'Stuttered extend selection up one page'), 1754 'Stuttered extend selection up one page'),
1755 0, 0, 1755 0, 0,
1756 self.editorActGrp, 1756 self.editorActGrp,
1757 'vm_edit_stuttered_extend_selection_up_page') 1757 'vm_edit_stuttered_extend_selection_up_page')
1758 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUPEXTEND) 1758 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUPEXTEND)
1759 act.triggered[()].connect(self.esm.map) 1759 act.triggered.connect(self.esm.map)
1760 self.editActions.append(act) 1760 self.editActions.append(act)
1761 1761
1762 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"): 1762 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"):
1763 act = E5Action( 1763 act = E5Action(
1764 QApplication.translate( 1764 QApplication.translate(
1766 QApplication.translate( 1766 QApplication.translate(
1767 'ViewManager', 'Stuttered move down one page'), 1767 'ViewManager', 'Stuttered move down one page'),
1768 0, 0, 1768 0, 0,
1769 self.editorActGrp, 'vm_edit_stuttered_move_down_page') 1769 self.editorActGrp, 'vm_edit_stuttered_move_down_page')
1770 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN) 1770 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN)
1771 act.triggered[()].connect(self.esm.map) 1771 act.triggered.connect(self.esm.map)
1772 self.editActions.append(act) 1772 self.editActions.append(act)
1773 1773
1774 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"): 1774 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"):
1775 act = E5Action( 1775 act = E5Action(
1776 QApplication.translate( 1776 QApplication.translate(
1781 'Stuttered extend selection down one page'), 1781 'Stuttered extend selection down one page'),
1782 0, 0, 1782 0, 0,
1783 self.editorActGrp, 1783 self.editorActGrp,
1784 'vm_edit_stuttered_extend_selection_down_page') 1784 'vm_edit_stuttered_extend_selection_down_page')
1785 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND) 1785 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND)
1786 act.triggered[()].connect(self.esm.map) 1786 act.triggered.connect(self.esm.map)
1787 self.editActions.append(act) 1787 self.editActions.append(act)
1788 1788
1789 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"): 1789 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"):
1790 act = E5Action( 1790 act = E5Action(
1791 QApplication.translate( 1791 QApplication.translate(
1798 self.editorActGrp, 'vm_edit_delete_right_end_next_word') 1798 self.editorActGrp, 'vm_edit_delete_right_end_next_word')
1799 if isMacPlatform(): 1799 if isMacPlatform():
1800 act.setShortcut(QKeySequence( 1800 act.setShortcut(QKeySequence(
1801 QApplication.translate('ViewManager', 'Alt+Del'))) 1801 QApplication.translate('ViewManager', 'Alt+Del')))
1802 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND) 1802 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND)
1803 act.triggered[()].connect(self.esm.map) 1803 act.triggered.connect(self.esm.map)
1804 self.editActions.append(act) 1804 self.editActions.append(act)
1805 1805
1806 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"): 1806 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"):
1807 act = E5Action( 1807 act = E5Action(
1808 QApplication.translate( 1808 QApplication.translate(
1812 'ViewManager', 1812 'ViewManager',
1813 'Move selected lines up one line'), 1813 'Move selected lines up one line'),
1814 0, 0, 1814 0, 0,
1815 self.editorActGrp, 'vm_edit_move_selection_up_one_line') 1815 self.editorActGrp, 'vm_edit_move_selection_up_one_line')
1816 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP) 1816 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP)
1817 act.triggered[()].connect(self.esm.map) 1817 act.triggered.connect(self.esm.map)
1818 self.editActions.append(act) 1818 self.editActions.append(act)
1819 1819
1820 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"): 1820 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"):
1821 act = E5Action( 1821 act = E5Action(
1822 QApplication.translate( 1822 QApplication.translate(
1826 'ViewManager', 1826 'ViewManager',
1827 'Move selected lines down one line'), 1827 'Move selected lines down one line'),
1828 0, 0, 1828 0, 0,
1829 self.editorActGrp, 'vm_edit_move_selection_down_one_line') 1829 self.editorActGrp, 'vm_edit_move_selection_down_one_line')
1830 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN) 1830 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN)
1831 act.triggered[()].connect(self.esm.map) 1831 act.triggered.connect(self.esm.map)
1832 self.editActions.append(act) 1832 self.editActions.append(act)
1833 1833
1834 act = E5Action( 1834 act = E5Action(
1835 QApplication.translate( 1835 QApplication.translate(
1836 'ViewManager', 1836 'ViewManager',
1840 'Duplicate current selection'), 1840 'Duplicate current selection'),
1841 QKeySequence(QApplication.translate('ViewManager', 1841 QKeySequence(QApplication.translate('ViewManager',
1842 'Ctrl+Shift+D')), 1842 'Ctrl+Shift+D')),
1843 0, self.editorActGrp, 'vm_edit_duplicate_current_selection') 1843 0, self.editorActGrp, 'vm_edit_duplicate_current_selection')
1844 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) 1844 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE)
1845 act.triggered[()].connect(self.esm.map) 1845 act.triggered.connect(self.esm.map)
1846 self.editActions.append(act) 1846 self.editActions.append(act)
1847 1847
1848 self.__textEdit.addActions(self.editorActGrp.actions()) 1848 self.__textEdit.addActions(self.editorActGrp.actions())
1849 1849
1850 def __createSearchActions(self): 1850 def __createSearchActions(self):
1867 """<b>Search</b>""" 1867 """<b>Search</b>"""
1868 """<p>Search for some text in the current editor. A""" 1868 """<p>Search for some text in the current editor. A"""
1869 """ dialog is shown to enter the searchtext and options""" 1869 """ dialog is shown to enter the searchtext and options"""
1870 """ for the search.</p>""" 1870 """ for the search.</p>"""
1871 )) 1871 ))
1872 self.searchAct.triggered[()].connect(self.__search) 1872 self.searchAct.triggered.connect(self.__search)
1873 self.searchActions.append(self.searchAct) 1873 self.searchActions.append(self.searchAct)
1874 1874
1875 self.searchNextAct = E5Action( 1875 self.searchNextAct = E5Action(
1876 QApplication.translate('ViewManager', 'Search next'), 1876 QApplication.translate('ViewManager', 'Search next'),
1877 UI.PixmapCache.getIcon("findNext.png"), 1877 UI.PixmapCache.getIcon("findNext.png"),
1887 """<b>Search next</b>""" 1887 """<b>Search next</b>"""
1888 """<p>Search the next occurrence of some text in the current""" 1888 """<p>Search the next occurrence of some text in the current"""
1889 """ editor. The previously entered searchtext and options are""" 1889 """ editor. The previously entered searchtext and options are"""
1890 """ reused.</p>""" 1890 """ reused.</p>"""
1891 )) 1891 ))
1892 self.searchNextAct.triggered[()].connect(self.searchDlg.findNext) 1892 self.searchNextAct.triggered.connect(self.searchDlg.findNext)
1893 self.searchActions.append(self.searchNextAct) 1893 self.searchActions.append(self.searchNextAct)
1894 1894
1895 self.searchPrevAct = E5Action( 1895 self.searchPrevAct = E5Action(
1896 QApplication.translate('ViewManager', 'Search previous'), 1896 QApplication.translate('ViewManager', 'Search previous'),
1897 UI.PixmapCache.getIcon("findPrev.png"), 1897 UI.PixmapCache.getIcon("findPrev.png"),
1907 """<b>Search previous</b>""" 1907 """<b>Search previous</b>"""
1908 """<p>Search the previous occurrence of some text in the""" 1908 """<p>Search the previous occurrence of some text in the"""
1909 """ current editor. The previously entered searchtext and""" 1909 """ current editor. The previously entered searchtext and"""
1910 """ options are reused.</p>""" 1910 """ options are reused.</p>"""
1911 )) 1911 ))
1912 self.searchPrevAct.triggered[()].connect(self.searchDlg.findPrev) 1912 self.searchPrevAct.triggered.connect(self.searchDlg.findPrev)
1913 self.searchActions.append(self.searchPrevAct) 1913 self.searchActions.append(self.searchPrevAct)
1914 1914
1915 self.searchClearMarkersAct = E5Action( 1915 self.searchClearMarkersAct = E5Action(
1916 QApplication.translate('ViewManager', 1916 QApplication.translate('ViewManager',
1917 'Clear search markers'), 1917 'Clear search markers'),
1926 self.searchClearMarkersAct.setWhatsThis(QApplication.translate( 1926 self.searchClearMarkersAct.setWhatsThis(QApplication.translate(
1927 'ViewManager', 1927 'ViewManager',
1928 """<b>Clear search markers</b>""" 1928 """<b>Clear search markers</b>"""
1929 """<p>Clear all displayed search markers.</p>""" 1929 """<p>Clear all displayed search markers.</p>"""
1930 )) 1930 ))
1931 self.searchClearMarkersAct.triggered[()].connect( 1931 self.searchClearMarkersAct.triggered.connect(
1932 self.__searchClearMarkers) 1932 self.__searchClearMarkers)
1933 self.searchActions.append(self.searchClearMarkersAct) 1933 self.searchActions.append(self.searchClearMarkersAct)
1934 1934
1935 self.replaceAct = E5Action( 1935 self.replaceAct = E5Action(
1936 QApplication.translate('ViewManager', 'Replace'), 1936 QApplication.translate('ViewManager', 'Replace'),
1946 """<b>Replace</b>""" 1946 """<b>Replace</b>"""
1947 """<p>Search for some text in the current editor and replace""" 1947 """<p>Search for some text in the current editor and replace"""
1948 """ it. A dialog is shown to enter the searchtext, the""" 1948 """ it. A dialog is shown to enter the searchtext, the"""
1949 """ replacement text and options for the search and replace.</p>""" 1949 """ replacement text and options for the search and replace.</p>"""
1950 )) 1950 ))
1951 self.replaceAct.triggered[()].connect(self.__replace) 1951 self.replaceAct.triggered.connect(self.__replace)
1952 self.searchActions.append(self.replaceAct) 1952 self.searchActions.append(self.replaceAct)
1953 1953
1954 def __createHelpActions(self): 1954 def __createHelpActions(self):
1955 """ 1955 """
1956 Private method to create the Help actions. 1956 Private method to create the Help actions.
1962 self.aboutAct.setStatusTip(self.tr( 1962 self.aboutAct.setStatusTip(self.tr(
1963 'Display information about this software')) 1963 'Display information about this software'))
1964 self.aboutAct.setWhatsThis(self.tr( 1964 self.aboutAct.setWhatsThis(self.tr(
1965 """<b>About</b>""" 1965 """<b>About</b>"""
1966 """<p>Display some information about this software.</p>""")) 1966 """<p>Display some information about this software.</p>"""))
1967 self.aboutAct.triggered[()].connect(self.__about) 1967 self.aboutAct.triggered.connect(self.__about)
1968 self.helpActions.append(self.aboutAct) 1968 self.helpActions.append(self.aboutAct)
1969 1969
1970 self.aboutQtAct = E5Action( 1970 self.aboutQtAct = E5Action(
1971 self.tr('About Qt'), 1971 self.tr('About Qt'),
1972 self.tr('About &Qt'), 1972 self.tr('About &Qt'),
1975 self.tr('Display information about the Qt toolkit')) 1975 self.tr('Display information about the Qt toolkit'))
1976 self.aboutQtAct.setWhatsThis(self.tr( 1976 self.aboutQtAct.setWhatsThis(self.tr(
1977 """<b>About Qt</b>""" 1977 """<b>About Qt</b>"""
1978 """<p>Display some information about the Qt toolkit.</p>""" 1978 """<p>Display some information about the Qt toolkit.</p>"""
1979 )) 1979 ))
1980 self.aboutQtAct.triggered[()].connect(self.__aboutQt) 1980 self.aboutQtAct.triggered.connect(self.__aboutQt)
1981 self.helpActions.append(self.aboutQtAct) 1981 self.helpActions.append(self.aboutQtAct)
1982 1982
1983 self.whatsThisAct = E5Action( 1983 self.whatsThisAct = E5Action(
1984 self.tr('What\'s This?'), 1984 self.tr('What\'s This?'),
1985 UI.PixmapCache.getIcon("whatsThis.png"), 1985 UI.PixmapCache.getIcon("whatsThis.png"),
1994 """ elements to get a short description of what they do and""" 1994 """ elements to get a short description of what they do and"""
1995 """ how to use them. In dialogs, this feature can be""" 1995 """ how to use them. In dialogs, this feature can be"""
1996 """ accessed using the context help button in the titlebar.""" 1996 """ accessed using the context help button in the titlebar."""
1997 """</p>""" 1997 """</p>"""
1998 )) 1998 ))
1999 self.whatsThisAct.triggered[()].connect(self.__whatsThis) 1999 self.whatsThisAct.triggered.connect(self.__whatsThis)
2000 self.helpActions.append(self.whatsThisAct) 2000 self.helpActions.append(self.whatsThisAct)
2001 2001
2002 def __createMenus(self): 2002 def __createMenus(self):
2003 """ 2003 """
2004 Private method to create the menus of the menu bar. 2004 Private method to create the menus of the menu bar.

eric ide

mercurial