ViewManager/ViewManager.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 3056
9986ec0e559a
parent 3013
fe886b7f8f40
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
9 9
10 from __future__ import unicode_literals # __IGNORE_WARNING__ 10 from __future__ import unicode_literals # __IGNORE_WARNING__
11 11
12 import os 12 import os
13 13
14 from PyQt4.QtCore import QSignalMapper, QTimer, QFileInfo, pyqtSignal, QRegExp, \ 14 from PyQt4.QtCore import QSignalMapper, QTimer, QFileInfo, pyqtSignal, \
15 QObject, Qt 15 QRegExp, QObject, Qt
16 from PyQt4.QtGui import QColor, QKeySequence, QLineEdit, QToolBar, QWidgetAction, \ 16 from PyQt4.QtGui import QColor, QKeySequence, QLineEdit, QToolBar, \
17 QDialog, QApplication, QMenu, QPalette, QComboBox, QPixmap 17 QWidgetAction, QDialog, QApplication, QMenu, QPalette, QComboBox, QPixmap
18 from PyQt4.Qsci import QsciScintilla 18 from PyQt4.Qsci import QsciScintilla
19 19
20 from E5Gui.E5Application import e5App 20 from E5Gui.E5Application import e5App
21 from E5Gui import E5FileDialog, E5MessageBox 21 from E5Gui import E5FileDialog, E5MessageBox
22 22
96 @signal editorChangedEd(Editor) emitted when the current editor has changed 96 @signal editorChangedEd(Editor) emitted when the current editor has changed
97 @signal lastEditorClosed() emitted after the last editor window was closed 97 @signal lastEditorClosed() emitted after the last editor window was closed
98 @signal editorOpened(str) emitted after an editor window was opened 98 @signal editorOpened(str) emitted after an editor window was opened
99 @signal editorOpenedEd(Editor) emitted after an editor window was opened 99 @signal editorOpenedEd(Editor) emitted after an editor window was opened
100 @signal editorClosed(str) emitted just before an editor window gets closed 100 @signal editorClosed(str) emitted just before an editor window gets closed
101 @signal editorClosedEd(Editor) emitted just before an editor window gets closed 101 @signal editorClosedEd(Editor) emitted just before an editor window gets
102 closed
102 @signal editorSaved(str) emitted after an editor window was saved 103 @signal editorSaved(str) emitted after an editor window was saved
103 @signal checkActions(Editor) emitted when some actions should be checked 104 @signal checkActions(Editor) emitted when some actions should be checked
104 for their status 105 for their status
105 @signal cursorChanged(Editor) emitted after the cursor position of the active 106 @signal cursorChanged(Editor) emitted after the cursor position of the
106 window has changed 107 active window has changed
107 @signal breakpointToggled(Editor) emitted when a breakpoint is toggled 108 @signal breakpointToggled(Editor) emitted when a breakpoint is toggled
108 @signal bookmarkToggled(Editor) emitted when a bookmark is toggled 109 @signal bookmarkToggled(Editor) emitted when a bookmark is toggled
109 @signal syntaxerrorToggled(Editor) emitted when a syntax error is toggled 110 @signal syntaxerrorToggled(Editor) emitted when a syntax error is toggled
110 @signal previewStateChanged(bool) emitted to signal a change in the preview state 111 @signal previewStateChanged(bool) emitted to signal a change in the
112 preview state
111 @signal editorLanguageChanged(Editor) emitted to signal a change of an 113 @signal editorLanguageChanged(Editor) emitted to signal a change of an
112 editor's language 114 editor's language
113 @signal editorTextChanged(Editor) emitted to signal a change of an editor's text 115 @signal editorTextChanged(Editor) emitted to signal a change of an
114 @signal editorLineChanged(str,int) emitted to signal a change of an editor's 116 editor's text
115 current line (line is given one based) 117 @signal editorLineChanged(str,int) emitted to signal a change of an
118 editor's current line (line is given one based)
116 """ 119 """
117 changeCaption = pyqtSignal(str) 120 changeCaption = pyqtSignal(str)
118 editorChanged = pyqtSignal(str) 121 editorChanged = pyqtSignal(str)
119 editorChangedEd = pyqtSignal(Editor) 122 editorChangedEd = pyqtSignal(Editor)
120 lastEditorClosed = pyqtSignal() 123 lastEditorClosed = pyqtSignal()
234 if len(self.recent): 237 if len(self.recent):
235 return self.recent[0] 238 return self.recent[0]
236 else: 239 else:
237 return None 240 return None
238 241
239 def setSbInfo(self, sbLine, sbPos, sbWritable, sbEncoding, sbLanguage, sbEol, sbZoom): 242 def setSbInfo(self, sbLine, sbPos, sbWritable, sbEncoding, sbLanguage,
240 """ 243 sbEol, sbZoom):
241 Public method to transfer statusbar info from the user interface to viewmanager. 244 """
242 245 Public method to transfer statusbar info from the user interface to
243 @param sbLine reference to the line number part of the statusbar (QLabel) 246 viewmanager.
244 @param sbPos reference to the character position part of the statusbar (QLabel) 247
248 @param sbLine reference to the line number part of the statusbar
249 (QLabel)
250 @param sbPos reference to the character position part of the statusbar
251 (QLabel)
245 @param sbWritable reference to the writability indicator part of 252 @param sbWritable reference to the writability indicator part of
246 the statusbar (QLabel) 253 the statusbar (QLabel)
247 @param sbEncoding reference to the encoding indicator part of the 254 @param sbEncoding reference to the encoding indicator part of the
248 statusbar (QLabel) 255 statusbar (QLabel)
249 @param sbLanguage reference to the language indicator part of the 256 @param sbLanguage reference to the language indicator part of the
250 statusbar (QLabel) 257 statusbar (QLabel)
251 @param sbEol reference to the eol indicator part of the statusbar (QLabel) 258 @param sbEol reference to the eol indicator part of the statusbar
259 (QLabel)
252 @param sbZoom reference to the zoom widget (E5ZoomWidget) 260 @param sbZoom reference to the zoom widget (E5ZoomWidget)
253 """ 261 """
254 self.sbLine = sbLine 262 self.sbLine = sbLine
255 self.sbPos = sbPos 263 self.sbPos = sbPos
256 self.sbWritable = sbWritable 264 self.sbWritable = sbWritable
259 self.sbEol = sbEol 267 self.sbEol = sbEol
260 self.sbZoom = sbZoom 268 self.sbZoom = sbZoom
261 self.sbZoom.valueChanged.connect(self.__zoom) 269 self.sbZoom.valueChanged.connect(self.__zoom)
262 self.__setSbFile(zoom=0) 270 self.__setSbFile(zoom=0)
263 271
264 ############################################################################ 272 ###########################################################################
265 ## methods below need to be implemented by a subclass 273 ## methods below need to be implemented by a subclass
266 ############################################################################ 274 ###########################################################################
267 275
268 def canCascade(self): 276 def canCascade(self):
269 """ 277 """
270 Public method to signal if cascading of managed windows is available. 278 Public method to signal if cascading of managed windows is available.
271 279
272 @return flag indicating cascading of windows is available 280 @ireturn flag indicating cascading of windows is available
273 @exception RuntimeError Not implemented 281 @exception RuntimeError Not implemented
274 """ 282 """
275 raise RuntimeError('Not implemented') 283 raise RuntimeError('Not implemented')
276 284
277 def canTile(self): 285 def canTile(self):
278 """ 286 """
279 Public method to signal if tiling of managed windows is available. 287 Public method to signal if tiling of managed windows is available.
280 288
281 @return flag indicating tiling of windows is available 289 @ireturn flag indicating tiling of windows is available
282 @exception RuntimeError Not implemented 290 @exception RuntimeError Not implemented
283 """ 291 """
284 raise RuntimeError('Not implemented') 292 raise RuntimeError('Not implemented')
285 293
286 def tile(self): 294 def tile(self):
301 309
302 def activeWindow(self): 310 def activeWindow(self):
303 """ 311 """
304 Public method to return the active (i.e. current) window. 312 Public method to return the active (i.e. current) window.
305 313
306 @return reference to the active editor 314 @ireturn reference to the active editor
307 @exception RuntimeError Not implemented 315 @exception RuntimeError Not implemented
308 """ 316 """
309 raise RuntimeError('Not implemented') 317 raise RuntimeError('Not implemented')
310 318
311 def _removeAllViews(self): 319 def _removeAllViews(self):
312 """ 320 """
313 Protected method to remove all views (i.e. windows) 321 Protected method to remove all views (i.e. windows).
314 322
315 @exception RuntimeError Not implemented 323 @exception RuntimeError Not implemented
316 """ 324 """
317 raise RuntimeError('Not implemented') 325 raise RuntimeError('Not implemented')
318 326
319 def _removeView(self, win): 327 def _removeView(self, win):
320 """ 328 """
321 Protected method to remove a view (i.e. window) 329 Protected method to remove a view (i.e. window).
322 330
323 @param win editor window to be removed 331 @param win editor window to be removed
324 @exception RuntimeError Not implemented 332 @exception RuntimeError Not implemented
325 """ 333 """
326 raise RuntimeError('Not implemented') 334 raise RuntimeError('Not implemented')
327 335
328 def _addView(self, win, fn=None, noName=""): 336 def _addView(self, win, fn=None, noName=""):
329 """ 337 """
330 Protected method to add a view (i.e. window) 338 Protected method to add a view (i.e. window).
331 339
332 @param win editor assembly to be added 340 @param win editor assembly to be added
333 @param fn filename of this editor 341 @param fn filename of this editor
334 @param noName name to be used for an unnamed editor (string) 342 @param noName name to be used for an unnamed editor (string)
335 @exception RuntimeError Not implemented 343 @exception RuntimeError Not implemented
336 """ 344 """
337 raise RuntimeError('Not implemented') 345 raise RuntimeError('Not implemented')
338 346
339 def _showView(self, win, fn=None): 347 def _showView(self, win, fn=None):
340 """ 348 """
341 Protected method to show a view (i.e. window) 349 Protected method to show a view (i.e. window).
342 350
343 @param win editor assembly to be shown 351 @param win editor assembly to be shown
344 @param fn filename of this editor 352 @param fn filename of this editor
345 @exception RuntimeError Not implemented 353 @exception RuntimeError Not implemented
346 """ 354 """
355 """ 363 """
356 raise RuntimeError('Not implemented') 364 raise RuntimeError('Not implemented')
357 365
358 def _initWindowActions(self): 366 def _initWindowActions(self):
359 """ 367 """
360 Protected method to define the user interface actions for window handling. 368 Protected method to define the user interface actions for window
369 handling.
361 370
362 @exception RuntimeError Not implemented 371 @exception RuntimeError Not implemented
363 """ 372 """
364 raise RuntimeError('Not implemented') 373 raise RuntimeError('Not implemented')
365 374
500 def __initFileActions(self): 509 def __initFileActions(self):
501 """ 510 """
502 Private method defining the user interface actions for file handling. 511 Private method defining the user interface actions for file handling.
503 """ 512 """
504 self.newAct = E5Action(QApplication.translate('ViewManager', 'New'), 513 self.newAct = E5Action(QApplication.translate('ViewManager', 'New'),
505 UI.PixmapCache.getIcon("new.png"), 514 UI.PixmapCache.getIcon("new.png"),
506 QApplication.translate('ViewManager', '&New'), 515 QApplication.translate('ViewManager', '&New'),
507 QKeySequence(QApplication.translate('ViewManager', "Ctrl+N", "File|New")), 516 QKeySequence(
508 0, self, 'vm_file_new') 517 QApplication.translate('ViewManager', "Ctrl+N", "File|New")),
518 0, self, 'vm_file_new')
509 self.newAct.setStatusTip( 519 self.newAct.setStatusTip(
510 QApplication.translate('ViewManager', 'Open an empty editor window')) 520 QApplication.translate(
521 'ViewManager', 'Open an empty editor window'))
511 self.newAct.setWhatsThis(QApplication.translate('ViewManager', 522 self.newAct.setWhatsThis(QApplication.translate('ViewManager',
512 """<b>New</b>""" 523 """<b>New</b>"""
513 """<p>An empty editor window will be created.</p>""" 524 """<p>An empty editor window will be created.</p>"""
514 )) 525 ))
515 self.newAct.triggered[()].connect(self.newEditor) 526 self.newAct.triggered[()].connect(self.newEditor)
516 self.fileActions.append(self.newAct) 527 self.fileActions.append(self.newAct)
517 528
518 self.openAct = E5Action(QApplication.translate('ViewManager', 'Open'), 529 self.openAct = E5Action(QApplication.translate('ViewManager', 'Open'),
519 UI.PixmapCache.getIcon("open.png"), 530 UI.PixmapCache.getIcon("open.png"),
520 QApplication.translate('ViewManager', '&Open...'), 531 QApplication.translate('ViewManager', '&Open...'),
521 QKeySequence( 532 QKeySequence(
522 QApplication.translate('ViewManager', "Ctrl+O", "File|Open")), 533 QApplication.translate('ViewManager', "Ctrl+O", "File|Open")),
523 0, self, 'vm_file_open') 534 0, self, 'vm_file_open')
524 self.openAct.setStatusTip(QApplication.translate('ViewManager', 'Open a file')) 535 self.openAct.setStatusTip(QApplication.translate(
525 self.openAct.setWhatsThis(QApplication.translate('ViewManager', 536 'ViewManager', 'Open a file'))
537 self.openAct.setWhatsThis(QApplication.translate(
538 'ViewManager',
526 """<b>Open a file</b>""" 539 """<b>Open a file</b>"""
527 """<p>You will be asked for the name of a file to be opened""" 540 """<p>You will be asked for the name of a file to be opened"""
528 """ in an editor window.</p>""" 541 """ in an editor window.</p>"""
529 )) 542 ))
530 self.openAct.triggered[()].connect(self.openFiles) 543 self.openAct.triggered[()].connect(self.openFiles)
531 self.fileActions.append(self.openAct) 544 self.fileActions.append(self.openAct)
532 545
533 self.closeActGrp = createActionGroup(self) 546 self.closeActGrp = createActionGroup(self)
534 547
535 self.closeAct = E5Action(QApplication.translate('ViewManager', 'Close'), 548 self.closeAct = E5Action(
536 UI.PixmapCache.getIcon("close.png"), 549 QApplication.translate('ViewManager', 'Close'),
537 QApplication.translate('ViewManager', '&Close'), 550 UI.PixmapCache.getIcon("close.png"),
538 QKeySequence( 551 QApplication.translate('ViewManager', '&Close'),
539 QApplication.translate('ViewManager', "Ctrl+W", "File|Close")), 552 QKeySequence(
540 0, self.closeActGrp, 'vm_file_close') 553 QApplication.translate('ViewManager', "Ctrl+W", "File|Close")),
554 0, self.closeActGrp, 'vm_file_close')
541 self.closeAct.setStatusTip( 555 self.closeAct.setStatusTip(
542 QApplication.translate('ViewManager', 'Close the current window')) 556 QApplication.translate('ViewManager', 'Close the current window'))
543 self.closeAct.setWhatsThis(QApplication.translate('ViewManager', 557 self.closeAct.setWhatsThis(QApplication.translate('ViewManager',
544 """<b>Close Window</b>""" 558 """<b>Close Window</b>"""
545 """<p>Close the current window.</p>""" 559 """<p>Close the current window.</p>"""
546 )) 560 ))
547 self.closeAct.triggered[()].connect(self.closeCurrentWindow) 561 self.closeAct.triggered[()].connect(self.closeCurrentWindow)
548 self.fileActions.append(self.closeAct) 562 self.fileActions.append(self.closeAct)
549 563
550 self.closeAllAct = E5Action(QApplication.translate('ViewManager', 'Close All'), 564 self.closeAllAct = E5Action(
551 QApplication.translate('ViewManager', 'Clos&e All'), 565 QApplication.translate('ViewManager', 'Close All'),
552 0, 0, self.closeActGrp, 'vm_file_close_all') 566 QApplication.translate('ViewManager', 'Clos&e All'),
567 0, 0, self.closeActGrp, 'vm_file_close_all')
553 self.closeAllAct.setStatusTip( 568 self.closeAllAct.setStatusTip(
554 QApplication.translate('ViewManager', 'Close all editor windows')) 569 QApplication.translate('ViewManager', 'Close all editor windows'))
555 self.closeAllAct.setWhatsThis(QApplication.translate('ViewManager', 570 self.closeAllAct.setWhatsThis(QApplication.translate('ViewManager',
556 """<b>Close All Windows</b>""" 571 """<b>Close All Windows</b>"""
557 """<p>Close all editor windows.</p>""" 572 """<p>Close all editor windows.</p>"""
561 576
562 self.closeActGrp.setEnabled(False) 577 self.closeActGrp.setEnabled(False)
563 578
564 self.saveActGrp = createActionGroup(self) 579 self.saveActGrp = createActionGroup(self)
565 580
566 self.saveAct = E5Action(QApplication.translate('ViewManager', 'Save'), 581 self.saveAct = E5Action(
567 UI.PixmapCache.getIcon("fileSave.png"), 582 QApplication.translate('ViewManager', 'Save'),
568 QApplication.translate('ViewManager', '&Save'), 583 UI.PixmapCache.getIcon("fileSave.png"),
569 QKeySequence( 584 QApplication.translate('ViewManager', '&Save'),
570 QApplication.translate('ViewManager', "Ctrl+S", "File|Save")), 585 QKeySequence(QApplication.translate(
571 0, self.saveActGrp, 'vm_file_save') 586 'ViewManager', "Ctrl+S", "File|Save")),
587 0, self.saveActGrp, 'vm_file_save')
572 self.saveAct.setStatusTip( 588 self.saveAct.setStatusTip(
573 QApplication.translate('ViewManager', 'Save the current file')) 589 QApplication.translate('ViewManager', 'Save the current file'))
574 self.saveAct.setWhatsThis(QApplication.translate('ViewManager', 590 self.saveAct.setWhatsThis(QApplication.translate('ViewManager',
575 """<b>Save File</b>""" 591 """<b>Save File</b>"""
576 """<p>Save the contents of current editor window.</p>""" 592 """<p>Save the contents of current editor window.</p>"""
577 )) 593 ))
578 self.saveAct.triggered[()].connect(self.saveCurrentEditor) 594 self.saveAct.triggered[()].connect(self.saveCurrentEditor)
579 self.fileActions.append(self.saveAct) 595 self.fileActions.append(self.saveAct)
580 596
581 self.saveAsAct = E5Action(QApplication.translate('ViewManager', 'Save as'), 597 self.saveAsAct = E5Action(
582 UI.PixmapCache.getIcon("fileSaveAs.png"), 598 QApplication.translate('ViewManager', 'Save as'),
583 QApplication.translate('ViewManager', 'Save &as...'), 599 UI.PixmapCache.getIcon("fileSaveAs.png"),
584 QKeySequence(QApplication.translate('ViewManager', 600 QApplication.translate('ViewManager', 'Save &as...'),
585 "Shift+Ctrl+S", "File|Save As")), 601 QKeySequence(QApplication.translate('ViewManager',
586 0, self.saveActGrp, 'vm_file_save_as') 602 "Shift+Ctrl+S", "File|Save As")),
603 0, self.saveActGrp, 'vm_file_save_as')
587 self.saveAsAct.setStatusTip(QApplication.translate('ViewManager', 604 self.saveAsAct.setStatusTip(QApplication.translate('ViewManager',
588 'Save the current file to a new one')) 605 'Save the current file to a new one'))
589 self.saveAsAct.setWhatsThis(QApplication.translate('ViewManager', 606 self.saveAsAct.setWhatsThis(QApplication.translate('ViewManager',
590 """<b>Save File as</b>""" 607 """<b>Save File as</b>"""
591 """<p>Save the contents of current editor window to a new file.""" 608 """<p>Save the contents of current editor window to a new file."""
592 """ The file can be entered in a file selection dialog.</p>""" 609 """ The file can be entered in a file selection dialog.</p>"""
593 )) 610 ))
594 self.saveAsAct.triggered[()].connect(self.saveAsCurrentEditor) 611 self.saveAsAct.triggered[()].connect(self.saveAsCurrentEditor)
595 self.fileActions.append(self.saveAsAct) 612 self.fileActions.append(self.saveAsAct)
596 613
597 self.saveAllAct = E5Action(QApplication.translate('ViewManager', 'Save all'), 614 self.saveAllAct = E5Action(
598 UI.PixmapCache.getIcon("fileSaveAll.png"), 615 QApplication.translate('ViewManager', 'Save all'),
599 QApplication.translate('ViewManager', 'Save a&ll'), 616 UI.PixmapCache.getIcon("fileSaveAll.png"),
600 0, 0, self.saveActGrp, 'vm_file_save_all') 617 QApplication.translate('ViewManager', 'Save a&ll'),
618 0, 0, self.saveActGrp, 'vm_file_save_all')
601 self.saveAllAct.setStatusTip(QApplication.translate('ViewManager', 619 self.saveAllAct.setStatusTip(QApplication.translate('ViewManager',
602 'Save all files')) 620 'Save all files'))
603 self.saveAllAct.setWhatsThis(QApplication.translate('ViewManager', 621 self.saveAllAct.setWhatsThis(QApplication.translate('ViewManager',
604 """<b>Save All Files</b>""" 622 """<b>Save All Files</b>"""
605 """<p>Save the contents of all editor windows.</p>""" 623 """<p>Save the contents of all editor windows.</p>"""
607 self.saveAllAct.triggered[()].connect(self.saveAllEditors) 625 self.saveAllAct.triggered[()].connect(self.saveAllEditors)
608 self.fileActions.append(self.saveAllAct) 626 self.fileActions.append(self.saveAllAct)
609 627
610 self.saveActGrp.setEnabled(False) 628 self.saveActGrp.setEnabled(False)
611 629
612 self.printAct = E5Action(QApplication.translate('ViewManager', 'Print'), 630 self.printAct = E5Action(
613 UI.PixmapCache.getIcon("print.png"), 631 QApplication.translate('ViewManager', 'Print'),
614 QApplication.translate('ViewManager', '&Print'), 632 UI.PixmapCache.getIcon("print.png"),
615 QKeySequence(QApplication.translate('ViewManager', 633 QApplication.translate('ViewManager', '&Print'),
616 "Ctrl+P", "File|Print")), 634 QKeySequence(QApplication.translate('ViewManager',
617 0, self, 'vm_file_print') 635 "Ctrl+P", "File|Print")),
636 0, self, 'vm_file_print')
618 self.printAct.setStatusTip(QApplication.translate('ViewManager', 637 self.printAct.setStatusTip(QApplication.translate('ViewManager',
619 'Print the current file')) 638 'Print the current file'))
620 self.printAct.setWhatsThis(QApplication.translate('ViewManager', 639 self.printAct.setWhatsThis(QApplication.translate('ViewManager',
621 """<b>Print File</b>""" 640 """<b>Print File</b>"""
622 """<p>Print the contents of current editor window.</p>""" 641 """<p>Print the contents of current editor window.</p>"""
634 'Print preview of the current file')) 653 'Print preview of the current file'))
635 self.printPreviewAct.setWhatsThis(QApplication.translate('ViewManager', 654 self.printPreviewAct.setWhatsThis(QApplication.translate('ViewManager',
636 """<b>Print Preview</b>""" 655 """<b>Print Preview</b>"""
637 """<p>Print preview of the current editor window.</p>""" 656 """<p>Print preview of the current editor window.</p>"""
638 )) 657 ))
639 self.printPreviewAct.triggered[()].connect(self.printPreviewCurrentEditor) 658 self.printPreviewAct.triggered[()].connect(
659 self.printPreviewCurrentEditor)
640 self.printPreviewAct.setEnabled(False) 660 self.printPreviewAct.setEnabled(False)
641 self.fileActions.append(self.printPreviewAct) 661 self.fileActions.append(self.printPreviewAct)
642 662
643 self.findFileNameAct = E5Action(QApplication.translate('ViewManager', 663 self.findFileNameAct = E5Action(QApplication.translate('ViewManager',
644 'Search File'), 664 'Search File'),
699 719
700 def initFileToolbar(self, toolbarManager): 720 def initFileToolbar(self, toolbarManager):
701 """ 721 """
702 Public method to create the File toolbar. 722 Public method to create the File toolbar.
703 723
704 @param toolbarManager reference to a toolbar manager object (E5ToolBarManager) 724 @param toolbarManager reference to a toolbar manager object
725 (E5ToolBarManager)
705 @return the generated toolbar 726 @return the generated toolbar
706 """ 727 """
707 tb = QToolBar(QApplication.translate('ViewManager', 'File'), self.ui) 728 tb = QToolBar(QApplication.translate('ViewManager', 'File'), self.ui)
708 tb.setIconSize(UI.Config.ToolBarIconSize) 729 tb.setIconSize(UI.Config.ToolBarIconSize)
709 tb.setObjectName("FileToolbar") 730 tb.setObjectName("FileToolbar")
724 return tb 745 return tb
725 746
726 def __initContextMenuExporters(self): 747 def __initContextMenuExporters(self):
727 """ 748 """
728 Private method used to setup the Exporters sub menu. 749 Private method used to setup the Exporters sub menu.
750
751 @return reference to the generated menu (QMenu)
729 """ 752 """
730 menu = QMenu(QApplication.translate('ViewManager', "Export as")) 753 menu = QMenu(QApplication.translate('ViewManager', "Export as"))
731 754
732 import QScintilla.Exporters 755 import QScintilla.Exporters
733 supportedExporters = QScintilla.Exporters.getSupportedFormats() 756 supportedExporters = QScintilla.Exporters.getSupportedFormats()
744 ## Initialize the edit related actions, edit menu and toolbar 767 ## Initialize the edit related actions, edit menu and toolbar
745 ################################################################## 768 ##################################################################
746 769
747 def __initEditActions(self): 770 def __initEditActions(self):
748 """ 771 """
749 Private method defining the user interface actions for the edit commands. 772 Private method defining the user interface actions for the edit
773 commands.
750 """ 774 """
751 self.editActGrp = createActionGroup(self) 775 self.editActGrp = createActionGroup(self)
752 776
753 self.undoAct = E5Action(QApplication.translate('ViewManager', 'Undo'), 777 self.undoAct = E5Action(QApplication.translate('ViewManager', 'Undo'),
754 UI.PixmapCache.getIcon("editUndo.png"), 778 UI.PixmapCache.getIcon("editUndo.png"),
783 self.redoAct.triggered[()].connect(self.__editRedo) 807 self.redoAct.triggered[()].connect(self.__editRedo)
784 self.editActions.append(self.redoAct) 808 self.editActions.append(self.redoAct)
785 809
786 self.revertAct = E5Action(QApplication.translate('ViewManager', 810 self.revertAct = E5Action(QApplication.translate('ViewManager',
787 'Revert to last saved state'), 811 'Revert to last saved state'),
788 QApplication.translate('ViewManager', 'Re&vert to last saved state'), 812 QApplication.translate(
813 'ViewManager', 'Re&vert to last saved state'),
789 QKeySequence(QApplication.translate('ViewManager', 814 QKeySequence(QApplication.translate('ViewManager',
790 "Ctrl+Y", "Edit|Revert")), 815 "Ctrl+Y", "Edit|Revert")),
791 0, 816 0,
792 self.editActGrp, 'vm_edit_revert') 817 self.editActGrp, 'vm_edit_revert')
793 self.revertAct.setStatusTip(QApplication.translate('ViewManager', 818 self.revertAct.setStatusTip(QApplication.translate('ViewManager',
803 self.copyActGrp = createActionGroup(self.editActGrp) 828 self.copyActGrp = createActionGroup(self.editActGrp)
804 829
805 self.cutAct = E5Action(QApplication.translate('ViewManager', 'Cut'), 830 self.cutAct = E5Action(QApplication.translate('ViewManager', 'Cut'),
806 UI.PixmapCache.getIcon("editCut.png"), 831 UI.PixmapCache.getIcon("editCut.png"),
807 QApplication.translate('ViewManager', 'Cu&t'), 832 QApplication.translate('ViewManager', 'Cu&t'),
808 QKeySequence(QApplication.translate('ViewManager', "Ctrl+X", "Edit|Cut")), 833 QKeySequence(QApplication.translate('ViewManager',
834 "Ctrl+X", "Edit|Cut")),
809 QKeySequence(QApplication.translate('ViewManager', 835 QKeySequence(QApplication.translate('ViewManager',
810 "Shift+Del", "Edit|Cut")), 836 "Shift+Del", "Edit|Cut")),
811 self.copyActGrp, 'vm_edit_cut') 837 self.copyActGrp, 'vm_edit_cut')
812 self.cutAct.setStatusTip(QApplication.translate('ViewManager', 838 self.cutAct.setStatusTip(QApplication.translate('ViewManager',
813 'Cut the selection')) 839 'Cut the selection'))
814 self.cutAct.setWhatsThis(QApplication.translate('ViewManager', 840 self.cutAct.setWhatsThis(QApplication.translate('ViewManager',
815 """<b>Cut</b>""" 841 """<b>Cut</b>"""
816 """<p>Cut the selected text of the current editor to the clipboard.</p>""" 842 """<p>Cut the selected text of the current editor to the"""
843 """ clipboard.</p>"""
817 )) 844 ))
818 self.cutAct.triggered[()].connect(self.__editCut) 845 self.cutAct.triggered[()].connect(self.__editCut)
819 self.editActions.append(self.cutAct) 846 self.editActions.append(self.cutAct)
820 847
821 self.copyAct = E5Action(QApplication.translate('ViewManager', 'Copy'), 848 self.copyAct = E5Action(QApplication.translate('ViewManager', 'Copy'),
828 self.copyActGrp, 'vm_edit_copy') 855 self.copyActGrp, 'vm_edit_copy')
829 self.copyAct.setStatusTip(QApplication.translate('ViewManager', 856 self.copyAct.setStatusTip(QApplication.translate('ViewManager',
830 'Copy the selection')) 857 'Copy the selection'))
831 self.copyAct.setWhatsThis(QApplication.translate('ViewManager', 858 self.copyAct.setWhatsThis(QApplication.translate('ViewManager',
832 """<b>Copy</b>""" 859 """<b>Copy</b>"""
833 """<p>Copy the selected text of the current editor to the clipboard.</p>""" 860 """<p>Copy the selected text of the current editor to the"""
861 """ clipboard.</p>"""
834 )) 862 ))
835 self.copyAct.triggered[()].connect(self.__editCopy) 863 self.copyAct.triggered[()].connect(self.__editCopy)
836 self.editActions.append(self.copyAct) 864 self.editActions.append(self.copyAct)
837 865
838 self.pasteAct = E5Action(QApplication.translate('ViewManager', 'Paste'), 866 self.pasteAct = E5Action(
839 UI.PixmapCache.getIcon("editPaste.png"), 867 QApplication.translate('ViewManager', 'Paste'),
840 QApplication.translate('ViewManager', '&Paste'), 868 UI.PixmapCache.getIcon("editPaste.png"),
841 QKeySequence(QApplication.translate('ViewManager', 869 QApplication.translate('ViewManager', '&Paste'),
842 "Ctrl+V", "Edit|Paste")), 870 QKeySequence(QApplication.translate('ViewManager',
843 QKeySequence(QApplication.translate('ViewManager', 871 "Ctrl+V", "Edit|Paste")),
844 "Shift+Ins", "Edit|Paste")), 872 QKeySequence(QApplication.translate('ViewManager',
845 self.copyActGrp, 'vm_edit_paste') 873 "Shift+Ins", "Edit|Paste")),
874 self.copyActGrp, 'vm_edit_paste')
846 self.pasteAct.setStatusTip(QApplication.translate('ViewManager', 875 self.pasteAct.setStatusTip(QApplication.translate('ViewManager',
847 'Paste the last cut/copied text')) 876 'Paste the last cut/copied text'))
848 self.pasteAct.setWhatsThis(QApplication.translate('ViewManager', 877 self.pasteAct.setWhatsThis(QApplication.translate('ViewManager',
849 """<b>Paste</b>""" 878 """<b>Paste</b>"""
850 """<p>Paste the last cut/copied text from the clipboard to""" 879 """<p>Paste the last cut/copied text from the clipboard to"""
851 """ the current editor.</p>""" 880 """ the current editor.</p>"""
852 )) 881 ))
853 self.pasteAct.triggered[()].connect(self.__editPaste) 882 self.pasteAct.triggered[()].connect(self.__editPaste)
854 self.editActions.append(self.pasteAct) 883 self.editActions.append(self.pasteAct)
855 884
856 self.deleteAct = E5Action(QApplication.translate('ViewManager', 'Clear'), 885 self.deleteAct = E5Action(
857 UI.PixmapCache.getIcon("editDelete.png"), 886 QApplication.translate('ViewManager', 'Clear'),
858 QApplication.translate('ViewManager', 'Clear'), 887 UI.PixmapCache.getIcon("editDelete.png"),
859 QKeySequence(QApplication.translate('ViewManager', 888 QApplication.translate('ViewManager', 'Clear'),
860 "Alt+Shift+C", "Edit|Clear")), 889 QKeySequence(QApplication.translate('ViewManager',
861 0, 890 "Alt+Shift+C", "Edit|Clear")),
862 self.copyActGrp, 'vm_edit_clear') 891 0,
892 self.copyActGrp, 'vm_edit_clear')
863 self.deleteAct.setStatusTip(QApplication.translate('ViewManager', 893 self.deleteAct.setStatusTip(QApplication.translate('ViewManager',
864 'Clear all text')) 894 'Clear all text'))
865 self.deleteAct.setWhatsThis(QApplication.translate('ViewManager', 895 self.deleteAct.setWhatsThis(QApplication.translate('ViewManager',
866 """<b>Clear</b>""" 896 """<b>Clear</b>"""
867 """<p>Delete all text of the current editor.</p>""" 897 """<p>Delete all text of the current editor.</p>"""
868 )) 898 ))
869 self.deleteAct.triggered[()].connect(self.__editDelete) 899 self.deleteAct.triggered[()].connect(self.__editDelete)
870 self.editActions.append(self.deleteAct) 900 self.editActions.append(self.deleteAct)
871 901
872 self.joinAct = E5Action(QApplication.translate('ViewManager', 'Join Lines'), 902 self.joinAct = E5Action(
873 QApplication.translate('ViewManager', 'Join Lines'), 903 QApplication.translate('ViewManager', 'Join Lines'),
874 QKeySequence(QApplication.translate('ViewManager', 904 QApplication.translate('ViewManager', 'Join Lines'),
875 "Ctrl+J", "Edit|Join Lines")), 905 QKeySequence(QApplication.translate('ViewManager',
876 0, 906 "Ctrl+J", "Edit|Join Lines")),
877 self.copyActGrp, 'vm_edit_join_lines') 907 0,
908 self.copyActGrp, 'vm_edit_join_lines')
878 self.joinAct.setStatusTip(QApplication.translate('ViewManager', 909 self.joinAct.setStatusTip(QApplication.translate('ViewManager',
879 'Join Lines')) 910 'Join Lines'))
880 self.joinAct.setWhatsThis(QApplication.translate('ViewManager', 911 self.joinAct.setWhatsThis(QApplication.translate('ViewManager',
881 """<b>Join Lines</b>""" 912 """<b>Join Lines</b>"""
882 """<p>Join the current and the next lines.</p>""" 913 """<p>Join the current and the next lines.</p>"""
883 )) 914 ))
884 self.joinAct.triggered[()].connect(self.__editJoin) 915 self.joinAct.triggered[()].connect(self.__editJoin)
885 self.editActions.append(self.joinAct) 916 self.editActions.append(self.joinAct)
886 917
887 self.indentAct = E5Action(QApplication.translate('ViewManager', 'Indent'), 918 self.indentAct = E5Action(
888 UI.PixmapCache.getIcon("editIndent.png"), 919 QApplication.translate('ViewManager', 'Indent'),
889 QApplication.translate('ViewManager', '&Indent'), 920 UI.PixmapCache.getIcon("editIndent.png"),
890 QKeySequence(QApplication.translate('ViewManager', 921 QApplication.translate('ViewManager', '&Indent'),
891 "Ctrl+I", "Edit|Indent")), 922 QKeySequence(QApplication.translate('ViewManager',
892 0, 923 "Ctrl+I", "Edit|Indent")),
893 self.editActGrp, 'vm_edit_indent') 924 0,
894 self.indentAct.setStatusTip(QApplication.translate('ViewManager', 'Indent line')) 925 self.editActGrp, 'vm_edit_indent')
926 self.indentAct.setStatusTip(QApplication.translate('ViewManager',
927 'Indent line'))
895 self.indentAct.setWhatsThis(QApplication.translate('ViewManager', 928 self.indentAct.setWhatsThis(QApplication.translate('ViewManager',
896 """<b>Indent</b>""" 929 """<b>Indent</b>"""
897 """<p>Indents the current line or the lines of the""" 930 """<p>Indents the current line or the lines of the"""
898 """ selection by one level.</p>""" 931 """ selection by one level.</p>"""
899 )) 932 ))
900 self.indentAct.triggered[()].connect(self.__editIndent) 933 self.indentAct.triggered[()].connect(self.__editIndent)
901 self.editActions.append(self.indentAct) 934 self.editActions.append(self.indentAct)
902 935
903 self.unindentAct = E5Action(QApplication.translate('ViewManager', 'Unindent'), 936 self.unindentAct = E5Action(
904 UI.PixmapCache.getIcon("editUnindent.png"), 937 QApplication.translate('ViewManager', 'Unindent'),
905 QApplication.translate('ViewManager', 'U&nindent'), 938 UI.PixmapCache.getIcon("editUnindent.png"),
906 QKeySequence(QApplication.translate('ViewManager', 939 QApplication.translate('ViewManager', 'U&nindent'),
907 "Ctrl+Shift+I", "Edit|Unindent")), 940 QKeySequence(QApplication.translate('ViewManager',
908 0, 941 "Ctrl+Shift+I", "Edit|Unindent")),
909 self.editActGrp, 'vm_edit_unindent') 942 0,
943 self.editActGrp, 'vm_edit_unindent')
910 self.unindentAct.setStatusTip(QApplication.translate('ViewManager', 944 self.unindentAct.setStatusTip(QApplication.translate('ViewManager',
911 'Unindent line')) 945 'Unindent line'))
912 self.unindentAct.setWhatsThis(QApplication.translate('ViewManager', 946 self.unindentAct.setWhatsThis(QApplication.translate('ViewManager',
913 """<b>Unindent</b>""" 947 """<b>Unindent</b>"""
914 """<p>Unindents the current line or the lines of the""" 948 """<p>Unindents the current line or the lines of the"""
933 """ current selection smartly.</p>""" 967 """ current selection smartly.</p>"""
934 )) 968 ))
935 self.smartIndentAct.triggered[()].connect(self.__editSmartIndent) 969 self.smartIndentAct.triggered[()].connect(self.__editSmartIndent)
936 self.editActions.append(self.smartIndentAct) 970 self.editActions.append(self.smartIndentAct)
937 971
938 self.commentAct = E5Action(QApplication.translate('ViewManager', 'Comment'), 972 self.commentAct = E5Action(
939 UI.PixmapCache.getIcon("editComment.png"), 973 QApplication.translate('ViewManager', 'Comment'),
940 QApplication.translate('ViewManager', 'C&omment'), 974 UI.PixmapCache.getIcon("editComment.png"),
941 QKeySequence(QApplication.translate('ViewManager', 975 QApplication.translate('ViewManager', 'C&omment'),
942 "Ctrl+M", "Edit|Comment")), 976 QKeySequence(QApplication.translate('ViewManager',
943 0, 977 "Ctrl+M", "Edit|Comment")),
944 self.editActGrp, 'vm_edit_comment') 978 0,
979 self.editActGrp, 'vm_edit_comment')
945 self.commentAct.setStatusTip(QApplication.translate('ViewManager', 980 self.commentAct.setStatusTip(QApplication.translate('ViewManager',
946 'Comment Line or Selection')) 981 'Comment Line or Selection'))
947 self.commentAct.setWhatsThis(QApplication.translate('ViewManager', 982 self.commentAct.setWhatsThis(QApplication.translate('ViewManager',
948 """<b>Comment</b>""" 983 """<b>Comment</b>"""
949 """<p>Comments the current line or the lines of the""" 984 """<p>Comments the current line or the lines of the"""
950 """ current selection.</p>""" 985 """ current selection.</p>"""
951 )) 986 ))
952 self.commentAct.triggered[()].connect(self.__editComment) 987 self.commentAct.triggered[()].connect(self.__editComment)
953 self.editActions.append(self.commentAct) 988 self.editActions.append(self.commentAct)
954 989
955 self.uncommentAct = E5Action(QApplication.translate('ViewManager', 'Uncomment'), 990 self.uncommentAct = E5Action(
956 UI.PixmapCache.getIcon("editUncomment.png"), 991 QApplication.translate('ViewManager', 'Uncomment'),
957 QApplication.translate('ViewManager', 'Unco&mment'), 992 UI.PixmapCache.getIcon("editUncomment.png"),
958 QKeySequence(QApplication.translate('ViewManager', 993 QApplication.translate('ViewManager', 'Unco&mment'),
959 "Alt+Ctrl+M", "Edit|Uncomment")), 994 QKeySequence(QApplication.translate('ViewManager',
960 0, 995 "Alt+Ctrl+M", "Edit|Uncomment")),
961 self.editActGrp, 'vm_edit_uncomment') 996 0,
997 self.editActGrp, 'vm_edit_uncomment')
962 self.uncommentAct.setStatusTip(QApplication.translate('ViewManager', 998 self.uncommentAct.setStatusTip(QApplication.translate('ViewManager',
963 'Uncomment Line or Selection')) 999 'Uncomment Line or Selection'))
964 self.uncommentAct.setWhatsThis(QApplication.translate('ViewManager', 1000 self.uncommentAct.setWhatsThis(QApplication.translate('ViewManager',
965 """<b>Uncomment</b>""" 1001 """<b>Uncomment</b>"""
966 """<p>Uncomments the current line or the lines of the""" 1002 """<p>Uncomments the current line or the lines of the"""
975 QApplication.translate('ViewManager', 'Toggle Comment'), 1011 QApplication.translate('ViewManager', 'Toggle Comment'),
976 QKeySequence(QApplication.translate('ViewManager', 1012 QKeySequence(QApplication.translate('ViewManager',
977 "Ctrl+Shift+M", "Edit|Toggle Comment")), 1013 "Ctrl+Shift+M", "Edit|Toggle Comment")),
978 0, 1014 0,
979 self.editActGrp, 'vm_edit_toggle_comment') 1015 self.editActGrp, 'vm_edit_toggle_comment')
980 self.toggleCommentAct.setStatusTip(QApplication.translate('ViewManager', 1016 self.toggleCommentAct.setStatusTip(QApplication.translate(
981 'Toggle the comment of the current line, selection or comment block')) 1017 'ViewManager',
982 self.toggleCommentAct.setWhatsThis(QApplication.translate('ViewManager', 1018 'Toggle the comment of the current line, selection or'
1019 ' comment block'))
1020 self.toggleCommentAct.setWhatsThis(QApplication.translate(
1021 'ViewManager',
983 """<b>Toggle Comment</b>""" 1022 """<b>Toggle Comment</b>"""
984 """<p>If the current line does not start with a block comment,""" 1023 """<p>If the current line does not start with a block comment,"""
985 """ the current line or selection is commented. If it is already""" 1024 """ the current line or selection is commented. If it is already"""
986 """ commented, this comment block is uncommented. </p>""" 1025 """ commented, this comment block is uncommented. </p>"""
987 )) 1026 ))
988 self.toggleCommentAct.triggered[()].connect(self.__editToggleComment) 1027 self.toggleCommentAct.triggered[()].connect(self.__editToggleComment)
989 self.editActions.append(self.toggleCommentAct) 1028 self.editActions.append(self.toggleCommentAct)
990 1029
991 self.streamCommentAct = E5Action(QApplication.translate('ViewManager', 1030 self.streamCommentAct = E5Action(
992 'Stream Comment'), 1031 QApplication.translate('ViewManager', 'Stream Comment'),
993 QApplication.translate('ViewManager', 'Stream Comment'), 1032 QApplication.translate('ViewManager', 'Stream Comment'),
994 0, 0, 1033 0, 0,
995 self.editActGrp, 'vm_edit_stream_comment') 1034 self.editActGrp, 'vm_edit_stream_comment')
996 self.streamCommentAct.setStatusTip(QApplication.translate('ViewManager', 1035 self.streamCommentAct.setStatusTip(QApplication.translate(
1036 'ViewManager',
997 'Stream Comment Line or Selection')) 1037 'Stream Comment Line or Selection'))
998 self.streamCommentAct.setWhatsThis(QApplication.translate('ViewManager', 1038 self.streamCommentAct.setWhatsThis(QApplication.translate(
1039 'ViewManager',
999 """<b>Stream Comment</b>""" 1040 """<b>Stream Comment</b>"""
1000 """<p>Stream comments the current line or the current selection.</p>""" 1041 """<p>Stream comments the current line or the current"""
1042 """ selection.</p>"""
1001 )) 1043 ))
1002 self.streamCommentAct.triggered[()].connect(self.__editStreamComment) 1044 self.streamCommentAct.triggered[()].connect(self.__editStreamComment)
1003 self.editActions.append(self.streamCommentAct) 1045 self.editActions.append(self.streamCommentAct)
1004 1046
1005 self.boxCommentAct = E5Action(QApplication.translate('ViewManager', 1047 self.boxCommentAct = E5Action(QApplication.translate('ViewManager',
1026 self.editActGrp, 'vm_edit_select_to_brace') 1068 self.editActGrp, 'vm_edit_select_to_brace')
1027 self.selectBraceAct.setStatusTip(QApplication.translate('ViewManager', 1069 self.selectBraceAct.setStatusTip(QApplication.translate('ViewManager',
1028 'Select text to the matching brace')) 1070 'Select text to the matching brace'))
1029 self.selectBraceAct.setWhatsThis(QApplication.translate('ViewManager', 1071 self.selectBraceAct.setWhatsThis(QApplication.translate('ViewManager',
1030 """<b>Select to brace</b>""" 1072 """<b>Select to brace</b>"""
1031 """<p>Select text of the current editor to the matching brace.</p>""" 1073 """<p>Select text of the current editor to the matching"""
1074 """ brace.</p>"""
1032 )) 1075 ))
1033 self.selectBraceAct.triggered[()].connect(self.__editSelectBrace) 1076 self.selectBraceAct.triggered[()].connect(self.__editSelectBrace)
1034 self.editActions.append(self.selectBraceAct) 1077 self.editActions.append(self.selectBraceAct)
1035 1078
1036 self.selectAllAct = E5Action(QApplication.translate('ViewManager', 'Select all'), 1079 self.selectAllAct = E5Action(
1037 QApplication.translate('ViewManager', '&Select all'), 1080 QApplication.translate('ViewManager', 'Select all'),
1038 QKeySequence(QApplication.translate('ViewManager', 1081 QApplication.translate('ViewManager', '&Select all'),
1039 "Ctrl+A", "Edit|Select all")), 1082 QKeySequence(QApplication.translate('ViewManager',
1040 0, 1083 "Ctrl+A", "Edit|Select all")),
1041 self.editActGrp, 'vm_edit_select_all') 1084 0,
1085 self.editActGrp, 'vm_edit_select_all')
1042 self.selectAllAct.setStatusTip(QApplication.translate('ViewManager', 1086 self.selectAllAct.setStatusTip(QApplication.translate('ViewManager',
1043 'Select all text')) 1087 'Select all text'))
1044 self.selectAllAct.setWhatsThis(QApplication.translate('ViewManager', 1088 self.selectAllAct.setWhatsThis(QApplication.translate('ViewManager',
1045 """<b>Select All</b>""" 1089 """<b>Select All</b>"""
1046 """<p>Select all text of the current editor.</p>""" 1090 """<p>Select all text of the current editor.</p>"""
1062 """<p>Deselect all text of the current editor.</p>""" 1106 """<p>Deselect all text of the current editor.</p>"""
1063 )) 1107 ))
1064 self.deselectAllAct.triggered[()].connect(self.__editDeselectAll) 1108 self.deselectAllAct.triggered[()].connect(self.__editDeselectAll)
1065 self.editActions.append(self.deselectAllAct) 1109 self.editActions.append(self.deselectAllAct)
1066 1110
1067 self.convertEOLAct = E5Action(QApplication.translate('ViewManager', 1111 self.convertEOLAct = E5Action(
1068 'Convert Line End Characters'), 1112 QApplication.translate(
1069 QApplication.translate('ViewManager', 'Convert &Line End Characters'), 1113 'ViewManager', 'Convert Line End Characters'),
1070 0, 0, 1114 QApplication.translate(
1071 self.editActGrp, 'vm_edit_convert_eol') 1115 'ViewManager', 'Convert &Line End Characters'),
1116 0, 0,
1117 self.editActGrp, 'vm_edit_convert_eol')
1072 self.convertEOLAct.setStatusTip(QApplication.translate('ViewManager', 1118 self.convertEOLAct.setStatusTip(QApplication.translate('ViewManager',
1073 'Convert Line End Characters')) 1119 'Convert Line End Characters'))
1074 self.convertEOLAct.setWhatsThis(QApplication.translate('ViewManager', 1120 self.convertEOLAct.setWhatsThis(QApplication.translate('ViewManager',
1075 """<b>Convert Line End Characters</b>""" 1121 """<b>Convert Line End Characters</b>"""
1076 """<p>Convert the line end characters to the currently set type.</p>""" 1122 """<p>Convert the line end characters to the currently set"""
1123 """ type.</p>"""
1077 )) 1124 ))
1078 self.convertEOLAct.triggered[()].connect(self.__convertEOL) 1125 self.convertEOLAct.triggered[()].connect(self.__convertEOL)
1079 self.editActions.append(self.convertEOLAct) 1126 self.editActions.append(self.convertEOLAct)
1080 1127
1081 self.shortenEmptyAct = E5Action(QApplication.translate('ViewManager', 1128 self.shortenEmptyAct = E5Action(QApplication.translate('ViewManager',
1085 self.editActGrp, 'vm_edit_shorten_empty_lines') 1132 self.editActGrp, 'vm_edit_shorten_empty_lines')
1086 self.shortenEmptyAct.setStatusTip(QApplication.translate('ViewManager', 1133 self.shortenEmptyAct.setStatusTip(QApplication.translate('ViewManager',
1087 'Shorten empty lines')) 1134 'Shorten empty lines'))
1088 self.shortenEmptyAct.setWhatsThis(QApplication.translate('ViewManager', 1135 self.shortenEmptyAct.setWhatsThis(QApplication.translate('ViewManager',
1089 """<b>Shorten empty lines</b>""" 1136 """<b>Shorten empty lines</b>"""
1090 """<p>Shorten lines consisting solely of whitespace characters.</p>""" 1137 """<p>Shorten lines consisting solely of whitespace"""
1138 """ characters.</p>"""
1091 )) 1139 ))
1092 self.shortenEmptyAct.triggered[()].connect(self.__shortenEmptyLines) 1140 self.shortenEmptyAct.triggered[()].connect(self.__shortenEmptyLines)
1093 self.editActions.append(self.shortenEmptyAct) 1141 self.editActions.append(self.shortenEmptyAct)
1094 1142
1095 self.autoCompleteAct = E5Action(QApplication.translate('ViewManager', 1143 self.autoCompleteAct = E5Action(QApplication.translate('ViewManager',
1101 self.editActGrp, 'vm_edit_autocomplete') 1149 self.editActGrp, 'vm_edit_autocomplete')
1102 self.autoCompleteAct.setStatusTip(QApplication.translate('ViewManager', 1150 self.autoCompleteAct.setStatusTip(QApplication.translate('ViewManager',
1103 'Autocomplete current word')) 1151 'Autocomplete current word'))
1104 self.autoCompleteAct.setWhatsThis(QApplication.translate('ViewManager', 1152 self.autoCompleteAct.setWhatsThis(QApplication.translate('ViewManager',
1105 """<b>Autocomplete</b>""" 1153 """<b>Autocomplete</b>"""
1106 """<p>Performs an autocompletion of the word containing the cursor.</p>""" 1154 """<p>Performs an autocompletion of the word containing"""
1155 """ the cursor.</p>"""
1107 )) 1156 ))
1108 self.autoCompleteAct.triggered[()].connect(self.__editAutoComplete) 1157 self.autoCompleteAct.triggered[()].connect(self.__editAutoComplete)
1109 self.editActions.append(self.autoCompleteAct) 1158 self.editActions.append(self.autoCompleteAct)
1110 1159
1111 self.autoCompleteFromDocAct = E5Action(QApplication.translate('ViewManager', 1160 self.autoCompleteFromDocAct = E5Action(
1112 'Autocomplete from Document'), 1161 QApplication.translate(
1113 QApplication.translate('ViewManager', 'Autocomplete from Document'), 1162 'ViewManager', 'Autocomplete from Document'),
1114 QKeySequence(QApplication.translate('ViewManager', "Ctrl+Shift+Space", 1163 QApplication.translate(
1115 "Edit|Autocomplete from Document")), 1164 'ViewManager', 'Autocomplete from Document'),
1116 0, 1165 QKeySequence(QApplication.translate(
1117 self.editActGrp, 'vm_edit_autocomplete_from_document') 1166 'ViewManager', "Ctrl+Shift+Space",
1118 self.autoCompleteFromDocAct.setStatusTip(QApplication.translate('ViewManager', 1167 "Edit|Autocomplete from Document")),
1168 0,
1169 self.editActGrp, 'vm_edit_autocomplete_from_document')
1170 self.autoCompleteFromDocAct.setStatusTip(QApplication.translate(
1171 'ViewManager',
1119 'Autocomplete current word from Document')) 1172 'Autocomplete current word from Document'))
1120 self.autoCompleteFromDocAct.setWhatsThis(QApplication.translate('ViewManager', 1173 self.autoCompleteFromDocAct.setWhatsThis(QApplication.translate(
1174 'ViewManager',
1121 """<b>Autocomplete from Document</b>""" 1175 """<b>Autocomplete from Document</b>"""
1122 """<p>Performs an autocompletion from document of the word""" 1176 """<p>Performs an autocompletion from document of the word"""
1123 """ containing the cursor.</p>""" 1177 """ containing the cursor.</p>"""
1124 )) 1178 ))
1125 self.autoCompleteFromDocAct.triggered[()].connect(self.__editAutoCompleteFromDoc) 1179 self.autoCompleteFromDocAct.triggered[()].connect(
1180 self.__editAutoCompleteFromDoc)
1126 self.editActions.append(self.autoCompleteFromDocAct) 1181 self.editActions.append(self.autoCompleteFromDocAct)
1127 1182
1128 self.autoCompleteFromAPIsAct = E5Action(QApplication.translate('ViewManager', 1183 self.autoCompleteFromAPIsAct = E5Action(
1129 'Autocomplete from APIs'), 1184 QApplication.translate('ViewManager', 'Autocomplete from APIs'),
1130 QApplication.translate('ViewManager', 'Autocomplete from APIs'), 1185 QApplication.translate('ViewManager', 'Autocomplete from APIs'),
1131 QKeySequence(QApplication.translate('ViewManager', "Ctrl+Alt+Space", 1186 QKeySequence(QApplication.translate(
1132 "Edit|Autocomplete from APIs")), 1187 'ViewManager', "Ctrl+Alt+Space",
1133 0, 1188 "Edit|Autocomplete from APIs")),
1134 self.editActGrp, 'vm_edit_autocomplete_from_api') 1189 0,
1135 self.autoCompleteFromAPIsAct.setStatusTip(QApplication.translate('ViewManager', 1190 self.editActGrp, 'vm_edit_autocomplete_from_api')
1191 self.autoCompleteFromAPIsAct.setStatusTip(QApplication.translate(
1192 'ViewManager',
1136 'Autocomplete current word from APIs')) 1193 'Autocomplete current word from APIs'))
1137 self.autoCompleteFromAPIsAct.setWhatsThis(QApplication.translate('ViewManager', 1194 self.autoCompleteFromAPIsAct.setWhatsThis(QApplication.translate(
1195 'ViewManager',
1138 """<b>Autocomplete from APIs</b>""" 1196 """<b>Autocomplete from APIs</b>"""
1139 """<p>Performs an autocompletion from APIs of the word containing""" 1197 """<p>Performs an autocompletion from APIs of the word"""
1140 """ the cursor.</p>""" 1198 """ containing the cursor.</p>"""
1141 )) 1199 ))
1142 self.autoCompleteFromAPIsAct.triggered[()].connect(self.__editAutoCompleteFromAPIs) 1200 self.autoCompleteFromAPIsAct.triggered[()].connect(
1201 self.__editAutoCompleteFromAPIs)
1143 self.editActions.append(self.autoCompleteFromAPIsAct) 1202 self.editActions.append(self.autoCompleteFromAPIsAct)
1144 1203
1145 self.autoCompleteFromAllAct = E5Action( 1204 self.autoCompleteFromAllAct = E5Action(
1146 QApplication.translate('ViewManager', 1205 QApplication.translate(
1147 'Autocomplete from Document and APIs'), 1206 'ViewManager', 'Autocomplete from Document and APIs'),
1148 QApplication.translate('ViewManager', 1207 QApplication.translate(
1149 'Autocomplete from Document and APIs'), 1208 'ViewManager', 'Autocomplete from Document and APIs'),
1150 QKeySequence(QApplication.translate('ViewManager', "Alt+Shift+Space", 1209 QKeySequence(QApplication.translate(
1151 "Edit|Autocomplete from Document and APIs")), 1210 'ViewManager', "Alt+Shift+Space",
1152 0, 1211 "Edit|Autocomplete from Document and APIs")),
1153 self.editActGrp, 'vm_edit_autocomplete_from_all') 1212 0,
1154 self.autoCompleteFromAllAct.setStatusTip(QApplication.translate('ViewManager', 1213 self.editActGrp, 'vm_edit_autocomplete_from_all')
1214 self.autoCompleteFromAllAct.setStatusTip(QApplication.translate(
1215 'ViewManager',
1155 'Autocomplete current word from Document and APIs')) 1216 'Autocomplete current word from Document and APIs'))
1156 self.autoCompleteFromAllAct.setWhatsThis(QApplication.translate('ViewManager', 1217 self.autoCompleteFromAllAct.setWhatsThis(QApplication.translate(
1218 'ViewManager',
1157 """<b>Autocomplete from Document and APIs</b>""" 1219 """<b>Autocomplete from Document and APIs</b>"""
1158 """<p>Performs an autocompletion from document and APIs""" 1220 """<p>Performs an autocompletion from document and APIs"""
1159 """ of the word containing the cursor.</p>""" 1221 """ of the word containing the cursor.</p>"""
1160 )) 1222 ))
1161 self.autoCompleteFromAllAct.triggered[()].connect(self.__editAutoCompleteFromAll) 1223 self.autoCompleteFromAllAct.triggered[()].connect(
1224 self.__editAutoCompleteFromAll)
1162 self.editActions.append(self.autoCompleteFromAllAct) 1225 self.editActions.append(self.autoCompleteFromAllAct)
1163 1226
1164 self.calltipsAct = E5Action(QApplication.translate('ViewManager', 1227 self.calltipsAct = E5Action(QApplication.translate('ViewManager',
1165 'Calltip'), 1228 'Calltip'),
1166 QApplication.translate('ViewManager', '&Calltip'), 1229 QApplication.translate('ViewManager', '&Calltip'),
1186 self.editActGrp, 'vm_edit_sort') 1249 self.editActGrp, 'vm_edit_sort')
1187 self.sortAct.setStatusTip(QApplication.translate('ViewManager', 1250 self.sortAct.setStatusTip(QApplication.translate('ViewManager',
1188 'Sort the lines containing the rectangular selection')) 1251 'Sort the lines containing the rectangular selection'))
1189 self.sortAct.setWhatsThis(QApplication.translate('ViewManager', 1252 self.sortAct.setWhatsThis(QApplication.translate('ViewManager',
1190 """<b>Sort</b>""" 1253 """<b>Sort</b>"""
1191 """<p>Sort the lines spanned by a rectangular selection based on the""" 1254 """<p>Sort the lines spanned by a rectangular selection based on"""
1192 """ selection ignoring leading and trailing whitespace.</p>""" 1255 """ the selection ignoring leading and trailing whitespace.</p>"""
1193 )) 1256 ))
1194 self.sortAct.triggered[()].connect(self.__editSortSelectedLines) 1257 self.sortAct.triggered[()].connect(self.__editSortSelectedLines)
1195 self.editActions.append(self.sortAct) 1258 self.editActions.append(self.sortAct)
1196 1259
1197 self.editActGrp.setEnabled(False) 1260 self.editActGrp.setEnabled(False)
1204 self.esm = QSignalMapper(self) 1267 self.esm = QSignalMapper(self)
1205 self.esm.mapped[int].connect(self.__editorCommand) 1268 self.esm.mapped[int].connect(self.__editorCommand)
1206 1269
1207 self.editorActGrp = createActionGroup(self.editActGrp) 1270 self.editorActGrp = createActionGroup(self.editActGrp)
1208 1271
1209 act = E5Action(QApplication.translate('ViewManager', 'Move left one character'), 1272 act = E5Action(
1210 QApplication.translate('ViewManager', 'Move left one character'), 1273 QApplication.translate('ViewManager', 'Move left one character'),
1211 QKeySequence(QApplication.translate('ViewManager', 'Left')), 0, 1274 QApplication.translate('ViewManager', 'Move left one character'),
1212 self.editorActGrp, 'vm_edit_move_left_char') 1275 QKeySequence(QApplication.translate('ViewManager', 'Left')), 0,
1276 self.editorActGrp, 'vm_edit_move_left_char')
1213 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT) 1277 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT)
1214 if isMacPlatform(): 1278 if isMacPlatform():
1215 act.setAlternateShortcut(QKeySequence( 1279 act.setAlternateShortcut(QKeySequence(
1216 QApplication.translate('ViewManager', 'Meta+B'))) 1280 QApplication.translate('ViewManager', 'Meta+B')))
1217 act.triggered[()].connect(self.esm.map) 1281 act.triggered[()].connect(self.esm.map)
1218 self.editActions.append(act) 1282 self.editActions.append(act)
1219 1283
1220 act = E5Action(QApplication.translate('ViewManager', 'Move right one character'), 1284 act = E5Action(
1221 QApplication.translate('ViewManager', 'Move right one character'), 1285 QApplication.translate('ViewManager', 'Move right one character'),
1222 QKeySequence(QApplication.translate('ViewManager', 'Right')), 0, 1286 QApplication.translate('ViewManager', 'Move right one character'),
1223 self.editorActGrp, 'vm_edit_move_right_char') 1287 QKeySequence(QApplication.translate('ViewManager', 'Right')), 0,
1288 self.editorActGrp, 'vm_edit_move_right_char')
1224 if isMacPlatform(): 1289 if isMacPlatform():
1225 act.setAlternateShortcut(QKeySequence( 1290 act.setAlternateShortcut(QKeySequence(
1226 QApplication.translate('ViewManager', 'Meta+F'))) 1291 QApplication.translate('ViewManager', 'Meta+F')))
1227 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT) 1292 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT)
1228 act.triggered[()].connect(self.esm.map) 1293 act.triggered[()].connect(self.esm.map)
1229 self.editActions.append(act) 1294 self.editActions.append(act)
1230 1295
1231 act = E5Action(QApplication.translate('ViewManager', 'Move up one line'), 1296 act = E5Action(
1232 QApplication.translate('ViewManager', 'Move up one line'), 1297 QApplication.translate('ViewManager', 'Move up one line'),
1233 QKeySequence(QApplication.translate('ViewManager', 'Up')), 0, 1298 QApplication.translate('ViewManager', 'Move up one line'),
1234 self.editorActGrp, 'vm_edit_move_up_line') 1299 QKeySequence(QApplication.translate('ViewManager', 'Up')), 0,
1300 self.editorActGrp, 'vm_edit_move_up_line')
1235 if isMacPlatform(): 1301 if isMacPlatform():
1236 act.setAlternateShortcut(QKeySequence( 1302 act.setAlternateShortcut(QKeySequence(
1237 QApplication.translate('ViewManager', 'Meta+P'))) 1303 QApplication.translate('ViewManager', 'Meta+P')))
1238 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP) 1304 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP)
1239 act.triggered[()].connect(self.esm.map) 1305 act.triggered[()].connect(self.esm.map)
1240 self.editActions.append(act) 1306 self.editActions.append(act)
1241 1307
1242 act = E5Action(QApplication.translate('ViewManager', 'Move down one line'), 1308 act = E5Action(
1243 QApplication.translate('ViewManager', 'Move down one line'), 1309 QApplication.translate('ViewManager', 'Move down one line'),
1244 QKeySequence(QApplication.translate('ViewManager', 'Down')), 0, 1310 QApplication.translate('ViewManager', 'Move down one line'),
1245 self.editorActGrp, 'vm_edit_move_down_line') 1311 QKeySequence(QApplication.translate('ViewManager', 'Down')), 0,
1312 self.editorActGrp, 'vm_edit_move_down_line')
1246 if isMacPlatform(): 1313 if isMacPlatform():
1247 act.setAlternateShortcut(QKeySequence( 1314 act.setAlternateShortcut(QKeySequence(
1248 QApplication.translate('ViewManager', 'Meta+N'))) 1315 QApplication.translate('ViewManager', 'Meta+N')))
1249 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN) 1316 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN)
1250 act.triggered[()].connect(self.esm.map) 1317 act.triggered[()].connect(self.esm.map)
1251 self.editActions.append(act) 1318 self.editActions.append(act)
1252 1319
1253 act = E5Action(QApplication.translate('ViewManager', 'Move left one word part'), 1320 act = E5Action(
1254 QApplication.translate('ViewManager', 'Move left one word part'), 1321 QApplication.translate('ViewManager', 'Move left one word part'),
1255 0, 0, 1322 QApplication.translate('ViewManager', 'Move left one word part'),
1256 self.editorActGrp, 'vm_edit_move_left_word_part') 1323 0, 0,
1324 self.editorActGrp, 'vm_edit_move_left_word_part')
1257 if not isMacPlatform(): 1325 if not isMacPlatform():
1258 act.setShortcut(QKeySequence( 1326 act.setShortcut(QKeySequence(
1259 QApplication.translate('ViewManager', 'Alt+Left'))) 1327 QApplication.translate('ViewManager', 'Alt+Left')))
1260 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT) 1328 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFT)
1261 act.triggered[()].connect(self.esm.map) 1329 act.triggered[()].connect(self.esm.map)
1262 self.editActions.append(act) 1330 self.editActions.append(act)
1263 1331
1264 act = E5Action(QApplication.translate('ViewManager', 'Move right one word part'), 1332 act = E5Action(
1265 QApplication.translate('ViewManager', 'Move right one word part'), 1333 QApplication.translate('ViewManager', 'Move right one word part'),
1266 0, 0, 1334 QApplication.translate('ViewManager', 'Move right one word part'),
1267 self.editorActGrp, 'vm_edit_move_right_word_part') 1335 0, 0,
1336 self.editorActGrp, 'vm_edit_move_right_word_part')
1268 if not isMacPlatform(): 1337 if not isMacPlatform():
1269 act.setShortcut(QKeySequence( 1338 act.setShortcut(QKeySequence(
1270 QApplication.translate('ViewManager', 'Alt+Right'))) 1339 QApplication.translate('ViewManager', 'Alt+Right')))
1271 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT) 1340 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHT)
1272 act.triggered[()].connect(self.esm.map) 1341 act.triggered[()].connect(self.esm.map)
1273 self.editActions.append(act) 1342 self.editActions.append(act)
1274 1343
1275 act = E5Action(QApplication.translate('ViewManager', 'Move left one word'), 1344 act = E5Action(
1276 QApplication.translate('ViewManager', 'Move left one word'), 1345 QApplication.translate('ViewManager', 'Move left one word'),
1277 0, 0, 1346 QApplication.translate('ViewManager', 'Move left one word'),
1278 self.editorActGrp, 'vm_edit_move_left_word') 1347 0, 0,
1348 self.editorActGrp, 'vm_edit_move_left_word')
1279 if isMacPlatform(): 1349 if isMacPlatform():
1280 act.setShortcut(QKeySequence( 1350 act.setShortcut(QKeySequence(
1281 QApplication.translate('ViewManager', 'Alt+Left'))) 1351 QApplication.translate('ViewManager', 'Alt+Left')))
1282 else: 1352 else:
1283 act.setShortcut(QKeySequence( 1353 act.setShortcut(QKeySequence(
1284 QApplication.translate('ViewManager', 'Ctrl+Left'))) 1354 QApplication.translate('ViewManager', 'Ctrl+Left')))
1285 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT) 1355 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT)
1286 act.triggered[()].connect(self.esm.map) 1356 act.triggered[()].connect(self.esm.map)
1287 self.editActions.append(act) 1357 self.editActions.append(act)
1288 1358
1289 act = E5Action(QApplication.translate('ViewManager', 'Move right one word'), 1359 act = E5Action(
1290 QApplication.translate('ViewManager', 'Move right one word'), 1360 QApplication.translate('ViewManager', 'Move right one word'),
1291 0, 0, 1361 QApplication.translate('ViewManager', 'Move right one word'),
1292 self.editorActGrp, 'vm_edit_move_right_word') 1362 0, 0,
1363 self.editorActGrp, 'vm_edit_move_right_word')
1293 if not isMacPlatform(): 1364 if not isMacPlatform():
1294 act.setShortcut(QKeySequence( 1365 act.setShortcut(QKeySequence(
1295 QApplication.translate('ViewManager', 'Ctrl+Right'))) 1366 QApplication.translate('ViewManager', 'Ctrl+Right')))
1296 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT) 1367 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT)
1297 act.triggered[()].connect(self.esm.map) 1368 act.triggered[()].connect(self.esm.map)
1340 QApplication.translate('ViewManager', 'End'))) 1411 QApplication.translate('ViewManager', 'End')))
1341 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND) 1412 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND)
1342 act.triggered[()].connect(self.esm.map) 1413 act.triggered[()].connect(self.esm.map)
1343 self.editActions.append(act) 1414 self.editActions.append(act)
1344 1415
1345 act = E5Action(QApplication.translate('ViewManager', 'Scroll view down one line'), 1416 act = E5Action(
1346 QApplication.translate('ViewManager', 'Scroll view down one line'), 1417 QApplication.translate('ViewManager', 'Scroll view down one line'),
1347 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Down')), 0, 1418 QApplication.translate('ViewManager', 'Scroll view down one line'),
1348 self.editorActGrp, 'vm_edit_scroll_down_line') 1419 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Down')),
1420 0,
1421 self.editorActGrp, 'vm_edit_scroll_down_line')
1349 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN) 1422 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN)
1350 act.triggered[()].connect(self.esm.map) 1423 act.triggered[()].connect(self.esm.map)
1351 self.editActions.append(act) 1424 self.editActions.append(act)
1352 1425
1353 act = E5Action(QApplication.translate('ViewManager', 'Scroll view up one line'), 1426 act = E5Action(
1354 QApplication.translate('ViewManager', 'Scroll view up one line'), 1427 QApplication.translate('ViewManager', 'Scroll view up one line'),
1355 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Up')), 0, 1428 QApplication.translate('ViewManager', 'Scroll view up one line'),
1356 self.editorActGrp, 'vm_edit_scroll_up_line') 1429 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Up')), 0,
1430 self.editorActGrp, 'vm_edit_scroll_up_line')
1357 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP) 1431 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP)
1358 act.triggered[()].connect(self.esm.map) 1432 act.triggered[()].connect(self.esm.map)
1359 self.editActions.append(act) 1433 self.editActions.append(act)
1360 1434
1361 act = E5Action(QApplication.translate('ViewManager', 'Move up one paragraph'), 1435 act = E5Action(
1362 QApplication.translate('ViewManager', 'Move up one paragraph'), 1436 QApplication.translate('ViewManager', 'Move up one paragraph'),
1363 QKeySequence(QApplication.translate('ViewManager', 'Alt+Up')), 0, 1437 QApplication.translate('ViewManager', 'Move up one paragraph'),
1364 self.editorActGrp, 'vm_edit_move_up_para') 1438 QKeySequence(QApplication.translate('ViewManager', 'Alt+Up')), 0,
1439 self.editorActGrp, 'vm_edit_move_up_para')
1365 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP) 1440 self.esm.setMapping(act, QsciScintilla.SCI_PARAUP)
1366 act.triggered[()].connect(self.esm.map) 1441 act.triggered[()].connect(self.esm.map)
1367 self.editActions.append(act) 1442 self.editActions.append(act)
1368 1443
1369 act = E5Action(QApplication.translate('ViewManager', 'Move down one paragraph'), 1444 act = E5Action(
1370 QApplication.translate('ViewManager', 'Move down one paragraph'), 1445 QApplication.translate('ViewManager', 'Move down one paragraph'),
1371 QKeySequence(QApplication.translate('ViewManager', 'Alt+Down')), 0, 1446 QApplication.translate('ViewManager', 'Move down one paragraph'),
1372 self.editorActGrp, 'vm_edit_move_down_para') 1447 QKeySequence(QApplication.translate('ViewManager', 'Alt+Down')), 0,
1448 self.editorActGrp, 'vm_edit_move_down_para')
1373 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN) 1449 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWN)
1374 act.triggered[()].connect(self.esm.map) 1450 act.triggered[()].connect(self.esm.map)
1375 self.editActions.append(act) 1451 self.editActions.append(act)
1376 1452
1377 act = E5Action(QApplication.translate('ViewManager', 'Move up one page'), 1453 act = E5Action(
1378 QApplication.translate('ViewManager', 'Move up one page'), 1454 QApplication.translate('ViewManager', 'Move up one page'),
1379 QKeySequence(QApplication.translate('ViewManager', 'PgUp')), 0, 1455 QApplication.translate('ViewManager', 'Move up one page'),
1380 self.editorActGrp, 'vm_edit_move_up_page') 1456 QKeySequence(QApplication.translate('ViewManager', 'PgUp')), 0,
1457 self.editorActGrp, 'vm_edit_move_up_page')
1381 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP) 1458 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP)
1382 act.triggered[()].connect(self.esm.map) 1459 act.triggered[()].connect(self.esm.map)
1383 self.editActions.append(act) 1460 self.editActions.append(act)
1384 1461
1385 act = E5Action(QApplication.translate('ViewManager', 'Move down one page'), 1462 act = E5Action(
1386 QApplication.translate('ViewManager', 'Move down one page'), 1463 QApplication.translate('ViewManager', 'Move down one page'),
1387 QKeySequence(QApplication.translate('ViewManager', 'PgDown')), 0, 1464 QApplication.translate('ViewManager', 'Move down one page'),
1388 self.editorActGrp, 'vm_edit_move_down_page') 1465 QKeySequence(QApplication.translate('ViewManager', 'PgDown')), 0,
1466 self.editorActGrp, 'vm_edit_move_down_page')
1389 if isMacPlatform(): 1467 if isMacPlatform():
1390 act.setAlternateShortcut(QKeySequence( 1468 act.setAlternateShortcut(QKeySequence(
1391 QApplication.translate('ViewManager', 'Meta+V'))) 1469 QApplication.translate('ViewManager', 'Meta+V')))
1392 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN) 1470 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN)
1393 act.triggered[()].connect(self.esm.map) 1471 act.triggered[()].connect(self.esm.map)
1394 self.editActions.append(act) 1472 self.editActions.append(act)
1395 1473
1396 act = E5Action(QApplication.translate('ViewManager', 'Move to start of document'), 1474 act = E5Action(
1397 QApplication.translate('ViewManager', 'Move to start of document'), 1475 QApplication.translate('ViewManager', 'Move to start of document'),
1398 0, 0, 1476 QApplication.translate('ViewManager', 'Move to start of document'),
1399 self.editorActGrp, 'vm_edit_move_start_text') 1477 0, 0,
1478 self.editorActGrp, 'vm_edit_move_start_text')
1400 if isMacPlatform(): 1479 if isMacPlatform():
1401 act.setShortcut(QKeySequence( 1480 act.setShortcut(QKeySequence(
1402 QApplication.translate('ViewManager', 'Ctrl+Up'))) 1481 QApplication.translate('ViewManager', 'Ctrl+Up')))
1403 else: 1482 else:
1404 act.setShortcut(QKeySequence( 1483 act.setShortcut(QKeySequence(
1405 QApplication.translate('ViewManager', 'Ctrl+Home'))) 1484 QApplication.translate('ViewManager', 'Ctrl+Home')))
1406 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART) 1485 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTSTART)
1407 act.triggered[()].connect(self.esm.map) 1486 act.triggered[()].connect(self.esm.map)
1408 self.editActions.append(act) 1487 self.editActions.append(act)
1409 1488
1410 act = E5Action(QApplication.translate('ViewManager', 'Move to end of document'), 1489 act = E5Action(
1411 QApplication.translate('ViewManager', 'Move to end of document'), 1490 QApplication.translate('ViewManager', 'Move to end of document'),
1412 0, 0, 1491 QApplication.translate('ViewManager', 'Move to end of document'),
1413 self.editorActGrp, 'vm_edit_move_end_text') 1492 0, 0,
1493 self.editorActGrp, 'vm_edit_move_end_text')
1414 if isMacPlatform(): 1494 if isMacPlatform():
1415 act.setShortcut(QKeySequence( 1495 act.setShortcut(QKeySequence(
1416 QApplication.translate('ViewManager', 'Ctrl+Down'))) 1496 QApplication.translate('ViewManager', 'Ctrl+Down')))
1417 else: 1497 else:
1418 act.setShortcut(QKeySequence( 1498 act.setShortcut(QKeySequence(
1419 QApplication.translate('ViewManager', 'Ctrl+End'))) 1499 QApplication.translate('ViewManager', 'Ctrl+End')))
1420 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND) 1500 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTEND)
1421 act.triggered[()].connect(self.esm.map) 1501 act.triggered[()].connect(self.esm.map)
1422 self.editActions.append(act) 1502 self.editActions.append(act)
1423 1503
1424 act = E5Action(QApplication.translate('ViewManager', 'Indent one level'), 1504 act = E5Action(
1425 QApplication.translate('ViewManager', 'Indent one level'), 1505 QApplication.translate('ViewManager', 'Indent one level'),
1426 QKeySequence(QApplication.translate('ViewManager', 'Tab')), 0, 1506 QApplication.translate('ViewManager', 'Indent one level'),
1427 self.editorActGrp, 'vm_edit_indent_one_level') 1507 QKeySequence(QApplication.translate('ViewManager', 'Tab')), 0,
1508 self.editorActGrp, 'vm_edit_indent_one_level')
1428 self.esm.setMapping(act, QsciScintilla.SCI_TAB) 1509 self.esm.setMapping(act, QsciScintilla.SCI_TAB)
1429 act.triggered[()].connect(self.esm.map) 1510 act.triggered[()].connect(self.esm.map)
1430 self.editActions.append(act) 1511 self.editActions.append(act)
1431 1512
1432 act = E5Action(QApplication.translate('ViewManager', 'Unindent one level'), 1513 act = E5Action(
1433 QApplication.translate('ViewManager', 'Unindent one level'), 1514 QApplication.translate('ViewManager', 'Unindent one level'),
1434 QKeySequence(QApplication.translate('ViewManager', 'Shift+Tab')), 0, 1515 QApplication.translate('ViewManager', 'Unindent one level'),
1435 self.editorActGrp, 'vm_edit_unindent_one_level') 1516 QKeySequence(QApplication.translate('ViewManager', 'Shift+Tab')),
1517 0,
1518 self.editorActGrp, 'vm_edit_unindent_one_level')
1436 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB) 1519 self.esm.setMapping(act, QsciScintilla.SCI_BACKTAB)
1437 act.triggered[()].connect(self.esm.map) 1520 act.triggered[()].connect(self.esm.map)
1438 self.editActions.append(act) 1521 self.editActions.append(act)
1439 1522
1440 act = E5Action(QApplication.translate('ViewManager', 1523 act = E5Action(
1441 'Extend selection left one character'), 1524 QApplication.translate(
1442 QApplication.translate('ViewManager', 1525 'ViewManager', 'Extend selection left one character'),
1443 'Extend selection left one character'), 1526 QApplication.translate(
1444 QKeySequence(QApplication.translate('ViewManager', 'Shift+Left')), 1527 'ViewManager', 'Extend selection left one character'),
1445 0, 1528 QKeySequence(QApplication.translate('ViewManager', 'Shift+Left')),
1446 self.editorActGrp, 'vm_edit_extend_selection_left_char') 1529 0,
1530 self.editorActGrp, 'vm_edit_extend_selection_left_char')
1447 if isMacPlatform(): 1531 if isMacPlatform():
1448 act.setAlternateShortcut(QKeySequence( 1532 act.setAlternateShortcut(QKeySequence(
1449 QApplication.translate('ViewManager', 'Meta+Shift+B'))) 1533 QApplication.translate('ViewManager', 'Meta+Shift+B')))
1450 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND) 1534 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND)
1451 act.triggered[()].connect(self.esm.map) 1535 act.triggered[()].connect(self.esm.map)
1452 self.editActions.append(act) 1536 self.editActions.append(act)
1453 1537
1454 act = E5Action(QApplication.translate('ViewManager', 1538 act = E5Action(
1455 'Extend selection right one character'), 1539 QApplication.translate(
1456 QApplication.translate('ViewManager', 1540 'ViewManager', 'Extend selection right one character'),
1457 'Extend selection right one character'), 1541 QApplication.translate(
1458 QKeySequence(QApplication.translate('ViewManager', 'Shift+Right')), 1542 'ViewManager', 'Extend selection right one character'),
1459 0, 1543 QKeySequence(QApplication.translate('ViewManager', 'Shift+Right')),
1460 self.editorActGrp, 'vm_edit_extend_selection_right_char') 1544 0,
1545 self.editorActGrp, 'vm_edit_extend_selection_right_char')
1461 if isMacPlatform(): 1546 if isMacPlatform():
1462 act.setAlternateShortcut(QKeySequence( 1547 act.setAlternateShortcut(QKeySequence(
1463 QApplication.translate('ViewManager', 'Meta+Shift+F'))) 1548 QApplication.translate('ViewManager', 'Meta+Shift+F')))
1464 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND) 1549 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND)
1465 act.triggered[()].connect(self.esm.map) 1550 act.triggered[()].connect(self.esm.map)
1466 self.editActions.append(act) 1551 self.editActions.append(act)
1467 1552
1468 act = E5Action(QApplication.translate('ViewManager', 1553 act = E5Action(
1469 'Extend selection up one line'), 1554 QApplication.translate(
1470 QApplication.translate('ViewManager', 1555 'ViewManager', 'Extend selection up one line'),
1471 'Extend selection up one line'), 1556 QApplication.translate(
1472 QKeySequence(QApplication.translate('ViewManager', 'Shift+Up')), 0, 1557 'ViewManager', 'Extend selection up one line'),
1473 self.editorActGrp, 'vm_edit_extend_selection_up_line') 1558 QKeySequence(QApplication.translate('ViewManager', 'Shift+Up')), 0,
1559 self.editorActGrp, 'vm_edit_extend_selection_up_line')
1474 if isMacPlatform(): 1560 if isMacPlatform():
1475 act.setAlternateShortcut(QKeySequence( 1561 act.setAlternateShortcut(QKeySequence(
1476 QApplication.translate('ViewManager', 'Meta+Shift+P'))) 1562 QApplication.translate('ViewManager', 'Meta+Shift+P')))
1477 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND) 1563 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPEXTEND)
1478 act.triggered[()].connect(self.esm.map) 1564 act.triggered[()].connect(self.esm.map)
1479 self.editActions.append(act) 1565 self.editActions.append(act)
1480 1566
1481 act = E5Action(QApplication.translate('ViewManager', 1567 act = E5Action(
1482 'Extend selection down one line'), 1568 QApplication.translate(
1483 QApplication.translate('ViewManager', 1569 'ViewManager', 'Extend selection down one line'),
1484 'Extend selection down one line'), 1570 QApplication.translate(
1485 QKeySequence(QApplication.translate('ViewManager', 'Shift+Down')), 1571 'ViewManager', 'Extend selection down one line'),
1486 0, 1572 QKeySequence(QApplication.translate('ViewManager', 'Shift+Down')),
1487 self.editorActGrp, 'vm_edit_extend_selection_down_line') 1573 0,
1574 self.editorActGrp, 'vm_edit_extend_selection_down_line')
1488 if isMacPlatform(): 1575 if isMacPlatform():
1489 act.setAlternateShortcut(QKeySequence( 1576 act.setAlternateShortcut(QKeySequence(
1490 QApplication.translate('ViewManager', 'Meta+Shift+N'))) 1577 QApplication.translate('ViewManager', 'Meta+Shift+N')))
1491 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND) 1578 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNEXTEND)
1492 act.triggered[()].connect(self.esm.map) 1579 act.triggered[()].connect(self.esm.map)
1493 self.editActions.append(act) 1580 self.editActions.append(act)
1494 1581
1495 act = E5Action(QApplication.translate('ViewManager', 1582 act = E5Action(
1496 'Extend selection left one word part'), 1583 QApplication.translate(
1497 QApplication.translate('ViewManager', 1584 'ViewManager', 'Extend selection left one word part'),
1498 'Extend selection left one word part'), 1585 QApplication.translate(
1499 0, 0, 1586 'ViewManager', 'Extend selection left one word part'),
1500 self.editorActGrp, 'vm_edit_extend_selection_left_word_part') 1587 0, 0,
1588 self.editorActGrp, 'vm_edit_extend_selection_left_word_part')
1501 if not isMacPlatform(): 1589 if not isMacPlatform():
1502 act.setShortcut(QKeySequence( 1590 act.setShortcut(QKeySequence(
1503 QApplication.translate('ViewManager', 'Alt+Shift+Left'))) 1591 QApplication.translate('ViewManager', 'Alt+Shift+Left')))
1504 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND) 1592 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTLEFTEXTEND)
1505 act.triggered[()].connect(self.esm.map) 1593 act.triggered[()].connect(self.esm.map)
1506 self.editActions.append(act) 1594 self.editActions.append(act)
1507 1595
1508 act = E5Action(QApplication.translate('ViewManager', 1596 act = E5Action(
1509 'Extend selection right one word part'), 1597 QApplication.translate(
1510 QApplication.translate('ViewManager', 1598 'ViewManager', 'Extend selection right one word part'),
1511 'Extend selection right one word part'), 1599 QApplication.translate(
1512 0, 0, 1600 'ViewManager', 'Extend selection right one word part'),
1513 self.editorActGrp, 'vm_edit_extend_selection_right_word_part') 1601 0, 0,
1602 self.editorActGrp, 'vm_edit_extend_selection_right_word_part')
1514 if not isMacPlatform(): 1603 if not isMacPlatform():
1515 act.setShortcut(QKeySequence( 1604 act.setShortcut(QKeySequence(
1516 QApplication.translate('ViewManager', 'Alt+Shift+Right'))) 1605 QApplication.translate('ViewManager', 'Alt+Shift+Right')))
1517 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND) 1606 self.esm.setMapping(act, QsciScintilla.SCI_WORDPARTRIGHTEXTEND)
1518 act.triggered[()].connect(self.esm.map) 1607 act.triggered[()].connect(self.esm.map)
1548 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) 1637 QApplication.translate('ViewManager', 'Ctrl+Shift+Right')))
1549 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND) 1638 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND)
1550 act.triggered[()].connect(self.esm.map) 1639 act.triggered[()].connect(self.esm.map)
1551 self.editActions.append(act) 1640 self.editActions.append(act)
1552 1641
1553 act = E5Action(QApplication.translate('ViewManager', 1642 act = E5Action(
1554 'Extend selection to first visible character in document line'), 1643 QApplication.translate(
1555 QApplication.translate('ViewManager', 1644 'ViewManager',
1556 'Extend selection to first visible character in document line'), 1645 'Extend selection to first visible character in document'
1557 0, 0, 1646 ' line'),
1558 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char') 1647 QApplication.translate(
1648 'ViewManager',
1649 'Extend selection to first visible character in document'
1650 ' line'),
1651 0, 0,
1652 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char')
1559 if not isMacPlatform(): 1653 if not isMacPlatform():
1560 act.setShortcut(QKeySequence( 1654 act.setShortcut(QKeySequence(
1561 QApplication.translate('ViewManager', 'Shift+Home'))) 1655 QApplication.translate('ViewManager', 'Shift+Home')))
1562 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND) 1656 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND)
1563 act.triggered[()].connect(self.esm.map) 1657 act.triggered[()].connect(self.esm.map)
1577 QApplication.translate('ViewManager', 'Shift+End'))) 1671 QApplication.translate('ViewManager', 'Shift+End')))
1578 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND) 1672 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND)
1579 act.triggered[()].connect(self.esm.map) 1673 act.triggered[()].connect(self.esm.map)
1580 self.editActions.append(act) 1674 self.editActions.append(act)
1581 1675
1582 act = E5Action(QApplication.translate('ViewManager', 1676 act = E5Action(
1583 'Extend selection up one paragraph'), 1677 QApplication.translate(
1584 QApplication.translate('ViewManager', 1678 'ViewManager', 'Extend selection up one paragraph'),
1585 'Extend selection up one paragraph'), 1679 QApplication.translate(
1586 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+Up')), 1680 'ViewManager', 'Extend selection up one paragraph'),
1587 0, 1681 QKeySequence(QApplication.translate(
1588 self.editorActGrp, 'vm_edit_extend_selection_up_para') 1682 'ViewManager', 'Alt+Shift+Up')),
1683 0,
1684 self.editorActGrp, 'vm_edit_extend_selection_up_para')
1589 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND) 1685 self.esm.setMapping(act, QsciScintilla.SCI_PARAUPEXTEND)
1590 act.triggered[()].connect(self.esm.map) 1686 act.triggered[()].connect(self.esm.map)
1591 self.editActions.append(act) 1687 self.editActions.append(act)
1592 1688
1593 act = E5Action(QApplication.translate('ViewManager', 1689 act = E5Action(QApplication.translate('ViewManager',
1600 self.editorActGrp, 'vm_edit_extend_selection_down_para') 1696 self.editorActGrp, 'vm_edit_extend_selection_down_para')
1601 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND) 1697 self.esm.setMapping(act, QsciScintilla.SCI_PARADOWNEXTEND)
1602 act.triggered[()].connect(self.esm.map) 1698 act.triggered[()].connect(self.esm.map)
1603 self.editActions.append(act) 1699 self.editActions.append(act)
1604 1700
1605 act = E5Action(QApplication.translate('ViewManager', 1701 act = E5Action(
1606 'Extend selection up one page'), 1702 QApplication.translate(
1607 QApplication.translate('ViewManager', 1703 'ViewManager', 'Extend selection up one page'),
1608 'Extend selection up one page'), 1704 QApplication.translate(
1609 QKeySequence(QApplication.translate('ViewManager', 'Shift+PgUp')), 1705 'ViewManager', 'Extend selection up one page'),
1610 0, 1706 QKeySequence(QApplication.translate('ViewManager', 'Shift+PgUp')),
1611 self.editorActGrp, 'vm_edit_extend_selection_up_page') 1707 0,
1708 self.editorActGrp, 'vm_edit_extend_selection_up_page')
1612 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND) 1709 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPEXTEND)
1613 act.triggered[()].connect(self.esm.map) 1710 act.triggered[()].connect(self.esm.map)
1614 self.editActions.append(act) 1711 self.editActions.append(act)
1615 1712
1616 act = E5Action(QApplication.translate('ViewManager', 1713 act = E5Action(
1617 'Extend selection down one page'), 1714 QApplication.translate(
1618 QApplication.translate('ViewManager', 1715 'ViewManager', 'Extend selection down one page'),
1619 'Extend selection down one page'), 1716 QApplication.translate(
1620 QKeySequence(QApplication.translate('ViewManager', 'Shift+PgDown')), 1717 'ViewManager', 'Extend selection down one page'),
1621 0, 1718 QKeySequence(QApplication.translate(
1622 self.editorActGrp, 'vm_edit_extend_selection_down_page') 1719 'ViewManager', 'Shift+PgDown')),
1720 0,
1721 self.editorActGrp, 'vm_edit_extend_selection_down_page')
1623 if isMacPlatform(): 1722 if isMacPlatform():
1624 act.setAlternateShortcut(QKeySequence( 1723 act.setAlternateShortcut(QKeySequence(
1625 QApplication.translate('ViewManager', 'Meta+Shift+V'))) 1724 QApplication.translate('ViewManager', 'Meta+Shift+V')))
1626 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND) 1725 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNEXTEND)
1627 act.triggered[()].connect(self.esm.map) 1726 act.triggered[()].connect(self.esm.map)
1657 QApplication.translate('ViewManager', 'Ctrl+Shift+End'))) 1756 QApplication.translate('ViewManager', 'Ctrl+Shift+End')))
1658 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND) 1757 self.esm.setMapping(act, QsciScintilla.SCI_DOCUMENTENDEXTEND)
1659 act.triggered[()].connect(self.esm.map) 1758 act.triggered[()].connect(self.esm.map)
1660 self.editActions.append(act) 1759 self.editActions.append(act)
1661 1760
1662 act = E5Action(QApplication.translate('ViewManager', 1761 act = E5Action(
1663 'Delete previous character'), 1762 QApplication.translate('ViewManager', 'Delete previous character'),
1664 QApplication.translate('ViewManager', 'Delete previous character'), 1763 QApplication.translate('ViewManager', 'Delete previous character'),
1665 QKeySequence(QApplication.translate('ViewManager', 'Backspace')), 1764 QKeySequence(QApplication.translate('ViewManager', 'Backspace')),
1666 0, 1765 0,
1667 self.editorActGrp, 'vm_edit_delete_previous_char') 1766 self.editorActGrp, 'vm_edit_delete_previous_char')
1668 if isMacPlatform(): 1767 if isMacPlatform():
1669 act.setAlternateShortcut(QKeySequence( 1768 act.setAlternateShortcut(QKeySequence(
1670 QApplication.translate('ViewManager', 'Meta+H'))) 1769 QApplication.translate('ViewManager', 'Meta+H')))
1671 else: 1770 else:
1672 act.setAlternateShortcut(QKeySequence( 1771 act.setAlternateShortcut(QKeySequence(
1673 QApplication.translate('ViewManager', 'Shift+Backspace'))) 1772 QApplication.translate('ViewManager', 'Shift+Backspace')))
1674 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK) 1773 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK)
1675 act.triggered[()].connect(self.esm.map) 1774 act.triggered[()].connect(self.esm.map)
1676 self.editActions.append(act) 1775 self.editActions.append(act)
1677 1776
1678 act = E5Action(QApplication.translate('ViewManager', 1777 act = E5Action(
1679 'Delete previous character if not at start of line'), 1778 QApplication.translate(
1680 QApplication.translate('ViewManager', 1779 'ViewManager',
1681 'Delete previous character if not at start of line'), 1780 'Delete previous character if not at start of line'),
1682 0, 0, 1781 QApplication.translate(
1683 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start') 1782 'ViewManager',
1783 'Delete previous character if not at start of line'),
1784 0, 0,
1785 self.editorActGrp, 'vm_edit_delet_previous_char_not_line_start')
1684 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE) 1786 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACKNOTLINE)
1685 act.triggered[()].connect(self.esm.map) 1787 act.triggered[()].connect(self.esm.map)
1686 self.editActions.append(act) 1788 self.editActions.append(act)
1687 1789
1688 act = E5Action(QApplication.translate('ViewManager', 'Delete current character'), 1790 act = E5Action(
1689 QApplication.translate('ViewManager', 'Delete current character'), 1791 QApplication.translate('ViewManager', 'Delete current character'),
1690 QKeySequence(QApplication.translate('ViewManager', 'Del')), 0, 1792 QApplication.translate('ViewManager', 'Delete current character'),
1691 self.editorActGrp, 'vm_edit_delete_current_char') 1793 QKeySequence(QApplication.translate('ViewManager', 'Del')), 0,
1794 self.editorActGrp, 'vm_edit_delete_current_char')
1692 if isMacPlatform(): 1795 if isMacPlatform():
1693 act.setAlternateShortcut(QKeySequence( 1796 act.setAlternateShortcut(QKeySequence(
1694 QApplication.translate('ViewManager', 'Meta+D'))) 1797 QApplication.translate('ViewManager', 'Meta+D')))
1695 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR) 1798 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR)
1696 act.triggered[()].connect(self.esm.map) 1799 act.triggered[()].connect(self.esm.map)
1697 self.editActions.append(act) 1800 self.editActions.append(act)
1698 1801
1699 act = E5Action(QApplication.translate('ViewManager', 'Delete word to left'), 1802 act = E5Action(
1700 QApplication.translate('ViewManager', 'Delete word to left'), 1803 QApplication.translate('ViewManager', 'Delete word to left'),
1701 QKeySequence(QApplication.translate('ViewManager', 1804 QApplication.translate('ViewManager', 'Delete word to left'),
1702 'Ctrl+Backspace')), 1805 QKeySequence(QApplication.translate(
1703 0, 1806 'ViewManager', 'Ctrl+Backspace')),
1704 self.editorActGrp, 'vm_edit_delete_word_left') 1807 0,
1808 self.editorActGrp, 'vm_edit_delete_word_left')
1705 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT) 1809 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT)
1706 act.triggered[()].connect(self.esm.map) 1810 act.triggered[()].connect(self.esm.map)
1707 self.editActions.append(act) 1811 self.editActions.append(act)
1708 1812
1709 act = E5Action(QApplication.translate('ViewManager', 'Delete word to right'), 1813 act = E5Action(
1710 QApplication.translate('ViewManager', 'Delete word to right'), 1814 QApplication.translate('ViewManager', 'Delete word to right'),
1711 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Del')), 0, 1815 QApplication.translate('ViewManager', 'Delete word to right'),
1712 self.editorActGrp, 'vm_edit_delete_word_right') 1816 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Del')), 0,
1817 self.editorActGrp, 'vm_edit_delete_word_right')
1713 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT) 1818 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT)
1714 act.triggered[()].connect(self.esm.map) 1819 act.triggered[()].connect(self.esm.map)
1715 self.editActions.append(act) 1820 self.editActions.append(act)
1716 1821
1717 act = E5Action(QApplication.translate('ViewManager', 'Delete line to left'), 1822 act = E5Action(
1718 QApplication.translate('ViewManager', 'Delete line to left'), 1823 QApplication.translate('ViewManager', 'Delete line to left'),
1719 QKeySequence(QApplication.translate('ViewManager', 1824 QApplication.translate('ViewManager', 'Delete line to left'),
1720 'Ctrl+Shift+Backspace')), 1825 QKeySequence(QApplication.translate(
1721 0, 1826 'ViewManager', 'Ctrl+Shift+Backspace')),
1722 self.editorActGrp, 'vm_edit_delete_line_left') 1827 0,
1828 self.editorActGrp, 'vm_edit_delete_line_left')
1723 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT) 1829 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT)
1724 act.triggered[()].connect(self.esm.map) 1830 act.triggered[()].connect(self.esm.map)
1725 self.editActions.append(act) 1831 self.editActions.append(act)
1726 1832
1727 act = E5Action(QApplication.translate('ViewManager', 'Delete line to right'), 1833 act = E5Action(
1728 QApplication.translate('ViewManager', 'Delete line to right'), 1834 QApplication.translate('ViewManager', 'Delete line to right'),
1729 0, 0, 1835 QApplication.translate('ViewManager', 'Delete line to right'),
1730 self.editorActGrp, 'vm_edit_delete_line_right') 1836 0, 0,
1837 self.editorActGrp, 'vm_edit_delete_line_right')
1731 if isMacPlatform(): 1838 if isMacPlatform():
1732 act.setShortcut(QKeySequence( 1839 act.setShortcut(QKeySequence(
1733 QApplication.translate('ViewManager', 'Meta+K'))) 1840 QApplication.translate('ViewManager', 'Meta+K')))
1734 else: 1841 else:
1735 act.setShortcut(QKeySequence( 1842 act.setShortcut(QKeySequence(
1736 QApplication.translate('ViewManager', 'Ctrl+Shift+Del'))) 1843 QApplication.translate('ViewManager', 'Ctrl+Shift+Del')))
1737 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT) 1844 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT)
1738 act.triggered[()].connect(self.esm.map) 1845 act.triggered[()].connect(self.esm.map)
1739 self.editActions.append(act) 1846 self.editActions.append(act)
1740 1847
1741 act = E5Action(QApplication.translate('ViewManager', 'Insert new line'), 1848 act = E5Action(
1742 QApplication.translate('ViewManager', 'Insert new line'), 1849 QApplication.translate('ViewManager', 'Insert new line'),
1743 QKeySequence(QApplication.translate('ViewManager', 'Return')), 1850 QApplication.translate('ViewManager', 'Insert new line'),
1744 QKeySequence(QApplication.translate('ViewManager', 'Enter')), 1851 QKeySequence(QApplication.translate('ViewManager', 'Return')),
1745 self.editorActGrp, 'vm_edit_insert_line') 1852 QKeySequence(QApplication.translate('ViewManager', 'Enter')),
1853 self.editorActGrp, 'vm_edit_insert_line')
1746 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE) 1854 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE)
1747 act.triggered[()].connect(self.esm.map) 1855 act.triggered[()].connect(self.esm.map)
1748 self.editActions.append(act) 1856 self.editActions.append(act)
1749 1857
1750 act = E5Action(QApplication.translate('ViewManager', 1858 act = E5Action(
1751 'Insert new line below current line'), 1859 QApplication.translate(
1752 QApplication.translate('ViewManager', 1860 'ViewManager', 'Insert new line below current line'),
1753 'Insert new line below current line'), 1861 QApplication.translate(
1754 QKeySequence(QApplication.translate('ViewManager', 'Shift+Return')), 1862 'ViewManager', 'Insert new line below current line'),
1755 QKeySequence(QApplication.translate('ViewManager', 'Shift+Enter')), 1863 QKeySequence(QApplication.translate(
1756 self.editorActGrp, 'vm_edit_insert_line_below') 1864 'ViewManager', 'Shift+Return')),
1865 QKeySequence(QApplication.translate('ViewManager', 'Shift+Enter')),
1866 self.editorActGrp, 'vm_edit_insert_line_below')
1757 act.triggered[()].connect(self.__newLineBelow) 1867 act.triggered[()].connect(self.__newLineBelow)
1758 self.editActions.append(act) 1868 self.editActions.append(act)
1759 1869
1760 act = E5Action(QApplication.translate('ViewManager', 'Delete current line'), 1870 act = E5Action(
1761 QApplication.translate('ViewManager', 'Delete current line'), 1871 QApplication.translate('ViewManager', 'Delete current line'),
1762 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+L')), 1872 QApplication.translate('ViewManager', 'Delete current line'),
1763 0, 1873 QKeySequence(QApplication.translate(
1764 self.editorActGrp, 'vm_edit_delete_current_line') 1874 'ViewManager', 'Ctrl+Shift+L')),
1875 0,
1876 self.editorActGrp, 'vm_edit_delete_current_line')
1765 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE) 1877 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE)
1766 act.triggered[()].connect(self.esm.map) 1878 act.triggered[()].connect(self.esm.map)
1767 self.editActions.append(act) 1879 self.editActions.append(act)
1768 1880
1769 act = E5Action(QApplication.translate('ViewManager', 'Duplicate current line'), 1881 act = E5Action(
1770 QApplication.translate('ViewManager', 'Duplicate current line'), 1882 QApplication.translate('ViewManager', 'Duplicate current line'),
1771 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+D')), 0, 1883 QApplication.translate('ViewManager', 'Duplicate current line'),
1772 self.editorActGrp, 'vm_edit_duplicate_current_line') 1884 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+D')), 0,
1885 self.editorActGrp, 'vm_edit_duplicate_current_line')
1773 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE) 1886 self.esm.setMapping(act, QsciScintilla.SCI_LINEDUPLICATE)
1774 act.triggered[()].connect(self.esm.map) 1887 act.triggered[()].connect(self.esm.map)
1775 self.editActions.append(act) 1888 self.editActions.append(act)
1776 1889
1777 act = E5Action(QApplication.translate('ViewManager', 1890 act = E5Action(
1778 'Swap current and previous lines'), 1891 QApplication.translate(
1779 QApplication.translate('ViewManager', 1892 'ViewManager', 'Swap current and previous lines'),
1780 'Swap current and previous lines'), 1893 QApplication.translate(
1781 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+T')), 0, 1894 'ViewManager', 'Swap current and previous lines'),
1782 self.editorActGrp, 'vm_edit_swap_current_previous_line') 1895 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+T')), 0,
1896 self.editorActGrp, 'vm_edit_swap_current_previous_line')
1783 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE) 1897 self.esm.setMapping(act, QsciScintilla.SCI_LINETRANSPOSE)
1784 act.triggered[()].connect(self.esm.map) 1898 act.triggered[()].connect(self.esm.map)
1785 self.editActions.append(act) 1899 self.editActions.append(act)
1786 1900
1787 act = E5Action(QApplication.translate('ViewManager', 'Cut current line'), 1901 act = E5Action(
1788 QApplication.translate('ViewManager', 'Cut current line'), 1902 QApplication.translate('ViewManager', 'Cut current line'),
1789 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+L')), 1903 QApplication.translate('ViewManager', 'Cut current line'),
1790 0, 1904 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+L')),
1791 self.editorActGrp, 'vm_edit_cut_current_line') 1905 0,
1906 self.editorActGrp, 'vm_edit_cut_current_line')
1792 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT) 1907 self.esm.setMapping(act, QsciScintilla.SCI_LINECUT)
1793 act.triggered[()].connect(self.esm.map) 1908 act.triggered[()].connect(self.esm.map)
1794 self.editActions.append(act) 1909 self.editActions.append(act)
1795 1910
1796 act = E5Action(QApplication.translate('ViewManager', 'Copy current line'), 1911 act = E5Action(
1797 QApplication.translate('ViewManager', 'Copy current line'), 1912 QApplication.translate('ViewManager', 'Copy current line'),
1798 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+T')), 1913 QApplication.translate('ViewManager', 'Copy current line'),
1799 0, 1914 QKeySequence(QApplication.translate(
1800 self.editorActGrp, 'vm_edit_copy_current_line') 1915 'ViewManager', 'Ctrl+Shift+T')),
1916 0,
1917 self.editorActGrp, 'vm_edit_copy_current_line')
1801 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY) 1918 self.esm.setMapping(act, QsciScintilla.SCI_LINECOPY)
1802 act.triggered[()].connect(self.esm.map) 1919 act.triggered[()].connect(self.esm.map)
1803 self.editActions.append(act) 1920 self.editActions.append(act)
1804 1921
1805 act = E5Action(QApplication.translate('ViewManager', 'Toggle insert/overtype'), 1922 act = E5Action(
1806 QApplication.translate('ViewManager', 'Toggle insert/overtype'), 1923 QApplication.translate('ViewManager', 'Toggle insert/overtype'),
1807 QKeySequence(QApplication.translate('ViewManager', 'Ins')), 0, 1924 QApplication.translate('ViewManager', 'Toggle insert/overtype'),
1808 self.editorActGrp, 'vm_edit_toggle_insert_overtype') 1925 QKeySequence(QApplication.translate('ViewManager', 'Ins')), 0,
1926 self.editorActGrp, 'vm_edit_toggle_insert_overtype')
1809 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE) 1927 self.esm.setMapping(act, QsciScintilla.SCI_EDITTOGGLEOVERTYPE)
1810 act.triggered[()].connect(self.esm.map) 1928 act.triggered[()].connect(self.esm.map)
1811 self.editActions.append(act) 1929 self.editActions.append(act)
1812 1930
1813 act = E5Action(QApplication.translate('ViewManager', 1931 act = E5Action(QApplication.translate('ViewManager',
1824 QApplication.translate('ViewManager', 'Alt+End'))) 1942 QApplication.translate('ViewManager', 'Alt+End')))
1825 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY) 1943 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAY)
1826 act.triggered[()].connect(self.esm.map) 1944 act.triggered[()].connect(self.esm.map)
1827 self.editActions.append(act) 1945 self.editActions.append(act)
1828 1946
1829 act = E5Action(QApplication.translate('ViewManager', 1947 act = E5Action(
1830 'Extend selection to end of display line'), 1948 QApplication.translate(
1831 QApplication.translate('ViewManager', 1949 'ViewManager', 'Extend selection to end of display line'),
1832 'Extend selection to end of display line'), 1950 QApplication.translate(
1833 0, 0, 1951 'ViewManager', 'Extend selection to end of display line'),
1834 self.editorActGrp, 'vm_edit_extend_selection_end_displayed_line') 1952 0, 0,
1953 self.editorActGrp, 'vm_edit_extend_selection_end_displayed_line')
1835 if isMacPlatform(): 1954 if isMacPlatform():
1836 act.setShortcut(QKeySequence( 1955 act.setShortcut(QKeySequence(
1837 QApplication.translate('ViewManager', 'Ctrl+Shift+Right'))) 1956 QApplication.translate('ViewManager', 'Ctrl+Shift+Right')))
1838 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND) 1957 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDDISPLAYEXTEND)
1839 act.triggered[()].connect(self.esm.map) 1958 act.triggered[()].connect(self.esm.map)
1845 self.editorActGrp, 'vm_edit_formfeed') 1964 self.editorActGrp, 'vm_edit_formfeed')
1846 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) 1965 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED)
1847 act.triggered[()].connect(self.esm.map) 1966 act.triggered[()].connect(self.esm.map)
1848 self.editActions.append(act) 1967 self.editActions.append(act)
1849 1968
1850 act = E5Action(QApplication.translate('ViewManager', 'Escape'), 1969 act = E5Action(
1851 QApplication.translate('ViewManager', 'Escape'), 1970 QApplication.translate('ViewManager', 'Escape'),
1852 QKeySequence(QApplication.translate('ViewManager', 'Esc')), 0, 1971 QApplication.translate('ViewManager', 'Escape'),
1853 self.editorActGrp, 'vm_edit_escape') 1972 QKeySequence(QApplication.translate('ViewManager', 'Esc')), 0,
1973 self.editorActGrp, 'vm_edit_escape')
1854 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL) 1974 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL)
1855 act.triggered[()].connect(self.esm.map) 1975 act.triggered[()].connect(self.esm.map)
1856 self.editActions.append(act) 1976 self.editActions.append(act)
1857 1977
1858 act = E5Action(QApplication.translate('ViewManager', 1978 act = E5Action(
1859 'Extend rectangular selection down one line'), 1979 QApplication.translate(
1860 QApplication.translate('ViewManager', 1980 'ViewManager', 'Extend rectangular selection down one line'),
1861 'Extend rectangular selection down one line'), 1981 QApplication.translate(
1862 QKeySequence(QApplication.translate('ViewManager', 1982 'ViewManager', 'Extend rectangular selection down one line'),
1863 'Alt+Ctrl+Down')), 1983 QKeySequence(QApplication.translate(
1864 0, 1984 'ViewManager', 'Alt+Ctrl+Down')),
1865 self.editorActGrp, 'vm_edit_extend_rect_selection_down_line') 1985 0,
1986 self.editorActGrp, 'vm_edit_extend_rect_selection_down_line')
1866 if isMacPlatform(): 1987 if isMacPlatform():
1867 act.setAlternateShortcut(QKeySequence( 1988 act.setAlternateShortcut(QKeySequence(
1868 QApplication.translate('ViewManager', 'Meta+Alt+Shift+N'))) 1989 QApplication.translate('ViewManager', 'Meta+Alt+Shift+N')))
1869 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND) 1990 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWNRECTEXTEND)
1870 act.triggered[()].connect(self.esm.map) 1991 act.triggered[()].connect(self.esm.map)
1871 self.editActions.append(act) 1992 self.editActions.append(act)
1872 1993
1873 act = E5Action(QApplication.translate('ViewManager', 1994 act = E5Action(
1874 'Extend rectangular selection up one line'), 1995 QApplication.translate(
1875 QApplication.translate('ViewManager', 1996 'ViewManager', 'Extend rectangular selection up one line'),
1876 'Extend rectangular selection up one line'), 1997 QApplication.translate(
1877 QKeySequence(QApplication.translate('ViewManager', 'Alt+Ctrl+Up')), 1998 'ViewManager', 'Extend rectangular selection up one line'),
1878 0, 1999 QKeySequence(QApplication.translate('ViewManager', 'Alt+Ctrl+Up')),
1879 self.editorActGrp, 'vm_edit_extend_rect_selection_up_line') 2000 0,
2001 self.editorActGrp, 'vm_edit_extend_rect_selection_up_line')
1880 if isMacPlatform(): 2002 if isMacPlatform():
1881 act.setAlternateShortcut(QKeySequence( 2003 act.setAlternateShortcut(QKeySequence(
1882 QApplication.translate('ViewManager', 'Meta+Alt+Shift+P'))) 2004 QApplication.translate('ViewManager', 'Meta+Alt+Shift+P')))
1883 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND) 2005 self.esm.setMapping(act, QsciScintilla.SCI_LINEUPRECTEXTEND)
1884 act.triggered[()].connect(self.esm.map) 2006 act.triggered[()].connect(self.esm.map)
1885 self.editActions.append(act) 2007 self.editActions.append(act)
1886 2008
1887 act = E5Action(QApplication.translate('ViewManager', 2009 act = E5Action(
1888 'Extend rectangular selection left one character'), 2010 QApplication.translate(
1889 QApplication.translate('ViewManager', 2011 'ViewManager',
1890 'Extend rectangular selection left one character'), 2012 'Extend rectangular selection left one character'),
1891 QKeySequence(QApplication.translate('ViewManager', 2013 QApplication.translate(
1892 'Alt+Ctrl+Left')), 2014 'ViewManager',
1893 0, 2015 'Extend rectangular selection left one character'),
1894 self.editorActGrp, 'vm_edit_extend_rect_selection_left_char') 2016 QKeySequence(QApplication.translate(
2017 'ViewManager', 'Alt+Ctrl+Left')),
2018 0,
2019 self.editorActGrp, 'vm_edit_extend_rect_selection_left_char')
1895 if isMacPlatform(): 2020 if isMacPlatform():
1896 act.setAlternateShortcut(QKeySequence( 2021 act.setAlternateShortcut(QKeySequence(
1897 QApplication.translate('ViewManager', 'Meta+Alt+Shift+B'))) 2022 QApplication.translate('ViewManager', 'Meta+Alt+Shift+B')))
1898 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND) 2023 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTRECTEXTEND)
1899 act.triggered[()].connect(self.esm.map) 2024 act.triggered[()].connect(self.esm.map)
1900 self.editActions.append(act) 2025 self.editActions.append(act)
1901 2026
1902 act = E5Action(QApplication.translate('ViewManager', 2027 act = E5Action(
1903 'Extend rectangular selection right one character'), 2028 QApplication.translate(
1904 QApplication.translate('ViewManager', 2029 'ViewManager',
1905 'Extend rectangular selection right one character'), 2030 'Extend rectangular selection right one character'),
1906 QKeySequence(QApplication.translate('ViewManager', 2031 QApplication.translate(
1907 'Alt+Ctrl+Right')), 2032 'ViewManager',
1908 0, 2033 'Extend rectangular selection right one character'),
1909 self.editorActGrp, 'vm_edit_extend_rect_selection_right_char') 2034 QKeySequence(QApplication.translate(
2035 'ViewManager', 'Alt+Ctrl+Right')),
2036 0,
2037 self.editorActGrp, 'vm_edit_extend_rect_selection_right_char')
1910 if isMacPlatform(): 2038 if isMacPlatform():
1911 act.setAlternateShortcut(QKeySequence( 2039 act.setAlternateShortcut(QKeySequence(
1912 QApplication.translate('ViewManager', 'Meta+Alt+Shift+F'))) 2040 QApplication.translate('ViewManager', 'Meta+Alt+Shift+F')))
1913 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND) 2041 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTRECTEXTEND)
1914 act.triggered[()].connect(self.esm.map) 2042 act.triggered[()].connect(self.esm.map)
1928 QApplication.translate('ViewManager', 'Alt+Shift+Home'))) 2056 QApplication.translate('ViewManager', 'Alt+Shift+Home')))
1929 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND) 2057 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMERECTEXTEND)
1930 act.triggered[()].connect(self.esm.map) 2058 act.triggered[()].connect(self.esm.map)
1931 self.editActions.append(act) 2059 self.editActions.append(act)
1932 2060
1933 act = E5Action(QApplication.translate('ViewManager', 2061 act = E5Action(
1934 'Extend rectangular selection to end of document line'), 2062 QApplication.translate(
1935 QApplication.translate('ViewManager', 2063 'ViewManager',
1936 'Extend rectangular selection to end of document line'), 2064 'Extend rectangular selection to end of document line'),
1937 0, 0, 2065 QApplication.translate(
1938 self.editorActGrp, 'vm_edit_extend_rect_selection_end_line') 2066 'ViewManager',
2067 'Extend rectangular selection to end of document line'),
2068 0, 0,
2069 self.editorActGrp, 'vm_edit_extend_rect_selection_end_line')
1939 if isMacPlatform(): 2070 if isMacPlatform():
1940 act.setShortcut(QKeySequence( 2071 act.setShortcut(QKeySequence(
1941 QApplication.translate('ViewManager', 'Meta+Alt+Shift+E'))) 2072 QApplication.translate('ViewManager', 'Meta+Alt+Shift+E')))
1942 else: 2073 else:
1943 act.setShortcut(QKeySequence( 2074 act.setShortcut(QKeySequence(
1944 QApplication.translate('ViewManager', 'Alt+Shift+End'))) 2075 QApplication.translate('ViewManager', 'Alt+Shift+End')))
1945 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND) 2076 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDRECTEXTEND)
1946 act.triggered[()].connect(self.esm.map) 2077 act.triggered[()].connect(self.esm.map)
1947 self.editActions.append(act) 2078 self.editActions.append(act)
1948 2079
1949 act = E5Action(QApplication.translate('ViewManager', 2080 act = E5Action(
1950 'Extend rectangular selection up one page'), 2081 QApplication.translate(
1951 QApplication.translate('ViewManager', 2082 'ViewManager',
1952 'Extend rectangular selection up one page'), 2083 'Extend rectangular selection up one page'),
1953 QKeySequence(QApplication.translate('ViewManager', 2084 QApplication.translate(
1954 'Alt+Shift+PgUp')), 2085 'ViewManager',
1955 0, 2086 'Extend rectangular selection up one page'),
1956 self.editorActGrp, 'vm_edit_extend_rect_selection_up_page') 2087 QKeySequence(QApplication.translate(
2088 'ViewManager', 'Alt+Shift+PgUp')),
2089 0,
2090 self.editorActGrp, 'vm_edit_extend_rect_selection_up_page')
1957 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND) 2091 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUPRECTEXTEND)
1958 act.triggered[()].connect(self.esm.map) 2092 act.triggered[()].connect(self.esm.map)
1959 self.editActions.append(act) 2093 self.editActions.append(act)
1960 2094
1961 act = E5Action(QApplication.translate('ViewManager', 2095 act = E5Action(
1962 'Extend rectangular selection down one page'), 2096 QApplication.translate(
1963 QApplication.translate('ViewManager', 2097 'ViewManager',
1964 'Extend rectangular selection down one page'), 2098 'Extend rectangular selection down one page'),
1965 QKeySequence(QApplication.translate('ViewManager', 2099 QApplication.translate(
1966 'Alt+Shift+PgDown')), 2100 'ViewManager',
1967 0, 2101 'Extend rectangular selection down one page'),
1968 self.editorActGrp, 'vm_edit_extend_rect_selection_down_page') 2102 QKeySequence(QApplication.translate(
2103 'ViewManager', 'Alt+Shift+PgDown')),
2104 0,
2105 self.editorActGrp, 'vm_edit_extend_rect_selection_down_page')
1969 if isMacPlatform(): 2106 if isMacPlatform():
1970 act.setAlternateShortcut(QKeySequence( 2107 act.setAlternateShortcut(QKeySequence(
1971 QApplication.translate('ViewManager', 'Meta+Alt+Shift+V'))) 2108 QApplication.translate('ViewManager', 'Meta+Alt+Shift+V')))
1972 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND) 2109 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWNRECTEXTEND)
1973 act.triggered[()].connect(self.esm.map) 2110 act.triggered[()].connect(self.esm.map)
1974 self.editActions.append(act) 2111 self.editActions.append(act)
1975 2112
1976 act = E5Action(QApplication.translate('ViewManager', 2113 act = E5Action(
1977 'Duplicate current selection'), 2114 QApplication.translate(
1978 QApplication.translate('ViewManager', 2115 'ViewManager', 'Duplicate current selection'),
1979 'Duplicate current selection'), 2116 QApplication.translate(
1980 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+D')), 2117 'ViewManager', 'Duplicate current selection'),
1981 0, 2118 QKeySequence(QApplication.translate(
1982 self.editorActGrp, 'vm_edit_duplicate_current_selection') 2119 'ViewManager', 'Ctrl+Shift+D')),
2120 0,
2121 self.editorActGrp, 'vm_edit_duplicate_current_selection')
1983 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE) 2122 self.esm.setMapping(act, QsciScintilla.SCI_SELECTIONDUPLICATE)
1984 act.triggered[()].connect(self.esm.map) 2123 act.triggered[()].connect(self.esm.map)
1985 self.editActions.append(act) 2124 self.editActions.append(act)
1986 2125
1987 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"): 2126 if hasattr(QsciScintilla, "SCI_SCROLLTOSTART"):
2089 self.esm.setMapping(act, QsciScintilla.SCI_HOME) 2228 self.esm.setMapping(act, QsciScintilla.SCI_HOME)
2090 act.triggered[()].connect(self.esm.map) 2229 act.triggered[()].connect(self.esm.map)
2091 self.editActions.append(act) 2230 self.editActions.append(act)
2092 2231
2093 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"): 2232 if hasattr(QsciScintilla, "SCI_HOMEEXTEND"):
2094 act = E5Action(QApplication.translate('ViewManager', 2233 act = E5Action(
2095 'Extend selection to start of document line'), 2234 QApplication.translate(
2096 QApplication.translate('ViewManager', 2235 'ViewManager',
2097 'Extend selection to start of document line'), 2236 'Extend selection to start of document line'),
2098 0, 0, 2237 QApplication.translate(
2099 self.editorActGrp, 'vm_edit_extend_selection_start_document_line') 2238 'ViewManager',
2239 'Extend selection to start of document line'),
2240 0, 0,
2241 self.editorActGrp,
2242 'vm_edit_extend_selection_start_document_line')
2100 if isMacPlatform(): 2243 if isMacPlatform():
2101 act.setShortcut(QKeySequence( 2244 act.setShortcut(QKeySequence(
2102 QApplication.translate('ViewManager', 'Meta+Shift+A'))) 2245 QApplication.translate('ViewManager', 'Meta+Shift+A')))
2103 self.esm.setMapping(act, QsciScintilla.SCI_HOME) 2246 self.esm.setMapping(act, QsciScintilla.SCI_HOME)
2104 act.triggered[()].connect(self.esm.map) 2247 act.triggered[()].connect(self.esm.map)
2105 self.editActions.append(act) 2248 self.editActions.append(act)
2106 2249
2107 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"): 2250 if hasattr(QsciScintilla, "SCI_HOMERECTEXTEND"):
2108 act = E5Action(QApplication.translate('ViewManager', 2251 act = E5Action(
2109 'Extend rectangular selection to start of document line'), 2252 QApplication.translate(
2110 QApplication.translate('ViewManager', 2253 'ViewManager',
2111 'Extend rectangular selection to start of document line'), 2254 'Extend rectangular selection to start of document line'),
2112 0, 0, 2255 QApplication.translate(
2113 self.editorActGrp, 'vm_edit_select_rect_start_line') 2256 'ViewManager',
2257 'Extend rectangular selection to start of document line'),
2258 0, 0,
2259 self.editorActGrp, 'vm_edit_select_rect_start_line')
2114 if isMacPlatform(): 2260 if isMacPlatform():
2115 act.setShortcut(QKeySequence( 2261 act.setShortcut(QKeySequence(
2116 QApplication.translate('ViewManager', 'Meta+Alt+Shift+A'))) 2262 QApplication.translate('ViewManager', 'Meta+Alt+Shift+A')))
2117 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND) 2263 self.esm.setMapping(act, QsciScintilla.SCI_HOMERECTEXTEND)
2118 act.triggered[()].connect(self.esm.map) 2264 act.triggered[()].connect(self.esm.map)
2119 self.editActions.append(act) 2265 self.editActions.append(act)
2120 2266
2121 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"): 2267 if hasattr(QsciScintilla, "SCI_HOMEDISPLAYEXTEND"):
2122 act = E5Action(QApplication.translate('ViewManager', 2268 act = E5Action(
2123 'Extend selection to start of display line'), 2269 QApplication.translate(
2124 QApplication.translate('ViewManager', 2270 'ViewManager',
2125 'Extend selection to start of display line'), 2271 'Extend selection to start of display line'),
2126 0, 0, 2272 QApplication.translate(
2127 self.editorActGrp, 'vm_edit_extend_selection_start_display_line') 2273 'ViewManager',
2274 'Extend selection to start of display line'),
2275 0, 0,
2276 self.editorActGrp,
2277 'vm_edit_extend_selection_start_display_line')
2128 if isMacPlatform(): 2278 if isMacPlatform():
2129 act.setShortcut(QKeySequence( 2279 act.setShortcut(QKeySequence(
2130 QApplication.translate('ViewManager', 'Ctrl+Shift+Left'))) 2280 QApplication.translate('ViewManager', 'Ctrl+Shift+Left')))
2131 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND) 2281 self.esm.setMapping(act, QsciScintilla.SCI_HOMEDISPLAYEXTEND)
2132 act.triggered[()].connect(self.esm.map) 2282 act.triggered[()].connect(self.esm.map)
2133 self.editActions.append(act) 2283 self.editActions.append(act)
2134 2284
2135 if hasattr(QsciScintilla, "SCI_HOMEWRAP"): 2285 if hasattr(QsciScintilla, "SCI_HOMEWRAP"):
2136 act = E5Action(QApplication.translate('ViewManager', 2286 act = E5Action(
2137 'Move to start of display or document line'), 2287 QApplication.translate(
2138 QApplication.translate('ViewManager', 2288 'ViewManager',
2139 'Move to start of display or document line'), 2289 'Move to start of display or document line'),
2140 0, 0, 2290 QApplication.translate(
2141 self.editorActGrp, 'vm_edit_move_start_display_document_line') 2291 'ViewManager',
2292 'Move to start of display or document line'),
2293 0, 0,
2294 self.editorActGrp, 'vm_edit_move_start_display_document_line')
2142 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP) 2295 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAP)
2143 act.triggered[()].connect(self.esm.map) 2296 act.triggered[()].connect(self.esm.map)
2144 self.editActions.append(act) 2297 self.editActions.append(act)
2145 2298
2146 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"): 2299 if hasattr(QsciScintilla, "SCI_HOMEWRAPEXTEND"):
2147 act = E5Action(QApplication.translate('ViewManager', 2300 act = E5Action(
2148 'Extend selection to start of display or document line'), 2301 QApplication.translate(
2149 QApplication.translate('ViewManager', 2302 'ViewManager',
2150 'Extend selection to start of display or document line'), 2303 'Extend selection to start of display or document line'),
2151 0, 0, 2304 QApplication.translate(
2152 self.editorActGrp, 2305 'ViewManager',
2153 'vm_edit_extend_selection_start_display_document_line') 2306 'Extend selection to start of display or document line'),
2307 0, 0,
2308 self.editorActGrp,
2309 'vm_edit_extend_selection_start_display_document_line')
2154 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND) 2310 self.esm.setMapping(act, QsciScintilla.SCI_HOMEWRAPEXTEND)
2155 act.triggered[()].connect(self.esm.map) 2311 act.triggered[()].connect(self.esm.map)
2156 self.editActions.append(act) 2312 self.editActions.append(act)
2157 2313
2158 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"): 2314 if hasattr(QsciScintilla, "SCI_VCHOMEWRAP"):
2168 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAP) 2324 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAP)
2169 act.triggered[()].connect(self.esm.map) 2325 act.triggered[()].connect(self.esm.map)
2170 self.editActions.append(act) 2326 self.editActions.append(act)
2171 2327
2172 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"): 2328 if hasattr(QsciScintilla, "SCI_VCHOMEWRAPEXTEND"):
2173 act = E5Action(QApplication.translate('ViewManager', 2329 act = E5Action(
2174 'Extend selection to first visible character in' 2330 QApplication.translate(
2175 ' display or document line'), 2331 'ViewManager',
2176 QApplication.translate('ViewManager', 2332 'Extend selection to first visible character in'
2177 'Extend selection to first visible character in' 2333 ' display or document line'),
2178 ' display or document line'), 2334 QApplication.translate(
2179 0, 0, 2335 'ViewManager',
2180 self.editorActGrp, 2336 'Extend selection to first visible character in'
2181 'vm_edit_extend_selection_first_visible_char_document_line') 2337 ' display or document line'),
2338 0, 0,
2339 self.editorActGrp,
2340 'vm_edit_extend_selection_first_visible_char_document_line')
2182 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAPEXTEND) 2341 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEWRAPEXTEND)
2183 act.triggered[()].connect(self.esm.map) 2342 act.triggered[()].connect(self.esm.map)
2184 self.editActions.append(act) 2343 self.editActions.append(act)
2185 2344
2186 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"): 2345 if hasattr(QsciScintilla, "SCI_LINEENDWRAP"):
2187 act = E5Action(QApplication.translate('ViewManager', 2346 act = E5Action(
2188 'Move to end of display or document line'), 2347 QApplication.translate(
2189 QApplication.translate('ViewManager', 2348 'ViewManager',
2190 'Move to end of display or document line'), 2349 'Move to end of display or document line'),
2191 0, 0, 2350 QApplication.translate(
2192 self.editorActGrp, 'vm_edit_end_start_display_document_line') 2351 'ViewManager',
2352 'Move to end of display or document line'),
2353 0, 0,
2354 self.editorActGrp, 'vm_edit_end_start_display_document_line')
2193 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP) 2355 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAP)
2194 act.triggered[()].connect(self.esm.map) 2356 act.triggered[()].connect(self.esm.map)
2195 self.editActions.append(act) 2357 self.editActions.append(act)
2196 2358
2197 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"): 2359 if hasattr(QsciScintilla, "SCI_LINEENDWRAPEXTEND"):
2198 act = E5Action(QApplication.translate('ViewManager', 2360 act = E5Action(
2199 'Extend selection to end of display or document line'), 2361 QApplication.translate(
2200 QApplication.translate('ViewManager', 2362 'ViewManager',
2201 'Extend selection to end of display or document line'), 2363 'Extend selection to end of display or document line'),
2202 0, 0, 2364 QApplication.translate(
2203 self.editorActGrp, 2365 'ViewManager',
2204 'vm_edit_extend_selection_end_display_document_line') 2366 'Extend selection to end of display or document line'),
2367 0, 0,
2368 self.editorActGrp,
2369 'vm_edit_extend_selection_end_display_document_line')
2205 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAPEXTEND) 2370 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDWRAPEXTEND)
2206 act.triggered[()].connect(self.esm.map) 2371 act.triggered[()].connect(self.esm.map)
2207 self.editActions.append(act) 2372 self.editActions.append(act)
2208 2373
2209 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"): 2374 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUP"):
2216 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP) 2381 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUP)
2217 act.triggered[()].connect(self.esm.map) 2382 act.triggered[()].connect(self.esm.map)
2218 self.editActions.append(act) 2383 self.editActions.append(act)
2219 2384
2220 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"): 2385 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEUPEXTEND"):
2221 act = E5Action(QApplication.translate('ViewManager', 2386 act = E5Action(
2222 'Stuttered extend selection up one page'), 2387 QApplication.translate(
2223 QApplication.translate('ViewManager', 2388 'ViewManager', 'Stuttered extend selection up one page'),
2224 'Stuttered extend selection up one page'), 2389 QApplication.translate(
2225 0, 0, 2390 'ViewManager', 'Stuttered extend selection up one page'),
2226 self.editorActGrp, 'vm_edit_stuttered_extend_selection_up_page') 2391 0, 0,
2392 self.editorActGrp,
2393 'vm_edit_stuttered_extend_selection_up_page')
2227 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUPEXTEND) 2394 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEUPEXTEND)
2228 act.triggered[()].connect(self.esm.map) 2395 act.triggered[()].connect(self.esm.map)
2229 self.editActions.append(act) 2396 self.editActions.append(act)
2230 2397
2231 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"): 2398 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWN"):
2238 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN) 2405 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWN)
2239 act.triggered[()].connect(self.esm.map) 2406 act.triggered[()].connect(self.esm.map)
2240 self.editActions.append(act) 2407 self.editActions.append(act)
2241 2408
2242 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"): 2409 if hasattr(QsciScintilla, "SCI_STUTTEREDPAGEDOWNEXTEND"):
2243 act = E5Action(QApplication.translate('ViewManager', 2410 act = E5Action(
2244 'Stuttered extend selection down one page'), 2411 QApplication.translate(
2245 QApplication.translate('ViewManager', 2412 'ViewManager', 'Stuttered extend selection down one page'),
2246 'Stuttered extend selection down one page'), 2413 QApplication.translate(
2247 0, 0, 2414 'ViewManager', 'Stuttered extend selection down one page'),
2248 self.editorActGrp, 'vm_edit_stuttered_extend_selection_down_page') 2415 0, 0,
2416 self.editorActGrp,
2417 'vm_edit_stuttered_extend_selection_down_page')
2249 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND) 2418 self.esm.setMapping(act, QsciScintilla.SCI_STUTTEREDPAGEDOWNEXTEND)
2250 act.triggered[()].connect(self.esm.map) 2419 act.triggered[()].connect(self.esm.map)
2251 self.editActions.append(act) 2420 self.editActions.append(act)
2252 2421
2253 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"): 2422 if hasattr(QsciScintilla, "SCI_DELWORDRIGHTEND"):
2254 act = E5Action(QApplication.translate('ViewManager', 2423 act = E5Action(
2255 'Delete right to end of next word'), 2424 QApplication.translate(
2256 QApplication.translate('ViewManager', 2425 'ViewManager', 'Delete right to end of next word'),
2257 'Delete right to end of next word'), 2426 QApplication.translate(
2258 0, 0, 2427 'ViewManager', 'Delete right to end of next word'),
2259 self.editorActGrp, 'vm_edit_delete_right_end_next_word') 2428 0, 0,
2429 self.editorActGrp, 'vm_edit_delete_right_end_next_word')
2260 if isMacPlatform(): 2430 if isMacPlatform():
2261 act.setShortcut(QKeySequence( 2431 act.setShortcut(QKeySequence(
2262 QApplication.translate('ViewManager', 'Alt+Del'))) 2432 QApplication.translate('ViewManager', 'Alt+Del')))
2263 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND) 2433 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHTEND)
2264 act.triggered[()].connect(self.esm.map) 2434 act.triggered[()].connect(self.esm.map)
2265 self.editActions.append(act) 2435 self.editActions.append(act)
2266 2436
2267 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"): 2437 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESUP"):
2268 act = E5Action(QApplication.translate('ViewManager', 2438 act = E5Action(
2269 'Move selected lines up one line'), 2439 QApplication.translate(
2270 QApplication.translate('ViewManager', 2440 'ViewManager', 'Move selected lines up one line'),
2271 'Move selected lines up one line'), 2441 QApplication.translate(
2272 0, 0, 2442 'ViewManager', 'Move selected lines up one line'),
2273 self.editorActGrp, 'vm_edit_move_selection_up_one_line') 2443 0, 0,
2444 self.editorActGrp, 'vm_edit_move_selection_up_one_line')
2274 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP) 2445 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESUP)
2275 act.triggered[()].connect(self.esm.map) 2446 act.triggered[()].connect(self.esm.map)
2276 self.editActions.append(act) 2447 self.editActions.append(act)
2277 2448
2278 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"): 2449 if hasattr(QsciScintilla, "SCI_MOVESELECTEDLINESDOWN"):
2279 act = E5Action(QApplication.translate('ViewManager', 2450 act = E5Action(
2280 'Move selected lines down one line'), 2451 QApplication.translate(
2281 QApplication.translate('ViewManager', 2452 'ViewManager', 'Move selected lines down one line'),
2282 'Move selected lines down one line'), 2453 QApplication.translate(
2283 0, 0, 2454 'ViewManager', 'Move selected lines down one line'),
2284 self.editorActGrp, 'vm_edit_move_selection_down_one_line') 2455 0, 0,
2456 self.editorActGrp, 'vm_edit_move_selection_down_one_line')
2285 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN) 2457 self.esm.setMapping(act, QsciScintilla.SCI_MOVESELECTEDLINESDOWN)
2286 act.triggered[()].connect(self.esm.map) 2458 act.triggered[()].connect(self.esm.map)
2287 self.editActions.append(act) 2459 self.editActions.append(act)
2288 2460
2289 self.editorActGrp.setEnabled(False) 2461 self.editorActGrp.setEnabled(False)
2290 2462
2291 self.editLowerCaseAct = E5Action(QApplication.translate('ViewManager', 2463 self.editLowerCaseAct = E5Action(
2292 'Convert selection to lower case'), 2464 QApplication.translate(
2293 QApplication.translate('ViewManager', 2465 'ViewManager', 'Convert selection to lower case'),
2294 'Convert selection to lower case'), 2466 QApplication.translate(
2295 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')), 2467 'ViewManager', 'Convert selection to lower case'),
2296 0, 2468 QKeySequence(QApplication.translate('ViewManager', 'Alt+Shift+U')),
2297 self.editActGrp, 'vm_edit_convert_selection_lower') 2469 0,
2470 self.editActGrp, 'vm_edit_convert_selection_lower')
2298 self.esm.setMapping(self.editLowerCaseAct, QsciScintilla.SCI_LOWERCASE) 2471 self.esm.setMapping(self.editLowerCaseAct, QsciScintilla.SCI_LOWERCASE)
2299 self.editLowerCaseAct.triggered[()].connect(self.esm.map) 2472 self.editLowerCaseAct.triggered[()].connect(self.esm.map)
2300 self.editActions.append(self.editLowerCaseAct) 2473 self.editActions.append(self.editLowerCaseAct)
2301 2474
2302 self.editUpperCaseAct = E5Action(QApplication.translate('ViewManager', 2475 self.editUpperCaseAct = E5Action(
2303 'Convert selection to upper case'), 2476 QApplication.translate(
2304 QApplication.translate('ViewManager', 2477 'ViewManager', 'Convert selection to upper case'),
2305 'Convert selection to upper case'), 2478 QApplication.translate(
2306 QKeySequence(QApplication.translate('ViewManager', 'Ctrl+Shift+U')), 2479 'ViewManager', 'Convert selection to upper case'),
2307 0, 2480 QKeySequence(QApplication.translate(
2308 self.editActGrp, 'vm_edit_convert_selection_upper') 2481 'ViewManager', 'Ctrl+Shift+U')),
2482 0,
2483 self.editActGrp, 'vm_edit_convert_selection_upper')
2309 self.esm.setMapping(self.editUpperCaseAct, QsciScintilla.SCI_UPPERCASE) 2484 self.esm.setMapping(self.editUpperCaseAct, QsciScintilla.SCI_UPPERCASE)
2310 self.editUpperCaseAct.triggered[()].connect(self.esm.map) 2485 self.editUpperCaseAct.triggered[()].connect(self.esm.map)
2311 self.editActions.append(self.editUpperCaseAct) 2486 self.editActions.append(self.editUpperCaseAct)
2312 2487
2313 def initEditMenu(self): 2488 def initEditMenu(self):
2314 """ 2489 """
2315 Public method to create the Edit menu 2490 Public method to create the Edit menu.
2316 2491
2317 @return the generated menu 2492 @return the generated menu
2318 """ 2493 """
2319 autocompletionMenu = \ 2494 autocompletionMenu = QMenu(
2320 QMenu(QApplication.translate('ViewManager', '&Autocomplete'), self.ui) 2495 QApplication.translate('ViewManager', '&Autocomplete'), self.ui)
2321 autocompletionMenu.setTearOffEnabled(True) 2496 autocompletionMenu.setTearOffEnabled(True)
2322 autocompletionMenu.addAction(self.autoCompleteAct) 2497 autocompletionMenu.addAction(self.autoCompleteAct)
2323 autocompletionMenu.addAction(self.autoCompleteFromDocAct) 2498 autocompletionMenu.addAction(self.autoCompleteFromDocAct)
2324 autocompletionMenu.addAction(self.autoCompleteFromAPIsAct) 2499 autocompletionMenu.addAction(self.autoCompleteFromAPIsAct)
2325 autocompletionMenu.addAction(self.autoCompleteFromAllAct) 2500 autocompletionMenu.addAction(self.autoCompleteFromAllAct)
2390 2565
2391 return menu 2566 return menu
2392 2567
2393 def initEditToolbar(self, toolbarManager): 2568 def initEditToolbar(self, toolbarManager):
2394 """ 2569 """
2395 Public method to create the Edit toolbar 2570 Public method to create the Edit toolbar.
2396 2571
2397 @param toolbarManager reference to a toolbar manager object (E5ToolBarManager) 2572 @param toolbarManager reference to a toolbar manager object
2573 (E5ToolBarManager)
2398 @return the generated toolbar 2574 @return the generated toolbar
2399 """ 2575 """
2400 tb = QToolBar(QApplication.translate('ViewManager', 'Edit'), self.ui) 2576 tb = QToolBar(QApplication.translate('ViewManager', 'Edit'), self.ui)
2401 tb.setIconSize(UI.Config.ToolBarIconSize) 2577 tb.setIconSize(UI.Config.ToolBarIconSize)
2402 tb.setObjectName("EditToolbar") 2578 tb.setObjectName("EditToolbar")
2426 ## Initialize the search related actions and the search toolbar 2602 ## Initialize the search related actions and the search toolbar
2427 ################################################################## 2603 ##################################################################
2428 2604
2429 def __initSearchActions(self): 2605 def __initSearchActions(self):
2430 """ 2606 """
2431 Private method defining the user interface actions for the search commands. 2607 Private method defining the user interface actions for the search
2608 commands.
2432 """ 2609 """
2433 self.searchActGrp = createActionGroup(self) 2610 self.searchActGrp = createActionGroup(self)
2434 2611
2435 self.searchAct = E5Action(QApplication.translate('ViewManager', 'Search'), 2612 self.searchAct = E5Action(
2436 UI.PixmapCache.getIcon("find.png"), 2613 QApplication.translate('ViewManager', 'Search'),
2437 QApplication.translate('ViewManager', '&Search...'), 2614 UI.PixmapCache.getIcon("find.png"),
2438 QKeySequence(QApplication.translate('ViewManager', 2615 QApplication.translate('ViewManager', '&Search...'),
2439 "Ctrl+F", "Search|Search")), 2616 QKeySequence(QApplication.translate('ViewManager',
2440 0, 2617 "Ctrl+F", "Search|Search")),
2441 self.searchActGrp, 'vm_search') 2618 0,
2619 self.searchActGrp, 'vm_search')
2442 self.searchAct.setStatusTip(QApplication.translate('ViewManager', 2620 self.searchAct.setStatusTip(QApplication.translate('ViewManager',
2443 'Search for a text')) 2621 'Search for a text'))
2444 self.searchAct.setWhatsThis(QApplication.translate('ViewManager', 2622 self.searchAct.setWhatsThis(QApplication.translate('ViewManager',
2445 """<b>Search</b>""" 2623 """<b>Search</b>"""
2446 """<p>Search for some text in the current editor. A""" 2624 """<p>Search for some text in the current editor. A"""
2448 """ for the search.</p>""" 2626 """ for the search.</p>"""
2449 )) 2627 ))
2450 self.searchAct.triggered[()].connect(self.__search) 2628 self.searchAct.triggered[()].connect(self.__search)
2451 self.searchActions.append(self.searchAct) 2629 self.searchActions.append(self.searchAct)
2452 2630
2453 self.searchNextAct = E5Action(QApplication.translate('ViewManager', 2631 self.searchNextAct = E5Action(
2454 'Search next'), 2632 QApplication.translate(
2455 UI.PixmapCache.getIcon("findNext.png"), 2633 'ViewManager', 'Search next'),
2456 QApplication.translate('ViewManager', 'Search &next'), 2634 UI.PixmapCache.getIcon("findNext.png"),
2457 QKeySequence(QApplication.translate('ViewManager', 2635 QApplication.translate('ViewManager', 'Search &next'),
2458 "F3", "Search|Search next")), 2636 QKeySequence(QApplication.translate('ViewManager',
2459 0, 2637 "F3", "Search|Search next")),
2460 self.searchActGrp, 'vm_search_next') 2638 0,
2639 self.searchActGrp, 'vm_search_next')
2461 self.searchNextAct.setStatusTip(QApplication.translate('ViewManager', 2640 self.searchNextAct.setStatusTip(QApplication.translate('ViewManager',
2462 'Search next occurrence of text')) 2641 'Search next occurrence of text'))
2463 self.searchNextAct.setWhatsThis(QApplication.translate('ViewManager', 2642 self.searchNextAct.setWhatsThis(QApplication.translate('ViewManager',
2464 """<b>Search next</b>""" 2643 """<b>Search next</b>"""
2465 """<p>Search the next occurrence of some text in the current editor.""" 2644 """<p>Search the next occurrence of some text in the current"""
2466 """ The previously entered searchtext and options are reused.</p>""" 2645 """ editor. The previously entered searchtext and options are"""
2646 """ reused.</p>"""
2467 )) 2647 ))
2468 self.searchNextAct.triggered[()].connect(self.__searchWidget.findNext) 2648 self.searchNextAct.triggered[()].connect(self.__searchWidget.findNext)
2469 self.searchActions.append(self.searchNextAct) 2649 self.searchActions.append(self.searchNextAct)
2470 2650
2471 self.searchPrevAct = E5Action(QApplication.translate('ViewManager', 2651 self.searchPrevAct = E5Action(
2472 'Search previous'), 2652 QApplication.translate('ViewManager', 'Search previous'),
2473 UI.PixmapCache.getIcon("findPrev.png"), 2653 UI.PixmapCache.getIcon("findPrev.png"),
2474 QApplication.translate('ViewManager', 'Search &previous'), 2654 QApplication.translate('ViewManager', 'Search &previous'),
2475 QKeySequence(QApplication.translate('ViewManager', 2655 QKeySequence(QApplication.translate('ViewManager',
2476 "Shift+F3", "Search|Search previous")), 2656 "Shift+F3", "Search|Search previous")),
2477 0, 2657 0,
2478 self.searchActGrp, 'vm_search_previous') 2658 self.searchActGrp, 'vm_search_previous')
2479 self.searchPrevAct.setStatusTip(QApplication.translate('ViewManager', 2659 self.searchPrevAct.setStatusTip(QApplication.translate('ViewManager',
2480 'Search previous occurrence of text')) 2660 'Search previous occurrence of text'))
2481 self.searchPrevAct.setWhatsThis(QApplication.translate('ViewManager', 2661 self.searchPrevAct.setWhatsThis(QApplication.translate('ViewManager',
2482 """<b>Search previous</b>""" 2662 """<b>Search previous</b>"""
2483 """<p>Search the previous occurrence of some text in the current editor.""" 2663 """<p>Search the previous occurrence of some text in the current"""
2484 """ The previously entered searchtext and options are reused.</p>""" 2664 """ editor. The previously entered searchtext and options are"""
2665 """ reused.</p>"""
2485 )) 2666 ))
2486 self.searchPrevAct.triggered[()].connect(self.__searchWidget.findPrev) 2667 self.searchPrevAct.triggered[()].connect(self.__searchWidget.findPrev)
2487 self.searchActions.append(self.searchPrevAct) 2668 self.searchActions.append(self.searchPrevAct)
2488 2669
2489 self.searchClearMarkersAct = E5Action(QApplication.translate('ViewManager', 2670 self.searchClearMarkersAct = E5Action(
2490 'Clear search markers'), 2671 QApplication.translate('ViewManager', 'Clear search markers'),
2491 UI.PixmapCache.getIcon("findClear.png"), 2672 UI.PixmapCache.getIcon("findClear.png"),
2492 QApplication.translate('ViewManager', 'Clear search markers'), 2673 QApplication.translate('ViewManager', 'Clear search markers'),
2493 QKeySequence(QApplication.translate('ViewManager', 2674 QKeySequence(QApplication.translate('ViewManager',
2494 "Ctrl+3", "Search|Clear search markers")), 2675 "Ctrl+3", "Search|Clear search markers")),
2495 0, 2676 0,
2496 self.searchActGrp, 'vm_clear_search_markers') 2677 self.searchActGrp, 'vm_clear_search_markers')
2497 self.searchClearMarkersAct.setStatusTip(QApplication.translate('ViewManager', 2678 self.searchClearMarkersAct.setStatusTip(QApplication.translate(
2679 'ViewManager',
2498 'Clear all displayed search markers')) 2680 'Clear all displayed search markers'))
2499 self.searchClearMarkersAct.setWhatsThis(QApplication.translate('ViewManager', 2681 self.searchClearMarkersAct.setWhatsThis(QApplication.translate(
2682 'ViewManager',
2500 """<b>Clear search markers</b>""" 2683 """<b>Clear search markers</b>"""
2501 """<p>Clear all displayed search markers.</p>""" 2684 """<p>Clear all displayed search markers.</p>"""
2502 )) 2685 ))
2503 self.searchClearMarkersAct.triggered[()].connect(self.__searchClearMarkers) 2686 self.searchClearMarkersAct.triggered[()].connect(
2687 self.__searchClearMarkers)
2504 self.searchActions.append(self.searchClearMarkersAct) 2688 self.searchActions.append(self.searchClearMarkersAct)
2505 2689
2506 self.searchNextWordAct = E5Action(QApplication.translate('ViewManager', 2690 self.searchNextWordAct = E5Action(
2507 'Search current word forward'), 2691 QApplication.translate(
2508 UI.PixmapCache.getIcon("findWordNext.png"), 2692 'ViewManager', 'Search current word forward'),
2509 QApplication.translate('ViewManager', 'Search current word forward'), 2693 UI.PixmapCache.getIcon("findWordNext.png"),
2510 QKeySequence(QApplication.translate('ViewManager', 2694 QApplication.translate(
2511 "Ctrl+.", "Search|Search current word forward")), 2695 'ViewManager', 'Search current word forward'),
2512 0, 2696 QKeySequence(QApplication.translate('ViewManager',
2513 self.searchActGrp, 'vm_search_word_next') 2697 "Ctrl+.", "Search|Search current word forward")),
2514 self.searchNextWordAct.setStatusTip(QApplication.translate('ViewManager', 2698 0,
2699 self.searchActGrp, 'vm_search_word_next')
2700 self.searchNextWordAct.setStatusTip(QApplication.translate(
2701 'ViewManager',
2515 'Search next occurrence of the current word')) 2702 'Search next occurrence of the current word'))
2516 self.searchNextWordAct.setWhatsThis(QApplication.translate('ViewManager', 2703 self.searchNextWordAct.setWhatsThis(QApplication.translate(
2704 'ViewManager',
2517 """<b>Search current word forward</b>""" 2705 """<b>Search current word forward</b>"""
2518 """<p>Search the next occurrence of the current word of the current""" 2706 """<p>Search the next occurrence of the current word of the"""
2519 """ editor.</p>""" 2707 """ current editor.</p>"""
2520 )) 2708 ))
2521 self.searchNextWordAct.triggered[()].connect(self.__findNextWord) 2709 self.searchNextWordAct.triggered[()].connect(self.__findNextWord)
2522 self.searchActions.append(self.searchNextWordAct) 2710 self.searchActions.append(self.searchNextWordAct)
2523 2711
2524 self.searchPrevWordAct = E5Action(QApplication.translate('ViewManager', 2712 self.searchPrevWordAct = E5Action(
2525 'Search current word backward'), 2713 QApplication.translate(
2526 UI.PixmapCache.getIcon("findWordPrev.png"), 2714 'ViewManager', 'Search current word backward'),
2527 QApplication.translate('ViewManager', 'Search current word backward'), 2715 UI.PixmapCache.getIcon("findWordPrev.png"),
2528 QKeySequence(QApplication.translate('ViewManager', 2716 QApplication.translate(
2529 "Ctrl+,", "Search|Search current word backward")), 2717 'ViewManager', 'Search current word backward'),
2530 0, 2718 QKeySequence(QApplication.translate('ViewManager',
2531 self.searchActGrp, 'vm_search_word_previous') 2719 "Ctrl+,", "Search|Search current word backward")),
2532 self.searchPrevWordAct.setStatusTip(QApplication.translate('ViewManager', 2720 0,
2721 self.searchActGrp, 'vm_search_word_previous')
2722 self.searchPrevWordAct.setStatusTip(QApplication.translate(
2723 'ViewManager',
2533 'Search previous occurrence of the current word')) 2724 'Search previous occurrence of the current word'))
2534 self.searchPrevWordAct.setWhatsThis(QApplication.translate('ViewManager', 2725 self.searchPrevWordAct.setWhatsThis(QApplication.translate(
2726 'ViewManager',
2535 """<b>Search current word backward</b>""" 2727 """<b>Search current word backward</b>"""
2536 """<p>Search the previous occurrence of the current word of the current""" 2728 """<p>Search the previous occurrence of the current word of the"""
2537 """ editor.</p>""" 2729 """ current editor.</p>"""
2538 )) 2730 ))
2539 self.searchPrevWordAct.triggered[()].connect(self.__findPrevWord) 2731 self.searchPrevWordAct.triggered[()].connect(self.__findPrevWord)
2540 self.searchActions.append(self.searchPrevWordAct) 2732 self.searchActions.append(self.searchPrevWordAct)
2541 2733
2542 self.replaceAct = E5Action(QApplication.translate('ViewManager', 'Replace'), 2734 self.replaceAct = E5Action(
2543 QApplication.translate('ViewManager', '&Replace...'), 2735 QApplication.translate('ViewManager', 'Replace'),
2544 QKeySequence(QApplication.translate('ViewManager', 2736 QApplication.translate('ViewManager', '&Replace...'),
2545 "Ctrl+R", "Search|Replace")), 2737 QKeySequence(QApplication.translate('ViewManager',
2546 0, 2738 "Ctrl+R", "Search|Replace")),
2547 self.searchActGrp, 'vm_search_replace') 2739 0,
2740 self.searchActGrp, 'vm_search_replace')
2548 self.replaceAct.setStatusTip(QApplication.translate('ViewManager', 2741 self.replaceAct.setStatusTip(QApplication.translate('ViewManager',
2549 'Replace some text')) 2742 'Replace some text'))
2550 self.replaceAct.setWhatsThis(QApplication.translate('ViewManager', 2743 self.replaceAct.setWhatsThis(QApplication.translate('ViewManager',
2551 """<b>Replace</b>""" 2744 """<b>Replace</b>"""
2552 """<p>Search for some text in the current editor and replace it. A""" 2745 """<p>Search for some text in the current editor and replace it."""
2553 """ dialog is shown to enter the searchtext, the replacement text""" 2746 """ A dialog is shown to enter the searchtext, the replacement"""
2554 """ and options for the search and replace.</p>""" 2747 """ text and options for the search and replace.</p>"""
2555 )) 2748 ))
2556 self.replaceAct.triggered[()].connect(self.__replace) 2749 self.replaceAct.triggered[()].connect(self.__replace)
2557 self.searchActions.append(self.replaceAct) 2750 self.searchActions.append(self.replaceAct)
2558 2751
2559 self.quickSearchAct = E5Action(QApplication.translate('ViewManager', 2752 self.quickSearchAct = E5Action(QApplication.translate('ViewManager',
2574 """ next occurrence of this text.</p>""" 2767 """ next occurrence of this text.</p>"""
2575 )) 2768 ))
2576 self.quickSearchAct.triggered[()].connect(self.__quickSearch) 2769 self.quickSearchAct.triggered[()].connect(self.__quickSearch)
2577 self.searchActions.append(self.quickSearchAct) 2770 self.searchActions.append(self.quickSearchAct)
2578 2771
2579 self.quickSearchBackAct = E5Action(QApplication.translate('ViewManager', 2772 self.quickSearchBackAct = E5Action(
2580 'Quicksearch backwards'), 2773 QApplication.translate('ViewManager', 'Quicksearch backwards'),
2581 UI.PixmapCache.getIcon("quickFindPrev.png"), 2774 UI.PixmapCache.getIcon("quickFindPrev.png"),
2582 QApplication.translate('ViewManager', 'Quicksearch &backwards'), 2775 QApplication.translate('ViewManager', 'Quicksearch &backwards'),
2583 QKeySequence(QApplication.translate('ViewManager', 2776 QKeySequence(QApplication.translate('ViewManager',
2584 "Ctrl+Shift+J", "Search|Quicksearch backwards")), 2777 "Ctrl+Shift+J", "Search|Quicksearch backwards")),
2585 0, self.searchActGrp, 'vm_quicksearch_backwards') 2778 0, self.searchActGrp, 'vm_quicksearch_backwards')
2586 self.quickSearchBackAct.setStatusTip(QApplication.translate('ViewManager', 2779 self.quickSearchBackAct.setStatusTip(QApplication.translate(
2780 'ViewManager',
2587 'Perform a quicksearch backwards')) 2781 'Perform a quicksearch backwards'))
2588 self.quickSearchBackAct.setWhatsThis(QApplication.translate('ViewManager', 2782 self.quickSearchBackAct.setWhatsThis(QApplication.translate(
2783 'ViewManager',
2589 """<b>Quicksearch backwards</b>""" 2784 """<b>Quicksearch backwards</b>"""
2590 """<p>This searches the previous occurrence of the quicksearch text.</p>""" 2785 """<p>This searches the previous occurrence of the quicksearch"""
2786 """ text.</p>"""
2591 )) 2787 ))
2592 self.quickSearchBackAct.triggered[()].connect(self.__quickSearchPrev) 2788 self.quickSearchBackAct.triggered[()].connect(self.__quickSearchPrev)
2593 self.searchActions.append(self.quickSearchBackAct) 2789 self.searchActions.append(self.quickSearchBackAct)
2594 2790
2595 self.quickSearchExtendAct = E5Action(QApplication.translate('ViewManager', 2791 self.quickSearchExtendAct = E5Action(
2596 'Quicksearch extend'), 2792 QApplication.translate('ViewManager', 'Quicksearch extend'),
2597 UI.PixmapCache.getIcon("quickFindExtend.png"), 2793 UI.PixmapCache.getIcon("quickFindExtend.png"),
2598 QApplication.translate('ViewManager', 'Quicksearch e&xtend'), 2794 QApplication.translate('ViewManager', 'Quicksearch e&xtend'),
2599 QKeySequence(QApplication.translate('ViewManager', 2795 QKeySequence(QApplication.translate('ViewManager',
2600 "Ctrl+Shift+H", "Search|Quicksearch extend")), 2796 "Ctrl+Shift+H", "Search|Quicksearch extend")),
2601 0, 2797 0,
2602 self.searchActGrp, 'vm_quicksearch_extend') 2798 self.searchActGrp, 'vm_quicksearch_extend')
2603 self.quickSearchExtendAct.setStatusTip(QApplication.translate('ViewManager', \ 2799 self.quickSearchExtendAct.setStatusTip(QApplication.translate(
2800 'ViewManager', \
2604 'Extend the quicksearch to the end of the current word')) 2801 'Extend the quicksearch to the end of the current word'))
2605 self.quickSearchExtendAct.setWhatsThis(QApplication.translate('ViewManager', 2802 self.quickSearchExtendAct.setWhatsThis(QApplication.translate(
2803 'ViewManager',
2606 """<b>Quicksearch extend</b>""" 2804 """<b>Quicksearch extend</b>"""
2607 """<p>This extends the quicksearch text to the end of the word""" 2805 """<p>This extends the quicksearch text to the end of the word"""
2608 """ currently found.</p>""" 2806 """ currently found.</p>"""
2609 )) 2807 ))
2610 self.quickSearchExtendAct.triggered[()].connect(self.__quickSearchExtend) 2808 self.quickSearchExtendAct.triggered[()].connect(
2809 self.__quickSearchExtend)
2611 self.searchActions.append(self.quickSearchExtendAct) 2810 self.searchActions.append(self.quickSearchExtendAct)
2612 2811
2613 self.gotoAct = E5Action(QApplication.translate('ViewManager', 'Goto Line'), 2812 self.gotoAct = E5Action(
2614 UI.PixmapCache.getIcon("goto.png"), 2813 QApplication.translate('ViewManager', 'Goto Line'),
2615 QApplication.translate('ViewManager', '&Goto Line...'), 2814 UI.PixmapCache.getIcon("goto.png"),
2616 QKeySequence(QApplication.translate('ViewManager', 2815 QApplication.translate('ViewManager', '&Goto Line...'),
2617 "Ctrl+G", "Search|Goto Line")), 2816 QKeySequence(QApplication.translate('ViewManager',
2618 0, 2817 "Ctrl+G", "Search|Goto Line")),
2619 self.searchActGrp, 'vm_search_goto_line') 2818 0,
2620 self.gotoAct.setStatusTip(QApplication.translate('ViewManager', 'Goto Line')) 2819 self.searchActGrp, 'vm_search_goto_line')
2621 self.gotoAct.setWhatsThis(QApplication.translate('ViewManager', 2820 self.gotoAct.setStatusTip(QApplication.translate(
2821 'ViewManager', 'Goto Line'))
2822 self.gotoAct.setWhatsThis(QApplication.translate(
2823 'ViewManager',
2622 """<b>Goto Line</b>""" 2824 """<b>Goto Line</b>"""
2623 """<p>Go to a specific line of text in the current editor.""" 2825 """<p>Go to a specific line of text in the current editor."""
2624 """ A dialog is shown to enter the linenumber.</p>""" 2826 """ A dialog is shown to enter the linenumber.</p>"""
2625 )) 2827 ))
2626 self.gotoAct.triggered[()].connect(self.__goto) 2828 self.gotoAct.triggered[()].connect(self.__goto)
2627 self.searchActions.append(self.gotoAct) 2829 self.searchActions.append(self.gotoAct)
2628 2830
2629 self.gotoBraceAct = E5Action(QApplication.translate('ViewManager', 'Goto Brace'), 2831 self.gotoBraceAct = E5Action(
2630 UI.PixmapCache.getIcon("gotoBrace.png"), 2832 QApplication.translate('ViewManager', 'Goto Brace'),
2631 QApplication.translate('ViewManager', 'Goto &Brace'), 2833 UI.PixmapCache.getIcon("gotoBrace.png"),
2632 QKeySequence(QApplication.translate('ViewManager', 2834 QApplication.translate('ViewManager', 'Goto &Brace'),
2633 "Ctrl+L", "Search|Goto Brace")), 2835 QKeySequence(QApplication.translate('ViewManager',
2634 0, 2836 "Ctrl+L", "Search|Goto Brace")),
2635 self.searchActGrp, 'vm_search_goto_brace') 2837 0,
2636 self.gotoBraceAct.setStatusTip(QApplication.translate('ViewManager', 2838 self.searchActGrp, 'vm_search_goto_brace')
2637 'Goto Brace')) 2839 self.gotoBraceAct.setStatusTip(QApplication.translate(
2638 self.gotoBraceAct.setWhatsThis(QApplication.translate('ViewManager', 2840 'ViewManager', 'Goto Brace'))
2841 self.gotoBraceAct.setWhatsThis(QApplication.translate(
2842 'ViewManager',
2639 """<b>Goto Brace</b>""" 2843 """<b>Goto Brace</b>"""
2640 """<p>Go to the matching brace in the current editor.</p>""" 2844 """<p>Go to the matching brace in the current editor.</p>"""
2641 )) 2845 ))
2642 self.gotoBraceAct.triggered[()].connect(self.__gotoBrace) 2846 self.gotoBraceAct.triggered[()].connect(self.__gotoBrace)
2643 self.searchActions.append(self.gotoBraceAct) 2847 self.searchActions.append(self.gotoBraceAct)
2644 2848
2645 self.gotoLastEditAct = E5Action( 2849 self.gotoLastEditAct = E5Action(
2646 QApplication.translate('ViewManager', 'Goto Last Edit Location'), 2850 QApplication.translate('ViewManager', 'Goto Last Edit Location'),
2647 UI.PixmapCache.getIcon("gotoLastEditPosition.png"), 2851 UI.PixmapCache.getIcon("gotoLastEditPosition.png"),
2648 QApplication.translate('ViewManager', 'Goto Last &Edit Location'), 2852 QApplication.translate('ViewManager', 'Goto Last &Edit Location'),
2649 QKeySequence(QApplication.translate('ViewManager', 2853 QKeySequence(QApplication.translate('ViewManager',
2650 "Ctrl+Shift+G", "Search|Goto Last Edit Location")), 2854 "Ctrl+Shift+G", "Search|Goto Last Edit Location")),
2651 0, 2855 0,
2652 self.searchActGrp, 'vm_search_goto_last_edit_location') 2856 self.searchActGrp, 'vm_search_goto_last_edit_location')
2653 self.gotoLastEditAct.setStatusTip( 2857 self.gotoLastEditAct.setStatusTip(
2654 QApplication.translate('ViewManager', 'Goto Last Edit Location')) 2858 QApplication.translate('ViewManager', 'Goto Last Edit Location'))
2655 self.gotoLastEditAct.setWhatsThis(QApplication.translate('ViewManager', 2859 self.gotoLastEditAct.setWhatsThis(QApplication.translate('ViewManager',
2656 """<b>Goto Last Edit Location</b>""" 2860 """<b>Goto Last Edit Location</b>"""
2657 """<p>Go to the location of the last edit in the current editor.</p>""" 2861 """<p>Go to the location of the last edit in the current"""
2862 """ editor.</p>"""
2658 )) 2863 ))
2659 self.gotoLastEditAct.triggered[()].connect(self.__gotoLastEditPosition) 2864 self.gotoLastEditAct.triggered[()].connect(self.__gotoLastEditPosition)
2660 self.searchActions.append(self.gotoLastEditAct) 2865 self.searchActions.append(self.gotoLastEditAct)
2661 2866
2662 self.gotoPreviousDefAct = E5Action( 2867 self.gotoPreviousDefAct = E5Action(
2663 QApplication.translate('ViewManager', 'Goto Previous Method or Class'), 2868 QApplication.translate(
2664 QApplication.translate('ViewManager', 'Goto Previous Method or Class'), 2869 'ViewManager', 'Goto Previous Method or Class'),
2665 QKeySequence(QApplication.translate('ViewManager', 2870 QApplication.translate(
2666 "Ctrl+Shift+Up", "Search|Goto Previous Method or Class")), 2871 'ViewManager', 'Goto Previous Method or Class'),
2667 0, 2872 QKeySequence(QApplication.translate(
2668 self.searchActGrp, 'vm_search_goto_previous_method_or_class') 2873 'ViewManager',
2874 "Ctrl+Shift+Up", "Search|Goto Previous Method or Class")),
2875 0,
2876 self.searchActGrp, 'vm_search_goto_previous_method_or_class')
2669 self.gotoPreviousDefAct.setStatusTip( 2877 self.gotoPreviousDefAct.setStatusTip(
2670 QApplication.translate('ViewManager', 2878 QApplication.translate(
2671 'Go to the previous method or class definition')) 2879 'ViewManager',
2672 self.gotoPreviousDefAct.setWhatsThis(QApplication.translate('ViewManager', 2880 'Go to the previous method or class definition'))
2881 self.gotoPreviousDefAct.setWhatsThis(QApplication.translate(
2882 'ViewManager',
2673 """<b>Goto Previous Method or Class</b>""" 2883 """<b>Goto Previous Method or Class</b>"""
2674 """<p>Goes to the line of the previous method or class definition""" 2884 """<p>Goes to the line of the previous method or class"""
2675 """ and highlights the name.</p>""" 2885 """ definition and highlights the name.</p>"""
2676 )) 2886 ))
2677 self.gotoPreviousDefAct.triggered[()].connect(self.__gotoPreviousMethodClass) 2887 self.gotoPreviousDefAct.triggered[()].connect(
2888 self.__gotoPreviousMethodClass)
2678 self.searchActions.append(self.gotoPreviousDefAct) 2889 self.searchActions.append(self.gotoPreviousDefAct)
2679 2890
2680 self.gotoNextDefAct = E5Action( 2891 self.gotoNextDefAct = E5Action(
2681 QApplication.translate('ViewManager', 'Goto Next Method or Class'), 2892 QApplication.translate('ViewManager', 'Goto Next Method or Class'),
2682 QApplication.translate('ViewManager', 'Goto Next Method or Class'), 2893 QApplication.translate('ViewManager', 'Goto Next Method or Class'),
2683 QKeySequence(QApplication.translate('ViewManager', 2894 QKeySequence(QApplication.translate('ViewManager',
2684 "Ctrl+Shift+Down", "Search|Goto Next Method or Class")), 2895 "Ctrl+Shift+Down", "Search|Goto Next Method or Class")),
2685 0, 2896 0,
2686 self.searchActGrp, 'vm_search_goto_next_method_or_class') 2897 self.searchActGrp, 'vm_search_goto_next_method_or_class')
2687 self.gotoNextDefAct.setStatusTip( 2898 self.gotoNextDefAct.setStatusTip(QApplication.translate(
2688 QApplication.translate('ViewManager', 2899 'ViewManager', 'Go to the next method or class definition'))
2689 'Go to the next method or class definition'))
2690 self.gotoNextDefAct.setWhatsThis(QApplication.translate('ViewManager', 2900 self.gotoNextDefAct.setWhatsThis(QApplication.translate('ViewManager',
2691 """<b>Goto Next Method or Class</b>""" 2901 """<b>Goto Next Method or Class</b>"""
2692 """<p>Goes to the line of the next method or class definition""" 2902 """<p>Goes to the line of the next method or class definition"""
2693 """ and highlights the name.</p>""" 2903 """ and highlights the name.</p>"""
2694 )) 2904 ))
2733 """ search and to display the result.</p>""" 2943 """ search and to display the result.</p>"""
2734 )) 2944 ))
2735 self.replaceFilesAct.triggered[()].connect(self.__replaceFiles) 2945 self.replaceFilesAct.triggered[()].connect(self.__replaceFiles)
2736 self.searchActions.append(self.replaceFilesAct) 2946 self.searchActions.append(self.replaceFilesAct)
2737 2947
2738 self.searchOpenFilesAct = E5Action(QApplication.translate('ViewManager', 2948 self.searchOpenFilesAct = E5Action(
2739 'Search in Open Files'), 2949 QApplication.translate('ViewManager', 'Search in Open Files'),
2740 UI.PixmapCache.getIcon("documentFind.png"), 2950 UI.PixmapCache.getIcon("documentFind.png"),
2741 QApplication.translate('ViewManager', 'Search in Open Files...'), 2951 QApplication.translate('ViewManager', 'Search in Open Files...'),
2742 QKeySequence(QApplication.translate('ViewManager', 2952 QKeySequence(QApplication.translate('ViewManager',
2743 "Meta+Ctrl+Alt+F", "Search|Search Open Files")), 2953 "Meta+Ctrl+Alt+F", "Search|Search Open Files")),
2744 0, 2954 0,
2745 self.searchActGrp, 'vm_search_in_open_files') 2955 self.searchActGrp, 'vm_search_in_open_files')
2746 self.searchOpenFilesAct.setStatusTip(QApplication.translate('ViewManager', 2956 self.searchOpenFilesAct.setStatusTip(QApplication.translate(
2747 'Search for a text in open files')) 2957 'ViewManager', 'Search for a text in open files'))
2748 self.searchOpenFilesAct.setWhatsThis(QApplication.translate('ViewManager', 2958 self.searchOpenFilesAct.setWhatsThis(QApplication.translate(
2959 'ViewManager',
2749 """<b>Search in Open Files</b>""" 2960 """<b>Search in Open Files</b>"""
2750 """<p>Search for some text in the currently opened files.""" 2961 """<p>Search for some text in the currently opened files."""
2751 """ A dialog is shown to enter the searchtext""" 2962 """ A dialog is shown to enter the searchtext"""
2752 """ and options for the search and to display the result.</p>""" 2963 """ and options for the search and to display the result.</p>"""
2753 )) 2964 ))
2754 self.searchOpenFilesAct.triggered[()].connect(self.__searchOpenFiles) 2965 self.searchOpenFilesAct.triggered[()].connect(self.__searchOpenFiles)
2755 self.searchActions.append(self.searchOpenFilesAct) 2966 self.searchActions.append(self.searchOpenFilesAct)
2756 2967
2757 self.replaceOpenFilesAct = E5Action(QApplication.translate('ViewManager', 2968 self.replaceOpenFilesAct = E5Action(
2758 'Replace in Open Files'), 2969 QApplication.translate('ViewManager', 'Replace in Open Files'),
2759 QApplication.translate('ViewManager', 'Replace in Open Files...'), 2970 QApplication.translate('ViewManager', 'Replace in Open Files...'),
2760 QKeySequence(QApplication.translate('ViewManager', 2971 QKeySequence(QApplication.translate('ViewManager',
2761 "Meta+Ctrl+Alt+R", "Search|Replace in Open Files")), 2972 "Meta+Ctrl+Alt+R", "Search|Replace in Open Files")),
2762 0, 2973 0,
2763 self.searchActGrp, 'vm_replace_in_open_files') 2974 self.searchActGrp, 'vm_replace_in_open_files')
2764 self.replaceOpenFilesAct.setStatusTip(QApplication.translate('ViewManager', 2975 self.replaceOpenFilesAct.setStatusTip(QApplication.translate(
2765 'Search for a text in open files and replace it')) 2976 'ViewManager', 'Search for a text in open files and replace it'))
2766 self.replaceOpenFilesAct.setWhatsThis(QApplication.translate('ViewManager', 2977 self.replaceOpenFilesAct.setWhatsThis(QApplication.translate(
2978 'ViewManager',
2767 """<b>Replace in Open Files</b>""" 2979 """<b>Replace in Open Files</b>"""
2768 """<p>Search for some text in the currently opened files""" 2980 """<p>Search for some text in the currently opened files"""
2769 """ and replace it. A dialog is shown to enter""" 2981 """ and replace it. A dialog is shown to enter"""
2770 """ the searchtext, the replacement text and options for the""" 2982 """ the searchtext, the replacement text and options for the"""
2771 """ search and to display the result.</p>""" 2983 """ search and to display the result.</p>"""
2773 self.replaceOpenFilesAct.triggered[()].connect(self.__replaceOpenFiles) 2985 self.replaceOpenFilesAct.triggered[()].connect(self.__replaceOpenFiles)
2774 self.searchActions.append(self.replaceOpenFilesAct) 2986 self.searchActions.append(self.replaceOpenFilesAct)
2775 2987
2776 def initSearchToolbars(self, toolbarManager): 2988 def initSearchToolbars(self, toolbarManager):
2777 """ 2989 """
2778 Public method to create the Search toolbars 2990 Public method to create the Search toolbars.
2779 2991
2780 @param toolbarManager reference to a toolbar manager object (E5ToolBarManager) 2992 @param toolbarManager reference to a toolbar manager object
2993 (E5ToolBarManager)
2781 @return a tuple of the generated toolbar (search, quicksearch) 2994 @return a tuple of the generated toolbar (search, quicksearch)
2782 """ 2995 """
2783 qtb = QToolBar(QApplication.translate('ViewManager', 'Quicksearch'), self.ui) 2996 qtb = QToolBar(QApplication.translate('ViewManager', 'Quicksearch'),
2997 self.ui)
2784 qtb.setIconSize(UI.Config.ToolBarIconSize) 2998 qtb.setIconSize(UI.Config.ToolBarIconSize)
2785 qtb.setObjectName("QuicksearchToolbar") 2999 qtb.setObjectName("QuicksearchToolbar")
2786 qtb.setToolTip(QApplication.translate('ViewManager', 'Quicksearch')) 3000 qtb.setToolTip(QApplication.translate('ViewManager', 'Quicksearch'))
2787 3001
2788 self.quickFindLineEdit = QuickSearchLineEdit(self) 3002 self.quickFindLineEdit = QuickSearchLineEdit(self)
2804 self.quickFindtextCombo.setAutoCompletion(False) 3018 self.quickFindtextCombo.setAutoCompletion(False)
2805 self.quickFindtextCombo.setMinimumWidth(250) 3019 self.quickFindtextCombo.setMinimumWidth(250)
2806 self.quickFindtextCombo.setSizeAdjustPolicy( 3020 self.quickFindtextCombo.setSizeAdjustPolicy(
2807 QComboBox.AdjustToMinimumContentsLengthWithIcon) 3021 QComboBox.AdjustToMinimumContentsLengthWithIcon)
2808 self.quickFindtextCombo.addItem("") 3022 self.quickFindtextCombo.addItem("")
2809 self.quickFindtextCombo.setWhatsThis(QApplication.translate('ViewManager', 3023 self.quickFindtextCombo.setWhatsThis(QApplication.translate(
2810 """<p>Enter the searchtext directly into this field.""" 3024 'ViewManager',
2811 """ The search will be performed case insensitive.""" 3025 """<p>Enter the searchtext directly into this field."""
2812 """ The quicksearch function is activated upon activation""" 3026 """ The search will be performed case insensitive."""
2813 """ of the quicksearch next action (default key Ctrl+Shift+K),""" 3027 """ The quicksearch function is activated upon activation"""
2814 """ if this entry field does not have the input focus.""" 3028 """ of the quicksearch next action (default key Ctrl+Shift+K),"""
2815 """ Otherwise it searches for the next occurrence of the""" 3029 """ if this entry field does not have the input focus."""
2816 """ text entered. The quicksearch backwards action""" 3030 """ Otherwise it searches for the next occurrence of the"""
2817 """ (default key Ctrl+Shift+J) searches backward.""" 3031 """ text entered. The quicksearch backwards action"""
2818 """ Activating the 'quicksearch extend' action""" 3032 """ (default key Ctrl+Shift+J) searches backward."""
2819 """ (default key Ctrl+Shift+H) extends the current""" 3033 """ Activating the 'quicksearch extend' action"""
2820 """ searchtext to the end of the currently found word.""" 3034 """ (default key Ctrl+Shift+H) extends the current"""
2821 """ The quicksearch can be ended by pressing the Return key""" 3035 """ searchtext to the end of the currently found word."""
2822 """ while the quicksearch entry has the the input focus.</p>""" 3036 """ The quicksearch can be ended by pressing the Return key"""
3037 """ while the quicksearch entry has the the input focus.</p>"""
2823 )) 3038 ))
2824 self.quickFindtextCombo._editor.returnPressed.connect(self.__quickSearchEnter) 3039 self.quickFindtextCombo._editor.returnPressed.connect(
2825 self.quickFindtextCombo._editor.textChanged.connect(self.__quickSearchText) 3040 self.__quickSearchEnter)
2826 self.quickFindtextCombo._editor.escPressed.connect(self.__quickSearchEscape) 3041 self.quickFindtextCombo._editor.textChanged.connect(
2827 self.quickFindtextCombo._editor.gotFocus.connect(self.__quickSearchFocusIn) 3042 self.__quickSearchText)
3043 self.quickFindtextCombo._editor.escPressed.connect(
3044 self.__quickSearchEscape)
3045 self.quickFindtextCombo._editor.gotFocus.connect(
3046 self.__quickSearchFocusIn)
2828 self.quickFindtextAction = QWidgetAction(self) 3047 self.quickFindtextAction = QWidgetAction(self)
2829 self.quickFindtextAction.setDefaultWidget(self.quickFindtextCombo) 3048 self.quickFindtextAction.setDefaultWidget(self.quickFindtextCombo)
2830 self.quickFindtextAction.setObjectName("vm_quickfindtext_action") 3049 self.quickFindtextAction.setObjectName("vm_quickfindtext_action")
2831 self.quickFindtextAction.setText(self.trUtf8("Quicksearch Textedit")) 3050 self.quickFindtextAction.setText(self.trUtf8("Quicksearch Textedit"))
2832 qtb.addAction(self.quickFindtextAction) 3051 qtb.addAction(self.quickFindtextAction)
2853 tb.addAction(self.searchFilesAct) 3072 tb.addAction(self.searchFilesAct)
2854 tb.addAction(self.searchOpenFilesAct) 3073 tb.addAction(self.searchOpenFilesAct)
2855 tb.addSeparator() 3074 tb.addSeparator()
2856 tb.addAction(self.gotoLastEditAct) 3075 tb.addAction(self.gotoLastEditAct)
2857 3076
2858 tb.setAllowedAreas(Qt.ToolBarAreas(Qt.TopToolBarArea | Qt.BottomToolBarArea)) 3077 tb.setAllowedAreas(
3078 Qt.ToolBarAreas(Qt.TopToolBarArea | Qt.BottomToolBarArea))
2859 3079
2860 toolbarManager.addToolBar(qtb, qtb.windowTitle()) 3080 toolbarManager.addToolBar(qtb, qtb.windowTitle())
2861 toolbarManager.addToolBar(tb, tb.windowTitle()) 3081 toolbarManager.addToolBar(tb, tb.windowTitle())
2862 toolbarManager.addAction(self.gotoAct, tb.windowTitle()) 3082 toolbarManager.addAction(self.gotoAct, tb.windowTitle())
2863 toolbarManager.addAction(self.gotoBraceAct, tb.windowTitle()) 3083 toolbarManager.addAction(self.gotoBraceAct, tb.windowTitle())
2868 ## Initialize the view related actions, view menu and toolbar 3088 ## Initialize the view related actions, view menu and toolbar
2869 ################################################################## 3089 ##################################################################
2870 3090
2871 def __initViewActions(self): 3091 def __initViewActions(self):
2872 """ 3092 """
2873 Private method defining the user interface actions for the view commands. 3093 Private method defining the user interface actions for the view
3094 commands.
2874 """ 3095 """
2875 self.viewActGrp = createActionGroup(self) 3096 self.viewActGrp = createActionGroup(self)
2876 self.viewFoldActGrp = createActionGroup(self) 3097 self.viewFoldActGrp = createActionGroup(self)
2877 3098
2878 self.zoomInAct = E5Action(QApplication.translate('ViewManager', 'Zoom in'), 3099 self.zoomInAct = E5Action(
2879 UI.PixmapCache.getIcon("zoomIn.png"), 3100 QApplication.translate('ViewManager', 'Zoom in'),
2880 QApplication.translate('ViewManager', 'Zoom &in'), 3101 UI.PixmapCache.getIcon("zoomIn.png"),
2881 QKeySequence(QApplication.translate('ViewManager', 3102 QApplication.translate('ViewManager', 'Zoom &in'),
2882 "Ctrl++", "View|Zoom in")), 3103 QKeySequence(QApplication.translate('ViewManager',
2883 QKeySequence(QApplication.translate('ViewManager', 3104 "Ctrl++", "View|Zoom in")),
2884 "Zoom In", "View|Zoom in")), 3105 QKeySequence(QApplication.translate('ViewManager',
2885 self.viewActGrp, 'vm_view_zoom_in') 3106 "Zoom In", "View|Zoom in")),
3107 self.viewActGrp, 'vm_view_zoom_in')
2886 self.zoomInAct.setStatusTip(QApplication.translate('ViewManager', 3108 self.zoomInAct.setStatusTip(QApplication.translate('ViewManager',
2887 'Zoom in on the text')) 3109 'Zoom in on the text'))
2888 self.zoomInAct.setWhatsThis(QApplication.translate('ViewManager', 3110 self.zoomInAct.setWhatsThis(QApplication.translate('ViewManager',
2889 """<b>Zoom in</b>""" 3111 """<b>Zoom in</b>"""
2890 """<p>Zoom in on the text. This makes the text bigger.</p>""" 3112 """<p>Zoom in on the text. This makes the text bigger.</p>"""
2891 )) 3113 ))
2892 self.zoomInAct.triggered[()].connect(self.__zoomIn) 3114 self.zoomInAct.triggered[()].connect(self.__zoomIn)
2893 self.viewActions.append(self.zoomInAct) 3115 self.viewActions.append(self.zoomInAct)
2894 3116
2895 self.zoomOutAct = E5Action(QApplication.translate('ViewManager', 'Zoom out'), 3117 self.zoomOutAct = E5Action(
2896 UI.PixmapCache.getIcon("zoomOut.png"), 3118 QApplication.translate('ViewManager', 'Zoom out'),
2897 QApplication.translate('ViewManager', 'Zoom &out'), 3119 UI.PixmapCache.getIcon("zoomOut.png"),
2898 QKeySequence(QApplication.translate('ViewManager', 3120 QApplication.translate('ViewManager', 'Zoom &out'),
2899 "Ctrl+-", "View|Zoom out")), 3121 QKeySequence(QApplication.translate('ViewManager',
2900 QKeySequence(QApplication.translate('ViewManager', 3122 "Ctrl+-", "View|Zoom out")),
2901 "Zoom Out", "View|Zoom out")), 3123 QKeySequence(QApplication.translate('ViewManager',
2902 self.viewActGrp, 'vm_view_zoom_out') 3124 "Zoom Out", "View|Zoom out")),
3125 self.viewActGrp, 'vm_view_zoom_out')
2903 self.zoomOutAct.setStatusTip(QApplication.translate('ViewManager', 3126 self.zoomOutAct.setStatusTip(QApplication.translate('ViewManager',
2904 'Zoom out on the text')) 3127 'Zoom out on the text'))
2905 self.zoomOutAct.setWhatsThis(QApplication.translate('ViewManager', 3128 self.zoomOutAct.setWhatsThis(QApplication.translate('ViewManager',
2906 """<b>Zoom out</b>""" 3129 """<b>Zoom out</b>"""
2907 """<p>Zoom out on the text. This makes the text smaller.</p>""" 3130 """<p>Zoom out on the text. This makes the text smaller.</p>"""
2908 )) 3131 ))
2909 self.zoomOutAct.triggered[()].connect(self.__zoomOut) 3132 self.zoomOutAct.triggered[()].connect(self.__zoomOut)
2910 self.viewActions.append(self.zoomOutAct) 3133 self.viewActions.append(self.zoomOutAct)
2911 3134
2912 self.zoomResetAct = E5Action(QApplication.translate('ViewManager', 'Zoom reset'), 3135 self.zoomResetAct = E5Action(
2913 UI.PixmapCache.getIcon("zoomReset.png"), 3136 QApplication.translate('ViewManager', 'Zoom reset'),
2914 QApplication.translate('ViewManager', 'Zoom &reset'), 3137 UI.PixmapCache.getIcon("zoomReset.png"),
2915 QKeySequence(QApplication.translate('ViewManager', 3138 QApplication.translate('ViewManager', 'Zoom &reset'),
2916 "Ctrl+0", "View|Zoom reset")), 3139 QKeySequence(QApplication.translate('ViewManager',
2917 0, 3140 "Ctrl+0", "View|Zoom reset")),
2918 self.viewActGrp, 'vm_view_zoom_reset') 3141 0,
3142 self.viewActGrp, 'vm_view_zoom_reset')
2919 self.zoomResetAct.setStatusTip(QApplication.translate('ViewManager', 3143 self.zoomResetAct.setStatusTip(QApplication.translate('ViewManager',
2920 'Reset the zoom of the text')) 3144 'Reset the zoom of the text'))
2921 self.zoomResetAct.setWhatsThis(QApplication.translate('ViewManager', 3145 self.zoomResetAct.setWhatsThis(QApplication.translate('ViewManager',
2922 """<b>Zoom reset</b>""" 3146 """<b>Zoom reset</b>"""
2923 """<p>Reset the zoom of the text. """ 3147 """<p>Reset the zoom of the text. """
2924 """This sets the zoom factor to 100%.</p>""" 3148 """This sets the zoom factor to 100%.</p>"""
2925 )) 3149 ))
2926 self.zoomResetAct.triggered[()].connect(self.__zoomReset) 3150 self.zoomResetAct.triggered[()].connect(self.__zoomReset)
2927 self.viewActions.append(self.zoomResetAct) 3151 self.viewActions.append(self.zoomResetAct)
2928 3152
2929 self.zoomToAct = E5Action(QApplication.translate('ViewManager', 'Zoom'), 3153 self.zoomToAct = E5Action(
2930 UI.PixmapCache.getIcon("zoomTo.png"), 3154 QApplication.translate('ViewManager', 'Zoom'),
2931 QApplication.translate('ViewManager', '&Zoom'), 3155 UI.PixmapCache.getIcon("zoomTo.png"),
2932 QKeySequence(QApplication.translate('ViewManager', 3156 QApplication.translate('ViewManager', '&Zoom'),
2933 "Ctrl+#", "View|Zoom")), 3157 QKeySequence(QApplication.translate('ViewManager',
2934 0, 3158 "Ctrl+#", "View|Zoom")),
2935 self.viewActGrp, 'vm_view_zoom') 3159 0,
3160 self.viewActGrp, 'vm_view_zoom')
2936 self.zoomToAct.setStatusTip(QApplication.translate('ViewManager', 3161 self.zoomToAct.setStatusTip(QApplication.translate('ViewManager',
2937 'Zoom the text')) 3162 'Zoom the text'))
2938 self.zoomToAct.setWhatsThis(QApplication.translate('ViewManager', 3163 self.zoomToAct.setWhatsThis(QApplication.translate('ViewManager',
2939 """<b>Zoom</b>""" 3164 """<b>Zoom</b>"""
2940 """<p>Zoom the text. This opens a dialog where the""" 3165 """<p>Zoom the text. This opens a dialog where the"""
2941 """ desired size can be entered.</p>""" 3166 """ desired size can be entered.</p>"""
2942 )) 3167 ))
2943 self.zoomToAct.triggered[()].connect(self.__zoom) 3168 self.zoomToAct.triggered[()].connect(self.__zoom)
2944 self.viewActions.append(self.zoomToAct) 3169 self.viewActions.append(self.zoomToAct)
2945 3170
2946 self.toggleAllAct = E5Action(QApplication.translate('ViewManager', 3171 self.toggleAllAct = E5Action(
2947 'Toggle all folds'), 3172 QApplication.translate('ViewManager', 'Toggle all folds'),
2948 QApplication.translate('ViewManager', 'Toggle &all folds'), 3173 QApplication.translate('ViewManager', 'Toggle &all folds'),
2949 0, 0, self.viewFoldActGrp, 'vm_view_toggle_all_folds') 3174 0, 0, self.viewFoldActGrp, 'vm_view_toggle_all_folds')
2950 self.toggleAllAct.setStatusTip(QApplication.translate('ViewManager', 3175 self.toggleAllAct.setStatusTip(QApplication.translate('ViewManager',
2951 'Toggle all folds')) 3176 'Toggle all folds'))
2952 self.toggleAllAct.setWhatsThis(QApplication.translate('ViewManager', 3177 self.toggleAllAct.setWhatsThis(QApplication.translate('ViewManager',
2953 """<b>Toggle all folds</b>""" 3178 """<b>Toggle all folds</b>"""
2954 """<p>Toggle all folds of the current editor.</p>""" 3179 """<p>Toggle all folds of the current editor.</p>"""
2955 )) 3180 ))
2956 self.toggleAllAct.triggered[()].connect(self.__toggleAll) 3181 self.toggleAllAct.triggered[()].connect(self.__toggleAll)
2957 self.viewActions.append(self.toggleAllAct) 3182 self.viewActions.append(self.toggleAllAct)
2958 3183
2959 self.toggleAllChildrenAct = \ 3184 self.toggleAllChildrenAct = E5Action(
2960 E5Action(QApplication.translate('ViewManager', 3185 QApplication.translate(
2961 'Toggle all folds (including children)'), 3186 'ViewManager', 'Toggle all folds (including children)'),
2962 QApplication.translate('ViewManager', 3187 QApplication.translate(
2963 'Toggle all &folds (including children)'), 3188 'ViewManager', 'Toggle all &folds (including children)'),
2964 0, 0, self.viewFoldActGrp, 'vm_view_toggle_all_folds_children') 3189 0, 0, self.viewFoldActGrp, 'vm_view_toggle_all_folds_children')
2965 self.toggleAllChildrenAct.setStatusTip(QApplication.translate('ViewManager', 3190 self.toggleAllChildrenAct.setStatusTip(QApplication.translate(
2966 'Toggle all folds (including children)')) 3191 'ViewManager', 'Toggle all folds (including children)'))
2967 self.toggleAllChildrenAct.setWhatsThis(QApplication.translate('ViewManager', 3192 self.toggleAllChildrenAct.setWhatsThis(QApplication.translate(
2968 """<b>Toggle all folds (including children)</b>""" 3193 'ViewManager',
2969 """<p>Toggle all folds of the current editor including""" 3194 """<b>Toggle all folds (including children)</b>"""
2970 """ all children.</p>""" 3195 """<p>Toggle all folds of the current editor including"""
2971 )) 3196 """ all children.</p>"""
2972 self.toggleAllChildrenAct.triggered[()].connect(self.__toggleAllChildren) 3197 ))
3198 self.toggleAllChildrenAct.triggered[()].connect(
3199 self.__toggleAllChildren)
2973 self.viewActions.append(self.toggleAllChildrenAct) 3200 self.viewActions.append(self.toggleAllChildrenAct)
2974 3201
2975 self.toggleCurrentAct = E5Action(QApplication.translate('ViewManager', 3202 self.toggleCurrentAct = E5Action(
2976 'Toggle current fold'), 3203 QApplication.translate('ViewManager', 'Toggle current fold'),
2977 QApplication.translate('ViewManager', 'Toggle &current fold'), 3204 QApplication.translate('ViewManager', 'Toggle &current fold'),
2978 0, 0, self.viewFoldActGrp, 'vm_view_toggle_current_fold') 3205 0, 0, self.viewFoldActGrp, 'vm_view_toggle_current_fold')
2979 self.toggleCurrentAct.setStatusTip(QApplication.translate('ViewManager', 3206 self.toggleCurrentAct.setStatusTip(QApplication.translate(
2980 'Toggle current fold')) 3207 'ViewManager', 'Toggle current fold'))
2981 self.toggleCurrentAct.setWhatsThis(QApplication.translate('ViewManager', 3208 self.toggleCurrentAct.setWhatsThis(QApplication.translate(
2982 """<b>Toggle current fold</b>""" 3209 'ViewManager',
2983 """<p>Toggle the folds of the current line of the current editor.</p>""" 3210 """<b>Toggle current fold</b>"""
2984 )) 3211 """<p>Toggle the folds of the current line of the current"""
3212 """ editor.</p>"""
3213 ))
2985 self.toggleCurrentAct.triggered[()].connect(self.__toggleCurrent) 3214 self.toggleCurrentAct.triggered[()].connect(self.__toggleCurrent)
2986 self.viewActions.append(self.toggleCurrentAct) 3215 self.viewActions.append(self.toggleCurrentAct)
2987 3216
2988 self.unhighlightAct = E5Action(QApplication.translate('ViewManager', 3217 self.unhighlightAct = E5Action(QApplication.translate('ViewManager',
2989 'Remove all highlights'), 3218 'Remove all highlights'),
2998 """<p>Remove the highlights of all editors.</p>""" 3227 """<p>Remove the highlights of all editors.</p>"""
2999 )) 3228 ))
3000 self.unhighlightAct.triggered[()].connect(self.unhighlight) 3229 self.unhighlightAct.triggered[()].connect(self.unhighlight)
3001 self.viewActions.append(self.unhighlightAct) 3230 self.viewActions.append(self.unhighlightAct)
3002 3231
3003 self.splitViewAct = E5Action(QApplication.translate('ViewManager', 'Split view'), 3232 self.splitViewAct = E5Action(
3004 UI.PixmapCache.getIcon("splitVertical.png"), 3233 QApplication.translate('ViewManager', 'Split view'),
3005 QApplication.translate('ViewManager', '&Split view'), 3234 UI.PixmapCache.getIcon("splitVertical.png"),
3006 0, 0, self, 'vm_view_split_view') 3235 QApplication.translate('ViewManager', '&Split view'),
3236 0, 0, self, 'vm_view_split_view')
3007 self.splitViewAct.setStatusTip(QApplication.translate('ViewManager', 3237 self.splitViewAct.setStatusTip(QApplication.translate('ViewManager',
3008 'Add a split to the view')) 3238 'Add a split to the view'))
3009 self.splitViewAct.setWhatsThis(QApplication.translate('ViewManager', 3239 self.splitViewAct.setWhatsThis(QApplication.translate('ViewManager',
3010 """<b>Split view</b>""" 3240 """<b>Split view</b>"""
3011 """<p>Add a split to the view.</p>""" 3241 """<p>Add a split to the view.</p>"""
3012 )) 3242 ))
3013 self.splitViewAct.triggered[()].connect(self.__splitView) 3243 self.splitViewAct.triggered[()].connect(self.__splitView)
3014 self.viewActions.append(self.splitViewAct) 3244 self.viewActions.append(self.splitViewAct)
3015 3245
3016 self.splitOrientationAct = E5Action(QApplication.translate('ViewManager', 3246 self.splitOrientationAct = E5Action(
3017 'Arrange horizontally'), 3247 QApplication.translate('ViewManager', 'Arrange horizontally'),
3018 QApplication.translate('ViewManager', 3248 QApplication.translate('ViewManager', 'Arrange &horizontally'),
3019 'Arrange &horizontally'), 3249 0, 0, self, 'vm_view_arrange_horizontally', True)
3020 0, 0, self, 'vm_view_arrange_horizontally', True) 3250 self.splitOrientationAct.setStatusTip(QApplication.translate(
3021 self.splitOrientationAct.setStatusTip(QApplication.translate('ViewManager', 3251 'ViewManager', 'Arrange the splitted views horizontally'))
3022 'Arrange the splitted views horizontally')) 3252 self.splitOrientationAct.setWhatsThis(QApplication.translate(
3023 self.splitOrientationAct.setWhatsThis(QApplication.translate('ViewManager', 3253 'ViewManager',
3024 """<b>Arrange horizontally</b>""" 3254 """<b>Arrange horizontally</b>"""
3025 """<p>Arrange the splitted views horizontally.</p>""" 3255 """<p>Arrange the splitted views horizontally.</p>"""
3026 )) 3256 ))
3027 self.splitOrientationAct.setChecked(False) 3257 self.splitOrientationAct.setChecked(False)
3028 self.splitOrientationAct.toggled[bool].connect(self.__splitOrientation) 3258 self.splitOrientationAct.toggled[bool].connect(self.__splitOrientation)
3029 self.viewActions.append(self.splitOrientationAct) 3259 self.viewActions.append(self.splitOrientationAct)
3030 3260
3031 self.splitRemoveAct = E5Action(QApplication.translate('ViewManager', 3261 self.splitRemoveAct = E5Action(
3032 'Remove split'), 3262 QApplication.translate('ViewManager', 'Remove split'),
3033 UI.PixmapCache.getIcon("remsplitVertical.png"), 3263 UI.PixmapCache.getIcon("remsplitVertical.png"),
3034 QApplication.translate('ViewManager', '&Remove split'), 3264 QApplication.translate('ViewManager', '&Remove split'),
3035 0, 0, self, 'vm_view_remove_split') 3265 0, 0, self, 'vm_view_remove_split')
3036 self.splitRemoveAct.setStatusTip(QApplication.translate('ViewManager', 3266 self.splitRemoveAct.setStatusTip(QApplication.translate('ViewManager',
3037 'Remove the current split')) 3267 'Remove the current split'))
3038 self.splitRemoveAct.setWhatsThis(QApplication.translate('ViewManager', 3268 self.splitRemoveAct.setWhatsThis(QApplication.translate('ViewManager',
3039 """<b>Remove split</b>""" 3269 """<b>Remove split</b>"""
3040 """<p>Remove the current split.</p>""" 3270 """<p>Remove the current split.</p>"""
3041 )) 3271 ))
3042 self.splitRemoveAct.triggered[()].connect(self.removeSplit) 3272 self.splitRemoveAct.triggered[()].connect(self.removeSplit)
3043 self.viewActions.append(self.splitRemoveAct) 3273 self.viewActions.append(self.splitRemoveAct)
3044 3274
3045 self.nextSplitAct = E5Action(QApplication.translate('ViewManager', 'Next split'), 3275 self.nextSplitAct = E5Action(
3046 QApplication.translate('ViewManager', '&Next split'), 3276 QApplication.translate('ViewManager', 'Next split'),
3047 QKeySequence(QApplication.translate('ViewManager', 3277 QApplication.translate('ViewManager', '&Next split'),
3048 "Ctrl+Alt+N", "View|Next split")), 3278 QKeySequence(QApplication.translate('ViewManager',
3049 0, 3279 "Ctrl+Alt+N", "View|Next split")),
3050 self, 'vm_next_split') 3280 0,
3281 self, 'vm_next_split')
3051 self.nextSplitAct.setStatusTip(QApplication.translate('ViewManager', 3282 self.nextSplitAct.setStatusTip(QApplication.translate('ViewManager',
3052 'Move to the next split')) 3283 'Move to the next split'))
3053 self.nextSplitAct.setWhatsThis(QApplication.translate('ViewManager', 3284 self.nextSplitAct.setWhatsThis(QApplication.translate('ViewManager',
3054 """<b>Next split</b>""" 3285 """<b>Next split</b>"""
3055 """<p>Move to the next split.</p>""" 3286 """<p>Move to the next split.</p>"""
3056 )) 3287 ))
3057 self.nextSplitAct.triggered[()].connect(self.nextSplit) 3288 self.nextSplitAct.triggered[()].connect(self.nextSplit)
3058 self.viewActions.append(self.nextSplitAct) 3289 self.viewActions.append(self.nextSplitAct)
3059 3290
3060 self.prevSplitAct = E5Action(QApplication.translate('ViewManager', 3291 self.prevSplitAct = E5Action(
3061 'Previous split'), 3292 QApplication.translate('ViewManager', 'Previous split'),
3062 QApplication.translate('ViewManager', '&Previous split'), 3293 QApplication.translate('ViewManager', '&Previous split'),
3063 QKeySequence(QApplication.translate('ViewManager', 3294 QKeySequence(QApplication.translate('ViewManager',
3064 "Ctrl+Alt+P", "View|Previous split")), 3295 "Ctrl+Alt+P", "View|Previous split")),
3065 0, self, 'vm_previous_split') 3296 0, self, 'vm_previous_split')
3066 self.prevSplitAct.setStatusTip(QApplication.translate('ViewManager', 3297 self.prevSplitAct.setStatusTip(QApplication.translate('ViewManager',
3067 'Move to the previous split')) 3298 'Move to the previous split'))
3068 self.prevSplitAct.setWhatsThis(QApplication.translate('ViewManager', 3299 self.prevSplitAct.setWhatsThis(QApplication.translate('ViewManager',
3069 """<b>Previous split</b>""" 3300 """<b>Previous split</b>"""
3070 """<p>Move to the previous split.</p>""" 3301 """<p>Move to the previous split.</p>"""
3098 self.prevSplitAct.setEnabled(False) 3329 self.prevSplitAct.setEnabled(False)
3099 self.previewAct.setEnabled(True) 3330 self.previewAct.setEnabled(True)
3100 3331
3101 def initViewMenu(self): 3332 def initViewMenu(self):
3102 """ 3333 """
3103 Public method to create the View menu 3334 Public method to create the View menu.
3104 3335
3105 @return the generated menu 3336 @return the generated menu
3106 """ 3337 """
3107 menu = QMenu(QApplication.translate('ViewManager', '&View'), self.ui) 3338 menu = QMenu(QApplication.translate('ViewManager', '&View'), self.ui)
3108 menu.setTearOffEnabled(True) 3339 menu.setTearOffEnabled(True)
3123 3354
3124 return menu 3355 return menu
3125 3356
3126 def initViewToolbar(self, toolbarManager): 3357 def initViewToolbar(self, toolbarManager):
3127 """ 3358 """
3128 Public method to create the View toolbar 3359 Public method to create the View toolbar.
3129 3360
3130 @param toolbarManager reference to a toolbar manager object (E5ToolBarManager) 3361 @param toolbarManager reference to a toolbar manager object
3362 (E5ToolBarManager)
3131 @return the generated toolbar 3363 @return the generated toolbar
3132 """ 3364 """
3133 tb = QToolBar(QApplication.translate('ViewManager', 'View'), self.ui) 3365 tb = QToolBar(QApplication.translate('ViewManager', 'View'), self.ui)
3134 tb.setIconSize(UI.Config.ToolBarIconSize) 3366 tb.setIconSize(UI.Config.ToolBarIconSize)
3135 tb.setObjectName("ViewToolbar") 3367 tb.setObjectName("ViewToolbar")
3150 ## Initialize the macro related actions and macro menu 3382 ## Initialize the macro related actions and macro menu
3151 ################################################################## 3383 ##################################################################
3152 3384
3153 def __initMacroActions(self): 3385 def __initMacroActions(self):
3154 """ 3386 """
3155 Private method defining the user interface actions for the macro commands. 3387 Private method defining the user interface actions for the macro
3388 commands.
3156 """ 3389 """
3157 self.macroActGrp = createActionGroup(self) 3390 self.macroActGrp = createActionGroup(self)
3158 3391
3159 self.macroStartRecAct = E5Action(QApplication.translate('ViewManager', 3392 self.macroStartRecAct = E5Action(
3160 'Start Macro Recording'), 3393 QApplication.translate('ViewManager', 'Start Macro Recording'),
3161 QApplication.translate('ViewManager', 3394 QApplication.translate('ViewManager', 'S&tart Macro Recording'),
3162 'S&tart Macro Recording'), 3395 0, 0, self.macroActGrp, 'vm_macro_start_recording')
3163 0, 0, self.macroActGrp, 'vm_macro_start_recording') 3396 self.macroStartRecAct.setStatusTip(QApplication.translate(
3164 self.macroStartRecAct.setStatusTip(QApplication.translate('ViewManager', 3397 'ViewManager', 'Start Macro Recording'))
3165 'Start Macro Recording')) 3398 self.macroStartRecAct.setWhatsThis(QApplication.translate(
3166 self.macroStartRecAct.setWhatsThis(QApplication.translate('ViewManager', 3399 'ViewManager',
3167 """<b>Start Macro Recording</b>""" 3400 """<b>Start Macro Recording</b>"""
3168 """<p>Start recording editor commands into a new macro.</p>""" 3401 """<p>Start recording editor commands into a new macro.</p>"""
3169 )) 3402 ))
3170 self.macroStartRecAct.triggered[()].connect(self.__macroStartRecording) 3403 self.macroStartRecAct.triggered[()].connect(self.__macroStartRecording)
3171 self.macroActions.append(self.macroStartRecAct) 3404 self.macroActions.append(self.macroStartRecAct)
3172 3405
3173 self.macroStopRecAct = E5Action(QApplication.translate('ViewManager', 3406 self.macroStopRecAct = E5Action(QApplication.translate('ViewManager',
3174 'Stop Macro Recording'), 3407 'Stop Macro Recording'),
3182 """<p>Stop recording editor commands into a new macro.</p>""" 3415 """<p>Stop recording editor commands into a new macro.</p>"""
3183 )) 3416 ))
3184 self.macroStopRecAct.triggered[()].connect(self.__macroStopRecording) 3417 self.macroStopRecAct.triggered[()].connect(self.__macroStopRecording)
3185 self.macroActions.append(self.macroStopRecAct) 3418 self.macroActions.append(self.macroStopRecAct)
3186 3419
3187 self.macroRunAct = E5Action(QApplication.translate('ViewManager', 'Run Macro'), 3420 self.macroRunAct = E5Action(
3188 QApplication.translate('ViewManager', '&Run Macro'), 3421 QApplication.translate('ViewManager', 'Run Macro'),
3189 0, 0, self.macroActGrp, 'vm_macro_run') 3422 QApplication.translate('ViewManager', '&Run Macro'),
3190 self.macroRunAct.setStatusTip(QApplication.translate('ViewManager', 'Run Macro')) 3423 0, 0, self.macroActGrp, 'vm_macro_run')
3191 self.macroRunAct.setWhatsThis(QApplication.translate('ViewManager', 3424 self.macroRunAct.setStatusTip(QApplication.translate(
3192 """<b>Run Macro</b>""" 3425 'ViewManager', 'Run Macro'))
3193 """<p>Run a previously recorded editor macro.</p>""" 3426 self.macroRunAct.setWhatsThis(QApplication.translate(
3194 )) 3427 'ViewManager',
3428 """<b>Run Macro</b>"""
3429 """<p>Run a previously recorded editor macro.</p>"""
3430 ))
3195 self.macroRunAct.triggered[()].connect(self.__macroRun) 3431 self.macroRunAct.triggered[()].connect(self.__macroRun)
3196 self.macroActions.append(self.macroRunAct) 3432 self.macroActions.append(self.macroRunAct)
3197 3433
3198 self.macroDeleteAct = E5Action(QApplication.translate('ViewManager', 3434 self.macroDeleteAct = E5Action(
3199 'Delete Macro'), 3435 QApplication.translate('ViewManager', 'Delete Macro'),
3200 QApplication.translate('ViewManager', '&Delete Macro'), 3436 QApplication.translate('ViewManager', '&Delete Macro'),
3201 0, 0, self.macroActGrp, 'vm_macro_delete') 3437 0, 0, self.macroActGrp, 'vm_macro_delete')
3202 self.macroDeleteAct.setStatusTip(QApplication.translate('ViewManager', 3438 self.macroDeleteAct.setStatusTip(QApplication.translate(
3203 'Delete Macro')) 3439 'ViewManager', 'Delete Macro'))
3204 self.macroDeleteAct.setWhatsThis(QApplication.translate('ViewManager', 3440 self.macroDeleteAct.setWhatsThis(QApplication.translate(
3205 """<b>Delete Macro</b>""" 3441 'ViewManager',
3206 """<p>Delete a previously recorded editor macro.</p>""" 3442 """<b>Delete Macro</b>"""
3207 )) 3443 """<p>Delete a previously recorded editor macro.</p>"""
3444 ))
3208 self.macroDeleteAct.triggered[()].connect(self.__macroDelete) 3445 self.macroDeleteAct.triggered[()].connect(self.__macroDelete)
3209 self.macroActions.append(self.macroDeleteAct) 3446 self.macroActions.append(self.macroDeleteAct)
3210 3447
3211 self.macroLoadAct = E5Action(QApplication.translate('ViewManager', 'Load Macro'), 3448 self.macroLoadAct = E5Action(
3212 QApplication.translate('ViewManager', '&Load Macro'), 3449 QApplication.translate('ViewManager', 'Load Macro'),
3213 0, 0, self.macroActGrp, 'vm_macro_load') 3450 QApplication.translate('ViewManager', '&Load Macro'),
3214 self.macroLoadAct.setStatusTip(QApplication.translate('ViewManager', 3451 0, 0, self.macroActGrp, 'vm_macro_load')
3215 'Load Macro')) 3452 self.macroLoadAct.setStatusTip(QApplication.translate(
3216 self.macroLoadAct.setWhatsThis(QApplication.translate('ViewManager', 3453 'ViewManager', 'Load Macro'))
3217 """<b>Load Macro</b>""" 3454 self.macroLoadAct.setWhatsThis(QApplication.translate(
3218 """<p>Load an editor macro from a file.</p>""" 3455 'ViewManager',
3219 )) 3456 """<b>Load Macro</b>"""
3457 """<p>Load an editor macro from a file.</p>"""
3458 ))
3220 self.macroLoadAct.triggered[()].connect(self.__macroLoad) 3459 self.macroLoadAct.triggered[()].connect(self.__macroLoad)
3221 self.macroActions.append(self.macroLoadAct) 3460 self.macroActions.append(self.macroLoadAct)
3222 3461
3223 self.macroSaveAct = E5Action(QApplication.translate('ViewManager', 'Save Macro'), 3462 self.macroSaveAct = E5Action(
3224 QApplication.translate('ViewManager', '&Save Macro'), 3463 QApplication.translate('ViewManager', 'Save Macro'),
3225 0, 0, self.macroActGrp, 'vm_macro_save') 3464 QApplication.translate('ViewManager', '&Save Macro'),
3465 0, 0, self.macroActGrp, 'vm_macro_save')
3226 self.macroSaveAct.setStatusTip(QApplication.translate('ViewManager', 3466 self.macroSaveAct.setStatusTip(QApplication.translate('ViewManager',
3227 'Save Macro')) 3467 'Save Macro'))
3228 self.macroSaveAct.setWhatsThis(QApplication.translate('ViewManager', 3468 self.macroSaveAct.setWhatsThis(QApplication.translate('ViewManager',
3229 """<b>Save Macro</b>""" 3469 """<b>Save Macro</b>"""
3230 """<p>Save a previously recorded editor macro to a file.</p>""" 3470 """<p>Save a previously recorded editor macro to a file.</p>"""
3234 3474
3235 self.macroActGrp.setEnabled(False) 3475 self.macroActGrp.setEnabled(False)
3236 3476
3237 def initMacroMenu(self): 3477 def initMacroMenu(self):
3238 """ 3478 """
3239 Public method to create the Macro menu 3479 Public method to create the Macro menu.
3240 3480
3241 @return the generated menu 3481 @return the generated menu
3242 """ 3482 """
3243 menu = QMenu(QApplication.translate('ViewManager', "&Macros"), self.ui) 3483 menu = QMenu(QApplication.translate('ViewManager', "&Macros"), self.ui)
3244 menu.setTearOffEnabled(True) 3484 menu.setTearOffEnabled(True)
3250 ## Initialize the bookmark related actions, bookmark menu and toolbar 3490 ## Initialize the bookmark related actions, bookmark menu and toolbar
3251 ##################################################################### 3491 #####################################################################
3252 3492
3253 def __initBookmarkActions(self): 3493 def __initBookmarkActions(self):
3254 """ 3494 """
3255 Private method defining the user interface actions for the bookmarks commands. 3495 Private method defining the user interface actions for the bookmarks
3496 commands.
3256 """ 3497 """
3257 self.bookmarkActGrp = createActionGroup(self) 3498 self.bookmarkActGrp = createActionGroup(self)
3258 3499
3259 self.bookmarkToggleAct = E5Action(QApplication.translate('ViewManager', 3500 self.bookmarkToggleAct = E5Action(
3260 'Toggle Bookmark'), 3501 QApplication.translate('ViewManager', 'Toggle Bookmark'),
3261 UI.PixmapCache.getIcon("bookmarkToggle.png"), 3502 UI.PixmapCache.getIcon("bookmarkToggle.png"),
3262 QApplication.translate('ViewManager', '&Toggle Bookmark'), 3503 QApplication.translate('ViewManager', '&Toggle Bookmark'),
3263 QKeySequence(QApplication.translate('ViewManager', 3504 QKeySequence(QApplication.translate(
3264 "Alt+Ctrl+T", "Bookmark|Toggle")), 0, 3505 'ViewManager', "Alt+Ctrl+T", "Bookmark|Toggle")),
3265 self.bookmarkActGrp, 'vm_bookmark_toggle') 3506 0,
3266 self.bookmarkToggleAct.setStatusTip(QApplication.translate('ViewManager', 3507 self.bookmarkActGrp, 'vm_bookmark_toggle')
3267 'Toggle Bookmark')) 3508 self.bookmarkToggleAct.setStatusTip(QApplication.translate(
3268 self.bookmarkToggleAct.setWhatsThis(QApplication.translate('ViewManager', 3509 'ViewManager', 'Toggle Bookmark'))
3269 """<b>Toggle Bookmark</b>""" 3510 self.bookmarkToggleAct.setWhatsThis(QApplication.translate(
3270 """<p>Toggle a bookmark at the current line of the current editor.</p>""" 3511 'ViewManager',
3271 )) 3512 """<b>Toggle Bookmark</b>"""
3513 """<p>Toggle a bookmark at the current line of the current"""
3514 """ editor.</p>"""
3515 ))
3272 self.bookmarkToggleAct.triggered[()].connect(self.__toggleBookmark) 3516 self.bookmarkToggleAct.triggered[()].connect(self.__toggleBookmark)
3273 self.bookmarkActions.append(self.bookmarkToggleAct) 3517 self.bookmarkActions.append(self.bookmarkToggleAct)
3274 3518
3275 self.bookmarkNextAct = E5Action(QApplication.translate('ViewManager', 3519 self.bookmarkNextAct = E5Action(
3276 'Next Bookmark'), 3520 QApplication.translate('ViewManager', 'Next Bookmark'),
3277 UI.PixmapCache.getIcon("bookmarkNext.png"), 3521 UI.PixmapCache.getIcon("bookmarkNext.png"),
3278 QApplication.translate('ViewManager', '&Next Bookmark'), 3522 QApplication.translate('ViewManager', '&Next Bookmark'),
3279 QKeySequence(QApplication.translate('ViewManager', 3523 QKeySequence(QApplication.translate(
3280 "Ctrl+PgDown", "Bookmark|Next")), 0, 3524 'ViewManager', "Ctrl+PgDown", "Bookmark|Next")),
3281 self.bookmarkActGrp, 'vm_bookmark_next') 3525 0,
3526 self.bookmarkActGrp, 'vm_bookmark_next')
3282 self.bookmarkNextAct.setStatusTip(QApplication.translate('ViewManager', 3527 self.bookmarkNextAct.setStatusTip(QApplication.translate('ViewManager',
3283 'Next Bookmark')) 3528 'Next Bookmark'))
3284 self.bookmarkNextAct.setWhatsThis(QApplication.translate('ViewManager', 3529 self.bookmarkNextAct.setWhatsThis(QApplication.translate('ViewManager',
3285 """<b>Next Bookmark</b>""" 3530 """<b>Next Bookmark</b>"""
3286 """<p>Go to next bookmark of the current editor.</p>""" 3531 """<p>Go to next bookmark of the current editor.</p>"""
3287 )) 3532 ))
3288 self.bookmarkNextAct.triggered[()].connect(self.__nextBookmark) 3533 self.bookmarkNextAct.triggered[()].connect(self.__nextBookmark)
3289 self.bookmarkActions.append(self.bookmarkNextAct) 3534 self.bookmarkActions.append(self.bookmarkNextAct)
3290 3535
3291 self.bookmarkPreviousAct = E5Action(QApplication.translate('ViewManager', 3536 self.bookmarkPreviousAct = E5Action(
3292 'Previous Bookmark'), 3537 QApplication.translate('ViewManager', 'Previous Bookmark'),
3293 UI.PixmapCache.getIcon("bookmarkPrevious.png"), 3538 UI.PixmapCache.getIcon("bookmarkPrevious.png"),
3294 QApplication.translate('ViewManager', '&Previous Bookmark'), 3539 QApplication.translate('ViewManager', '&Previous Bookmark'),
3295 QKeySequence(QApplication.translate('ViewManager', 3540 QKeySequence(QApplication.translate(
3296 "Ctrl+PgUp", "Bookmark|Previous")), 3541 'ViewManager', "Ctrl+PgUp", "Bookmark|Previous")),
3297 0, self.bookmarkActGrp, 'vm_bookmark_previous') 3542 0,
3298 self.bookmarkPreviousAct.setStatusTip(QApplication.translate('ViewManager', 3543 self.bookmarkActGrp, 'vm_bookmark_previous')
3299 'Previous Bookmark')) 3544 self.bookmarkPreviousAct.setStatusTip(QApplication.translate(
3300 self.bookmarkPreviousAct.setWhatsThis(QApplication.translate('ViewManager', 3545 'ViewManager', 'Previous Bookmark'))
3301 """<b>Previous Bookmark</b>""" 3546 self.bookmarkPreviousAct.setWhatsThis(QApplication.translate(
3302 """<p>Go to previous bookmark of the current editor.</p>""" 3547 'ViewManager',
3303 )) 3548 """<b>Previous Bookmark</b>"""
3549 """<p>Go to previous bookmark of the current editor.</p>"""
3550 ))
3304 self.bookmarkPreviousAct.triggered[()].connect(self.__previousBookmark) 3551 self.bookmarkPreviousAct.triggered[()].connect(self.__previousBookmark)
3305 self.bookmarkActions.append(self.bookmarkPreviousAct) 3552 self.bookmarkActions.append(self.bookmarkPreviousAct)
3306 3553
3307 self.bookmarkClearAct = E5Action(QApplication.translate('ViewManager', 3554 self.bookmarkClearAct = E5Action(
3308 'Clear Bookmarks'), 3555 QApplication.translate('ViewManager', 'Clear Bookmarks'),
3309 QApplication.translate('ViewManager', '&Clear Bookmarks'), 3556 QApplication.translate('ViewManager', '&Clear Bookmarks'),
3310 QKeySequence(QApplication.translate('ViewManager', 3557 QKeySequence(QApplication.translate(
3311 "Alt+Ctrl+C", "Bookmark|Clear")), 3558 'ViewManager', "Alt+Ctrl+C", "Bookmark|Clear")),
3312 0, 3559 0,
3313 self.bookmarkActGrp, 'vm_bookmark_clear') 3560 self.bookmarkActGrp, 'vm_bookmark_clear')
3314 self.bookmarkClearAct.setStatusTip(QApplication.translate('ViewManager', 3561 self.bookmarkClearAct.setStatusTip(QApplication.translate(
3315 'Clear Bookmarks')) 3562 'ViewManager', 'Clear Bookmarks'))
3316 self.bookmarkClearAct.setWhatsThis(QApplication.translate('ViewManager', 3563 self.bookmarkClearAct.setWhatsThis(QApplication.translate(
3317 """<b>Clear Bookmarks</b>""" 3564 'ViewManager',
3318 """<p>Clear bookmarks of all editors.</p>""" 3565 """<b>Clear Bookmarks</b>"""
3319 )) 3566 """<p>Clear bookmarks of all editors.</p>"""
3567 ))
3320 self.bookmarkClearAct.triggered[()].connect(self.__clearAllBookmarks) 3568 self.bookmarkClearAct.triggered[()].connect(self.__clearAllBookmarks)
3321 self.bookmarkActions.append(self.bookmarkClearAct) 3569 self.bookmarkActions.append(self.bookmarkClearAct)
3322 3570
3323 self.syntaxErrorGotoAct = E5Action(QApplication.translate('ViewManager', 3571 self.syntaxErrorGotoAct = E5Action(
3324 'Goto Syntax Error'), 3572 QApplication.translate('ViewManager', 'Goto Syntax Error'),
3325 UI.PixmapCache.getIcon("syntaxErrorGoto.png"), 3573 UI.PixmapCache.getIcon("syntaxErrorGoto.png"),
3326 QApplication.translate('ViewManager', '&Goto Syntax Error'), 3574 QApplication.translate('ViewManager', '&Goto Syntax Error'),
3327 0, 0, 3575 0, 0,
3328 self.bookmarkActGrp, 'vm_syntaxerror_goto') 3576 self.bookmarkActGrp, 'vm_syntaxerror_goto')
3329 self.syntaxErrorGotoAct.setStatusTip(QApplication.translate('ViewManager', 3577 self.syntaxErrorGotoAct.setStatusTip(QApplication.translate(
3330 'Goto Syntax Error')) 3578 'ViewManager', 'Goto Syntax Error'))
3331 self.syntaxErrorGotoAct.setWhatsThis(QApplication.translate('ViewManager', 3579 self.syntaxErrorGotoAct.setWhatsThis(QApplication.translate(
3332 """<b>Goto Syntax Error</b>""" 3580 'ViewManager',
3333 """<p>Go to next syntax error of the current editor.</p>""" 3581 """<b>Goto Syntax Error</b>"""
3334 )) 3582 """<p>Go to next syntax error of the current editor.</p>"""
3583 ))
3335 self.syntaxErrorGotoAct.triggered[()].connect(self.__gotoSyntaxError) 3584 self.syntaxErrorGotoAct.triggered[()].connect(self.__gotoSyntaxError)
3336 self.bookmarkActions.append(self.syntaxErrorGotoAct) 3585 self.bookmarkActions.append(self.syntaxErrorGotoAct)
3337 3586
3338 self.syntaxErrorClearAct = E5Action(QApplication.translate('ViewManager', 3587 self.syntaxErrorClearAct = E5Action(
3339 'Clear Syntax Errors'), 3588 QApplication.translate('ViewManager', 'Clear Syntax Errors'),
3340 QApplication.translate('ViewManager', 'Clear &Syntax Errors'), 3589 QApplication.translate('ViewManager', 'Clear &Syntax Errors'),
3341 0, 0, 3590 0, 0,
3342 self.bookmarkActGrp, 'vm_syntaxerror_clear') 3591 self.bookmarkActGrp, 'vm_syntaxerror_clear')
3343 self.syntaxErrorClearAct.setStatusTip(QApplication.translate('ViewManager', 3592 self.syntaxErrorClearAct.setStatusTip(QApplication.translate(
3344 'Clear Syntax Errors')) 3593 'ViewManager', 'Clear Syntax Errors'))
3345 self.syntaxErrorClearAct.setWhatsThis(QApplication.translate('ViewManager', 3594 self.syntaxErrorClearAct.setWhatsThis(QApplication.translate(
3346 """<b>Clear Syntax Errors</b>""" 3595 'ViewManager',
3347 """<p>Clear syntax errors of all editors.</p>""" 3596 """<b>Clear Syntax Errors</b>"""
3348 )) 3597 """<p>Clear syntax errors of all editors.</p>"""
3349 self.syntaxErrorClearAct.triggered[()].connect(self.__clearAllSyntaxErrors) 3598 ))
3599 self.syntaxErrorClearAct.triggered[()].connect(
3600 self.__clearAllSyntaxErrors)
3350 self.bookmarkActions.append(self.syntaxErrorClearAct) 3601 self.bookmarkActions.append(self.syntaxErrorClearAct)
3351 3602
3352 self.warningsNextAct = E5Action(QApplication.translate('ViewManager', 3603 self.warningsNextAct = E5Action(QApplication.translate('ViewManager',
3353 'Next warning message'), 3604 'Next warning message'),
3354 UI.PixmapCache.getIcon("warningNext.png"), 3605 UI.PixmapCache.getIcon("warningNext.png"),
3364 """ having a py3flakes warning.</p>""" 3615 """ having a py3flakes warning.</p>"""
3365 )) 3616 ))
3366 self.warningsNextAct.triggered[()].connect(self.__nextWarning) 3617 self.warningsNextAct.triggered[()].connect(self.__nextWarning)
3367 self.bookmarkActions.append(self.warningsNextAct) 3618 self.bookmarkActions.append(self.warningsNextAct)
3368 3619
3369 self.warningsPreviousAct = E5Action(QApplication.translate('ViewManager', 3620 self.warningsPreviousAct = E5Action(
3370 'Previous warning message'), 3621 QApplication.translate('ViewManager', 'Previous warning message'),
3371 UI.PixmapCache.getIcon("warningPrev.png"), 3622 UI.PixmapCache.getIcon("warningPrev.png"),
3372 QApplication.translate('ViewManager', 3623 QApplication.translate('ViewManager',
3373 '&Previous warning message'), 3624 '&Previous warning message'),
3374 0, 0, 3625 0, 0,
3375 self.bookmarkActGrp, 'vm_warning_previous') 3626 self.bookmarkActGrp, 'vm_warning_previous')
3376 self.warningsPreviousAct.setStatusTip(QApplication.translate('ViewManager', 3627 self.warningsPreviousAct.setStatusTip(QApplication.translate(
3377 'Previous warning message')) 3628 'ViewManager', 'Previous warning message'))
3378 self.warningsPreviousAct.setWhatsThis(QApplication.translate('ViewManager', 3629 self.warningsPreviousAct.setWhatsThis(QApplication.translate(
3379 """<b>Previous warning message</b>""" 3630 'ViewManager',
3380 """<p>Go to previous line of the current editor""" 3631 """<b>Previous warning message</b>"""
3381 """ having a py3flakes warning.</p>""" 3632 """<p>Go to previous line of the current editor"""
3382 )) 3633 """ having a py3flakes warning.</p>"""
3634 ))
3383 self.warningsPreviousAct.triggered[()].connect(self.__previousWarning) 3635 self.warningsPreviousAct.triggered[()].connect(self.__previousWarning)
3384 self.bookmarkActions.append(self.warningsPreviousAct) 3636 self.bookmarkActions.append(self.warningsPreviousAct)
3385 3637
3386 self.warningsClearAct = E5Action(QApplication.translate('ViewManager', 3638 self.warningsClearAct = E5Action(
3387 'Clear Warning Messages'), 3639 QApplication.translate('ViewManager', 'Clear Warning Messages'),
3388 QApplication.translate('ViewManager', 3640 QApplication.translate('ViewManager', 'Clear &Warning Messages'),
3389 'Clear &Warning Messages'), 3641 0, 0,
3390 0, 0, 3642 self.bookmarkActGrp, 'vm_warnings_clear')
3391 self.bookmarkActGrp, 'vm_warnings_clear') 3643 self.warningsClearAct.setStatusTip(QApplication.translate(
3392 self.warningsClearAct.setStatusTip(QApplication.translate('ViewManager', 3644 'ViewManager', 'Clear Warning Messages'))
3393 'Clear Warning Messages')) 3645 self.warningsClearAct.setWhatsThis(QApplication.translate(
3394 self.warningsClearAct.setWhatsThis(QApplication.translate('ViewManager', 3646 'ViewManager',
3395 """<b>Clear Warning Messages</b>""" 3647 """<b>Clear Warning Messages</b>"""
3396 """<p>Clear py3flakes warning messages of all editors.</p>""" 3648 """<p>Clear py3flakes warning messages of all editors.</p>"""
3397 )) 3649 ))
3398 self.warningsClearAct.triggered[()].connect(self.__clearAllWarnings) 3650 self.warningsClearAct.triggered[()].connect(self.__clearAllWarnings)
3399 self.bookmarkActions.append(self.warningsClearAct) 3651 self.bookmarkActions.append(self.warningsClearAct)
3400 3652
3401 self.notcoveredNextAct = E5Action(QApplication.translate('ViewManager', 3653 self.notcoveredNextAct = E5Action(
3402 'Next uncovered line'), 3654 QApplication.translate('ViewManager', 'Next uncovered line'),
3403 UI.PixmapCache.getIcon("notcoveredNext.png"), 3655 UI.PixmapCache.getIcon("notcoveredNext.png"),
3404 QApplication.translate('ViewManager', '&Next uncovered line'), 3656 QApplication.translate('ViewManager', '&Next uncovered line'),
3405 0, 0, 3657 0, 0,
3406 self.bookmarkActGrp, 'vm_uncovered_next') 3658 self.bookmarkActGrp, 'vm_uncovered_next')
3407 self.notcoveredNextAct.setStatusTip(QApplication.translate('ViewManager', 3659 self.notcoveredNextAct.setStatusTip(QApplication.translate(
3408 'Next uncovered line')) 3660 'ViewManager', 'Next uncovered line'))
3409 self.notcoveredNextAct.setWhatsThis(QApplication.translate('ViewManager', 3661 self.notcoveredNextAct.setWhatsThis(QApplication.translate(
3410 """<b>Next uncovered line</b>""" 3662 'ViewManager',
3411 """<p>Go to next line of the current editor marked as not covered.</p>""" 3663 """<b>Next uncovered line</b>"""
3412 )) 3664 """<p>Go to next line of the current editor marked as not"""
3665 """ covered.</p>"""
3666 ))
3413 self.notcoveredNextAct.triggered[()].connect(self.__nextUncovered) 3667 self.notcoveredNextAct.triggered[()].connect(self.__nextUncovered)
3414 self.bookmarkActions.append(self.notcoveredNextAct) 3668 self.bookmarkActions.append(self.notcoveredNextAct)
3415 3669
3416 self.notcoveredPreviousAct = E5Action(QApplication.translate('ViewManager', 3670 self.notcoveredPreviousAct = E5Action(
3417 'Previous uncovered line'), 3671 QApplication.translate('ViewManager', 'Previous uncovered line'),
3418 UI.PixmapCache.getIcon("notcoveredPrev.png"), 3672 UI.PixmapCache.getIcon("notcoveredPrev.png"),
3419 QApplication.translate('ViewManager', 3673 QApplication.translate('ViewManager',
3420 '&Previous uncovered line'), 3674 '&Previous uncovered line'),
3421 0, 0, 3675 0, 0,
3422 self.bookmarkActGrp, 'vm_uncovered_previous') 3676 self.bookmarkActGrp, 'vm_uncovered_previous')
3423 self.notcoveredPreviousAct.setStatusTip(QApplication.translate('ViewManager', 3677 self.notcoveredPreviousAct.setStatusTip(QApplication.translate(
3424 'Previous uncovered line')) 3678 'ViewManager', 'Previous uncovered line'))
3425 self.notcoveredPreviousAct.setWhatsThis(QApplication.translate('ViewManager', 3679 self.notcoveredPreviousAct.setWhatsThis(QApplication.translate(
3426 """<b>Previous uncovered line</b>""" 3680 'ViewManager',
3427 """<p>Go to previous line of the current editor marked""" 3681 """<b>Previous uncovered line</b>"""
3428 """ as not covered.</p>""" 3682 """<p>Go to previous line of the current editor marked"""
3429 )) 3683 """ as not covered.</p>"""
3430 self.notcoveredPreviousAct.triggered[()].connect(self.__previousUncovered) 3684 ))
3685 self.notcoveredPreviousAct.triggered[()].connect(
3686 self.__previousUncovered)
3431 self.bookmarkActions.append(self.notcoveredPreviousAct) 3687 self.bookmarkActions.append(self.notcoveredPreviousAct)
3432 3688
3433 self.taskNextAct = E5Action(QApplication.translate('ViewManager', 3689 self.taskNextAct = E5Action(
3434 'Next Task'), 3690 QApplication.translate('ViewManager', 'Next Task'),
3435 UI.PixmapCache.getIcon("taskNext.png"), 3691 UI.PixmapCache.getIcon("taskNext.png"),
3436 QApplication.translate('ViewManager', '&Next Task'), 3692 QApplication.translate('ViewManager', '&Next Task'),
3437 0, 0, 3693 0, 0,
3438 self.bookmarkActGrp, 'vm_task_next') 3694 self.bookmarkActGrp, 'vm_task_next')
3439 self.taskNextAct.setStatusTip(QApplication.translate('ViewManager', 3695 self.taskNextAct.setStatusTip(QApplication.translate(
3440 'Next Task')) 3696 'ViewManager', 'Next Task'))
3441 self.taskNextAct.setWhatsThis(QApplication.translate('ViewManager', 3697 self.taskNextAct.setWhatsThis(QApplication.translate(
3442 """<b>Next Task</b>""" 3698 'ViewManager',
3443 """<p>Go to next line of the current editor having a task.</p>""" 3699 """<b>Next Task</b>"""
3444 )) 3700 """<p>Go to next line of the current editor having a task.</p>"""
3701 ))
3445 self.taskNextAct.triggered[()].connect(self.__nextTask) 3702 self.taskNextAct.triggered[()].connect(self.__nextTask)
3446 self.bookmarkActions.append(self.taskNextAct) 3703 self.bookmarkActions.append(self.taskNextAct)
3447 3704
3448 self.taskPreviousAct = E5Action(QApplication.translate('ViewManager', 3705 self.taskPreviousAct = E5Action(
3449 'Previous Task'), 3706 QApplication.translate('ViewManager', 'Previous Task'),
3450 UI.PixmapCache.getIcon("taskPrev.png"), 3707 UI.PixmapCache.getIcon("taskPrev.png"),
3451 QApplication.translate('ViewManager', 3708 QApplication.translate('ViewManager',
3452 '&Previous Task'), 3709 '&Previous Task'),
3453 0, 0, 3710 0, 0,
3454 self.bookmarkActGrp, 'vm_task_previous') 3711 self.bookmarkActGrp, 'vm_task_previous')
3455 self.taskPreviousAct.setStatusTip(QApplication.translate('ViewManager', 3712 self.taskPreviousAct.setStatusTip(QApplication.translate(
3456 'Previous Task')) 3713 'ViewManager', 'Previous Task'))
3457 self.taskPreviousAct.setWhatsThis(QApplication.translate('ViewManager', 3714 self.taskPreviousAct.setWhatsThis(QApplication.translate(
3458 """<b>Previous Task</b>""" 3715 'ViewManager',
3459 """<p>Go to previous line of the current editor having a task.</p>""" 3716 """<b>Previous Task</b>"""
3460 )) 3717 """<p>Go to previous line of the current editor having a"""
3718 """ task.</p>"""
3719 ))
3461 self.taskPreviousAct.triggered[()].connect(self.__previousTask) 3720 self.taskPreviousAct.triggered[()].connect(self.__previousTask)
3462 self.bookmarkActions.append(self.taskPreviousAct) 3721 self.bookmarkActions.append(self.taskPreviousAct)
3463 3722
3464 self.changeNextAct = E5Action(QApplication.translate('ViewManager', 3723 self.changeNextAct = E5Action(
3465 'Next Change'), 3724 QApplication.translate('ViewManager', 'Next Change'),
3466 UI.PixmapCache.getIcon("changeNext.png"), 3725 UI.PixmapCache.getIcon("changeNext.png"),
3467 QApplication.translate('ViewManager', '&Next Change'), 3726 QApplication.translate('ViewManager', '&Next Change'),
3468 0, 0, 3727 0, 0,
3469 self.bookmarkActGrp, 'vm_change_next') 3728 self.bookmarkActGrp, 'vm_change_next')
3470 self.changeNextAct.setStatusTip(QApplication.translate('ViewManager', 3729 self.changeNextAct.setStatusTip(QApplication.translate(
3471 'Next Change')) 3730 'ViewManager', 'Next Change'))
3472 self.changeNextAct.setWhatsThis(QApplication.translate('ViewManager', 3731 self.changeNextAct.setWhatsThis(QApplication.translate(
3473 """<b>Next Change</b>""" 3732 'ViewManager',
3474 """<p>Go to next line of the current editor having a change marker.</p>""" 3733 """<b>Next Change</b>"""
3475 )) 3734 """<p>Go to next line of the current editor having a change"""
3735 """ marker.</p>"""
3736 ))
3476 self.changeNextAct.triggered[()].connect(self.__nextChange) 3737 self.changeNextAct.triggered[()].connect(self.__nextChange)
3477 self.bookmarkActions.append(self.changeNextAct) 3738 self.bookmarkActions.append(self.changeNextAct)
3478 3739
3479 self.changePreviousAct = E5Action(QApplication.translate('ViewManager', 3740 self.changePreviousAct = E5Action(
3480 'Previous Change'), 3741 QApplication.translate('ViewManager', 'Previous Change'),
3481 UI.PixmapCache.getIcon("changePrev.png"), 3742 UI.PixmapCache.getIcon("changePrev.png"),
3482 QApplication.translate('ViewManager', 3743 QApplication.translate('ViewManager',
3483 '&Previous Change'), 3744 '&Previous Change'),
3484 0, 0, 3745 0, 0,
3485 self.bookmarkActGrp, 'vm_change_previous') 3746 self.bookmarkActGrp, 'vm_change_previous')
3486 self.changePreviousAct.setStatusTip(QApplication.translate('ViewManager', 3747 self.changePreviousAct.setStatusTip(QApplication.translate(
3487 'Previous Change')) 3748 'ViewManager', 'Previous Change'))
3488 self.changePreviousAct.setWhatsThis(QApplication.translate('ViewManager', 3749 self.changePreviousAct.setWhatsThis(QApplication.translate(
3489 """<b>Previous Change</b>""" 3750 'ViewManager',
3490 """<p>Go to previous line of the current editor having""" 3751 """<b>Previous Change</b>"""
3491 """ a change marker.</p>""" 3752 """<p>Go to previous line of the current editor having"""
3492 )) 3753 """ a change marker.</p>"""
3754 ))
3493 self.changePreviousAct.triggered[()].connect(self.__previousChange) 3755 self.changePreviousAct.triggered[()].connect(self.__previousChange)
3494 self.bookmarkActions.append(self.changePreviousAct) 3756 self.bookmarkActions.append(self.changePreviousAct)
3495 3757
3496 self.bookmarkActGrp.setEnabled(False) 3758 self.bookmarkActGrp.setEnabled(False)
3497 3759
3498 def initBookmarkMenu(self): 3760 def initBookmarkMenu(self):
3499 """ 3761 """
3500 Public method to create the Bookmark menu 3762 Public method to create the Bookmark menu.
3501 3763
3502 @return the generated menu 3764 @return the generated menu
3503 """ 3765 """
3504 menu = QMenu(QApplication.translate('ViewManager', '&Bookmarks'), self.ui) 3766 menu = QMenu(QApplication.translate('ViewManager', '&Bookmarks'),
3505 self.bookmarksMenu = QMenu(QApplication.translate('ViewManager', '&Bookmarks'), 3767 self.ui)
3768 self.bookmarksMenu = QMenu(
3769 QApplication.translate('ViewManager', '&Bookmarks'),
3506 menu) 3770 menu)
3507 menu.setTearOffEnabled(True) 3771 menu.setTearOffEnabled(True)
3508 3772
3509 menu.addAction(self.bookmarkToggleAct) 3773 menu.addAction(self.bookmarkToggleAct)
3510 menu.addAction(self.bookmarkNextAct) 3774 menu.addAction(self.bookmarkNextAct)
3535 3799
3536 return menu 3800 return menu
3537 3801
3538 def initBookmarkToolbar(self, toolbarManager): 3802 def initBookmarkToolbar(self, toolbarManager):
3539 """ 3803 """
3540 Public method to create the Bookmark toolbar 3804 Public method to create the Bookmark toolbar.
3541 3805
3542 @param toolbarManager reference to a toolbar manager object (E5ToolBarManager) 3806 @param toolbarManager reference to a toolbar manager object
3807 (E5ToolBarManager)
3543 @return the generated toolbar 3808 @return the generated toolbar
3544 """ 3809 """
3545 tb = QToolBar(QApplication.translate('ViewManager', 'Bookmarks'), self.ui) 3810 tb = QToolBar(QApplication.translate('ViewManager', 'Bookmarks'),
3811 self.ui)
3546 tb.setIconSize(UI.Config.ToolBarIconSize) 3812 tb.setIconSize(UI.Config.ToolBarIconSize)
3547 tb.setObjectName("BookmarksToolbar") 3813 tb.setObjectName("BookmarksToolbar")
3548 tb.setToolTip(QApplication.translate('ViewManager', 'Bookmarks')) 3814 tb.setToolTip(QApplication.translate('ViewManager', 'Bookmarks'))
3549 3815
3550 tb.addAction(self.bookmarkToggleAct) 3816 tb.addAction(self.bookmarkToggleAct)
3576 """ 3842 """
3577 Private method to initialize the spell checking actions. 3843 Private method to initialize the spell checking actions.
3578 """ 3844 """
3579 self.spellingActGrp = createActionGroup(self) 3845 self.spellingActGrp = createActionGroup(self)
3580 3846
3581 self.spellCheckAct = E5Action(QApplication.translate('ViewManager', 3847 self.spellCheckAct = E5Action(
3582 'Check spelling'), 3848 QApplication.translate('ViewManager', 'Check spelling'),
3583 UI.PixmapCache.getIcon("spellchecking.png"), 3849 UI.PixmapCache.getIcon("spellchecking.png"),
3584 QApplication.translate('ViewManager', 3850 QApplication.translate('ViewManager',
3585 'Check &spelling...'), 3851 'Check &spelling...'),
3586 QKeySequence(QApplication.translate('ViewManager', 3852 QKeySequence(QApplication.translate('ViewManager',
3587 "Shift+F7", "Spelling|Spell Check")), 3853 "Shift+F7", "Spelling|Spell Check")),
3588 0, 3854 0,
3589 self.spellingActGrp, 'vm_spelling_spellcheck') 3855 self.spellingActGrp, 'vm_spelling_spellcheck')
3590 self.spellCheckAct.setStatusTip(QApplication.translate('ViewManager', 3856 self.spellCheckAct.setStatusTip(QApplication.translate(
3591 'Perform spell check of current editor')) 3857 'ViewManager', 'Perform spell check of current editor'))
3592 self.spellCheckAct.setWhatsThis(QApplication.translate('ViewManager', 3858 self.spellCheckAct.setWhatsThis(QApplication.translate(
3593 """<b>Check spelling</b>""" 3859 'ViewManager',
3594 """<p>Perform a spell check of the current editor.</p>""" 3860 """<b>Check spelling</b>"""
3595 )) 3861 """<p>Perform a spell check of the current editor.</p>"""
3862 ))
3596 self.spellCheckAct.triggered[()].connect(self.__spellCheck) 3863 self.spellCheckAct.triggered[()].connect(self.__spellCheck)
3597 self.spellingActions.append(self.spellCheckAct) 3864 self.spellingActions.append(self.spellCheckAct)
3598 3865
3599 self.autoSpellCheckAct = E5Action(QApplication.translate('ViewManager', 3866 self.autoSpellCheckAct = E5Action(
3600 'Automatic spell checking'), 3867 QApplication.translate('ViewManager', 'Automatic spell checking'),
3601 UI.PixmapCache.getIcon("autospellchecking.png"), 3868 UI.PixmapCache.getIcon("autospellchecking.png"),
3602 QApplication.translate('ViewManager', 3869 QApplication.translate('ViewManager',
3603 '&Automatic spell checking'), 3870 '&Automatic spell checking'),
3604 0, 0, 3871 0, 0,
3605 self.spellingActGrp, 'vm_spelling_autospellcheck', True) 3872 self.spellingActGrp, 'vm_spelling_autospellcheck', True)
3606 self.autoSpellCheckAct.setStatusTip(QApplication.translate('ViewManager', 3873 self.autoSpellCheckAct.setStatusTip(QApplication.translate(
3607 '(De-)Activate automatic spell checking')) 3874 'ViewManager', '(De-)Activate automatic spell checking'))
3608 self.autoSpellCheckAct.setWhatsThis(QApplication.translate('ViewManager', 3875 self.autoSpellCheckAct.setWhatsThis(QApplication.translate(
3609 """<b>Automatic spell checking</b>""" 3876 'ViewManager',
3610 """<p>Activate or deactivate the automatic spell checking function of""" 3877 """<b>Automatic spell checking</b>"""
3611 """ all editors.</p>""" 3878 """<p>Activate or deactivate the automatic spell checking"""
3612 )) 3879 """ function of all editors.</p>"""
3880 ))
3613 self.autoSpellCheckAct.setChecked( 3881 self.autoSpellCheckAct.setChecked(
3614 Preferences.getEditor("AutoSpellCheckingEnabled")) 3882 Preferences.getEditor("AutoSpellCheckingEnabled"))
3615 self.autoSpellCheckAct.triggered[()].connect(self.__setAutoSpellChecking) 3883 self.autoSpellCheckAct.triggered[()].connect(
3884 self.__setAutoSpellChecking)
3616 self.spellingActions.append(self.autoSpellCheckAct) 3885 self.spellingActions.append(self.autoSpellCheckAct)
3617 3886
3618 self.__enableSpellingActions() 3887 self.__enableSpellingActions()
3619 3888
3620 def __enableSpellingActions(self): 3889 def __enableSpellingActions(self):
3622 Private method to set the enabled state of the spelling actions. 3891 Private method to set the enabled state of the spelling actions.
3623 """ 3892 """
3624 from QScintilla.SpellChecker import SpellChecker 3893 from QScintilla.SpellChecker import SpellChecker
3625 spellingAvailable = SpellChecker.isAvailable() 3894 spellingAvailable = SpellChecker.isAvailable()
3626 3895
3627 self.spellCheckAct.setEnabled(len(self.editors) != 0 and spellingAvailable) 3896 self.spellCheckAct.setEnabled(
3897 len(self.editors) != 0 and spellingAvailable)
3628 self.autoSpellCheckAct.setEnabled(spellingAvailable) 3898 self.autoSpellCheckAct.setEnabled(spellingAvailable)
3629 3899
3630 def addToExtrasMenu(self, menu): 3900 def addToExtrasMenu(self, menu):
3631 """ 3901 """
3632 Public method to add some actions to the extras menu. 3902 Public method to add some actions to the extras menu.
3903
3904 @param menu reference to the menu to add actions to (QMenu)
3633 """ 3905 """
3634 self.__editSpellingMenu = QMenu(QApplication.translate('ViewManager', 3906 self.__editSpellingMenu = QMenu(QApplication.translate('ViewManager',
3635 "Edit Dictionary")) 3907 "Edit Dictionary"))
3636 self.__editProjectPwlAct = self.__editSpellingMenu.addAction( 3908 self.__editProjectPwlAct = self.__editSpellingMenu.addAction(
3637 QApplication.translate('ViewManager', "Project Word List"), 3909 QApplication.translate('ViewManager', "Project Word List"),
3644 QApplication.translate('ViewManager', "User Word List"), 3916 QApplication.translate('ViewManager', "User Word List"),
3645 self.__editUserPWL) 3917 self.__editUserPWL)
3646 self.__editUserPelAct = self.__editSpellingMenu.addAction( 3918 self.__editUserPelAct = self.__editSpellingMenu.addAction(
3647 QApplication.translate('ViewManager', "User Exception List"), 3919 QApplication.translate('ViewManager', "User Exception List"),
3648 self.__editUserPEL) 3920 self.__editUserPEL)
3649 self.__editSpellingMenu.aboutToShow.connect(self.__showEditSpellingMenu) 3921 self.__editSpellingMenu.aboutToShow.connect(
3922 self.__showEditSpellingMenu)
3650 3923
3651 menu.addAction(self.spellCheckAct) 3924 menu.addAction(self.spellCheckAct)
3652 menu.addAction(self.autoSpellCheckAct) 3925 menu.addAction(self.autoSpellCheckAct)
3653 menu.addMenu(self.__editSpellingMenu) 3926 menu.addMenu(self.__editSpellingMenu)
3654 menu.addSeparator() 3927 menu.addSeparator()
3655 3928
3656 def initSpellingToolbar(self, toolbarManager): 3929 def initSpellingToolbar(self, toolbarManager):
3657 """ 3930 """
3658 Public method to create the Spelling toolbar 3931 Public method to create the Spelling toolbar.
3659 3932
3660 @param toolbarManager reference to a toolbar manager object (E5ToolBarManager) 3933 @param toolbarManager reference to a toolbar manager object
3934 (E5ToolBarManager)
3661 @return the generated toolbar 3935 @return the generated toolbar
3662 """ 3936 """
3663 tb = QToolBar(QApplication.translate('ViewManager', 'Spelling'), self.ui) 3937 tb = QToolBar(QApplication.translate('ViewManager', 'Spelling'),
3938 self.ui)
3664 tb.setIconSize(UI.Config.ToolBarIconSize) 3939 tb.setIconSize(UI.Config.ToolBarIconSize)
3665 tb.setObjectName("SpellingToolbar") 3940 tb.setObjectName("SpellingToolbar")
3666 tb.setToolTip(QApplication.translate('ViewManager', 'Spelling')) 3941 tb.setToolTip(QApplication.translate('ViewManager', 'Spelling'))
3667 3942
3668 tb.addAction(self.spellCheckAct) 3943 tb.addAction(self.spellCheckAct)
3860 @param fn name of file to be opened (string) 4135 @param fn name of file to be opened (string)
3861 @param lineno line number to place the cursor at (integer) 4136 @param lineno line number to place the cursor at (integer)
3862 @param filetype type of the source file (string) 4137 @param filetype type of the source file (string)
3863 @param selStart start of an area to be selected (integer) 4138 @param selStart start of an area to be selected (integer)
3864 @param selEnd end of an area to be selected (integer) 4139 @param selEnd end of an area to be selected (integer)
4140 @param pos position within the line to place the cursor at (integer)
3865 """ 4141 """
3866 try: 4142 try:
3867 newWin, editor = self.getEditor(fn, filetype=filetype) 4143 newWin, editor = self.getEditor(fn, filetype=filetype)
3868 except (IOError, UnicodeDecodeError): 4144 except (IOError, UnicodeDecodeError):
3869 return 4145 return
3886 """ 4162 """
3887 Private method to establish all editor connections. 4163 Private method to establish all editor connections.
3888 4164
3889 @param editor reference to the editor object to be connected 4165 @param editor reference to the editor object to be connected
3890 """ 4166 """
3891 editor.modificationStatusChanged.connect(self._modificationStatusChanged) 4167 editor.modificationStatusChanged.connect(
4168 self._modificationStatusChanged)
3892 editor.cursorChanged.connect(self.__cursorChanged) 4169 editor.cursorChanged.connect(self.__cursorChanged)
3893 editor.editorSaved.connect(self.__editorSaved) 4170 editor.editorSaved.connect(self.__editorSaved)
3894 editor.breakpointToggled.connect(self.__breakpointToggled) 4171 editor.breakpointToggled.connect(self.__breakpointToggled)
3895 editor.bookmarkToggled.connect(self.__bookmarkToggled) 4172 editor.bookmarkToggled.connect(self.__bookmarkToggled)
3896 editor.syntaxerrorToggled.connect(self._syntaxErrorToggled) 4173 editor.syntaxerrorToggled.connect(self._syntaxErrorToggled)
3905 editor.eolChanged.connect(self.__editorConfigChanged) 4182 editor.eolChanged.connect(self.__editorConfigChanged)
3906 editor.encodingChanged.connect(self.__editorConfigChanged) 4183 editor.encodingChanged.connect(self.__editorConfigChanged)
3907 editor.selectionChanged.connect(self.__searchWidget.selectionChanged) 4184 editor.selectionChanged.connect(self.__searchWidget.selectionChanged)
3908 editor.selectionChanged.connect(self.__replaceWidget.selectionChanged) 4185 editor.selectionChanged.connect(self.__replaceWidget.selectionChanged)
3909 editor.selectionChanged.connect(self.__editorSelectionChanged) 4186 editor.selectionChanged.connect(self.__editorSelectionChanged)
3910 editor.lastEditPositionAvailable.connect(self.__lastEditPositionAvailable) 4187 editor.lastEditPositionAvailable.connect(
4188 self.__lastEditPositionAvailable)
3911 editor.zoomValueChanged.connect(self.zoomValueChanged) 4189 editor.zoomValueChanged.connect(self.zoomValueChanged)
3912 4190
3913 editor.languageChanged.connect(lambda: self.editorLanguageChanged.emit(editor)) 4191 editor.languageChanged.connect(
4192 lambda: self.editorLanguageChanged.emit(editor))
3914 editor.textChanged.connect(lambda: self.editorTextChanged.emit(editor)) 4193 editor.textChanged.connect(lambda: self.editorTextChanged.emit(editor))
3915 4194
3916 def newEditorView(self, fn, caller, filetype=""): 4195 def newEditorView(self, fn, caller, filetype=""):
3917 """ 4196 """
3918 Public method to create a new editor displaying the given document. 4197 Public method to create a new editor displaying the given document.
3936 @param fn filename of this view 4215 @param fn filename of this view
3937 @return reference to the new editor object (Editor.Editor) and the new 4216 @return reference to the new editor object (Editor.Editor) and the new
3938 edito assembly object (EditorAssembly.EditorAssembly) 4217 edito assembly object (EditorAssembly.EditorAssembly)
3939 """ 4218 """
3940 from QScintilla.EditorAssembly import EditorAssembly 4219 from QScintilla.EditorAssembly import EditorAssembly
3941 assembly = EditorAssembly(self.dbs, fn, self, filetype=filetype, editor=caller, 4220 assembly = EditorAssembly(self.dbs, fn, self, filetype=filetype,
4221 editor=caller,
3942 tv=e5App().getObject("TaskViewer")) 4222 tv=e5App().getObject("TaskViewer"))
3943 editor = assembly.getEditor() 4223 editor = assembly.getEditor()
3944 self.editors.append(editor) 4224 self.editors.append(editor)
3945 self.__connectEditor(editor) 4225 self.__connectEditor(editor)
3946 self.__editorOpened() 4226 self.__editorOpened()
3964 self.recent = self.recent[:maxRecent] 4244 self.recent = self.recent[:maxRecent]
3965 self.__saveRecent() 4245 self.__saveRecent()
3966 4246
3967 def showDebugSource(self, fn, line): 4247 def showDebugSource(self, fn, line):
3968 """ 4248 """
3969 Public method to open the given file and highlight the given line in it. 4249 Public method to open the given file and highlight the given line in
4250 it.
3970 4251
3971 @param fn filename of editor to update (string) 4252 @param fn filename of editor to update (string)
3972 @param line line number to highlight (int) 4253 @param line line number to highlight (int)
3973 """ 4254 """
3974 self.openSourceFile(fn, line) 4255 self.openSourceFile(fn, line)
3991 4272
3992 enc = self.currentEditor.getEncoding() 4273 enc = self.currentEditor.getEncoding()
3993 lang = self.currentEditor.getLanguage() 4274 lang = self.currentEditor.getLanguage()
3994 eol = self.currentEditor.getEolIndicator() 4275 eol = self.currentEditor.getEolIndicator()
3995 zoom = self.currentEditor.getZoom() 4276 zoom = self.currentEditor.getZoom()
3996 self.__setSbFile(fn, line, encoding=enc, language=lang, eol=eol, zoom=zoom) 4277 self.__setSbFile(fn, line, encoding=enc, language=lang, eol=eol,
4278 zoom=zoom)
3997 4279
3998 # Change the highlighted line. 4280 # Change the highlighted line.
3999 self.currentEditor.highlight(line, error, syntaxError) 4281 self.currentEditor.highlight(line, error, syntaxError)
4000 4282
4001 self.currentEditor.highlightVisible() 4283 self.currentEditor.highlightVisible()
4025 writ = 'ro' 4307 writ = 'ro'
4026 self.sbWritable.setText(writ) 4308 self.sbWritable.setText(writ)
4027 4309
4028 if line is None: 4310 if line is None:
4029 line = '' 4311 line = ''
4030 self.sbLine.setText(QApplication.translate('ViewManager', 'Line: {0:5}') 4312 self.sbLine.setText(
4031 .format(line)) 4313 QApplication.translate('ViewManager', 'Line: {0:5}').format(line))
4032 4314
4033 if pos is None: 4315 if pos is None:
4034 pos = '' 4316 pos = ''
4035 self.sbPos.setText(QApplication.translate('ViewManager', 'Pos: {0:5}') 4317 self.sbPos.setText(
4036 .format(pos)) 4318 QApplication.translate('ViewManager', 'Pos: {0:5}').format(pos))
4037 4319
4038 if encoding is None: 4320 if encoding is None:
4039 encoding = '' 4321 encoding = ''
4040 self.sbEnc.setText(encoding) 4322 self.sbEnc.setText(encoding)
4041 4323
4047 if pixmap.isNull(): 4329 if pixmap.isNull():
4048 self.sbLang.setText(language) 4330 self.sbLang.setText(language)
4049 self.sbLang.setToolTip("") 4331 self.sbLang.setToolTip("")
4050 else: 4332 else:
4051 self.sbLang.setText("") 4333 self.sbLang.setText("")
4052 self.sbLang.setToolTip(QApplication.translate('ViewManager', 4334 self.sbLang.setToolTip(
4053 'Language: {0}'.format(language))) 4335 QApplication.translate('ViewManager', 'Language: {0}')
4336 .format(language))
4054 4337
4055 if eol is None: 4338 if eol is None:
4056 eol = '' 4339 eol = ''
4057 self.sbEol.setPixmap(self.__eolPixmap(eol)) 4340 self.sbEol.setPixmap(self.__eolPixmap(eol))
4058 self.sbEol.setToolTip(QApplication.translate('ViewManager', 4341 self.sbEol.setToolTip(
4059 'EOL Mode: {0}'.format(eol))) 4342 QApplication.translate('ViewManager', 'EOL Mode: {0}').format(eol))
4060 4343
4061 if zoom is None: 4344 if zoom is None:
4062 if QApplication.focusWidget() == e5App().getObject("Shell"): 4345 if QApplication.focusWidget() == e5App().getObject("Shell"):
4063 aw = e5App().getObject("Shell") 4346 aw = e5App().getObject("Shell")
4064 else: 4347 else:
4087 4370
4088 def unhighlight(self, current=False): 4371 def unhighlight(self, current=False):
4089 """ 4372 """
4090 Public method to switch off all highlights. 4373 Public method to switch off all highlights.
4091 4374
4092 @param current flag indicating only the current editor should be unhighlighted 4375 @param current flag indicating only the current editor should be
4093 (boolean) 4376 unhighlighted (boolean)
4094 """ 4377 """
4095 if current: 4378 if current:
4096 if self.currentEditor is not None: 4379 if self.currentEditor is not None:
4097 self.currentEditor.highlight() 4380 self.currentEditor.highlight()
4098 else: 4381 else:
4120 If there is no editor with the given file, a new editor window is 4403 If there is no editor with the given file, a new editor window is
4121 created. 4404 created.
4122 4405
4123 @param fn filename to look for 4406 @param fn filename to look for
4124 @param filetype type of the source file (string) 4407 @param filetype type of the source file (string)
4125 @return tuple of two values giving a flag indicating a new window creation and 4408 @return tuple of two values giving a flag indicating a new window
4126 a reference to the editor displaying this file 4409 creation and a reference to the editor displaying this file
4127 """ 4410 """
4128 newWin = False 4411 newWin = False
4129 editor = self.activeWindow() 4412 editor = self.activeWindow()
4130 if editor is None or not Utilities.samepath(fn, editor.getFileName()): 4413 if editor is None or not Utilities.samepath(fn, editor.getFileName()):
4131 for editor in self.editors: 4414 for editor in self.editors:
4132 if Utilities.samepath(fn, editor.getFileName()): 4415 if Utilities.samepath(fn, editor.getFileName()):
4133 break 4416 break
4134 else: 4417 else:
4135 from QScintilla.EditorAssembly import EditorAssembly 4418 from QScintilla.EditorAssembly import EditorAssembly
4136 assembly = EditorAssembly(self.dbs, fn, self, filetype=filetype, 4419 assembly = EditorAssembly(self.dbs, fn, self,
4420 filetype=filetype,
4137 tv=e5App().getObject("TaskViewer")) 4421 tv=e5App().getObject("TaskViewer"))
4138 editor = assembly.getEditor() 4422 editor = assembly.getEditor()
4139 self.editors.append(editor) 4423 self.editors.append(editor)
4140 self.__connectEditor(editor) 4424 self.__connectEditor(editor)
4141 self.__editorOpened() 4425 self.__editorOpened()
4152 4436
4153 def getOpenEditors(self): 4437 def getOpenEditors(self):
4154 """ 4438 """
4155 Public method to get references to all open editors. 4439 Public method to get references to all open editors.
4156 4440
4157 @return list of references to all open editors (list of QScintilla.editor) 4441 @return list of references to all open editors (list of
4442 QScintilla.editor)
4158 """ 4443 """
4159 return self.editors 4444 return self.editors
4160 4445
4161 def getOpenEditorsCount(self): 4446 def getOpenEditorsCount(self):
4162 """ 4447 """
4373 act.setEnabled(QFileInfo(rs).exists()) 4658 act.setEnabled(QFileInfo(rs).exists())
4374 idx += 1 4659 idx += 1
4375 4660
4376 self.recentMenu.addSeparator() 4661 self.recentMenu.addSeparator()
4377 self.recentMenu.addAction( 4662 self.recentMenu.addAction(
4378 QApplication.translate('ViewManager', '&Clear'), self.__clearRecent) 4663 QApplication.translate('ViewManager', '&Clear'),
4664 self.__clearRecent)
4379 4665
4380 def __openSourceFile(self, act): 4666 def __openSourceFile(self, act):
4381 """ 4667 """
4382 Private method to open a file from the list of recently opened files. 4668 Private method to open a file from the list of recently opened files.
4383 4669
4406 act.setEnabled(QFileInfo(rp).exists()) 4692 act.setEnabled(QFileInfo(rp).exists())
4407 4693
4408 if len(self.bookmarked): 4694 if len(self.bookmarked):
4409 self.bookmarkedMenu.addSeparator() 4695 self.bookmarkedMenu.addSeparator()
4410 self.bookmarkedMenu.addAction( 4696 self.bookmarkedMenu.addAction(
4411 QApplication.translate('ViewManager', '&Add'), self.__addBookmarked) 4697 QApplication.translate('ViewManager', '&Add'),
4698 self.__addBookmarked)
4412 self.bookmarkedMenu.addAction( 4699 self.bookmarkedMenu.addAction(
4413 QApplication.translate('ViewManager', '&Edit...'), self.__editBookmarked) 4700 QApplication.translate('ViewManager', '&Edit...'),
4701 self.__editBookmarked)
4414 self.bookmarkedMenu.addAction( 4702 self.bookmarkedMenu.addAction(
4415 QApplication.translate('ViewManager', '&Clear'), self.__clearBookmarked) 4703 QApplication.translate('ViewManager', '&Clear'),
4704 self.__clearBookmarked)
4416 4705
4417 def __addBookmarked(self): 4706 def __addBookmarked(self):
4418 """ 4707 """
4419 Private method to add the current file to the list of bookmarked files. 4708 Private method to add the current file to the list of bookmarked files.
4420 """ 4709 """
4475 for editor in self.editors: 4764 for editor in self.editors:
4476 editor.projectLexerAssociationsChanged() 4765 editor.projectLexerAssociationsChanged()
4477 4766
4478 def enableEditorsCheckFocusIn(self, enabled): 4767 def enableEditorsCheckFocusIn(self, enabled):
4479 """ 4768 """
4480 Public method to set a flag enabling the editors to perform focus in checks. 4769 Public method to set a flag enabling the editors to perform focus in
4481 4770 checks.
4482 @param enabled flag indicating focus in checks should be performed (boolean) 4771
4772 @param enabled flag indicating focus in checks should be performed
4773 (boolean)
4483 """ 4774 """
4484 self.editorsCheckFocusIn = enabled 4775 self.editorsCheckFocusIn = enabled
4485 4776
4486 def editorsCheckFocusInEnabled(self): 4777 def editorsCheckFocusInEnabled(self):
4487 """ 4778 """
4602 """ 4893 """
4603 self.activeWindow().unindentLineOrSelection() 4894 self.activeWindow().unindentLineOrSelection()
4604 4895
4605 def __editSmartIndent(self): 4896 def __editSmartIndent(self):
4606 """ 4897 """
4607 Private method to handle the smart indent action 4898 Private method to handle the smart indent action.
4608 """ 4899 """
4609 self.activeWindow().smartIndentLineOrSelection() 4900 self.activeWindow().smartIndentLineOrSelection()
4610 4901
4611 def __editToggleComment(self): 4902 def __editToggleComment(self):
4612 """ 4903 """
4694 self.activeWindow().autoCompleteFromAll() 4985 self.activeWindow().autoCompleteFromAll()
4695 4986
4696 def __editorAutoCompletionAPIsAvailable(self, available): 4987 def __editorAutoCompletionAPIsAvailable(self, available):
4697 """ 4988 """
4698 Private method to handle the availability of API autocompletion signal. 4989 Private method to handle the availability of API autocompletion signal.
4990
4991 @param available flag indicating the availability of API
4992 autocompletion (boolean)
4699 """ 4993 """
4700 self.autoCompleteFromAPIsAct.setEnabled(available) 4994 self.autoCompleteFromAPIsAct.setEnabled(available)
4701 4995
4702 def __editShowCallTips(self): 4996 def __editShowCallTips(self):
4703 """ 4997 """
4709 ## Below are the action and utility methods for the search menu 5003 ## Below are the action and utility methods for the search menu
4710 ################################################################## 5004 ##################################################################
4711 5005
4712 def textForFind(self, getCurrentWord=True): 5006 def textForFind(self, getCurrentWord=True):
4713 """ 5007 """
4714 Public method to determine the selection or the current word for the next 5008 Public method to determine the selection or the current word for the
4715 find operation. 5009 next find operation.
4716 5010
4717 @param getCurrentWord flag indicating to return the current word, if no selected 5011 @param getCurrentWord flag indicating to return the current word, if
4718 text was found (boolean) 5012 no selected text was found (boolean)
4719 @return selection or current word (string) 5013 @return selection or current word (string)
4720 """ 5014 """
4721 aw = self.activeWindow() 5015 aw = self.activeWindow()
4722 if aw is None: 5016 if aw is None:
4723 return "" 5017 return ""
4738 Private slot to handle the incremental quick search. 5032 Private slot to handle the incremental quick search.
4739 """ 5033 """
4740 # first we have to check if quick search is active 5034 # first we have to check if quick search is active
4741 # and try to activate it if not 5035 # and try to activate it if not
4742 if self.__quickSearchToolbarVisibility is None: 5036 if self.__quickSearchToolbarVisibility is None:
4743 self.__quickSearchToolbarVisibility = self.__quickSearchToolbar.isVisible() 5037 self.__quickSearchToolbarVisibility = \
5038 self.__quickSearchToolbar.isVisible()
4744 if not self.__quickSearchToolbar.isVisible(): 5039 if not self.__quickSearchToolbar.isVisible():
4745 self.__quickSearchToolbar.show() 5040 self.__quickSearchToolbar.show()
4746 if not self.quickFindtextCombo.lineEdit().hasFocus(): 5041 if not self.quickFindtextCombo.lineEdit().hasFocus():
4747 aw = self.activeWindow() 5042 aw = self.activeWindow()
4748 self.quickFindtextCombo.lastActive = aw 5043 self.quickFindtextCombo.lastActive = aw
4766 self.quickFindtextCombo.lastActive = self.activeWindow() 5061 self.quickFindtextCombo.lastActive = self.activeWindow()
4767 5062
4768 def __quickSearchEnter(self): 5063 def __quickSearchEnter(self):
4769 """ 5064 """
4770 Private slot to handle the incremental quick search return pressed 5065 Private slot to handle the incremental quick search return pressed
4771 (jump back to text) 5066 (jump back to text).
4772 """ 5067 """
4773 if self.quickFindtextCombo.lastActive: 5068 if self.quickFindtextCombo.lastActive:
4774 self.quickFindtextCombo.lastActive.setFocus() 5069 self.quickFindtextCombo.lastActive.setFocus()
4775 if self.__quickSearchToolbarVisibility is not None: 5070 if self.__quickSearchToolbarVisibility is not None:
4776 self.__quickSearchToolbar.setVisible(self.__quickSearchToolbarVisibility) 5071 self.__quickSearchToolbar.setVisible(
5072 self.__quickSearchToolbarVisibility)
4777 self.__quickSearchToolbarVisibility = None 5073 self.__quickSearchToolbarVisibility = None
4778 5074
4779 def __quickSearchEscape(self): 5075 def __quickSearchEscape(self):
4780 """ 5076 """
4781 Private slot to handle the incremental quick search escape pressed 5077 Private slot to handle the incremental quick search escape pressed
4782 (jump back to text) 5078 (jump back to text).
4783 """ 5079 """
4784 if self.quickFindtextCombo.lastActive: 5080 if self.quickFindtextCombo.lastActive:
4785 self.quickFindtextCombo.lastActive.setFocus() 5081 self.quickFindtextCombo.lastActive.setFocus()
4786 aw = self.activeWindow() 5082 aw = self.activeWindow()
4787 if aw and self.quickFindtextCombo.lastCursorPos: 5083 if aw and self.quickFindtextCombo.lastCursorPos:
4788 aw.setCursorPosition(self.quickFindtextCombo.lastCursorPos[0], 5084 aw.setCursorPosition(self.quickFindtextCombo.lastCursorPos[0],
4789 self.quickFindtextCombo.lastCursorPos[1]) 5085 self.quickFindtextCombo.lastCursorPos[1])
4790 if self.__quickSearchToolbarVisibility is not None: 5086 if self.__quickSearchToolbarVisibility is not None:
4791 self.__quickSearchToolbar.setVisible(self.__quickSearchToolbarVisibility) 5087 self.__quickSearchToolbar.setVisible(
5088 self.__quickSearchToolbarVisibility)
4792 self.__quickSearchToolbarVisibility = None 5089 self.__quickSearchToolbarVisibility = None
4793 5090
4794 def __quickSearchText(self): 5091 def __quickSearchText(self):
4795 """ 5092 """
4796 Private slot to handle the textChanged signal of the quicksearch edit. 5093 Private slot to handle the textChanged signal of the quicksearch edit.
4802 Private slot to handle the quickFindPrev toolbutton action. 5099 Private slot to handle the quickFindPrev toolbutton action.
4803 """ 5100 """
4804 # first we have to check if quick search is active 5101 # first we have to check if quick search is active
4805 # and try to activate it if not 5102 # and try to activate it if not
4806 if self.__quickSearchToolbarVisibility is None: 5103 if self.__quickSearchToolbarVisibility is None:
4807 self.__quickSearchToolbarVisibility = self.__quickSearchToolbar.isVisible() 5104 self.__quickSearchToolbarVisibility = \
5105 self.__quickSearchToolbar.isVisible()
4808 if not self.__quickSearchToolbar.isVisible(): 5106 if not self.__quickSearchToolbar.isVisible():
4809 self.__quickSearchToolbar.show() 5107 self.__quickSearchToolbar.show()
4810 if not self.quickFindtextCombo.lineEdit().hasFocus(): 5108 if not self.quickFindtextCombo.lineEdit().hasFocus():
4811 aw = self.activeWindow() 5109 aw = self.activeWindow()
4812 self.quickFindtextCombo.lastActive = aw 5110 self.quickFindtextCombo.lastActive = aw
4878 elif lineFrom == 0: 5176 elif lineFrom == 0:
4879 return 5177 return
4880 else: 5178 else:
4881 line = lineFrom - 1 5179 line = lineFrom - 1
4882 index = aw.lineLength(line) 5180 index = aw.lineLength(line)
4883 ok = aw.findFirst(text, False, False, False, True, False, line, index) 5181 ok = aw.findFirst(text, False, False, False, True, False,
5182 line, index)
4884 else: 5183 else:
4885 ok = aw.findFirst(text, False, False, False, True, not back, 5184 ok = aw.findFirst(text, False, False, False, True, not back,
4886 cline, cindex) 5185 cline, cindex)
4887 else: 5186 else:
4888 ok = aw.findFirst(text, False, False, False, True, not back, 5187 ok = aw.findFirst(text, False, False, False, True, not back,
4900 palette.setColor(QPalette.Base, QColor("red")) 5199 palette.setColor(QPalette.Base, QColor("red"))
4901 palette.setColor(QPalette.Text, QColor("white")) 5200 palette.setColor(QPalette.Text, QColor("white"))
4902 self.quickFindtextCombo.lineEdit().setPalette(palette) 5201 self.quickFindtextCombo.lineEdit().setPalette(palette)
4903 else: 5202 else:
4904 palette = self.quickFindtextCombo.lineEdit().palette() 5203 palette = self.quickFindtextCombo.lineEdit().palette()
4905 palette.setColor(QPalette.Base, 5204 palette.setColor(
4906 self.quickFindtextCombo.palette().color(QPalette.Base)) 5205 QPalette.Base,
4907 palette.setColor(QPalette.Text, 5206 self.quickFindtextCombo.palette().color(QPalette.Base))
4908 self.quickFindtextCombo.palette().color(QPalette.Text)) 5207 palette.setColor(
5208 QPalette.Text,
5209 self.quickFindtextCombo.palette().color(QPalette.Text))
4909 self.quickFindtextCombo.lineEdit().setPalette(palette) 5210 self.quickFindtextCombo.lineEdit().setPalette(palette)
4910 5211
4911 def __quickSearchExtend(self): 5212 def __quickSearchExtend(self):
4912 """ 5213 """
4913 Private method to handle the quicksearch extend action. 5214 Private method to handle the quicksearch extend action.
4945 self.__searchWidget.hide() 5246 self.__searchWidget.hide()
4946 self.__replaceWidget.show(self.textForFind()) 5247 self.__replaceWidget.show(self.textForFind())
4947 5248
4948 def __findNextWord(self): 5249 def __findNextWord(self):
4949 """ 5250 """
4950 Private slot to find the next occurrence of the current word of the current 5251 Private slot to find the next occurrence of the current word of the
4951 editor. 5252 current editor.
4952 """ 5253 """
4953 self.activeWindow().searchCurrentWordForward() 5254 self.activeWindow().searchCurrentWordForward()
4954 5255
4955 def __findPrevWord(self): 5256 def __findPrevWord(self):
4956 """ 5257 """
4957 Private slot to find the previous occurrence of the current word of the current 5258 Private slot to find the previous occurrence of the current word of
4958 editor. 5259 the current editor.
4959 """ 5260 """
4960 self.activeWindow().searchCurrentWordBackward() 5261 self.activeWindow().searchCurrentWordBackward()
4961 5262
4962 def __searchClearMarkers(self): 5263 def __searchClearMarkers(self):
4963 """ 5264 """
4990 """ 5291 """
4991 self.activeWindow().gotoLastEditPosition() 5292 self.activeWindow().gotoLastEditPosition()
4992 5293
4993 def __lastEditPositionAvailable(self): 5294 def __lastEditPositionAvailable(self):
4994 """ 5295 """
4995 Private slot to handle the lastEditPositionAvailable signal of an editor. 5296 Private slot to handle the lastEditPositionAvailable signal of an
5297 editor.
4996 """ 5298 """
4997 self.gotoLastEditAct.setEnabled(True) 5299 self.gotoLastEditAct.setEnabled(True)
4998 5300
4999 def __gotoNextMethodClass(self): 5301 def __gotoNextMethodClass(self):
5000 """ 5302 """
5002 """ 5304 """
5003 self.activeWindow().gotoMethodClass(False) 5305 self.activeWindow().gotoMethodClass(False)
5004 5306
5005 def __gotoPreviousMethodClass(self): 5307 def __gotoPreviousMethodClass(self):
5006 """ 5308 """
5007 Private slot to go to the previous Python/Ruby method or class definition. 5309 Private slot to go to the previous Python/Ruby method or class
5310 definition.
5008 """ 5311 """
5009 self.activeWindow().gotoMethodClass(True) 5312 self.activeWindow().gotoMethodClass(True)
5010 5313
5011 def __searchFiles(self): 5314 def __searchFiles(self):
5012 """ 5315 """
5113 if aw: 5416 if aw:
5114 aw.foldAll() 5417 aw.foldAll()
5115 5418
5116 def __toggleAllChildren(self): 5419 def __toggleAllChildren(self):
5117 """ 5420 """
5118 Private method to handle the toggle all folds (including children) action. 5421 Private method to handle the toggle all folds (including children)
5422 action.
5119 """ 5423 """
5120 aw = self.activeWindow() 5424 aw = self.activeWindow()
5121 if aw: 5425 if aw:
5122 aw.foldAll(True) 5426 aw.foldAll(True)
5123 5427
5137 self.addSplit() 5441 self.addSplit()
5138 5442
5139 def __splitOrientation(self, checked): 5443 def __splitOrientation(self, checked):
5140 """ 5444 """
5141 Private method to handle the split orientation action. 5445 Private method to handle the split orientation action.
5446
5447 @param checked flag indicating the checked state of the action
5448 (boolean). True means splitting horizontally.
5142 """ 5449 """
5143 if checked: 5450 if checked:
5144 self.setSplitOrientation(Qt.Horizontal) 5451 self.setSplitOrientation(Qt.Horizontal)
5145 self.splitViewAct.setIcon( 5452 self.splitViewAct.setIcon(
5146 UI.PixmapCache.getIcon("splitHorizontal.png")) 5453 UI.PixmapCache.getIcon("splitHorizontal.png"))
5497 self.__editSpellingDictionary(pel) 5804 self.__editSpellingDictionary(pel)
5498 5805
5499 def __editSpellingDictionary(self, dictionaryFile): 5806 def __editSpellingDictionary(self, dictionaryFile):
5500 """ 5807 """
5501 Private slot to edit the given spelling dictionary. 5808 Private slot to edit the given spelling dictionary.
5809
5810 @param dictionaryFile file name of the dictionary to edit (string)
5502 """ 5811 """
5503 if os.path.exists(dictionaryFile): 5812 if os.path.exists(dictionaryFile):
5504 try: 5813 try:
5505 f = open(dictionaryFile, "r", encoding="utf-8") 5814 f = open(dictionaryFile, "r", encoding="utf-8")
5506 data = f.read() 5815 data = f.read()
5507 f.close() 5816 f.close()
5508 except (IOError, OSError) as err: 5817 except (IOError, OSError) as err:
5509 E5MessageBox.critical(self.ui, 5818 E5MessageBox.critical(
5510 QApplication.translate('ViewManager', "Edit Spelling Dictionary"), 5819 self.ui,
5511 QApplication.translate('ViewManager', 5820 QApplication.translate(
5821 'ViewManager', "Edit Spelling Dictionary"),
5822 QApplication.translate(
5823 'ViewManager',
5512 """<p>The spelling dictionary file <b>{0}</b> could""" 5824 """<p>The spelling dictionary file <b>{0}</b> could"""
5513 """ not be read.</p><p>Reason: {1}</p>""").format( 5825 """ not be read.</p><p>Reason: {1}</p>""").format(
5514 dictionaryFile, str(err))) 5826 dictionaryFile, str(err)))
5515 return 5827 return
5516 5828
5517 fileInfo = dictionaryFile if len(dictionaryFile) < 40 \ 5829 fileInfo = dictionaryFile if len(dictionaryFile) < 40 \
5518 else "...{0}".format(dictionaryFile[-40:]) 5830 else "...{0}".format(dictionaryFile[-40:])
5519 from QScintilla.SpellingDictionaryEditDialog import \ 5831 from QScintilla.SpellingDictionaryEditDialog import \
5520 SpellingDictionaryEditDialog 5832 SpellingDictionaryEditDialog
5521 dlg = SpellingDictionaryEditDialog(data, 5833 dlg = SpellingDictionaryEditDialog(
5522 QApplication.translate('ViewManager', "Editing {0}").format(fileInfo), 5834 data,
5835 QApplication.translate('ViewManager', "Editing {0}")
5836 .format(fileInfo),
5523 self.ui) 5837 self.ui)
5524 if dlg.exec_() == QDialog.Accepted: 5838 if dlg.exec_() == QDialog.Accepted:
5525 data = dlg.getData() 5839 data = dlg.getData()
5526 try: 5840 try:
5527 f = open(dictionaryFile, "w", encoding="utf-8") 5841 f = open(dictionaryFile, "w", encoding="utf-8")
5528 f.write(data) 5842 f.write(data)
5529 f.close() 5843 f.close()
5530 except (IOError, OSError) as err: 5844 except (IOError, OSError) as err:
5531 E5MessageBox.critical(self.ui, 5845 E5MessageBox.critical(
5532 QApplication.translate('ViewManager', "Edit Spelling Dictionary"), 5846 self.ui,
5533 QApplication.translate('ViewManager', 5847 QApplication.translate(
5534 """<p>The spelling dictionary file <b>{0}</b> could""" 5848 'ViewManager', "Edit Spelling Dictionary"),
5535 """ not be written.</p><p>Reason: {1}</p>""").format( 5849 QApplication.translate(
5850 'ViewManager',
5851 """<p>The spelling dictionary file <b>{0}</b>"""
5852 """ could not be written.</p>"""
5853 """<p>Reason: {1}</p>""").format(
5536 dictionaryFile, str(err))) 5854 dictionaryFile, str(err)))
5537 return 5855 return
5538 5856
5539 if self.ui.notificationsEnabled(): 5857 if self.ui.notificationsEnabled():
5540 self.ui.showNotification( 5858 self.ui.showNotification(
5541 UI.PixmapCache.getPixmap("spellchecking48.png"), 5859 UI.PixmapCache.getPixmap("spellchecking48.png"),
5542 QApplication.translate('ViewManager', "Edit Spelling Dictionary"), 5860 QApplication.translate(
5543 QApplication.translate('ViewManager', 5861 'ViewManager', "Edit Spelling Dictionary"),
5862 QApplication.translate(
5863 'ViewManager',
5544 "The spelling dictionary was saved successfully.")) 5864 "The spelling dictionary was saved successfully."))
5545 5865
5546 ################################################################## 5866 ##################################################################
5547 ## Below are general utility methods 5867 ## Below are general utility methods
5548 ################################################################## 5868 ##################################################################
5558 line, pos = editor.getCursorPosition() 5878 line, pos = editor.getCursorPosition()
5559 enc = editor.getEncoding() 5879 enc = editor.getEncoding()
5560 lang = editor.getLanguage() 5880 lang = editor.getLanguage()
5561 eol = editor.getEolIndicator() 5881 eol = editor.getEolIndicator()
5562 zoom = editor.getZoom() 5882 zoom = editor.getZoom()
5563 self.__setSbFile(editor.getFileName(), line + 1, pos, enc, lang, eol, zoom) 5883 self.__setSbFile(editor.getFileName(), line + 1, pos, enc, lang,
5884 eol, zoom)
5564 5885
5565 def closeViewManager(self): 5886 def closeViewManager(self):
5566 """ 5887 """
5567 Public method to shutdown the viewmanager. 5888 Public method to shutdown the viewmanager.
5568 5889
5576 5897
5577 # save the list of recently opened projects 5898 # save the list of recently opened projects
5578 self.__saveRecent() 5899 self.__saveRecent()
5579 5900
5580 # save the list of recently opened projects 5901 # save the list of recently opened projects
5581 Preferences.Prefs.settings.setValue('Bookmarked/Sources', self.bookmarked) 5902 Preferences.Prefs.settings.setValue(
5903 'Bookmarked/Sources', self.bookmarked)
5582 5904
5583 if len(self.editors): 5905 if len(self.editors):
5584 res = False 5906 res = False
5585 else: 5907 else:
5586 res = True 5908 res = True
5675 """ 5997 """
5676 Protected slot to check some actions for their enable/disable status 5998 Protected slot to check some actions for their enable/disable status
5677 and set the statusbar info. 5999 and set the statusbar info.
5678 6000
5679 @param editor editor window 6001 @param editor editor window
5680 @param setSb flag indicating an update of the status bar is wanted (boolean) 6002 @param setSb flag indicating an update of the status bar is wanted
6003 (boolean)
5681 """ 6004 """
5682 if editor is not None: 6005 if editor is not None:
5683 self.saveAct.setEnabled(editor.isModified()) 6006 self.saveAct.setEnabled(editor.isModified())
5684 self.revertAct.setEnabled(editor.isModified()) 6007 self.revertAct.setEnabled(editor.isModified())
5685 6008
5686 self.undoAct.setEnabled(editor.isUndoAvailable()) 6009 self.undoAct.setEnabled(editor.isUndoAvailable())
5687 self.redoAct.setEnabled(editor.isRedoAvailable()) 6010 self.redoAct.setEnabled(editor.isRedoAvailable())
5688 self.gotoLastEditAct.setEnabled(editor.isLastEditPositionAvailable()) 6011 self.gotoLastEditAct.setEnabled(
6012 editor.isLastEditPositionAvailable())
5689 6013
5690 lex = editor.getLexer() 6014 lex = editor.getLexer()
5691 if lex is not None: 6015 if lex is not None:
5692 self.commentAct.setEnabled(lex.canBlockComment()) 6016 self.commentAct.setEnabled(lex.canBlockComment())
5693 self.uncommentAct.setEnabled(lex.canBlockComment()) 6017 self.uncommentAct.setEnabled(lex.canBlockComment())
5903 if aw: 6227 if aw:
5904 aw.newLineBelow() 6228 aw.newLineBelow()
5905 6229
5906 def __editorConfigChanged(self): 6230 def __editorConfigChanged(self):
5907 """ 6231 """
5908 Private slot to handle changes of an editor's configuration (e.g. language). 6232 Private slot to handle changes of an editor's configuration (e.g.
6233 language).
5909 """ 6234 """
5910 editor = self.sender() 6235 editor = self.sender()
5911 fn = editor.getFileName() 6236 fn = editor.getFileName()
5912 line, pos = editor.getCursorPosition() 6237 line, pos = editor.getCursorPosition()
5913 enc = editor.getEncoding() 6238 enc = editor.getEncoding()
5943 ## Below are protected utility methods 6268 ## Below are protected utility methods
5944 ################################################################## 6269 ##################################################################
5945 6270
5946 def _getOpenStartDir(self): 6271 def _getOpenStartDir(self):
5947 """ 6272 """
5948 Protected method to return the starting directory for a file open dialog. 6273 Protected method to return the starting directory for a file open
6274 dialog.
5949 6275
5950 The appropriate starting directory is calculated 6276 The appropriate starting directory is calculated
5951 using the following search order, until a match is found:<br /> 6277 using the following search order, until a match is found:<br />
5952 1: Directory of currently active editor<br /> 6278 1: Directory of currently active editor<br />
5953 2: Directory of currently active Project<br /> 6279 2: Directory of currently active Project<br />
5963 # check, if there is an active project and return its path 6289 # check, if there is an active project and return its path
5964 elif e5App().getObject("Project").isOpen(): 6290 elif e5App().getObject("Project").isOpen():
5965 return e5App().getObject("Project").ppath 6291 return e5App().getObject("Project").ppath
5966 6292
5967 else: 6293 else:
5968 return Preferences.getMultiProject("Workspace") or Utilities.getHomeDir() 6294 return Preferences.getMultiProject("Workspace") or \
6295 Utilities.getHomeDir()
5969 6296
5970 def _getOpenFileFilter(self): 6297 def _getOpenFileFilter(self):
5971 """ 6298 """
5972 Protected method to return the active filename filter for a file open dialog. 6299 Protected method to return the active filename filter for a file open
6300 dialog.
5973 6301
5974 The appropriate filename filter is determined by file extension of 6302 The appropriate filename filter is determined by file extension of
5975 the currently active editor. 6303 the currently active editor.
5976 6304
5977 @return name of the filename filter (string) or None 6305 @return name of the filename filter (string) or None
5999 ################################################################## 6327 ##################################################################
6000 6328
6001 def getAPIsManager(self): 6329 def getAPIsManager(self):
6002 """ 6330 """
6003 Public method to get a reference to the APIs manager. 6331 Public method to get a reference to the APIs manager.
6332
6004 @return the APIs manager object (eric5.QScintilla.APIsManager) 6333 @return the APIs manager object (eric5.QScintilla.APIsManager)
6005 """ 6334 """
6006 return self.apisManager 6335 return self.apisManager
6007 6336
6008 ####################################################################### 6337 #######################################################################

eric ide

mercurial