QScintilla/ShellWindow.py

changeset 6576
ea60ea85067a
parent 6387
a168b5f26a14
child 6581
8eb6220f2bb7
equal deleted inserted replaced
6575:40a11619ee77 6576:ea60ea85067a
65 # initialize the APIs manager 65 # initialize the APIs manager
66 self.__apisManager = APIsManager(parent=self) 66 self.__apisManager = APIsManager(parent=self)
67 67
68 # initialize the debug server and shell widgets 68 # initialize the debug server and shell widgets
69 self.__debugServer = DebugServer(preventPassiveDebugging=True) 69 self.__debugServer = DebugServer(preventPassiveDebugging=True)
70 self.__shell = Shell(self.__debugServer, self, True, self) 70 self.__shell = Shell(self.__debugServer, self, None, True, self)
71 self.__searchWidget = SearchWidget(self.__shell, self, showLine=True) 71 self.__searchWidget = SearchWidget(self.__shell, self, showLine=True)
72 72
73 centralWidget = QWidget() 73 centralWidget = QWidget()
74 layout = QVBoxLayout() 74 layout = QVBoxLayout()
75 layout.setContentsMargins(1, 1, 1, 1) 75 layout.setContentsMargins(1, 1, 1, 1)
1149 self.__historyMenu.addAction(self.showHistoryAct) 1149 self.__historyMenu.addAction(self.showHistoryAct)
1150 self.__historyMenu.addAction(self.clearHistoryAct) 1150 self.__historyMenu.addAction(self.clearHistoryAct)
1151 self.__historyMenu.setEnabled(self.__shell.isHistoryEnabled()) 1151 self.__historyMenu.setEnabled(self.__shell.isHistoryEnabled())
1152 1152
1153 self.__startMenu = self.menuBar().addMenu(self.tr("&Start")) 1153 self.__startMenu = self.menuBar().addMenu(self.tr("&Start"))
1154 self.__startMenu.aboutToShow.connect(self.__showLanguageMenu) 1154 self.__startMenu.aboutToShow.connect(self.__showStartMenu)
1155 self.__startMenu.triggered.connect(self.__startShell) 1155 self.__startMenu.triggered.connect(self.__startShell)
1156 1156
1157 self.menuBar().addSeparator() 1157 self.menuBar().addSeparator()
1158 1158
1159 self.__helpMenu = self.menuBar().addMenu(self.tr("&Help")) 1159 self.__helpMenu = self.menuBar().addMenu(self.tr("&Help"))
1161 self.__helpMenu.addAction(self.aboutAct) 1161 self.__helpMenu.addAction(self.aboutAct)
1162 self.__helpMenu.addAction(self.aboutQtAct) 1162 self.__helpMenu.addAction(self.aboutQtAct)
1163 self.__helpMenu.addSeparator() 1163 self.__helpMenu.addSeparator()
1164 self.__helpMenu.addAction(self.whatsThisAct) 1164 self.__helpMenu.addAction(self.whatsThisAct)
1165 1165
1166 def __showLanguageMenu(self): 1166 def __showStartMenu(self):
1167 """ 1167 """
1168 Private slot to prepare the language menu. 1168 Private slot to prepare the language menu.
1169 """ 1169 """
1170 self.__startMenu.clear() 1170 self.__startMenu.clear()
1171 clientLanguages = self.__debugServer.getSupportedLanguages( 1171 for venvName in sorted(self.virtualenvManager.getVirtualenvNames()):
1172 shellOnly=True) 1172 self.__startMenu.addAction(venvName)
1173 for language in sorted(clientLanguages):
1174 act = self.__startMenu.addAction(language)
1175 act.setData(language)
1176 1173
1177 def __startShell(self, action): 1174 def __startShell(self, action):
1178 """ 1175 """
1179 Private slot to start a shell according to the action triggered. 1176 Private slot to start a shell according to the action triggered.
1180 1177
1181 @param action menu action that was triggered (QAction) 1178 @param action menu action that was triggered (QAction)
1182 """ 1179 """
1183 language = action.data() 1180 venvName = action.text()
1184 self.__debugServer.startClient(False, language) 1181 self.__debugServer.startClient(False, venvName=venvName)
1182 self.__debugServer.remoteBanner()
1185 1183
1186 ################################################################## 1184 ##################################################################
1187 ## Below are the toolbar handling methods 1185 ## Below are the toolbar handling methods
1188 ################################################################## 1186 ##################################################################
1189 1187

eric ide

mercurial