eric7/QScintilla/ShellWindow.py

branch
eric7
changeset 8521
4794215f9a3c
parent 8358
144a6b854f70
child 8637
394377638256
equal deleted inserted replaced
8520:48e1237aaef7 8521:4794215f9a3c
239 """<p>This quits the Shell window.</p>""" 239 """<p>This quits the Shell window.</p>"""
240 )) 240 ))
241 self.exitAct.triggered.connect(self.quit) 241 self.exitAct.triggered.connect(self.quit)
242 self.exitAct.setMenuRole(QAction.MenuRole.QuitRole) 242 self.exitAct.setMenuRole(QAction.MenuRole.QuitRole)
243 self.fileActions.append(self.exitAct) 243 self.fileActions.append(self.exitAct)
244 244
245 self.newWindowAct = EricAction( 245 self.newWindowAct = EricAction(
246 self.tr('New Window'), 246 self.tr('New Window'),
247 UI.PixmapCache.getIcon("newWindow"), 247 UI.PixmapCache.getIcon("newWindow"),
248 self.tr('New &Window'), 248 self.tr('New &Window'),
249 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")), 249 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")),
254 """<b>New Window</b>""" 254 """<b>New Window</b>"""
255 """<p>This opens a new instance of the Shell window.</p>""" 255 """<p>This opens a new instance of the Shell window.</p>"""
256 )) 256 ))
257 self.newWindowAct.triggered.connect(self.__newWindow) 257 self.newWindowAct.triggered.connect(self.__newWindow)
258 self.fileActions.append(self.newWindowAct) 258 self.fileActions.append(self.newWindowAct)
259 259
260 self.restartAct = EricAction( 260 self.restartAct = EricAction(
261 self.tr('Restart'), 261 self.tr('Restart'),
262 UI.PixmapCache.getIcon("restart"), 262 UI.PixmapCache.getIcon("restart"),
263 self.tr('Restart'), 263 self.tr('Restart'),
264 0, 0, self, 'shell_restart') 264 0, 0, self, 'shell_restart')
269 """<p>Restart the shell for the currently selected""" 269 """<p>Restart the shell for the currently selected"""
270 """ environment.</p>""" 270 """ environment.</p>"""
271 )) 271 ))
272 self.restartAct.triggered.connect(self.__shell.doRestart) 272 self.restartAct.triggered.connect(self.__shell.doRestart)
273 self.fileActions.append(self.restartAct) 273 self.fileActions.append(self.restartAct)
274 274
275 self.clearRestartAct = EricAction( 275 self.clearRestartAct = EricAction(
276 self.tr('Restart and Clear'), 276 self.tr('Restart and Clear'),
277 UI.PixmapCache.getIcon("restartDelete"), 277 UI.PixmapCache.getIcon("restartDelete"),
278 self.tr('Restart and Clear'), 278 self.tr('Restart and Clear'),
279 Qt.Key.Key_F4, 0, self, 'shell_clear_restart') 279 Qt.Key.Key_F4, 0, self, 'shell_clear_restart')
284 """<p>Clear the shell window and restart the shell for the""" 284 """<p>Clear the shell window and restart the shell for the"""
285 """ currently selected environment.</p>""" 285 """ currently selected environment.</p>"""
286 )) 286 ))
287 self.clearRestartAct.triggered.connect(self.__shell.doClearRestart) 287 self.clearRestartAct.triggered.connect(self.__shell.doClearRestart)
288 self.fileActions.append(self.clearRestartAct) 288 self.fileActions.append(self.clearRestartAct)
289
290 self.saveContentsAct = EricAction(
291 self.tr('Save Contents'),
292 UI.PixmapCache.getIcon("fileSave"),
293 self.tr('Save Contents...'),
294 QKeySequence(QCoreApplication.translate(
295 'ViewManager', "Ctrl+S", "File|Save")),
296 0, self, 'vm_file_save')
297 self.saveContentsAct.setStatusTip(self.tr(
298 'Save the current contents of the shell to a file'))
299 self.saveContentsAct.setWhatsThis(self.tr(
300 """<b>Save Contents</b>"""
301 """<p>Save the current contents of the shell to a file.</p>"""
302 ))
303 self.saveContentsAct.triggered.connect(self.__shell.saveContents)
304 self.fileActions.append(self.saveContentsAct)
289 305
290 def __createEditActions(self): 306 def __createEditActions(self):
291 """ 307 """
292 Private method defining the user interface actions for the edit 308 Private method defining the user interface actions for the edit
293 commands. 309 commands.
1153 self.__fileMenu.addAction(self.newWindowAct) 1169 self.__fileMenu.addAction(self.newWindowAct)
1154 self.__fileMenu.addSeparator() 1170 self.__fileMenu.addSeparator()
1155 self.__fileMenu.addAction(self.restartAct) 1171 self.__fileMenu.addAction(self.restartAct)
1156 self.__fileMenu.addAction(self.clearRestartAct) 1172 self.__fileMenu.addAction(self.clearRestartAct)
1157 self.__fileMenu.addSeparator() 1173 self.__fileMenu.addSeparator()
1174 self.__fileMenu.addAction(self.saveContentsAct)
1175 self.__fileMenu.addSeparator()
1158 self.__fileMenu.addAction(self.exitAct) 1176 self.__fileMenu.addAction(self.exitAct)
1159 1177
1160 self.__editMenu = self.menuBar().addMenu(self.tr("&Edit")) 1178 self.__editMenu = self.menuBar().addMenu(self.tr("&Edit"))
1161 self.__editMenu.setTearOffEnabled(True) 1179 self.__editMenu.setTearOffEnabled(True)
1162 self.__editMenu.addAction(self.cutAct) 1180 self.__editMenu.addAction(self.cutAct)
1226 filetb.addAction(self.newWindowAct) 1244 filetb.addAction(self.newWindowAct)
1227 filetb.addSeparator() 1245 filetb.addSeparator()
1228 filetb.addAction(self.restartAct) 1246 filetb.addAction(self.restartAct)
1229 filetb.addAction(self.clearRestartAct) 1247 filetb.addAction(self.clearRestartAct)
1230 filetb.addSeparator() 1248 filetb.addSeparator()
1249 filetb.addAction(self.saveContentsAct)
1250 filetb.addSeparator()
1231 filetb.addAction(self.exitAct) 1251 filetb.addAction(self.exitAct)
1232 1252
1233 edittb = self.addToolBar(self.tr("Edit")) 1253 edittb = self.addToolBar(self.tr("Edit"))
1234 edittb.setIconSize(UI.Config.ToolBarIconSize) 1254 edittb.setIconSize(UI.Config.ToolBarIconSize)
1235 edittb.addAction(self.cutAct) 1255 edittb.addAction(self.cutAct)

eric ide

mercurial