eric6/QScintilla/ShellWindow.py

Mon, 12 Oct 2020 19:28:42 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 12 Oct 2020 19:28:42 +0200
changeset 7781
607a6098cb44
parent 7759
51aa6c6b66f7
child 7829
5a99dd3ebe5f
permissions
-rw-r--r--

Performed some more code cleanup.

5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7360
9190402e4505 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7267
diff changeset
3 # Copyright (c) 2017 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a stand alone shell window.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
10 import sys
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
11 import os
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
12
7267
aedc309827c7 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
13 from PyQt5.QtCore import (
aedc309827c7 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
14 Qt, QCoreApplication, QPoint, QSize, QSignalMapper, QProcess
aedc309827c7 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
15 )
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 from PyQt5.QtGui import QKeySequence
7267
aedc309827c7 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
17 from PyQt5.QtWidgets import (
aedc309827c7 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
18 QWidget, QVBoxLayout, QApplication, QAction, QWhatsThis, QDialog
aedc309827c7 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
19 )
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 from PyQt5.Qsci import QsciScintilla
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 from E5Gui.E5MainWindow import E5MainWindow
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 from E5Gui.E5Action import E5Action, createActionGroup
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 from E5Gui.E5Application import e5App
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 from E5Gui.E5ZoomWidget import E5ZoomWidget
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 from E5Gui import E5MessageBox
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
28 import UI.Config
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 import UI.PixmapCache
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 import Preferences
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 from Globals import isMacPlatform
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 from .Shell import Shell
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 from .APIsManager import APIsManager
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 from Debugger.DebugServer import DebugServer
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 from UI.SearchWidget import SearchWidget
6358
1a274e1ef9c0 ShellWindow: fixed an issue related to the use of the virtual environment manager causing the shell window application not to start anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
39 from VirtualEnv.VirtualenvManager import VirtualenvManager
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
41 from eric6config import getConfig
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
42
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 class ShellWindow(E5MainWindow):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 Class implementing a stand alone shell window.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 """
6581
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
48 def __init__(self, originalPathString, parent=None, name=None):
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 Constructor
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51
6581
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
52 @param originalPathString original PATH environment variable
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
53 @type str
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 @param parent reference to the parent widget
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 @type QWidget
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 @param name object name of the window
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 @type str
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 super(ShellWindow, self).__init__(parent)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 if name is not None:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 self.setObjectName(name)
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
62 self.setWindowIcon(UI.PixmapCache.getIcon("shell"))
6581
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
63 self.setWindowTitle(self.tr("eric6 Shell"))
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 self.setStyle(Preferences.getUI("Style"),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 Preferences.getUI("StyleSheet"))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 # initialize the APIs manager
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 self.__apisManager = APIsManager(parent=self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 # initialize the debug server and shell widgets
6581
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
72 self.__debugServer = DebugServer(originalPathString,
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
73 preventPassiveDebugging=True)
6576
ea60ea85067a VitualEnv Manager:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6387
diff changeset
74 self.__shell = Shell(self.__debugServer, self, None, True, self)
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
75 self.__searchWidget = SearchWidget(self.__shell, self, showLine=True)
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 centralWidget = QWidget()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 layout = QVBoxLayout()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 layout.setContentsMargins(1, 1, 1, 1)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 layout.addWidget(self.__shell)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 layout.addWidget(self.__searchWidget)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 centralWidget.setLayout(layout)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.setCentralWidget(centralWidget)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 self.__searchWidget.hide()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 self.__searchWidget.searchNext.connect(self.__shell.searchNext)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.__searchWidget.searchPrevious.connect(self.__shell.searchPrev)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 self.__shell.searchStringFound.connect(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 self.__searchWidget.searchStringFound)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.__shell.zoomValueChanged.connect(self.__zoomValueChanged)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.__createActions()
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
94 self.__createMenus()
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
95 self.__createToolBars()
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.__createStatusBar()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.__readSettings()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99
5799
e87f52c0374a Finished improving the Shell window history handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5798
diff changeset
100 self.__shell.historyStyleChanged.connect(self.__historyStyleChanged)
e87f52c0374a Finished improving the Shell window history handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5798
diff changeset
101
6358
1a274e1ef9c0 ShellWindow: fixed an issue related to the use of the virtual environment manager causing the shell window application not to start anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
102 # Generate the virtual environment manager and register it
1a274e1ef9c0 ShellWindow: fixed an issue related to the use of the virtual environment manager causing the shell window application not to start anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
103 self.virtualenvManager = VirtualenvManager(self)
1a274e1ef9c0 ShellWindow: fixed an issue related to the use of the virtual environment manager causing the shell window application not to start anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
104 e5App().registerObject("VirtualEnvManager", self.virtualenvManager)
1a274e1ef9c0 ShellWindow: fixed an issue related to the use of the virtual environment manager causing the shell window application not to start anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
105
6581
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
106 self.__shell.virtualEnvironmentChanged.connect(
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
107 self.__virtualEnvironmentChanged)
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
108
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
109 # now start the debug client with the most recently used virtual
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
110 # environment
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
111 self.__debugServer.startClient(
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
112 False, venvName=Preferences.getShell("LastVirtualEnvironment")
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
113 )
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 # set the keyboard input interval
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 interval = Preferences.getUI("KeyboardInputInterval")
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 if interval > 0:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 QApplication.setKeyboardInputInterval(interval)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 def closeEvent(self, event):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 Protected method to handle the close event.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
124 @param event close event
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
125 @type QCloseEvent
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 self.__writeSettings()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 self.__debugServer.shutdownServer()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 self.__shell.closeShell()
5712
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
130 Preferences.syncPreferences()
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 event.accept()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 ## Below are API handling methods
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 def getAPIsManager(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 Public method to get a reference to the APIs manager.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 @return the APIs manager object (eric6.QScintilla.APIsManager)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 return self.__apisManager
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 ## Below are action related methods
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 def __readShortcut(self, act, category):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 Private function to read a single keyboard shortcut from the settings.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
154 @param act reference to the action object
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
155 @type E5Action
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
156 @param category category the action belongs to
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
157 @type str
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 if act.objectName():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 accel = Preferences.Prefs.settings.value(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 "Shortcuts/{0}/{1}/Accel".format(category, act.objectName()))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 if accel is not None:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 act.setShortcut(QKeySequence(accel))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 accel = Preferences.Prefs.settings.value(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 "Shortcuts/{0}/{1}/AltAccel".format(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 category, act.objectName()))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 if accel is not None:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 act.setAlternateShortcut(QKeySequence(accel), removeEmpty=True)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 def __createActions(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 Private method to create the actions.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 self.fileActions = []
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 self.editActions = []
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 self.searchActions = []
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.viewActions = []
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 self.helpActions = []
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 self.viewActGrp = createActionGroup(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 self.__createFileActions()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 self.__createEditActions()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 self.__createSearchActions()
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
185 self.__createViewActions()
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 self.__createHelpActions()
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
187 self.__createHistoryActions()
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 # read the keyboard shortcuts and make them identical to the main
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 # eric6 shortcuts
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 for act in self.helpActions:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 self.__readShortcut(act, "General")
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 for act in self.editActions:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 self.__readShortcut(act, "Edit")
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 for act in self.fileActions:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 self.__readShortcut(act, "View")
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 for act in self.searchActions:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 self.__readShortcut(act, "Search")
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 def __createFileActions(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 Private method defining the user interface actions for the file
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 commands.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 self.exitAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 self.tr('Quit'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
207 UI.PixmapCache.getIcon("exit"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 self.tr('&Quit'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 QKeySequence(self.tr("Ctrl+Q", "File|Quit")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 0, self, 'quit')
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
211 self.exitAct.setStatusTip(self.tr('Quit the Shell'))
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 self.exitAct.setWhatsThis(self.tr(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 """<b>Quit the Shell</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 """<p>This quits the Shell window.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 self.exitAct.triggered.connect(self.quit)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 self.exitAct.setMenuRole(QAction.QuitRole)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 self.fileActions.append(self.exitAct)
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
219
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
220 self.newWindowAct = E5Action(
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
221 self.tr('New Window'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
222 UI.PixmapCache.getIcon("newWindow"),
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
223 self.tr('New &Window'),
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
224 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")),
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
225 0, self, 'new_window')
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
226 self.newWindowAct.setStatusTip(self.tr(
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
227 'Open a new Shell window'))
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
228 self.newWindowAct.setWhatsThis(self.tr(
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
229 """<b>New Window</b>"""
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
230 """<p>This opens a new instance of the Shell window.</p>"""
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
231 ))
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
232 self.newWindowAct.triggered.connect(self.__newWindow)
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
233 self.fileActions.append(self.newWindowAct)
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
234
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
235 self.restartAct = E5Action(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
236 self.tr('Restart'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
237 UI.PixmapCache.getIcon("restart"),
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
238 self.tr('Restart'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
239 0, 0, self, 'shell_restart')
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
240 self.restartAct.setStatusTip(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
241 'Restart the shell'))
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
242 self.restartAct.setWhatsThis(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
243 """<b>Restart</b>"""
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
244 """<p>Restart the shell for the currently selected language.</p>"""
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
245 ))
6581
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
246 self.restartAct.triggered.connect(self.__shell.doRestart)
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
247 self.fileActions.append(self.restartAct)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
248
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
249 self.clearRestartAct = E5Action(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
250 self.tr('Restart and Clear'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
251 UI.PixmapCache.getIcon("restartDelete"),
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
252 self.tr('Restart and Clear'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
253 Qt.Key_F4, 0, self, 'shell_clear_restart')
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
254 self.clearRestartAct.setStatusTip(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
255 'Clear the window and restart the shell'))
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
256 self.clearRestartAct.setWhatsThis(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
257 """<b>Restart and Clear</b>"""
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
258 """<p>Clear the shell window and restart the shell for the"""
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
259 """ currently selected language.</p>"""
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
260 ))
6581
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
261 self.clearRestartAct.triggered.connect(self.__shell.doClearRestart)
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
262 self.fileActions.append(self.clearRestartAct)
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 def __createEditActions(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 Private method defining the user interface actions for the edit
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 commands.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 self.editActGrp = createActionGroup(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 self.copyActGrp = createActionGroup(self.editActGrp)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 self.cutAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 QCoreApplication.translate('ViewManager', 'Cut'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
274 UI.PixmapCache.getIcon("editCut"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 QCoreApplication.translate('ViewManager', 'Cu&t'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 'ViewManager', "Ctrl+X", "Edit|Cut")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 'ViewManager', "Shift+Del", "Edit|Cut")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 self.copyActGrp, 'vm_edit_cut')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 self.cutAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 'ViewManager', 'Cut the selection'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 self.cutAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 """<b>Cut</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 """<p>Cut the selected text of the current editor to the"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 """ clipboard.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 self.cutAct.triggered.connect(self.__shell.cut)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 self.editActions.append(self.cutAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 self.copyAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 QCoreApplication.translate('ViewManager', 'Copy'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
294 UI.PixmapCache.getIcon("editCopy"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 QCoreApplication.translate('ViewManager', '&Copy'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 'ViewManager', "Ctrl+C", "Edit|Copy")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 'ViewManager', "Ctrl+Ins", "Edit|Copy")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 self.copyActGrp, 'vm_edit_copy')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 self.copyAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 'ViewManager', 'Copy the selection'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 self.copyAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 """<b>Copy</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 """<p>Copy the selected text of the current editor to the"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 """ clipboard.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 self.copyAct.triggered.connect(self.__shell.copy)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 self.editActions.append(self.copyAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 self.pasteAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 QCoreApplication.translate('ViewManager', 'Paste'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
314 UI.PixmapCache.getIcon("editPaste"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 QCoreApplication.translate('ViewManager', '&Paste'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 'ViewManager', "Ctrl+V", "Edit|Paste")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 'ViewManager', "Shift+Ins", "Edit|Paste")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 self.copyActGrp, 'vm_edit_paste')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 self.pasteAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 'ViewManager', 'Paste the last cut/copied text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 self.pasteAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 """<b>Paste</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 """<p>Paste the last cut/copied text from the clipboard to"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 """ the current editor.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 self.pasteAct.triggered.connect(self.__shell.paste)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 self.editActions.append(self.pasteAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
332 self.clearAct = E5Action(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 QCoreApplication.translate('ViewManager', 'Clear'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
334 UI.PixmapCache.getIcon("editDelete"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 QCoreApplication.translate('ViewManager', 'Clear'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 'ViewManager', "Alt+Shift+C", "Edit|Clear")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 self.copyActGrp, 'vm_edit_clear')
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
340 self.clearAct.setStatusTip(QCoreApplication.translate(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 'ViewManager', 'Clear all text'))
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
342 self.clearAct.setWhatsThis(QCoreApplication.translate(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 """<b>Clear</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 """<p>Delete all text of the current editor.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 ))
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
347 self.clearAct.triggered.connect(self.__shell.clear)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
348 self.editActions.append(self.clearAct)
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 self.cutAct.setEnabled(False)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 self.copyAct.setEnabled(False)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 self.__shell.copyAvailable.connect(self.cutAct.setEnabled)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 self.__shell.copyAvailable.connect(self.copyAct.setEnabled)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 ####################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 ## Below follow the actions for QScintilla standard commands.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 ####################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 self.esm = QSignalMapper(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 self.esm.mapped[int].connect(self.__shell.editorCommand)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 self.editorActGrp = createActionGroup(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 QCoreApplication.translate('ViewManager', 'Delete current line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 QCoreApplication.translate('ViewManager', 'Delete current line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 'ViewManager', 'Ctrl+Shift+L')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 self.editorActGrp, 'vm_edit_delete_current_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 QCoreApplication.translate('ViewManager', 'Indent one level'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
377 QCoreApplication.translate('ViewManager', 'Indent one level'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378 QKeySequence(QCoreApplication.translate('ViewManager', 'Tab')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 self.editorActGrp, 'vm_edit_indent_one_level')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 self.esm.setMapping(act, QsciScintilla.SCI_TAB)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 QCoreApplication.translate('ViewManager', 'Insert new line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 QCoreApplication.translate('ViewManager', 'Insert new line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 QKeySequence(QCoreApplication.translate('ViewManager', 'Return')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 QKeySequence(QCoreApplication.translate('ViewManager', 'Enter')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 self.editorActGrp, 'vm_edit_insert_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 'Delete previous character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
397 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 'Delete previous character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 QKeySequence(QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 'Backspace')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401 0, self.editorActGrp, 'vm_edit_delete_previous_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 QCoreApplication.translate('ViewManager', 'Meta+H')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
405 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
407 QCoreApplication.translate('ViewManager', 'Shift+Backspace')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
408 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
413 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 'Delete current character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 'Delete current character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 QKeySequence(QCoreApplication.translate('ViewManager', 'Del')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 0, self.editorActGrp, 'vm_edit_delete_current_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 QCoreApplication.translate('ViewManager', 'Meta+D')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 QCoreApplication.translate('ViewManager', 'Delete word to left'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 QCoreApplication.translate('ViewManager', 'Delete word to left'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430 'ViewManager', 'Ctrl+Backspace')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 self.editorActGrp, 'vm_edit_delete_word_left')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 QCoreApplication.translate('ViewManager', 'Delete word to right'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 QCoreApplication.translate('ViewManager', 'Delete word to right'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440 QKeySequence(QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 'Ctrl+Del')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 0, self.editorActGrp, 'vm_edit_delete_word_right')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448 QCoreApplication.translate('ViewManager', 'Delete line to left'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 QCoreApplication.translate('ViewManager', 'Delete line to left'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451 'ViewManager', 'Ctrl+Shift+Backspace')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453 self.editorActGrp, 'vm_edit_delete_line_left')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459 QCoreApplication.translate('ViewManager', 'Delete line to right'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
460 QCoreApplication.translate('ViewManager', 'Delete line to right'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 self.editorActGrp, 'vm_edit_delete_line_right')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 QCoreApplication.translate('ViewManager', 'Meta+K')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
466 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Del')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
469 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
474 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
475 'Move left one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477 'Move left one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 QKeySequence(QCoreApplication.translate('ViewManager', 'Left')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 self.editorActGrp, 'vm_edit_move_left_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 QCoreApplication.translate('ViewManager', 'Meta+B')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
485 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
486
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
487 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
488 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
489 'Move right one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
490 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 'Move right one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 QKeySequence(QCoreApplication.translate('ViewManager', 'Right')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
493 0, self.editorActGrp, 'vm_edit_move_right_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
494 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
496 QCoreApplication.translate('ViewManager', 'Meta+F')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
497 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
501 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
502 QCoreApplication.translate('ViewManager', 'Move left one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503 QCoreApplication.translate('ViewManager', 'Move left one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
504 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
505 self.editorActGrp, 'vm_edit_move_left_word')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
506 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
507 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 QCoreApplication.translate('ViewManager', 'Alt+Left')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
509 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
510 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
511 QCoreApplication.translate('ViewManager', 'Ctrl+Left')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
513 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
514 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
515
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
516 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
517 QCoreApplication.translate('ViewManager', 'Move right one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
518 QCoreApplication.translate('ViewManager', 'Move right one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
520 self.editorActGrp, 'vm_edit_move_right_word')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
521 if not isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
522 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
523 QCoreApplication.translate('ViewManager', 'Ctrl+Right')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
524 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
525 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
526 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
528 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
529 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531 'Move to first visible character in document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
533 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534 'Move to first visible character in document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536 self.editorActGrp, 'vm_edit_move_first_visible_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537 if not isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 QCoreApplication.translate('ViewManager', 'Home')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
543
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
546 'ViewManager', 'Move to end of document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
547 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548 'ViewManager', 'Move to end of document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
549 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
550 self.editorActGrp, 'vm_edit_move_end_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
551 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
552 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
553 QCoreApplication.translate('ViewManager', 'Meta+E')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
554 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
555 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
556 QCoreApplication.translate('ViewManager', 'End')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
557 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
558 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
559 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
561 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
562 QCoreApplication.translate('ViewManager', 'Move up one line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
563 QCoreApplication.translate('ViewManager', 'Move up one line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
564 QKeySequence(QCoreApplication.translate('ViewManager', 'Up')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
565 self.editorActGrp, 'vm_edit_move_up_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
566 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
567 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568 QCoreApplication.translate('ViewManager', 'Meta+P')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
569 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
570 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
571 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
574 QCoreApplication.translate('ViewManager', 'Move down one line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
575 QCoreApplication.translate('ViewManager', 'Move down one line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
576 QKeySequence(QCoreApplication.translate('ViewManager', 'Down')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
577 self.editorActGrp, 'vm_edit_move_down_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
578 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
579 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
580 QCoreApplication.translate('ViewManager', 'Meta+N')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
581 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
582 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
583 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
584
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
585 act = E5Action(
5712
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
586 self.tr('Move forward one history entry'),
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
587 self.tr('Move forward one history entry'),
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
588 QKeySequence(QCoreApplication.translate('ViewManager',
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
589 'Ctrl+Down')),
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
590 0, self.editorActGrp, 'vm_edit_scroll_down_line')
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
591 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLDOWN)
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
592 act.triggered.connect(self.esm.map)
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
593 self.editActions.append(act)
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
594
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
595 act = E5Action(
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
596 self.tr('Move back one history entry'),
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
597 self.tr('Move back one history entry'),
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
598 QKeySequence(QCoreApplication.translate('ViewManager', 'Ctrl+Up')),
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
599 0, self.editorActGrp, 'vm_edit_scroll_up_line')
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
600 self.esm.setMapping(act, QsciScintilla.SCI_LINESCROLLUP)
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
601 act.triggered.connect(self.esm.map)
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
602 self.editActions.append(act)
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
603
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
604 act = E5Action(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
605 QCoreApplication.translate('ViewManager', 'Move up one page'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
606 QCoreApplication.translate('ViewManager', 'Move up one page'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
607 QKeySequence(QCoreApplication.translate('ViewManager', 'PgUp')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
608 self.editorActGrp, 'vm_edit_move_up_page')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
609 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
610 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
611 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
612
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
613 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
614 QCoreApplication.translate('ViewManager', 'Move down one page'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
615 QCoreApplication.translate('ViewManager', 'Move down one page'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
616 QKeySequence(QCoreApplication.translate('ViewManager', 'PgDown')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
617 0, self.editorActGrp, 'vm_edit_move_down_page')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
618 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
619 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
620 QCoreApplication.translate('ViewManager', 'Meta+V')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
621 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
622 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
623 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
624
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
625 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626 QCoreApplication.translate('ViewManager', 'Escape'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
627 QCoreApplication.translate('ViewManager', 'Escape'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
628 QKeySequence(QCoreApplication.translate('ViewManager', 'Esc')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
629 self.editorActGrp, 'vm_edit_escape')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
630 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
631 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
632 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
633
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
634 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
635 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
636 'ViewManager', 'Extend selection left one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
637 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
638 'ViewManager', 'Extend selection left one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
639 QKeySequence(QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
640 'Shift+Left')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
641 0, self.editorActGrp, 'vm_edit_extend_selection_left_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
642 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
643 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
644 QCoreApplication.translate('ViewManager', 'Meta+Shift+B')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
645 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
646 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
647 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
648
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
649 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
650 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
651 'ViewManager', 'Extend selection right one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
652 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
653 'ViewManager', 'Extend selection right one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
654 QKeySequence(QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
655 'Shift+Right')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
656 0, self.editorActGrp, 'vm_edit_extend_selection_right_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
657 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
658 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
659 QCoreApplication.translate('ViewManager', 'Meta+Shift+F')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
660 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
661 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
662 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
663
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
664 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
665 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
666 'ViewManager', 'Extend selection left one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
667 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
668 'ViewManager', 'Extend selection left one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
669 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
670 self.editorActGrp, 'vm_edit_extend_selection_left_word')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
671 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
672 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
673 QCoreApplication.translate('ViewManager', 'Alt+Shift+Left')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
674 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
675 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
676 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Left')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
677 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
678 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
679 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
680
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
681 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
682 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
683 'ViewManager', 'Extend selection right one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
684 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
685 'ViewManager', 'Extend selection right one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
686 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
687 self.editorActGrp, 'vm_edit_extend_selection_right_word')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
688 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
689 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
690 QCoreApplication.translate('ViewManager', 'Alt+Shift+Right')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
691 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
692 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
693 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Right')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
694 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
695 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
696 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
697
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
698 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
699 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
700 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
701 'Extend selection to first visible character in document'
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
702 ' line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
703 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
704 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
705 'Extend selection to first visible character in document'
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
706 ' line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
707 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
708 self.editorActGrp, 'vm_edit_extend_selection_first_visible_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
709 if not isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
710 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
711 QCoreApplication.translate('ViewManager', 'Shift+Home')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
712 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
713 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
714 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
715
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
716 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
717 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
718 'ViewManager', 'Extend selection to end of document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
719 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
720 'ViewManager', 'Extend selection to end of document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
721 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
722 self.editorActGrp, 'vm_edit_extend_selection_end_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
723 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
724 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
725 QCoreApplication.translate('ViewManager', 'Meta+Shift+E')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
726 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
727 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
728 QCoreApplication.translate('ViewManager', 'Shift+End')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
729 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
730 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
731 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
732
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
733 def __createSearchActions(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
734 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
735 Private method defining the user interface actions for the search
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
736 commands.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
737 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
738 self.searchActGrp = createActionGroup(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
739
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
740 self.searchAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
741 QCoreApplication.translate('ViewManager', 'Search'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
742 UI.PixmapCache.getIcon("find"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
743 QCoreApplication.translate('ViewManager', '&Search...'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
744 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
745 'ViewManager', "Ctrl+F", "Search|Search")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
746 0,
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
747 self, 'vm_search')
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
748 self.searchAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
749 'ViewManager', 'Search for a text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
750 self.searchAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
751 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
752 """<b>Search</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
753 """<p>Search for some text in the current editor. A"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
754 """ dialog is shown to enter the searchtext and options"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
755 """ for the search.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
756 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
757 self.searchAct.triggered.connect(self.__showFind)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
758 self.searchActions.append(self.searchAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
759
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
760 self.searchNextAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
761 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
762 'ViewManager', 'Search next'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
763 UI.PixmapCache.getIcon("findNext"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 QCoreApplication.translate('ViewManager', 'Search &next'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
765 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
766 'ViewManager', "F3", "Search|Search next")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
767 0,
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
768 self, 'vm_search_next')
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
769 self.searchNextAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
770 'ViewManager', 'Search next occurrence of text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
771 self.searchNextAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
772 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
773 """<b>Search next</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
774 """<p>Search the next occurrence of some text in the current"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
775 """ editor. The previously entered searchtext and options are"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
776 """ reused.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
777 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
778 self.searchNextAct.triggered.connect(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
779 self.__searchWidget.on_findNextButton_clicked)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
780 self.searchActions.append(self.searchNextAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
781
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
782 self.searchPrevAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
783 QCoreApplication.translate('ViewManager', 'Search previous'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
784 UI.PixmapCache.getIcon("findPrev"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
785 QCoreApplication.translate('ViewManager', 'Search &previous'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
786 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
787 'ViewManager', "Shift+F3", "Search|Search previous")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
788 0,
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
789 self, 'vm_search_previous')
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
790 self.searchPrevAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
791 'ViewManager', 'Search previous occurrence of text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
792 self.searchPrevAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
793 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
794 """<b>Search previous</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
795 """<p>Search the previous occurrence of some text in the current"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
796 """ editor. The previously entered searchtext and options are"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
797 """ reused.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
798 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
799 self.searchPrevAct.triggered.connect(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
800 self.__searchWidget.on_findPrevButton_clicked)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
801 self.searchActions.append(self.searchPrevAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
802
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
803 def __createViewActions(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
804 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
805 Private method defining the user interface actions for the view
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
806 commands.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
807 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
808 self.viewActGrp = createActionGroup(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
809
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
810 self.zoomInAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
811 QCoreApplication.translate('ViewManager', 'Zoom in'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
812 UI.PixmapCache.getIcon("zoomIn"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
813 QCoreApplication.translate('ViewManager', 'Zoom &in'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
814 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
815 'ViewManager', "Ctrl++", "View|Zoom in")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
816 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
817 'ViewManager', "Zoom In", "View|Zoom in")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
818 self.viewActGrp, 'vm_view_zoom_in')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
819 self.zoomInAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
820 'ViewManager', 'Zoom in on the text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
821 self.zoomInAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
822 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
823 """<b>Zoom in</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
824 """<p>Zoom in on the text. This makes the text bigger.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
825 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
826 self.zoomInAct.triggered.connect(self.__zoomIn)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
827 self.viewActions.append(self.zoomInAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
828
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
829 self.zoomOutAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
830 QCoreApplication.translate('ViewManager', 'Zoom out'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
831 UI.PixmapCache.getIcon("zoomOut"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
832 QCoreApplication.translate('ViewManager', 'Zoom &out'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
833 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
834 'ViewManager', "Ctrl+-", "View|Zoom out")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
835 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
836 'ViewManager', "Zoom Out", "View|Zoom out")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
837 self.viewActGrp, 'vm_view_zoom_out')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
838 self.zoomOutAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
839 'ViewManager', 'Zoom out on the text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
840 self.zoomOutAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
841 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
842 """<b>Zoom out</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
843 """<p>Zoom out on the text. This makes the text smaller.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
844 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
845 self.zoomOutAct.triggered.connect(self.__zoomOut)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
846 self.viewActions.append(self.zoomOutAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
847
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
848 self.zoomResetAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
849 QCoreApplication.translate('ViewManager', 'Zoom reset'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
850 UI.PixmapCache.getIcon("zoomReset"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
851 QCoreApplication.translate('ViewManager', 'Zoom &reset'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
852 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
853 'ViewManager', "Ctrl+0", "View|Zoom reset")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
854 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
855 self.viewActGrp, 'vm_view_zoom_reset')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
856 self.zoomResetAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
857 'ViewManager', 'Reset the zoom of the text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
858 self.zoomResetAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
859 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
860 """<b>Zoom reset</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
861 """<p>Reset the zoom of the text. """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
862 """This sets the zoom factor to 100%.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
863 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
864 self.zoomResetAct.triggered.connect(self.__zoomReset)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
865 self.viewActions.append(self.zoomResetAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
866
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
867 self.zoomToAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
868 QCoreApplication.translate('ViewManager', 'Zoom'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
869 UI.PixmapCache.getIcon("zoomTo"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
870 QCoreApplication.translate('ViewManager', '&Zoom'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
871 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
872 'ViewManager', "Ctrl+#", "View|Zoom")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
873 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
874 self.viewActGrp, 'vm_view_zoom')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
875 self.zoomToAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
876 'ViewManager', 'Zoom the text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
877 self.zoomToAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
878 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
879 """<b>Zoom</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
880 """<p>Zoom the text. This opens a dialog where the"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
881 """ desired size can be entered.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
882 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
883 self.zoomToAct.triggered.connect(self.__zoom)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
884 self.viewActions.append(self.zoomToAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
885
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
886 def __createHistoryActions(self):
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
887 """
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
888 Private method defining the user interface actions for the history
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
889 commands.
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
890 """
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
891 self.showHistoryAct = E5Action(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
892 self.tr('Show History'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
893 UI.PixmapCache.getIcon("history"),
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
894 self.tr('&Show History...'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
895 0, 0,
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
896 self, 'shell_show_history')
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
897 self.showHistoryAct.setStatusTip(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
898 "Show the shell history in a dialog"))
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
899 self.showHistoryAct.triggered.connect(self.__shell.showHistory)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
900
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
901 self.clearHistoryAct = E5Action(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
902 self.tr('Clear History'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
903 UI.PixmapCache.getIcon("historyClear"),
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
904 self.tr('&Clear History...'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
905 0, 0,
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
906 self, 'shell_clear_history')
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
907 self.clearHistoryAct.setStatusTip(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
908 "Clear the shell history"))
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
909 self.clearHistoryAct.triggered.connect(self.__shell.clearHistory)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
910
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
911 self.selectHistoryAct = E5Action(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
912 self.tr('Select History Entry'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
913 self.tr('Select History &Entry'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
914 0, 0,
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
915 self, 'shell_select_history')
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
916 self.selectHistoryAct.setStatusTip(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
917 "Select an entry of the shell history"))
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
918 self.selectHistoryAct.triggered.connect(self.__shell.selectHistory)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
919
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
920 def __createHelpActions(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
921 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
922 Private method to create the Help actions.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
923 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
924 self.aboutAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
925 self.tr('About'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
926 self.tr('&About'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
927 0, 0, self, 'about_eric')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
928 self.aboutAct.setStatusTip(self.tr(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
929 'Display information about this software'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
930 self.aboutAct.setWhatsThis(self.tr(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
931 """<b>About</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
932 """<p>Display some information about this software.</p>"""))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
933 self.aboutAct.triggered.connect(self.__about)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
934 self.helpActions.append(self.aboutAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
935
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
936 self.aboutQtAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
937 self.tr('About Qt'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
938 self.tr('About &Qt'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
939 0, 0, self, 'about_qt')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
940 self.aboutQtAct.setStatusTip(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
941 self.tr('Display information about the Qt toolkit'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
942 self.aboutQtAct.setWhatsThis(self.tr(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
943 """<b>About Qt</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
944 """<p>Display some information about the Qt toolkit.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
945 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
946 self.aboutQtAct.triggered.connect(self.__aboutQt)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
947 self.helpActions.append(self.aboutQtAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
948
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
949 self.whatsThisAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
950 self.tr('What\'s This?'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
951 UI.PixmapCache.getIcon("whatsThis"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
952 self.tr('&What\'s This?'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
953 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
954 0, self, 'help_help_whats_this')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
955 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
956 self.whatsThisAct.setWhatsThis(self.tr(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
957 """<b>Display context sensitive help</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
958 """<p>In What's This? mode, the mouse cursor shows an arrow"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
959 """ with a question mark, and you can click on the interface"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
960 """ elements to get a short description of what they do and"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
961 """ how to use them. In dialogs, this feature can be"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
962 """ accessed using the context help button in the titlebar."""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
963 """</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
964 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
965 self.whatsThisAct.triggered.connect(self.__whatsThis)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
966 self.helpActions.append(self.whatsThisAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
967
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
968 def __showFind(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
969 """
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
970 Private method to display the search widget.
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
971 """
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
972 txt = self.__shell.selectedText()
6387
a168b5f26a14 Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6358
diff changeset
973 self.showFind(txt)
a168b5f26a14 Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6358
diff changeset
974
a168b5f26a14 Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6358
diff changeset
975 def showFind(self, txt=""):
a168b5f26a14 Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6358
diff changeset
976 """
a168b5f26a14 Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6358
diff changeset
977 Public method to display the search widget.
a168b5f26a14 Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6358
diff changeset
978
a168b5f26a14 Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6358
diff changeset
979 @param txt text to be shown in the combo
a168b5f26a14 Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6358
diff changeset
980 @type str
a168b5f26a14 Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6358
diff changeset
981 """
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
982 self.__searchWidget.showFind(txt)
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
983
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
984 def activeWindow(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
985 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
986 Public method to get a reference to the active shell.
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
987
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
988 @return reference to the shell widget
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
989 @rtype Shell
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
990 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
991 return self.__shell
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
992
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
993 def __readSettings(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
994 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
995 Private method to read the settings remembered last time.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
996 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
997 settings = Preferences.Prefs.settings
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
998 pos = settings.value("ShellWindow/Position", QPoint(0, 0))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
999 size = settings.value("ShellWindow/Size", QSize(800, 600))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1000 self.resize(size)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1001 self.move(pos)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1002
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1003 def __writeSettings(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1004 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1005 Private method to write the settings for reuse.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1006 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1007 settings = Preferences.Prefs.settings
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1008 settings.setValue("ShellWindow/Position", self.pos())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1009 settings.setValue("ShellWindow/Size", self.size())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1010
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1011 def quit(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1012 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1013 Public method to quit the application.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1014 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1015 e5App().closeAllWindows()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1016
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1017 def __newWindow(self):
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1018 """
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1019 Private slot to start a new instance of eric6.
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1020 """
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1021 program = sys.executable
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1022 eric6 = os.path.join(getConfig("ericDir"), "eric6_shell.py")
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1023 args = [eric6]
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1024 QProcess.startDetached(program, args)
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1025
6581
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1026 def __virtualEnvironmentChanged(self, venvName):
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1027 """
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1028 Private slot handling a change of the shell's virtual environment.
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1029
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1030 @param venvName name of the virtual environment of the shell
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1031 @type str
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1032 """
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1033 if venvName:
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1034 self.setWindowTitle(self.tr("eric6 Shell [{0}]").format(venvName))
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1035 else:
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1036 self.setWindowTitle(self.tr("eric6 Shell"))
8eb6220f2bb7 Shell: changed code to start the shell/debugger backend with an unmodified PATH setting and added some more special commands (see what's this help of the shell).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6576
diff changeset
1037
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1038 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1039 ## Below are the action methods for the view menu
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1040 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1041
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1042 def __zoomIn(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1043 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1044 Private method to handle the zoom in action.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1045 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1046 self.__shell.zoomIn()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1047 self.__sbZoom.setValue(self.__shell.getZoom())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1048
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1049 def __zoomOut(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1050 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1051 Private method to handle the zoom out action.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1052 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1053 self.__shell.zoomOut()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1054 self.__sbZoom.setValue(self.__shell.getZoom())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1055
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1056 def __zoomReset(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1057 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1058 Private method to reset the zoom factor.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1059 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1060 self.__shell.zoomTo(0)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1061 self.__sbZoom.setValue(self.__shell.getZoom())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1062
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1063 def __zoom(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1064 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1065 Private method to handle the zoom action.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1066 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1067 from QScintilla.ZoomDialog import ZoomDialog
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1068 dlg = ZoomDialog(self.__shell.getZoom(), self, None, True)
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
1069 if dlg.exec() == QDialog.Accepted:
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1070 value = dlg.getZoomSize()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1071 self.__zoomTo(value)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1072
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1073 def __zoomTo(self, value):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1074 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1075 Private slot to zoom to a given value.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1076
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1077 @param value zoom value to be set
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1078 @type int
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1079 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1080 self.__shell.zoomTo(value)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1081 self.__sbZoom.setValue(self.__shell.getZoom())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1082
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1083 def __zoomValueChanged(self, value):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1084 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1085 Private slot to handle changes of the zoom value.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1086
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1087 @param value new zoom value
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1088 @type int
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1089 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1090 self.__sbZoom.setValue(value)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1091
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1092 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1093 ## Below are the action methods for the help menu
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1094 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1095
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1096 def __about(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1097 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1098 Private slot to show a little About message.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1099 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1100 E5MessageBox.about(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1101 self,
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
1102 self.tr("About eric6 Shell Window"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1103 self.tr(
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
1104 "The eric6 Shell is a standalone shell window."
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
1105 " It uses the same backend as the debugger of"
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
1106 " the full IDE, but is executed independently."))
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1107
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1108 def __aboutQt(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1109 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1110 Private slot to handle the About Qt dialog.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1111 """
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
1112 E5MessageBox.aboutQt(self, "eric6 Shell Window")
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1113