eric6/QScintilla/ShellWindow.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 7960
e8fc383322f7
child 8143
2c730d5fd177
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

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
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7829
diff changeset
3 # Copyright (c) 2017 - 2021 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"))
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
63 self.setWindowTitle(self.tr("eric 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
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
190 # eric shortcuts
5709
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>"""
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
244 """<p>Restart the shell for the currently selected"""
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
245 """ environment.</p>"""
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
246 ))
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
247 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
248 self.fileActions.append(self.restartAct)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
249
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
250 self.clearRestartAct = E5Action(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
251 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
252 UI.PixmapCache.getIcon("restartDelete"),
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
253 self.tr('Restart and Clear'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
254 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
255 self.clearRestartAct.setStatusTip(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
256 'Clear the window and restart the shell'))
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
257 self.clearRestartAct.setWhatsThis(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
258 """<b>Restart and Clear</b>"""
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
259 """<p>Clear the shell window and restart the shell for the"""
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
260 """ currently selected environment.</p>"""
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
261 ))
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
262 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
263 self.fileActions.append(self.clearRestartAct)
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 def __createEditActions(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 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
268 commands.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 self.editActGrp = createActionGroup(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 self.copyActGrp = createActionGroup(self.editActGrp)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 self.cutAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 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
275 UI.PixmapCache.getIcon("editCut"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 QCoreApplication.translate('ViewManager', 'Cu&t'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 'ViewManager', "Ctrl+X", "Edit|Cut")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 'ViewManager', "Shift+Del", "Edit|Cut")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 self.copyActGrp, 'vm_edit_cut')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 self.cutAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 'ViewManager', 'Cut the selection'))
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
284 self.cutAct.setWhatsThis(self.tr(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 """<b>Cut</b>"""
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
286 """<p>Cut the selected text to the clipboard.</p>"""
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 self.cutAct.triggered.connect(self.__shell.cut)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 self.editActions.append(self.cutAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 self.copyAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 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
293 UI.PixmapCache.getIcon("editCopy"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 QCoreApplication.translate('ViewManager', '&Copy'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 'ViewManager', "Ctrl+C", "Edit|Copy")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 'ViewManager', "Ctrl+Ins", "Edit|Copy")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 self.copyActGrp, 'vm_edit_copy')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 self.copyAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 'ViewManager', 'Copy the selection'))
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
302 self.copyAct.setWhatsThis(self.tr(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 """<b>Copy</b>"""
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
304 """<p>Copy the selected text to the clipboard.</p>"""
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 self.copyAct.triggered.connect(self.__shell.copy)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 self.editActions.append(self.copyAct)
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.pasteAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 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
311 UI.PixmapCache.getIcon("editPaste"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 QCoreApplication.translate('ViewManager', '&Paste'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 'ViewManager', "Ctrl+V", "Edit|Paste")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 'ViewManager', "Shift+Ins", "Edit|Paste")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 self.copyActGrp, 'vm_edit_paste')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 self.pasteAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 'ViewManager', 'Paste the last cut/copied text'))
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
320 self.pasteAct.setWhatsThis(self.tr(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 """<b>Paste</b>"""
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
322 """<p>Paste the last cut/copied text from the clipboard.</p>"""
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 self.pasteAct.triggered.connect(self.__shell.paste)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 self.editActions.append(self.pasteAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
327 self.clearAct = E5Action(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 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
329 UI.PixmapCache.getIcon("editDelete"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 QCoreApplication.translate('ViewManager', 'Clear'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332 'ViewManager', "Alt+Shift+C", "Edit|Clear")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 self.copyActGrp, 'vm_edit_clear')
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
335 self.clearAct.setStatusTip(QCoreApplication.translate(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 'ViewManager', 'Clear all text'))
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
337 self.clearAct.setWhatsThis(self.tr(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 """<b>Clear</b>"""
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
339 """<p>Delete all text.</p>"""
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 ))
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
341 self.clearAct.triggered.connect(self.__shell.clear)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
342 self.editActions.append(self.clearAct)
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 self.cutAct.setEnabled(False)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 self.copyAct.setEnabled(False)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 self.__shell.copyAvailable.connect(self.cutAct.setEnabled)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 self.__shell.copyAvailable.connect(self.copyAct.setEnabled)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348
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 ## Below follow the actions for QScintilla standard commands.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 ####################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 self.esm = QSignalMapper(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 self.esm.mapped[int].connect(self.__shell.editorCommand)
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 self.editorActGrp = createActionGroup(self)
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 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 QCoreApplication.translate('ViewManager', 'Delete current line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 QCoreApplication.translate('ViewManager', 'Delete current line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 'ViewManager', 'Ctrl+Shift+L')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 self.editorActGrp, 'vm_edit_delete_current_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 self.esm.setMapping(act, QsciScintilla.SCI_LINEDELETE)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 QCoreApplication.translate('ViewManager', 'Indent one level'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 QCoreApplication.translate('ViewManager', 'Indent one level'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 QKeySequence(QCoreApplication.translate('ViewManager', 'Tab')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 self.editorActGrp, 'vm_edit_indent_one_level')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 self.esm.setMapping(act, QsciScintilla.SCI_TAB)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
377
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 QCoreApplication.translate('ViewManager', 'Insert new line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 QCoreApplication.translate('ViewManager', 'Insert new line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 QKeySequence(QCoreApplication.translate('ViewManager', 'Return')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 QKeySequence(QCoreApplication.translate('ViewManager', 'Enter')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 self.editorActGrp, 'vm_edit_insert_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 self.esm.setMapping(act, QsciScintilla.SCI_NEWLINE)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 'Delete previous character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 'Delete previous character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 QKeySequence(QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 'Backspace')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 0, self.editorActGrp, 'vm_edit_delete_previous_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
397 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 QCoreApplication.translate('ViewManager', 'Meta+H')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401 QCoreApplication.translate('ViewManager', 'Shift+Backspace')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 self.esm.setMapping(act, QsciScintilla.SCI_DELETEBACK)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
405
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
407 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
408 'Delete current character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 'Delete current character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 QKeySequence(QCoreApplication.translate('ViewManager', 'Del')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412 0, self.editorActGrp, 'vm_edit_delete_current_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
413 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 QCoreApplication.translate('ViewManager', 'Meta+D')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 self.esm.setMapping(act, QsciScintilla.SCI_CLEAR)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 QCoreApplication.translate('ViewManager', 'Delete word to left'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 QCoreApplication.translate('ViewManager', 'Delete word to left'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 'ViewManager', 'Ctrl+Backspace')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 self.editorActGrp, 'vm_edit_delete_word_left')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDLEFT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 QCoreApplication.translate('ViewManager', 'Delete word to right'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 QCoreApplication.translate('ViewManager', 'Delete word to right'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 QKeySequence(QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 'Ctrl+Del')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 0, self.editorActGrp, 'vm_edit_delete_word_right')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 self.esm.setMapping(act, QsciScintilla.SCI_DELWORDRIGHT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 QCoreApplication.translate('ViewManager', 'Delete line to left'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443 QCoreApplication.translate('ViewManager', 'Delete line to left'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 'ViewManager', 'Ctrl+Shift+Backspace')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 self.editorActGrp, 'vm_edit_delete_line_left')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448 self.esm.setMapping(act, QsciScintilla.SCI_DELLINELEFT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453 QCoreApplication.translate('ViewManager', 'Delete line to right'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 QCoreApplication.translate('ViewManager', 'Delete line to right'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 self.editorActGrp, 'vm_edit_delete_line_right')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459 QCoreApplication.translate('ViewManager', 'Meta+K')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
460 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Del')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 self.esm.setMapping(act, QsciScintilla.SCI_DELLINERIGHT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
466
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
469 'Move left one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 'Move left one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472 QKeySequence(QCoreApplication.translate('ViewManager', 'Left')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473 self.editorActGrp, 'vm_edit_move_left_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
474 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
475 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477 QCoreApplication.translate('ViewManager', 'Meta+B')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 'Move right one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
485 'Move right one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
486 QKeySequence(QCoreApplication.translate('ViewManager', 'Right')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
487 0, self.editorActGrp, 'vm_edit_move_right_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
488 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
489 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
490 QCoreApplication.translate('ViewManager', 'Meta+F')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
493 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
494
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
496 QCoreApplication.translate('ViewManager', 'Move left one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
497 QCoreApplication.translate('ViewManager', 'Move left one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 self.editorActGrp, 'vm_edit_move_left_word')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
501 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
502 QCoreApplication.translate('ViewManager', 'Alt+Left')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
504 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
505 QCoreApplication.translate('ViewManager', 'Ctrl+Left')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
506 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
507 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
509
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
510 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
511 QCoreApplication.translate('ViewManager', 'Move right one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 QCoreApplication.translate('ViewManager', 'Move right one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
513 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
514 self.editorActGrp, 'vm_edit_move_right_word')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
515 if not isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
516 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
517 QCoreApplication.translate('ViewManager', 'Ctrl+Right')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
518 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHT)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
520 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
521
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
522 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
523 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
524 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
525 'Move to first visible character in document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
526 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
528 'Move to first visible character in document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
529 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530 self.editorActGrp, 'vm_edit_move_first_visible_char')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531 if not isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
533 QCoreApplication.translate('ViewManager', 'Home')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534 self.esm.setMapping(act, QsciScintilla.SCI_VCHOME)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 'ViewManager', 'Move to end of document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 'ViewManager', 'Move to end of document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
543 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544 self.editorActGrp, 'vm_edit_move_end_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
546 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
547 QCoreApplication.translate('ViewManager', 'Meta+E')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
549 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
550 QCoreApplication.translate('ViewManager', 'End')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
551 self.esm.setMapping(act, QsciScintilla.SCI_LINEEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
552 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
553 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
554
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
555 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
556 QCoreApplication.translate('ViewManager', 'Move up one line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
557 QCoreApplication.translate('ViewManager', 'Move up one line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
558 QKeySequence(QCoreApplication.translate('ViewManager', 'Up')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
559 self.editorActGrp, 'vm_edit_move_up_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
561 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
562 QCoreApplication.translate('ViewManager', 'Meta+P')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
563 self.esm.setMapping(act, QsciScintilla.SCI_LINEUP)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
564 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
565 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
566
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
567 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568 QCoreApplication.translate('ViewManager', 'Move down one line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
569 QCoreApplication.translate('ViewManager', 'Move down one line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
570 QKeySequence(QCoreApplication.translate('ViewManager', 'Down')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
571 self.editorActGrp, 'vm_edit_move_down_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
574 QCoreApplication.translate('ViewManager', 'Meta+N')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
575 self.esm.setMapping(act, QsciScintilla.SCI_LINEDOWN)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
576 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
577 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
578
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
579 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
580 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
581 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
582 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
583 '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
584 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
585 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
586 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
587 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
588
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
589 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
590 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
591 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
592 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
593 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
594 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
595 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
596 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
597
f0d08bdeacf4 Modified the handling of the Up/Down arrows of the shell widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
598 act = E5Action(
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
599 QCoreApplication.translate('ViewManager', 'Move up one page'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
600 QCoreApplication.translate('ViewManager', 'Move up one page'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
601 QKeySequence(QCoreApplication.translate('ViewManager', 'PgUp')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
602 self.editorActGrp, 'vm_edit_move_up_page')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
603 self.esm.setMapping(act, QsciScintilla.SCI_PAGEUP)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
604 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
605 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
606
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
607 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
608 QCoreApplication.translate('ViewManager', 'Move down one page'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
609 QCoreApplication.translate('ViewManager', 'Move down one page'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
610 QKeySequence(QCoreApplication.translate('ViewManager', 'PgDown')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
611 0, self.editorActGrp, 'vm_edit_move_down_page')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
612 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
613 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
614 QCoreApplication.translate('ViewManager', 'Meta+V')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
615 self.esm.setMapping(act, QsciScintilla.SCI_PAGEDOWN)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
616 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
617 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
618
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
619 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
620 QCoreApplication.translate('ViewManager', 'Escape'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
621 QCoreApplication.translate('ViewManager', 'Escape'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
622 QKeySequence(QCoreApplication.translate('ViewManager', 'Esc')), 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
623 self.editorActGrp, 'vm_edit_escape')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
624 self.esm.setMapping(act, QsciScintilla.SCI_CANCEL)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
625 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
627
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
628 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
629 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
630 'ViewManager', 'Extend selection left one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
631 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
632 'ViewManager', 'Extend selection left one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
633 QKeySequence(QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
634 'Shift+Left')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
635 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
636 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
637 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
638 QCoreApplication.translate('ViewManager', 'Meta+Shift+B')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
639 self.esm.setMapping(act, QsciScintilla.SCI_CHARLEFTEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
640 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
641 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
642
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
643 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
644 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
645 'ViewManager', 'Extend selection right one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
646 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
647 'ViewManager', 'Extend selection right one character'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
648 QKeySequence(QCoreApplication.translate('ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
649 'Shift+Right')),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
650 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
651 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
652 act.setAlternateShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
653 QCoreApplication.translate('ViewManager', 'Meta+Shift+F')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
654 self.esm.setMapping(act, QsciScintilla.SCI_CHARRIGHTEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
655 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
656 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
657
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
658 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
659 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
660 'ViewManager', 'Extend selection left one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
661 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
662 'ViewManager', 'Extend selection left one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
663 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
664 self.editorActGrp, 'vm_edit_extend_selection_left_word')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
665 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
666 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
667 QCoreApplication.translate('ViewManager', 'Alt+Shift+Left')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
668 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
669 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
670 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Left')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
671 self.esm.setMapping(act, QsciScintilla.SCI_WORDLEFTEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
672 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
673 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
674
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
675 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
676 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
677 'ViewManager', 'Extend selection right one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
678 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
679 'ViewManager', 'Extend selection right one word'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
680 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
681 self.editorActGrp, 'vm_edit_extend_selection_right_word')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
682 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
683 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
684 QCoreApplication.translate('ViewManager', 'Alt+Shift+Right')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
685 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
686 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
687 QCoreApplication.translate('ViewManager', 'Ctrl+Shift+Right')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
688 self.esm.setMapping(act, QsciScintilla.SCI_WORDRIGHTEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
689 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
690 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
691
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
692 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
693 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
694 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
695 'Extend selection to first visible character in document'
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
696 ' line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
697 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
698 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
699 'Extend selection to first visible character in document'
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
700 ' line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
701 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
702 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
703 if not isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
704 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
705 QCoreApplication.translate('ViewManager', 'Shift+Home')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
706 self.esm.setMapping(act, QsciScintilla.SCI_VCHOMEEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
707 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
708 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
710 act = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
711 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
712 'ViewManager', 'Extend selection to end of document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
713 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
714 'ViewManager', 'Extend selection to end of document line'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
715 0, 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
716 self.editorActGrp, 'vm_edit_extend_selection_end_line')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
717 if isMacPlatform():
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
718 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
719 QCoreApplication.translate('ViewManager', 'Meta+Shift+E')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
720 else:
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
721 act.setShortcut(QKeySequence(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
722 QCoreApplication.translate('ViewManager', 'Shift+End')))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
723 self.esm.setMapping(act, QsciScintilla.SCI_LINEENDEXTEND)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
724 act.triggered.connect(self.esm.map)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
725 self.editActions.append(act)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
726
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
727 def __createSearchActions(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
728 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
729 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
730 commands.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
731 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
732 self.searchActGrp = createActionGroup(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
733
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
734 self.searchAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
735 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
736 UI.PixmapCache.getIcon("find"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
737 QCoreApplication.translate('ViewManager', '&Search...'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
738 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
739 'ViewManager', "Ctrl+F", "Search|Search")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
740 0,
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
741 self, 'vm_search')
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
742 self.searchAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
743 'ViewManager', 'Search for a text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
744 self.searchAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
745 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
746 """<b>Search</b>"""
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
747 """<p>Search for some text in the shell window. A"""
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
748 """ dialog is shown to enter the search text and options"""
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
749 """ for the search.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
750 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
751 self.searchAct.triggered.connect(self.__showFind)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
752 self.searchActions.append(self.searchAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
753
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
754 self.searchNextAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
755 QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
756 '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
757 UI.PixmapCache.getIcon("findNext"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
758 QCoreApplication.translate('ViewManager', 'Search &next'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
759 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
760 'ViewManager', "F3", "Search|Search next")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
761 0,
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
762 self, 'vm_search_next')
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
763 self.searchNextAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 'ViewManager', 'Search next occurrence of text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
765 self.searchNextAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
766 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
767 """<b>Search next</b>"""
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
768 """<p>Search the next occurrence of some text in the shell"""
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
769 """ window. The previously entered search text and options are"""
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
770 """ reused.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
771 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
772 self.searchNextAct.triggered.connect(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
773 self.__searchWidget.on_findNextButton_clicked)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
774 self.searchActions.append(self.searchNextAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
775
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
776 self.searchPrevAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
777 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
778 UI.PixmapCache.getIcon("findPrev"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
779 QCoreApplication.translate('ViewManager', 'Search &previous'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
780 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
781 'ViewManager', "Shift+F3", "Search|Search previous")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
782 0,
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
783 self, 'vm_search_previous')
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
784 self.searchPrevAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
785 'ViewManager', 'Search previous occurrence of text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
786 self.searchPrevAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
787 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
788 """<b>Search previous</b>"""
7829
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
789 """<p>Search the previous occurrence of some text in the shell"""
5a99dd3ebe5f ShellWindow: corrected some texts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
790 """ window. The previously entered search text and options are"""
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
791 """ reused.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
792 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
793 self.searchPrevAct.triggered.connect(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
794 self.__searchWidget.on_findPrevButton_clicked)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
795 self.searchActions.append(self.searchPrevAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
796
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
797 def __createViewActions(self):
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 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
800 commands.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
801 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
802 self.viewActGrp = createActionGroup(self)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
803
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
804 self.zoomInAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
805 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
806 UI.PixmapCache.getIcon("zoomIn"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
807 QCoreApplication.translate('ViewManager', 'Zoom &in'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
808 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
809 'ViewManager', "Ctrl++", "View|Zoom in")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
810 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
811 'ViewManager', "Zoom In", "View|Zoom in")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
812 self.viewActGrp, 'vm_view_zoom_in')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
813 self.zoomInAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
814 'ViewManager', 'Zoom in on the text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
815 self.zoomInAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
816 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
817 """<b>Zoom in</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
818 """<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
819 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
820 self.zoomInAct.triggered.connect(self.__zoomIn)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
821 self.viewActions.append(self.zoomInAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
822
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
823 self.zoomOutAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
824 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
825 UI.PixmapCache.getIcon("zoomOut"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
826 QCoreApplication.translate('ViewManager', 'Zoom &out'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
827 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
828 'ViewManager', "Ctrl+-", "View|Zoom out")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
829 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
830 'ViewManager', "Zoom Out", "View|Zoom out")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
831 self.viewActGrp, 'vm_view_zoom_out')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
832 self.zoomOutAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
833 'ViewManager', 'Zoom out on the text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
834 self.zoomOutAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
835 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
836 """<b>Zoom out</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
837 """<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
838 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
839 self.zoomOutAct.triggered.connect(self.__zoomOut)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
840 self.viewActions.append(self.zoomOutAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
841
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
842 self.zoomResetAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
843 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
844 UI.PixmapCache.getIcon("zoomReset"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
845 QCoreApplication.translate('ViewManager', 'Zoom &reset'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
846 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
847 'ViewManager', "Ctrl+0", "View|Zoom reset")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
848 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
849 self.viewActGrp, 'vm_view_zoom_reset')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
850 self.zoomResetAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
851 'ViewManager', 'Reset the zoom of the text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
852 self.zoomResetAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
853 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
854 """<b>Zoom reset</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
855 """<p>Reset the zoom of the text. """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
856 """This sets the zoom factor to 100%.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
857 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
858 self.zoomResetAct.triggered.connect(self.__zoomReset)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
859 self.viewActions.append(self.zoomResetAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
860
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
861 self.zoomToAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
862 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
863 UI.PixmapCache.getIcon("zoomTo"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
864 QCoreApplication.translate('ViewManager', '&Zoom'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
865 QKeySequence(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
866 'ViewManager', "Ctrl+#", "View|Zoom")),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
867 0,
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
868 self.viewActGrp, 'vm_view_zoom')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
869 self.zoomToAct.setStatusTip(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
870 'ViewManager', 'Zoom the text'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
871 self.zoomToAct.setWhatsThis(QCoreApplication.translate(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
872 'ViewManager',
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
873 """<b>Zoom</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
874 """<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
875 """ desired size can be entered.</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
876 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
877 self.zoomToAct.triggered.connect(self.__zoom)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
878 self.viewActions.append(self.zoomToAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
879
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
880 def __createHistoryActions(self):
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
881 """
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
882 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
883 commands.
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
884 """
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
885 self.showHistoryAct = E5Action(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
886 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
887 UI.PixmapCache.getIcon("history"),
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
888 self.tr('&Show History...'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
889 0, 0,
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
890 self, 'shell_show_history')
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
891 self.showHistoryAct.setStatusTip(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
892 "Show the shell history in a dialog"))
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
893 self.showHistoryAct.triggered.connect(self.__shell.showHistory)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
894
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
895 self.clearHistoryAct = E5Action(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
896 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
897 UI.PixmapCache.getIcon("historyClear"),
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
898 self.tr('&Clear History...'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
899 0, 0,
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
900 self, 'shell_clear_history')
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
901 self.clearHistoryAct.setStatusTip(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
902 "Clear the shell history"))
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
903 self.clearHistoryAct.triggered.connect(self.__shell.clearHistory)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
904
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
905 self.selectHistoryAct = E5Action(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
906 self.tr('Select History Entry'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
907 self.tr('Select History &Entry'),
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
908 0, 0,
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
909 self, 'shell_select_history')
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
910 self.selectHistoryAct.setStatusTip(self.tr(
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
911 "Select an entry of the shell history"))
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
912 self.selectHistoryAct.triggered.connect(self.__shell.selectHistory)
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
913
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
914 def __createHelpActions(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
915 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
916 Private method to create the Help actions.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
917 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
918 self.aboutAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
919 self.tr('About'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
920 self.tr('&About'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
921 0, 0, self, 'about_eric')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
922 self.aboutAct.setStatusTip(self.tr(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
923 'Display information about this software'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
924 self.aboutAct.setWhatsThis(self.tr(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
925 """<b>About</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
926 """<p>Display some information about this software.</p>"""))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
927 self.aboutAct.triggered.connect(self.__about)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
928 self.helpActions.append(self.aboutAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
929
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
930 self.aboutQtAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
931 self.tr('About Qt'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
932 self.tr('About &Qt'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
933 0, 0, self, 'about_qt')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
934 self.aboutQtAct.setStatusTip(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
935 self.tr('Display information about the Qt toolkit'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
936 self.aboutQtAct.setWhatsThis(self.tr(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
937 """<b>About Qt</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
938 """<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
939 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
940 self.aboutQtAct.triggered.connect(self.__aboutQt)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
941 self.helpActions.append(self.aboutQtAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
942
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
943 self.whatsThisAct = E5Action(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
944 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
945 UI.PixmapCache.getIcon("whatsThis"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
946 self.tr('&What\'s This?'),
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
947 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
948 0, self, 'help_help_whats_this')
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
949 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help'))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
950 self.whatsThisAct.setWhatsThis(self.tr(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
951 """<b>Display context sensitive help</b>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
952 """<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
953 """ 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
954 """ 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
955 """ 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
956 """ 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
957 """</p>"""
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
958 ))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
959 self.whatsThisAct.triggered.connect(self.__whatsThis)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
960 self.helpActions.append(self.whatsThisAct)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
961
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
962 def __showFind(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
963 """
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
964 Private method to display the search widget.
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
965 """
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
966 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
967 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
968
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
969 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
970 """
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
971 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
972
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 @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
974 @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
975 """
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
976 self.__searchWidget.showFind(txt)
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
977
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
978 def activeWindow(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
979 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
980 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
981
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
982 @return reference to the shell widget
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
983 @rtype Shell
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
984 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
985 return self.__shell
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
986
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
987 def __readSettings(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
988 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
989 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
990 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
991 settings = Preferences.Prefs.settings
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
992 pos = settings.value("ShellWindow/Position", QPoint(0, 0))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
993 size = settings.value("ShellWindow/Size", QSize(800, 600))
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
994 self.resize(size)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
995 self.move(pos)
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 def __writeSettings(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
998 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
999 Private method to write the settings for reuse.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1000 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1001 settings = Preferences.Prefs.settings
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1002 settings.setValue("ShellWindow/Position", self.pos())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1003 settings.setValue("ShellWindow/Size", self.size())
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 def quit(self):
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 Public method to quit the application.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1008 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1009 e5App().closeAllWindows()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1010
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1011 def __newWindow(self):
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1012 """
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1013 Private slot to start a new instance of eric.
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1014 """
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1015 program = sys.executable
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1016 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
1017 args = [eric6]
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1018 QProcess.startDetached(program, args)
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1019
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
1020 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
1021 """
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
1022 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
1023
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
1024 @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
1025 @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
1026 """
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 if venvName:
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1028 self.setWindowTitle(self.tr("eric Shell [{0}]").format(venvName))
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
1029 else:
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1030 self.setWindowTitle(self.tr("eric 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
1031
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1032 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1033 ## 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
1034 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1035
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1036 def __zoomIn(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1037 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1038 Private method to handle the zoom in action.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1039 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1040 self.__shell.zoomIn()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1041 self.__sbZoom.setValue(self.__shell.getZoom())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1042
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1043 def __zoomOut(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1044 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1045 Private method to handle the zoom out action.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1046 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1047 self.__shell.zoomOut()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1048 self.__sbZoom.setValue(self.__shell.getZoom())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1049
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1050 def __zoomReset(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1051 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1052 Private method to reset the zoom factor.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1053 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1054 self.__shell.zoomTo(0)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1055 self.__sbZoom.setValue(self.__shell.getZoom())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1056
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1057 def __zoom(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1058 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1059 Private method to handle the zoom action.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1060 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1061 from QScintilla.ZoomDialog import ZoomDialog
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1062 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
1063 if dlg.exec() == QDialog.Accepted:
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1064 value = dlg.getZoomSize()
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1065 self.__zoomTo(value)
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 def __zoomTo(self, value):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1068 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1069 Private slot to zoom to a given value.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1070
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1071 @param value zoom value to be set
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1072 @type int
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1073 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1074 self.__shell.zoomTo(value)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1075 self.__sbZoom.setValue(self.__shell.getZoom())
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1076
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1077 def __zoomValueChanged(self, value):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1078 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1079 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
1080
5711
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1081 @param value new zoom value
50b6867ffcd3 Finished implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5710
diff changeset
1082 @type int
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1083 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1084 self.__sbZoom.setValue(value)
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1085
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1086 ##################################################################
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1087 ## 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
1088 ##################################################################
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 def __about(self):
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 Private slot to show a little About message.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1093 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1094 E5MessageBox.about(
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1095 self,
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1096 self.tr("About eric Shell Window"),
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1097 self.tr(
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1098 "The eric Shell is a standalone shell window."
5710
b5809b948010 Continued implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5709
diff changeset
1099 " 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
1100 " the full IDE, but is executed independently."))
5709
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1101
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1102 def __aboutQt(self):
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1103 """
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1104 Private slot to handle the About Qt dialog.
f81d0eca2c62 Started implementing the standalone shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1105 """
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
1106 E5MessageBox.aboutQt(self, "eric Shell Window")
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 __whatsThis(self):