eric6/QScintilla/ShellWindow.py

Tue, 06 Oct 2020 17:52:44 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 06 Oct 2020 17:52:44 +0200
changeset 7759
51aa6c6b66f7
parent 7533
88261c96484b
child 7781
607a6098cb44
permissions
-rw-r--r--

Changed calls to exec_() into exec() (remainder of Python2 elimination).

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