QScintilla/ShellWindow.py

changeset 5799
e87f52c0374a
parent 5798
e4f9552f7f93
child 6048
82ad8ec9548c
equal deleted inserted replaced
5798:e4f9552f7f93 5799:e87f52c0374a
38 from UI.SearchWidget import SearchWidget 38 from UI.SearchWidget import SearchWidget
39 39
40 from eric6config import getConfig 40 from eric6config import getConfig
41 41
42 42
43 # TODO: implement history handling changes (Shell.historyStyleChanged)
44 class ShellWindow(E5MainWindow): 43 class ShellWindow(E5MainWindow):
45 """ 44 """
46 Class implementing a stand alone shell window. 45 Class implementing a stand alone shell window.
47 """ 46 """
48 def __init__(self, parent=None, name=None): 47 def __init__(self, parent=None, name=None):
90 self.__createMenus() 89 self.__createMenus()
91 self.__createToolBars() 90 self.__createToolBars()
92 self.__createStatusBar() 91 self.__createStatusBar()
93 92
94 self.__readSettings() 93 self.__readSettings()
94
95 self.__shell.historyStyleChanged.connect(self.__historyStyleChanged)
95 96
96 # now start the debug client 97 # now start the debug client
97 self.__debugServer.startClient(False) 98 self.__debugServer.startClient(False)
98 99
99 # set the keyboard input interval 100 # set the keyboard input interval
1131 self.__historyMenu = self.menuBar().addMenu(self.tr("Histor&y")) 1132 self.__historyMenu = self.menuBar().addMenu(self.tr("Histor&y"))
1132 self.__historyMenu.setTearOffEnabled(True) 1133 self.__historyMenu.setTearOffEnabled(True)
1133 self.__historyMenu.addAction(self.selectHistoryAct) 1134 self.__historyMenu.addAction(self.selectHistoryAct)
1134 self.__historyMenu.addAction(self.showHistoryAct) 1135 self.__historyMenu.addAction(self.showHistoryAct)
1135 self.__historyMenu.addAction(self.clearHistoryAct) 1136 self.__historyMenu.addAction(self.clearHistoryAct)
1137 self.__historyMenu.setEnabled(self.__shell.isHistoryEnabled())
1136 1138
1137 self.__startMenu = self.menuBar().addMenu(self.tr("&Start")) 1139 self.__startMenu = self.menuBar().addMenu(self.tr("&Start"))
1138 self.__startMenu.aboutToShow.connect(self.__showLanguageMenu) 1140 self.__startMenu.aboutToShow.connect(self.__showLanguageMenu)
1139 self.__startMenu.triggered.connect(self.__startShell) 1141 self.__startMenu.triggered.connect(self.__startShell)
1140 1142
1202 viewtb.addAction(self.zoomInAct) 1204 viewtb.addAction(self.zoomInAct)
1203 viewtb.addAction(self.zoomOutAct) 1205 viewtb.addAction(self.zoomOutAct)
1204 viewtb.addAction(self.zoomResetAct) 1206 viewtb.addAction(self.zoomResetAct)
1205 viewtb.addAction(self.zoomToAct) 1207 viewtb.addAction(self.zoomToAct)
1206 1208
1207 historytb = self.addToolBar(self.tr("History")) 1209 self.__historyToolbar = self.addToolBar(self.tr("History"))
1208 historytb.setIconSize(UI.Config.ToolBarIconSize) 1210 self.__historyToolbar.setIconSize(UI.Config.ToolBarIconSize)
1209 historytb.addAction(self.showHistoryAct) 1211 self.__historyToolbar.addAction(self.showHistoryAct)
1210 historytb.addAction(self.clearHistoryAct) 1212 self.__historyToolbar.addAction(self.clearHistoryAct)
1213 self.__historyToolbar.setEnabled(self.__shell.isHistoryEnabled())
1211 1214
1212 helptb = self.addToolBar(self.tr("Help")) 1215 helptb = self.addToolBar(self.tr("Help"))
1213 helptb.setIconSize(UI.Config.ToolBarIconSize) 1216 helptb.setIconSize(UI.Config.ToolBarIconSize)
1214 helptb.addAction(self.whatsThisAct) 1217 helptb.addAction(self.whatsThisAct)
1215 1218
1234 """<p>This part of the status bar allows zooming the shell.</p>""" 1237 """<p>This part of the status bar allows zooming the shell.</p>"""
1235 )) 1238 ))
1236 1239
1237 self.__sbZoom.valueChanged.connect(self.__zoomTo) 1240 self.__sbZoom.valueChanged.connect(self.__zoomTo)
1238 self.__sbZoom.setValue(0) 1241 self.__sbZoom.setValue(0)
1242
1243 def __historyStyleChanged(self, historyStyle):
1244 """
1245 Private slot to handle a change of the shell history style.
1246
1247 @param historyStyle style to be used for the history
1248 @type ShellHistoryStyle
1249 """
1250 enabled = self.__shell.isHistoryEnabled()
1251 self.__historyMenu.setEnabled(enabled)
1252 self.__historyToolbar.setEnabled(enabled)

eric ide

mercurial