eric6/ViewManager/ViewManager.py

Sat, 04 May 2019 11:10:44 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 04 May 2019 11:10:44 +0200
branch
maintenance
changeset 6989
8b8cadf8d7e9
parent 6923
ViewManager/ViewManager.py@d062df8f1d9f
parent 6942
ViewManager/ViewManager.py@2602857055c5
child 7035
d2036d7f5ef6
permissions
-rw-r--r--

Merged with default branch to prepare release 19.5.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
6645
ad476851d7e0 Updated copyright for 2019.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6421
diff changeset
3 # Copyright (c) 2002 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the viewmanager base class.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3145
a9de05d4a22f # __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3142
diff changeset
10 from __future__ import unicode_literals
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2484
diff changeset
11
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 import os
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
6072
059c8f981ef4 Fixed a signal/slot issue with the "Remove Split" action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6053
diff changeset
14 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QSignalMapper, QTimer, \
6932
8a3df4c6ac9a Continued implementing the Python AST Viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6931
diff changeset
15 QFileInfo, QRegExp, Qt, QCoreApplication, QPoint
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
16 from PyQt5.QtGui import QColor, QKeySequence, QPalette, QPixmap
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
17 from PyQt5.QtWidgets import QLineEdit, QToolBar, QWidgetAction, QDialog, \
4896
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
18 QApplication, QMenu, QComboBox, QWidget
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
19 from PyQt5.Qsci import QsciScintilla
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
21 from E5Gui.E5Application import e5App
549
fe99d46d56c8 Continued replacing QMessageBox.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 548
diff changeset
22 from E5Gui import E5FileDialog, E5MessageBox
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
1449
36138359d3a3 Finished the Mac part of the QScintilla 2.6 support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
24 from Globals import recentNameFiles, isMacPlatform
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 from QScintilla.Editor import Editor
6843
5e1afd1577b9 Editor: added these capabilities
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6735
diff changeset
29 from QScintilla.QsciScintillaCompat import QSCINTILLA_VERSION
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 import Utilities
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 import UI.PixmapCache
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 import UI.Config
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
36 from E5Gui.E5Action import E5Action, createActionGroup
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
38
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 class QuickSearchLineEdit(QLineEdit):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 Class implementing a line edit that reacts to newline and cancel commands.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 @signal escPressed() emitted after the cancel command was activated
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 @signal gotFocus() emitted when the focus is changed to this widget
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 """
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 478
diff changeset
46 escPressed = pyqtSignal()
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 478
diff changeset
47 gotFocus = pyqtSignal()
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 478
diff changeset
48
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 def editorCommand(self, cmd):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 Public method to perform an editor command.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 @param cmd the scintilla command to be performed
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 if cmd == QsciScintilla.SCI_NEWLINE:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 cb = self.parent()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 hasEntry = cb.findText(self.text()) != -1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 if not hasEntry:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 if cb.insertPolicy() == QComboBox.InsertAtTop:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 cb.insertItem(0, self.text())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 cb.addItem(self.text())
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 478
diff changeset
63 self.returnPressed.emit()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 elif cmd == QsciScintilla.SCI_CANCEL:
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 478
diff changeset
65 self.escPressed.emit()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 def keyPressEvent(self, evt):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3547
diff changeset
69 Protected method to handle the press of the ESC key.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 @param evt key event (QKeyPressEvent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 if evt.key() == Qt.Key_Escape:
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 478
diff changeset
74 self.escPressed.emit()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 else:
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2484
diff changeset
76 super(QuickSearchLineEdit, self).keyPressEvent(evt) # pass it on
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 def focusInEvent(self, evt):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3547
diff changeset
80 Protected method to record the current editor widget.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 @param evt focus event (QFocusEvent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 """
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 478
diff changeset
84 self.gotFocus.emit()
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2484
diff changeset
85 super(QuickSearchLineEdit, self).focusInEvent(evt) # pass it on
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
87
4917
682750cc7bd5 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4913
diff changeset
88 class ViewManager(QWidget):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 Base class inherited by all specific viewmanager classes.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 It defines the interface to be implemented by specific
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 viewmanager classes and all common methods.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94
2424
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
95 @signal changeCaption(str) emitted if a change of the caption is necessary
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
96 @signal editorChanged(str) emitted when the current editor has changed
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
97 @signal editorChangedEd(Editor) emitted when the current editor has changed
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
98 @signal lastEditorClosed() emitted after the last editor window was closed
501
5c615a85241a Finished porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
99 @signal editorOpened(str) emitted after an editor window was opened
5c615a85241a Finished porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
100 @signal editorOpenedEd(Editor) emitted after an editor window was opened
5c615a85241a Finished porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
101 @signal editorClosed(str) emitted just before an editor window gets closed
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
102 @signal editorClosedEd(Editor) emitted just before an editor window gets
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
103 closed
4025
ffc69fe3a61d Added three new signals to the viewmanager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
104 @signal editorRenamed(str) emitted after an editor was renamed
ffc69fe3a61d Added three new signals to the viewmanager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
105 @signal editorRenamedEd(Editor) emitted after an editor was renamed
501
5c615a85241a Finished porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
106 @signal editorSaved(str) emitted after an editor window was saved
4025
ffc69fe3a61d Added three new signals to the viewmanager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
107 @signal editorSavedEd(Editor) emitted after an editor window was saved
501
5c615a85241a Finished porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
108 @signal checkActions(Editor) emitted when some actions should be checked
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
109 for their status
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
110 @signal cursorChanged(Editor) emitted after the cursor position of the
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
111 active window has changed
2424
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
112 @signal breakpointToggled(Editor) emitted when a breakpoint is toggled
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
113 @signal bookmarkToggled(Editor) emitted when a bookmark is toggled
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
114 @signal syntaxerrorToggled(Editor) emitted when a syntax error is toggled
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
115 @signal previewStateChanged(bool) emitted to signal a change in the
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
116 preview state
6931
faac36ec9d76 Started implementing the Python AST Viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6891
diff changeset
117 @signal astViewerStateChanged(bool) emitted to signal a change in the
faac36ec9d76 Started implementing the Python AST Viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6891
diff changeset
118 AST viewer state
2424
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
119 @signal editorLanguageChanged(Editor) emitted to signal a change of an
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
120 editor's language
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
121 @signal editorTextChanged(Editor) emitted to signal a change of an
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
122 editor's text
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
123 @signal editorLineChanged(str,int) emitted to signal a change of an
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
124 editor's current line (line is given one based)
6932
8a3df4c6ac9a Continued implementing the Python AST Viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6931
diff changeset
125 @signal editorDoubleClickedEd(Editor, position, buttons) emitted to signal
8a3df4c6ac9a Continued implementing the Python AST Viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6931
diff changeset
126 a mouse double click in an editor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 """
2424
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
128 changeCaption = pyqtSignal(str)
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
129 editorChanged = pyqtSignal(str)
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
130 editorChangedEd = pyqtSignal(Editor)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
131 lastEditorClosed = pyqtSignal()
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
132 editorOpened = pyqtSignal(str)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
133 editorOpenedEd = pyqtSignal(Editor)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
134 editorClosed = pyqtSignal(str)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
135 editorClosedEd = pyqtSignal(Editor)
4025
ffc69fe3a61d Added three new signals to the viewmanager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
136 editorRenamed = pyqtSignal(str)
ffc69fe3a61d Added three new signals to the viewmanager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
137 editorRenamedEd = pyqtSignal(Editor)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
138 editorSaved = pyqtSignal(str)
4025
ffc69fe3a61d Added three new signals to the viewmanager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
139 editorSavedEd = pyqtSignal(Editor)
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
140 checkActions = pyqtSignal(Editor)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
141 cursorChanged = pyqtSignal(Editor)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
142 breakpointToggled = pyqtSignal(Editor)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
143 bookmarkToggled = pyqtSignal(Editor)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
144 syntaxerrorToggled = pyqtSignal(Editor)
2424
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
145 previewStateChanged = pyqtSignal(bool)
6931
faac36ec9d76 Started implementing the Python AST Viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6891
diff changeset
146 astViewerStateChanged = pyqtSignal(bool)
2424
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
147 editorLanguageChanged = pyqtSignal(Editor)
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2415
diff changeset
148 editorTextChanged = pyqtSignal(Editor)
2769
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2673
diff changeset
149 editorLineChanged = pyqtSignal(str, int)
6932
8a3df4c6ac9a Continued implementing the Python AST Viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6931
diff changeset
150 editorDoubleClickedEd = pyqtSignal(Editor, QPoint, int)
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
151
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2484
diff changeset
156 super(ViewManager, self).__init__()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 # initialize the instance variables
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 self.editors = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 self.currentEditor = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 self.untitledCount = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 self.srHistory = {
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
163 "search": [],
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
164 "replace": []
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 }
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 self.editorsCheckFocusIn = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 self.recent = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 self.__loadRecent()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 self.bookmarked = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 bs = Preferences.Prefs.settings.value("Bookmarked/Sources")
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
173 if bs is not None:
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
174 self.bookmarked = bs
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 # initialize the autosave timer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.autosaveInterval = Preferences.getEditor("AutosaveInterval")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 self.autosaveTimer = QTimer(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 self.autosaveTimer.setObjectName("AutosaveTimer")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 self.autosaveTimer.setSingleShot(True)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
181 self.autosaveTimer.timeout.connect(self.__autosave)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 # initialize the APIs manager
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
184 from QScintilla.APIsManager import APIsManager
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
185 self.apisManager = APIsManager(parent=self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186
155
375e3c884874 Added code to transmit selections to remote editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 128
diff changeset
187 self.__cooperationClient = None
375e3c884874 Added code to transmit selections to remote editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 128
diff changeset
188
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 335
diff changeset
189 self.__lastFocusWidget = None
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 335
diff changeset
190
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 def setReferences(self, ui, dbs):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 Public method to set some references needed later on.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 @param ui reference to the main user interface
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 @param dbs reference to the debug server object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 """
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2391
diff changeset
198 from QScintilla.SearchReplaceWidget import SearchReplaceSlidingWidget
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2391
diff changeset
199
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 self.ui = ui
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 self.dbs = dbs
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202
2362
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
203 self.__searchWidget = SearchReplaceSlidingWidget(False, self, ui)
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
204 self.__replaceWidget = SearchReplaceSlidingWidget(True, self, ui)
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
205
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
206 self.checkActions.connect(self.__searchWidget.updateSelectionCheckBox)
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
207 self.checkActions.connect(self.__replaceWidget.updateSelectionCheckBox)
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
208
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
209 def searchWidget(self):
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
210 """
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
211 Public method to get a reference to the search widget.
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
212
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
213 @return reference to the search widget (SearchReplaceSlidingWidget)
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
214 """
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
215 return self.__searchWidget
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
216
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
217 def replaceWidget(self):
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
218 """
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
219 Public method to get a reference to the replace widget.
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
220
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
221 @return reference to the replace widget (SearchReplaceSlidingWidget)
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
222 """
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2351
diff changeset
223 return self.__replaceWidget
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 def __loadRecent(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 Private method to load the recently opened filenames.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 self.recent = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 Preferences.Prefs.rsettings.sync()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 rs = Preferences.Prefs.rsettings.value(recentNameFiles)
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
232 if rs is not None:
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
233 for f in Preferences.toList(rs):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 if QFileInfo(f).exists():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 self.recent.append(f)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 def __saveRecent(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 Private method to save the list of recently opened filenames.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 """
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
241 Preferences.Prefs.rsettings.setValue(recentNameFiles, self.recent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 Preferences.Prefs.rsettings.sync()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 def getMostRecent(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 Public method to get the most recently opened file.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 @return path of the most recently opened file (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 if len(self.recent):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 return self.recent[0]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 return None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
255 def setSbInfo(self, sbLine, sbPos, sbWritable, sbEncoding, sbLanguage,
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
256 sbEol, sbZoom):
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
257 """
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
258 Public method to transfer statusbar info from the user interface to
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
259 viewmanager.
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
260
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3031
diff changeset
261 @param sbLine reference to the line number part of the statusbar
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
262 (QLabel)
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
263 @param sbPos reference to the character position part of the statusbar
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
264 (QLabel)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
265 @param sbWritable reference to the writability indicator part of
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 the statusbar (QLabel)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
267 @param sbEncoding reference to the encoding indicator part of the
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 statusbar (QLabel)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
269 @param sbLanguage reference to the language indicator part of the
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 statusbar (QLabel)
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
271 @param sbEol reference to the eol indicator part of the statusbar
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
272 (QLabel)
2334
fc69ad77e18a Introduced a zoom widget in the status bar of several windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2331
diff changeset
273 @param sbZoom reference to the zoom widget (E5ZoomWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 self.sbLine = sbLine
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 self.sbPos = sbPos
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 self.sbWritable = sbWritable
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 self.sbEnc = sbEncoding
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 self.sbLang = sbLanguage
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 self.sbEol = sbEol
2334
fc69ad77e18a Introduced a zoom widget in the status bar of several windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2331
diff changeset
281 self.sbZoom = sbZoom
3346
39f9273ebd61 Fixed issues caused by the signal/slot connection changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3345
diff changeset
282 self.sbZoom.valueChanged.connect(self.__zoomTo)
2334
fc69ad77e18a Introduced a zoom widget in the status bar of several windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2331
diff changeset
283 self.__setSbFile(zoom=0)
3321
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
284
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
285 self.sbLang.clicked.connect(self.__showLanguagesMenu)
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
286 self.sbEol.clicked.connect(self.__showEolMenu)
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
287 self.sbEnc.clicked.connect(self.__showEncodingsMenu)
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
288
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
289 ##################################################################
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
290 ## Below are menu handling methods for status bar labels
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
291 ##################################################################
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
292
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
293 def __showLanguagesMenu(self, pos):
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
294 """
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
295 Private slot to show the Languages menu of the current editor.
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
296
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
297 @param pos position the menu should be shown at (QPoint)
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
298 """
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
299 aw = self.activeWindow()
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
300 if aw is not None:
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
301 menu = aw.getMenu("Languages")
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
302 if menu is not None:
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
303 menu.exec_(pos)
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
304
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
305 def __showEolMenu(self, pos):
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
306 """
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
307 Private slot to show the EOL menu of the current editor.
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
308
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
309 @param pos position the menu should be shown at (QPoint)
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
310 """
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
311 aw = self.activeWindow()
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
312 if aw is not None:
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
313 menu = aw.getMenu("Eol")
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
314 if menu is not None:
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
315 menu.exec_(pos)
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
316
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
317 def __showEncodingsMenu(self, pos):
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
318 """
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
319 Private slot to show the Encodings menu of the current editor.
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
320
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
321 @param pos position the menu should be shown at (QPoint)
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
322 """
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
323 aw = self.activeWindow()
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
324 if aw is not None:
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
325 menu = aw.getMenu("Encodings")
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
326 if menu is not None:
ad3a75d3d870 Added the encodings, eol and language menus to the respective status bar entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3261
diff changeset
327 menu.exec_(pos)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
329 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 ## methods below need to be implemented by a subclass
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
331 ###########################################################################
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 def canCascade(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 Public method to signal if cascading of managed windows is available.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2886
diff changeset
337 @ireturn flag indicating cascading of windows is available
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 def canTile(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 Public method to signal if tiling of managed windows is available.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2886
diff changeset
346 @ireturn flag indicating tiling of windows is available
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 def tile(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 Public method to tile the managed windows.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 def cascade(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 Public method to cascade the managed windows.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 def activeWindow(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 Public method to return the active (i.e. current) window.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2886
diff changeset
371 @ireturn reference to the active editor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 def _removeAllViews(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
377 """
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2886
diff changeset
378 Protected method to remove all views (i.e. windows).
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 def _removeView(self, win):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 """
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2886
diff changeset
386 Protected method to remove a view (i.e. window).
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 @param win editor window to be removed
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392
6052
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
393 def _addView(self, win, fn=None, noName="", addNext=False, indexes=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 """
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2886
diff changeset
395 Protected method to add a view (i.e. window).
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396
1416
c547d0b2e9c6 Fixed a few issues related to the new editor assembly and to drag&drop of tabs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1358
diff changeset
397 @param win editor assembly to be added
6052
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
398 @type EditorAssembly
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 @param fn filename of this editor
6052
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
400 @type str
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
401 @param noName name to be used for an unnamed editor
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
402 @type str
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
403 @param addNext flag indicating to add the view next to the current
6052
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
404 view
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
405 @type bool
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
406 @param indexes of the editor, first the split view index, second the
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
407 index within the view
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
408 @type tuple of two int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
413 def _showView(self, win, fn=None):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 """
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2886
diff changeset
415 Protected method to show a view (i.e. window).
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416
1419
e200f9084c5d Fixed a few more editor assembly related issues and made 'listspace' the default view manager for Mac.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1416
diff changeset
417 @param win editor assembly to be shown
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 @param fn filename of this editor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 def showWindowMenu(self, windowMenu):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425 Public method to set up the viewmanager part of the Window menu.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 @param windowMenu reference to the window menu
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 def _initWindowActions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 """
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
434 Protected method to define the user interface actions for window
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
435 handling.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 def setEditorName(self, editor, newName):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443 Public method to change the displayed name of the editor.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 @param editor editor window to be changed
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446 @param newName new name to be shown (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451 def _modificationStatusChanged(self, m, editor):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453 Protected slot to handle the modificationStatusChanged signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 @param m flag indicating the modification status (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 @param editor editor window changed
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 @exception RuntimeError Not implemented
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459 raise RuntimeError('Not implemented')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
460
4896
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
461 def mainWidget(self):
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
462 """
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
463 Public method to return a reference to the main Widget of a
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
464 specific view manager subclass.
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
465
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
466 @exception RuntimeError Not implemented
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
467 """
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
468 raise RuntimeError('Not implemented')
5ace700023de Changed code to get rid of multiple inheritance in the viewmanager subclasses.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4891
diff changeset
469
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 #####################################################################
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 ## methods above need to be implemented by a subclass
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472 #####################################################################
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
474 def canSplit(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
475 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 Public method to signal if splitting of the view is available.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 @return flag indicating splitting of the view is available.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 return False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482 def addSplit(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 Public method used to split the current view.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
485 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
486 pass
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
487
6072
059c8f981ef4 Fixed a signal/slot issue with the "Remove Split" action.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6053
diff changeset
488 @pyqtSlot()
6052
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
489 def removeSplit(self, index=-1):
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
490 """
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
491 Public method used to remove the current split view or a split view
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
492 by index.
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
493
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
494 @param index index of the split to be removed (-1 means to
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
495 delete the current split)
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
496 @type int
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
497 @return flag indicating successful deletion
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
498 @rtype bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500 return False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
501
6052
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
502 def splitCount(self):
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
503 """
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
504 Public method to get the number of split views.
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
505
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
506 @return number of split views
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
507 @rtype int
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
508 """
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
509 return 0
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
510
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
511 def setSplitCount(self, count):
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
512 """
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
513 Public method to set the number of split views.
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
514
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
515 @param count number of split views
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
516 @type int
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
517 """
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
518 pass
8b49d3e0b4c8 Extended the session to store/retrieve the split views and the order of the editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
519
3100
1c86bf655433 Added icons to the editor context menu 'New View' entries and gave them better titles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3069
diff changeset
520 def getSplitOrientation(self):
1c86bf655433 Added icons to the editor context menu 'New View' entries and gave them better titles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3069
diff changeset
521 """
1c86bf655433 Added icons to the editor context menu 'New View' entries and gave them better titles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3069
diff changeset
522 Public method to get the orientation of the split view.
1c86bf655433 Added icons to the editor context menu 'New View' entries and gave them better titles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3069
diff changeset
523
1c86bf655433 Added icons to the editor context menu 'New View' entries and gave them better titles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3069
diff changeset
524 @return orientation of the split (Qt.Horizontal or Qt.Vertical)
1c86bf655433 Added icons to the editor context menu 'New View' entries and gave them better titles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3069
diff changeset
525 """
1c86bf655433 Added icons to the editor context menu 'New View' entries and gave them better titles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3069
diff changeset
526 return Qt.Vertical
1c86bf655433 Added icons to the editor context menu 'New View' entries and gave them better titles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3069
diff changeset
527
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
528 def setSplitOrientation(self, orientation):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
529 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530 Public method used to set the orientation of the split view.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 @param orientation orientation of the split
3100
1c86bf655433 Added icons to the editor context menu 'New View' entries and gave them better titles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3069
diff changeset
533 (Qt.Horizontal or Qt.Vertical)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 pass
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537 def nextSplit(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 Public slot used to move to the next split.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 pass
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
543 def prevSplit(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 Public slot used to move to the previous split.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
546 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
547 pass
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
549 def eventFilter(self, qobject, event):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
550 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
551 Public method called to filter an event.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
552
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
553 @param qobject object, that generated the event (QObject)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
554 @param event the event, that was generated by object (QEvent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
555 @return flag indicating if event was filtered out
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
556 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
557 return False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
558
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
559 #####################################################################
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560 ## methods above need to be implemented by a subclass, that supports
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
561 ## splitting of the viewmanager area.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
562 #####################################################################
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
563
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
564 def initActions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
565 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
566 Public method defining the user interface actions.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
567 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568 # list containing all edit actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
569 self.editActions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
570
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
571 # list containing all file actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572 self.fileActions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
574 # list containing all search actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
575 self.searchActions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
576
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
577 # list containing all view actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
578 self.viewActions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
579
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
580 # list containing all window actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
581 self.windowActions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
582
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
583 # list containing all macro actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
584 self.macroActions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
585
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
586 # list containing all bookmark actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
587 self.bookmarkActions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
588
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
589 # list containing all spell checking actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
590 self.spellingActions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
591
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
592 self.__actions = {
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
593 "bookmark": self.bookmarkActions,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
594 "edit": self.editActions,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
595 "file": self.fileActions,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
596 "macro": self.macroActions,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
597 "search": self.searchActions,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
598 "spelling": self.spellingActions,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
599 "view": self.viewActions,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
600 "window": self.windowActions,
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
601 }
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
602
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
603 self._initWindowActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
604 self.__initFileActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
605 self.__initEditActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
606 self.__initSearchActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
607 self.__initViewActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
608 self.__initMacroActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
609 self.__initBookmarkActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
610 self.__initSpellingActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
611
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
612 ##################################################################
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
613 ## Initialize the file related actions, file menu and toolbar
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
614 ##################################################################
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
615
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
616 def __initFileActions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
617 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
618 Private method defining the user interface actions for file handling.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
619 """
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
620 self.newAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
621 QCoreApplication.translate('ViewManager', 'New'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
622 UI.PixmapCache.getIcon("new.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
623 QCoreApplication.translate('ViewManager', '&New'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
624 QKeySequence(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
625 QCoreApplication.translate('ViewManager', "Ctrl+N",
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
626 "File|New")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
627 0, self, 'vm_file_new')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 559
diff changeset
628 self.newAct.setStatusTip(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
629 QCoreApplication.translate(
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
630 'ViewManager', 'Open an empty editor window'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
631 self.newAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
632 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
633 """<b>New</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
634 """<p>An empty editor window will be created.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
635 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
636 self.newAct.triggered.connect(self.newEditor)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
637 self.fileActions.append(self.newAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
638
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
639 self.openAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
640 QCoreApplication.translate('ViewManager', 'Open'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
641 UI.PixmapCache.getIcon("open.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
642 QCoreApplication.translate('ViewManager', '&Open...'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
643 QKeySequence(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
644 QCoreApplication.translate('ViewManager', "Ctrl+O",
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
645 "File|Open")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
646 0, self, 'vm_file_open')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
647 self.openAct.setStatusTip(QCoreApplication.translate(
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
648 'ViewManager', 'Open a file'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
649 self.openAct.setWhatsThis(QCoreApplication.translate(
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
650 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
651 """<b>Open a file</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
652 """<p>You will be asked for the name of a file to be opened"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
653 """ in an editor window.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
654 ))
3346
39f9273ebd61 Fixed issues caused by the signal/slot connection changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3345
diff changeset
655 self.openAct.triggered.connect(self.__openFiles)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
656 self.fileActions.append(self.openAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
657
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
658 self.closeActGrp = createActionGroup(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
659
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
660 self.closeAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
661 QCoreApplication.translate('ViewManager', 'Close'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
662 UI.PixmapCache.getIcon("close.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
663 QCoreApplication.translate('ViewManager', '&Close'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
664 QKeySequence(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
665 QCoreApplication.translate('ViewManager', "Ctrl+W",
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
666 "File|Close")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
667 0, self.closeActGrp, 'vm_file_close')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 559
diff changeset
668 self.closeAct.setStatusTip(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
669 QCoreApplication.translate('ViewManager',
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
670 'Close the current window'))
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
671 self.closeAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
672 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
673 """<b>Close Window</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
674 """<p>Close the current window.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
675 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
676 self.closeAct.triggered.connect(self.closeCurrentWindow)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
677 self.fileActions.append(self.closeAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
678
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
679 self.closeAllAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
680 QCoreApplication.translate('ViewManager', 'Close All'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
681 QCoreApplication.translate('ViewManager', 'Clos&e All'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
682 0, 0, self.closeActGrp, 'vm_file_close_all')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 559
diff changeset
683 self.closeAllAct.setStatusTip(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
684 QCoreApplication.translate('ViewManager',
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
685 'Close all editor windows'))
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
686 self.closeAllAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
687 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
688 """<b>Close All Windows</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
689 """<p>Close all editor windows.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
690 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
691 self.closeAllAct.triggered.connect(self.closeAllWindows)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
692 self.fileActions.append(self.closeAllAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
693
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
694 self.closeActGrp.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
695
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
696 self.saveActGrp = createActionGroup(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
697
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
698 self.saveAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
699 QCoreApplication.translate('ViewManager', 'Save'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
700 UI.PixmapCache.getIcon("fileSave.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
701 QCoreApplication.translate('ViewManager', '&Save'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
702 QKeySequence(QCoreApplication.translate(
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
703 'ViewManager', "Ctrl+S", "File|Save")),
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
704 0, self.saveActGrp, 'vm_file_save')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 559
diff changeset
705 self.saveAct.setStatusTip(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
706 QCoreApplication.translate('ViewManager', 'Save the current file'))
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
707 self.saveAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
708 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
709 """<b>Save File</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
710 """<p>Save the contents of current editor window.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
711 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
712 self.saveAct.triggered.connect(self.saveCurrentEditor)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
713 self.fileActions.append(self.saveAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
714
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
715 self.saveAsAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
716 QCoreApplication.translate('ViewManager', 'Save as'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
717 UI.PixmapCache.getIcon("fileSaveAs.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
718 QCoreApplication.translate('ViewManager', 'Save &as...'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
719 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
720 'ViewManager', "Shift+Ctrl+S", "File|Save As")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
721 0, self.saveActGrp, 'vm_file_save_as')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
722 self.saveAsAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
723 'ViewManager', 'Save the current file to a new one'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
724 self.saveAsAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
725 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
726 """<b>Save File as</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
727 """<p>Save the contents of current editor window to a new file."""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
728 """ The file can be entered in a file selection dialog.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
729 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
730 self.saveAsAct.triggered.connect(self.saveAsCurrentEditor)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
731 self.fileActions.append(self.saveAsAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
732
4402
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
733 self.saveCopyAct = E5Action(
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
734 QCoreApplication.translate('ViewManager', 'Save Copy'),
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
735 UI.PixmapCache.getIcon("fileSaveCopy.png"),
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
736 QCoreApplication.translate('ViewManager', 'Save &Copy...'),
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
737 0, 0, self.saveActGrp, 'vm_file_save_copy')
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
738 self.saveCopyAct.setStatusTip(QCoreApplication.translate(
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
739 'ViewManager', 'Save a copy of the current file'))
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
740 self.saveCopyAct.setWhatsThis(QCoreApplication.translate(
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
741 'ViewManager',
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
742 """<b>Save Copy</b>"""
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
743 """<p>Save a copy of the contents of current editor window."""
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
744 """ The file can be entered in a file selection dialog.</p>"""
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
745 ))
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
746 self.saveCopyAct.triggered.connect(self.saveCopyCurrentEditor)
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
747 self.fileActions.append(self.saveCopyAct)
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
748
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
749 self.saveAllAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
750 QCoreApplication.translate('ViewManager', 'Save all'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
751 UI.PixmapCache.getIcon("fileSaveAll.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
752 QCoreApplication.translate('ViewManager', 'Save a&ll'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
753 0, 0, self.saveActGrp, 'vm_file_save_all')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
754 self.saveAllAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
755 'ViewManager', 'Save all files'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
756 self.saveAllAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
757 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
758 """<b>Save All Files</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
759 """<p>Save the contents of all editor windows.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
760 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
761 self.saveAllAct.triggered.connect(self.saveAllEditors)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
762 self.fileActions.append(self.saveAllAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
763
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 self.saveActGrp.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
765
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
766 self.printAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
767 QCoreApplication.translate('ViewManager', 'Print'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
768 UI.PixmapCache.getIcon("print.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
769 QCoreApplication.translate('ViewManager', '&Print'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
770 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
771 'ViewManager', "Ctrl+P", "File|Print")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
772 0, self, 'vm_file_print')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
773 self.printAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
774 'ViewManager', 'Print the current file'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
775 self.printAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
776 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
777 """<b>Print File</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
778 """<p>Print the contents of current editor window.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
779 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
780 self.printAct.triggered.connect(self.printCurrentEditor)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
781 self.printAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
782 self.fileActions.append(self.printAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
783
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
784 self.printPreviewAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
785 QCoreApplication.translate('ViewManager', 'Print Preview'),
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
786 UI.PixmapCache.getIcon("printPreview.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
787 QCoreApplication.translate('ViewManager', 'Print Preview'),
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
788 0, 0, self, 'vm_file_print_preview')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
789 self.printPreviewAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
790 'ViewManager', 'Print preview of the current file'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
791 self.printPreviewAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
792 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
793 """<b>Print Preview</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
794 """<p>Print preview of the current editor window.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
795 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
796 self.printPreviewAct.triggered.connect(
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
797 self.printPreviewCurrentEditor)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
798 self.printPreviewAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
799 self.fileActions.append(self.printPreviewAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
800
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
801 self.findFileNameAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
802 QCoreApplication.translate('ViewManager', 'Search File'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
803 QCoreApplication.translate('ViewManager', 'Search &File...'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
804 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
805 'ViewManager', "Alt+Ctrl+F", "File|Search File")),
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
806 0, self, 'vm_file_search_file')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
807 self.findFileNameAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
808 'ViewManager', 'Search for a file'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
809 self.findFileNameAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
810 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
811 """<b>Search File</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
812 """<p>Search for a file.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
813 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
814 self.findFileNameAct.triggered.connect(self.__findFileName)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
815 self.fileActions.append(self.findFileNameAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
816
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
817 def initFileMenu(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
818 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
819 Public method to create the File menu.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
820
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
821 @return the generated menu
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
822 """
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
823 menu = QMenu(QCoreApplication.translate('ViewManager', '&File'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
824 self.ui)
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
825 self.recentMenu = QMenu(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
826 QCoreApplication.translate('ViewManager', 'Open &Recent Files'),
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
827 menu)
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
828 self.bookmarkedMenu = QMenu(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
829 QCoreApplication.translate('ViewManager',
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
830 'Open &Bookmarked Files'),
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
831 menu)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
832 self.exportersMenu = self.__initContextMenuExporters()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
833 menu.setTearOffEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
834
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
835 menu.addAction(self.newAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
836 menu.addAction(self.openAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
837 self.menuRecentAct = menu.addMenu(self.recentMenu)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
838 menu.addMenu(self.bookmarkedMenu)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
839 menu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
840 menu.addAction(self.closeAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
841 menu.addAction(self.closeAllAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
842 menu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
843 menu.addAction(self.findFileNameAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
844 menu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
845 menu.addAction(self.saveAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
846 menu.addAction(self.saveAsAct)
4402
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
847 menu.addAction(self.saveCopyAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
848 menu.addAction(self.saveAllAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
849 self.exportersMenuAct = menu.addMenu(self.exportersMenu)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
850 menu.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
851 menu.addAction(self.printPreviewAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
852 menu.addAction(self.printAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
853
461
34528aaedf1c Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 454
diff changeset
854 self.recentMenu.aboutToShow.connect(self.__showRecentMenu)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
855 self.recentMenu.triggered.connect(self.__openSourceFile)
461
34528aaedf1c Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 454
diff changeset
856 self.bookmarkedMenu.aboutToShow.connect(self.__showBookmarkedMenu)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
857 self.bookmarkedMenu.triggered.connect(self.__openSourceFile)
461
34528aaedf1c Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 454
diff changeset
858 menu.aboutToShow.connect(self.__showFileMenu)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
859
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
860 self.exportersMenuAct.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
861
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
862 return menu
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
863
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
864 def initFileToolbar(self, toolbarManager):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
865 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
866 Public method to create the File toolbar.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
867
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
868 @param toolbarManager reference to a toolbar manager object
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
869 (E5ToolBarManager)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
870 @return the generated toolbar
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
871 """
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
872 tb = QToolBar(QCoreApplication.translate('ViewManager', 'File'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
873 self.ui)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
874 tb.setIconSize(UI.Config.ToolBarIconSize)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
875 tb.setObjectName("FileToolbar")
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
876 tb.setToolTip(QCoreApplication.translate('ViewManager', 'File'))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
877
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
878 tb.addAction(self.newAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
879 tb.addAction(self.openAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
880 tb.addAction(self.closeAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
881 tb.addSeparator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
882 tb.addAction(self.saveAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
883 tb.addAction(self.saveAsAct)
4402
ad524553e765 Added capability to save a copy of the editor contents.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4298
diff changeset
884 tb.addAction(self.saveCopyAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
885 tb.addAction(self.saveAllAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
886
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
887 toolbarManager.addToolBar(tb, tb.windowTitle())
816
53e282890577 Made the toolbars of the initial layout more minimalistic.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
888 toolbarManager.addAction(self.printPreviewAct, tb.windowTitle())
53e282890577 Made the toolbars of the initial layout more minimalistic.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
889 toolbarManager.addAction(self.printAct, tb.windowTitle())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
890
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
891 return tb
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
892
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
893 def __initContextMenuExporters(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
894 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
895 Private method used to setup the Exporters sub menu.
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2886
diff changeset
896
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2886
diff changeset
897 @return reference to the generated menu (QMenu)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
898 """
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
899 menu = QMenu(QCoreApplication.translate('ViewManager', "Export as"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
900
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
901 import QScintilla.Exporters
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
902 supportedExporters = QScintilla.Exporters.getSupportedFormats()
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
903 exporters = sorted(list(supportedExporters.keys()))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
904 for exporter in exporters:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
905 act = menu.addAction(supportedExporters[exporter])
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
906 act.setData(exporter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
907
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
908 menu.triggered.connect(self.__exportMenuTriggered)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
909
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
910 return menu
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
911
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
912 ##################################################################
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
913 ## Initialize the edit related actions, edit menu and toolbar
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
914 ##################################################################
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
915
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
916 def __initEditActions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
917 """
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
918 Private method defining the user interface actions for the edit
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
919 commands.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
920 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
921 self.editActGrp = createActionGroup(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
922
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
923 self.undoAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
924 QCoreApplication.translate('ViewManager', 'Undo'),
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
925 UI.PixmapCache.getIcon("editUndo.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
926 QCoreApplication.translate('ViewManager', '&Undo'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
927 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
928 'ViewManager', "Ctrl+Z", "Edit|Undo")),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
929 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
930 'ViewManager', "Alt+Backspace", "Edit|Undo")),
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
931 self.editActGrp, 'vm_edit_undo')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
932 self.undoAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
933 'ViewManager', 'Undo the last change'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
934 self.undoAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
935 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
936 """<b>Undo</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
937 """<p>Undo the last change done in the current editor.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
938 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
939 self.undoAct.triggered.connect(self.__editUndo)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
940 self.editActions.append(self.undoAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
941
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
942 self.redoAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
943 QCoreApplication.translate('ViewManager', 'Redo'),
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
944 UI.PixmapCache.getIcon("editRedo.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
945 QCoreApplication.translate('ViewManager', '&Redo'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
946 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
947 'ViewManager', "Ctrl+Shift+Z", "Edit|Redo")),
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
948 0,
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
949 self.editActGrp, 'vm_edit_redo')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
950 self.redoAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
951 'ViewManager', 'Redo the last change'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
952 self.redoAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
953 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
954 """<b>Redo</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
955 """<p>Redo the last change done in the current editor.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
956 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
957 self.redoAct.triggered.connect(self.__editRedo)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
958 self.editActions.append(self.redoAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
959
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
960 self.revertAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
961 QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
962 'ViewManager', 'Revert to last saved state'),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
963 QCoreApplication.translate(
3039
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
964 'ViewManager', 'Re&vert to last saved state'),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
965 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
966 'ViewManager', "Ctrl+Y", "Edit|Revert")),
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
967 0,
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
968 self.editActGrp, 'vm_edit_revert')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
969 self.revertAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
970 'ViewManager', 'Revert to last saved state'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
971 self.revertAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
972 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
973 """<b>Revert to last saved state</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
974 """<p>Undo all changes up to the last saved state"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
975 """ of the current editor.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
976 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
977 self.revertAct.triggered.connect(self.__editRevert)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
978 self.editActions.append(self.revertAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
979
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
980 self.copyActGrp = createActionGroup(self.editActGrp)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
981
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
982 self.cutAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
983 QCoreApplication.translate('ViewManager', 'Cut'),
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
984 UI.PixmapCache.getIcon("editCut.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
985 QCoreApplication.translate('ViewManager', 'Cu&t'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
986 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
987 'ViewManager', "Ctrl+X", "Edit|Cut")),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
988 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
989 'ViewManager', "Shift+Del", "Edit|Cut")),
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
990 self.copyActGrp, 'vm_edit_cut')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
991 self.cutAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
992 'ViewManager', 'Cut the selection'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
993 self.cutAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
994 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
995 """<b>Cut</b>"""
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
996 """<p>Cut the selected text of the current editor to the"""
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
997 """ clipboard.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
998 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
999 self.cutAct.triggered.connect(self.__editCut)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1000 self.editActions.append(self.cutAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1001
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1002 self.copyAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1003 QCoreApplication.translate('ViewManager', 'Copy'),
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1004 UI.PixmapCache.getIcon("editCopy.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1005 QCoreApplication.translate('ViewManager', '&Copy'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1006 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1007 'ViewManager', "Ctrl+C", "Edit|Copy")),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1008 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1009 'ViewManager', "Ctrl+Ins", "Edit|Copy")),
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1010 self.copyActGrp, 'vm_edit_copy')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1011 self.copyAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1012 'ViewManager', 'Copy the selection'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1013 self.copyAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1014 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1015 """<b>Copy</b>"""
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1016 """<p>Copy the selected text of the current editor to the"""
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1017 """ clipboard.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1018 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
1019 self.copyAct.triggered.connect(self.__editCopy)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1020 self.editActions.append(self.copyAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1021
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1022 self.pasteAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1023 QCoreApplication.translate('ViewManager', 'Paste'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1024 UI.PixmapCache.getIcon("editPaste.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1025 QCoreApplication.translate('ViewManager', '&Paste'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1026 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1027 'ViewManager', "Ctrl+V", "Edit|Paste")),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1028 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1029 'ViewManager', "Shift+Ins", "Edit|Paste")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1030 self.copyActGrp, 'vm_edit_paste')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1031 self.pasteAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1032 'ViewManager', 'Paste the last cut/copied text'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1033 self.pasteAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1034 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1035 """<b>Paste</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1036 """<p>Paste the last cut/copied text from the clipboard to"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1037 """ the current editor.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1038 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
1039 self.pasteAct.triggered.connect(self.__editPaste)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1040 self.editActions.append(self.pasteAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1041
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1042 self.deleteAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1043 QCoreApplication.translate('ViewManager', 'Clear'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1044 UI.PixmapCache.getIcon("editDelete.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1045 QCoreApplication.translate('ViewManager', 'Clear'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1046 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1047 'ViewManager', "Alt+Shift+C", "Edit|Clear")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1048 0,
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1049 self.copyActGrp, 'vm_edit_clear')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1050 self.deleteAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1051 'ViewManager', 'Clear all text'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1052 self.deleteAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1053 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1054 """<b>Clear</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1055 """<p>Delete all text of the current editor.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1056 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
1057 self.deleteAct.triggered.connect(self.__editDelete)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1058 self.editActions.append(self.deleteAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1059
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1060 self.joinAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1061 QCoreApplication.translate('ViewManager', 'Join Lines'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1062 QCoreApplication.translate('ViewManager', 'Join Lines'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1063 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1064 'ViewManager', "Ctrl+J", "Edit|Join Lines")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1065 0,
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1066 self.copyActGrp, 'vm_edit_join_lines')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1067 self.joinAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1068 'ViewManager', 'Join Lines'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1069 self.joinAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1070 'ViewManager',
478
e7d778ea21d6 Added an editor action to join the current line with the next one.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
1071 """<b>Join Lines</b>"""
e7d778ea21d6 Added an editor action to join the current line with the next one.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
1072 """<p>Join the current and the next lines.</p>"""
e7d778ea21d6 Added an editor action to join the current line with the next one.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
1073 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
1074 self.joinAct.triggered.connect(self.__editJoin)
478
e7d778ea21d6 Added an editor action to join the current line with the next one.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
1075 self.editActions.append(self.joinAct)
e7d778ea21d6 Added an editor action to join the current line with the next one.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
1076
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1077 self.indentAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1078 QCoreApplication.translate('ViewManager', 'Indent'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1079 UI.PixmapCache.getIcon("editIndent.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1080 QCoreApplication.translate('ViewManager', '&Indent'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1081 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1082 'ViewManager', "Ctrl+I", "Edit|Indent")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1083 0,
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1084 self.editActGrp, 'vm_edit_indent')
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1085 self.indentAct.setStatusTip(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1086 'ViewManager', 'Indent line'))
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1087 self.indentAct.setWhatsThis(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1088 'ViewManager',
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1089 """<b>Indent</b>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1090 """<p>Indents the current line or the lines of the"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1091 """ selection by one level.</p>"""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1092 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3321
diff changeset
1093 self.indentAct.triggered.connect(self.__editIndent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1094 self.editActions.append(self.indentAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1095
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1096 self.unindentAct = E5Action(
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1097 QCoreApplication.translate('ViewManager', 'Unindent'),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1098 UI.PixmapCache.getIcon("editUnindent.png"),
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1099 QCoreApplication.translate('ViewManager', 'U&nindent'),
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
1100 QKeySequence(QCoreApplication.translate(
3031
ed2eaa573ca5 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1101 'ViewManager', "Ctrl+Shift+I", "Edit|Unindent")),
3013
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
1102 0,
fe886b7f8f40 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: