src/eric7/QScintilla/ShellWindow.py

branch
eric7
changeset 10069
435cc5875135
parent 9695
ad962e9b904d
child 10132
66c11ab8fefd
equal deleted inserted replaced
10068:7febcdccb2a1 10069:435cc5875135
8 """ 8 """
9 9
10 import os 10 import os
11 11
12 from PyQt6.Qsci import QsciScintilla 12 from PyQt6.Qsci import QsciScintilla
13 from PyQt6.QtCore import QCoreApplication, QPoint, QProcess, QSignalMapper, QSize, Qt 13 from PyQt6.QtCore import (
14 QCoreApplication,
15 QPoint,
16 QProcess,
17 QSignalMapper,
18 QSize,
19 Qt,
20 pyqtSlot,
21 )
14 from PyQt6.QtGui import QAction, QKeySequence 22 from PyQt6.QtGui import QAction, QKeySequence
15 from PyQt6.QtWidgets import QApplication, QDialog, QVBoxLayout, QWhatsThis, QWidget 23 from PyQt6.QtWidgets import QApplication, QDialog, QVBoxLayout, QWhatsThis, QWidget
16 24
17 from eric7 import Preferences 25 from eric7 import Preferences
18 from eric7.Debugger.DebugServer import DebugServer 26 from eric7.Debugger.DebugServer import DebugServer
26 from eric7.SystemUtilities import OSUtilities, PythonUtilities 34 from eric7.SystemUtilities import OSUtilities, PythonUtilities
27 from eric7.UI.SearchWidget import SearchWidget 35 from eric7.UI.SearchWidget import SearchWidget
28 from eric7.VirtualEnv.VirtualenvManager import VirtualenvManager 36 from eric7.VirtualEnv.VirtualenvManager import VirtualenvManager
29 37
30 from .APIsManager import APIsManager 38 from .APIsManager import APIsManager
31 from .Shell import Shell 39 from .Shell import Shell, ShellHistoryStyle
32 40
33 41
34 class ShellWindow(EricMainWindow): 42 class ShellWindow(EricMainWindow):
35 """ 43 """
36 Class implementing a stand alone shell window. 44 Class implementing a stand alone shell window.
420 #################################################################### 428 ####################################################################
421 ## Below follow the actions for QScintilla standard commands. 429 ## Below follow the actions for QScintilla standard commands.
422 #################################################################### 430 ####################################################################
423 431
424 self.esm = QSignalMapper(self) 432 self.esm = QSignalMapper(self)
425 try: 433 self.esm.mappedInt.connect(self.__shell.editorCommand)
426 self.esm.mappedInt.connect(self.__shell.editorCommand)
427 except AttributeError:
428 # pre Qt 5.15
429 self.esm.mapped[int].connect(self.__shell.editorCommand)
430 434
431 self.editorActGrp = createActionGroup(self) 435 self.editorActGrp = createActionGroup(self)
432 436
433 act = EricAction( 437 act = EricAction(
434 QCoreApplication.translate("ViewManager", "Delete current line"), 438 QCoreApplication.translate("ViewManager", "Delete current line"),
1500 ) 1504 )
1501 1505
1502 self.__sbZoom.valueChanged.connect(self.__zoomTo) 1506 self.__sbZoom.valueChanged.connect(self.__zoomTo)
1503 self.__sbZoom.setValue(0) 1507 self.__sbZoom.setValue(0)
1504 1508
1509 # TODO: add code to select the shell history style
1510 @pyqtSlot(ShellHistoryStyle)
1505 def __historyStyleChanged(self, historyStyle): 1511 def __historyStyleChanged(self, historyStyle):
1506 """ 1512 """
1507 Private slot to handle a change of the shell history style. 1513 Private slot to handle a change of the shell history style.
1508 1514
1509 @param historyStyle style to be used for the history 1515 @param historyStyle style to be used for the history

eric ide

mercurial