eric6/QScintilla/ShellWindow.py

changeset 7533
88261c96484b
parent 7360
9190402e4505
child 7759
51aa6c6b66f7
equal deleted inserted replaced
7532:1358e9d67a1c 7533:88261c96484b
58 @type str 58 @type str
59 """ 59 """
60 super(ShellWindow, self).__init__(parent) 60 super(ShellWindow, self).__init__(parent)
61 if name is not None: 61 if name is not None:
62 self.setObjectName(name) 62 self.setObjectName(name)
63 self.setWindowIcon(UI.PixmapCache.getIcon("shell.png")) 63 self.setWindowIcon(UI.PixmapCache.getIcon("shell"))
64 self.setWindowTitle(self.tr("eric6 Shell")) 64 self.setWindowTitle(self.tr("eric6 Shell"))
65 65
66 self.setStyle(Preferences.getUI("Style"), 66 self.setStyle(Preferences.getUI("Style"),
67 Preferences.getUI("StyleSheet")) 67 Preferences.getUI("StyleSheet"))
68 68
203 Private method defining the user interface actions for the file 203 Private method defining the user interface actions for the file
204 commands. 204 commands.
205 """ 205 """
206 self.exitAct = E5Action( 206 self.exitAct = E5Action(
207 self.tr('Quit'), 207 self.tr('Quit'),
208 UI.PixmapCache.getIcon("exit.png"), 208 UI.PixmapCache.getIcon("exit"),
209 self.tr('&Quit'), 209 self.tr('&Quit'),
210 QKeySequence(self.tr("Ctrl+Q", "File|Quit")), 210 QKeySequence(self.tr("Ctrl+Q", "File|Quit")),
211 0, self, 'quit') 211 0, self, 'quit')
212 self.exitAct.setStatusTip(self.tr('Quit the Shell')) 212 self.exitAct.setStatusTip(self.tr('Quit the Shell'))
213 self.exitAct.setWhatsThis(self.tr( 213 self.exitAct.setWhatsThis(self.tr(
218 self.exitAct.setMenuRole(QAction.QuitRole) 218 self.exitAct.setMenuRole(QAction.QuitRole)
219 self.fileActions.append(self.exitAct) 219 self.fileActions.append(self.exitAct)
220 220
221 self.newWindowAct = E5Action( 221 self.newWindowAct = E5Action(
222 self.tr('New Window'), 222 self.tr('New Window'),
223 UI.PixmapCache.getIcon("newWindow.png"), 223 UI.PixmapCache.getIcon("newWindow"),
224 self.tr('New &Window'), 224 self.tr('New &Window'),
225 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")), 225 QKeySequence(self.tr("Ctrl+Shift+N", "File|New Window")),
226 0, self, 'new_window') 226 0, self, 'new_window')
227 self.newWindowAct.setStatusTip(self.tr( 227 self.newWindowAct.setStatusTip(self.tr(
228 'Open a new Shell window')) 228 'Open a new Shell window'))
233 self.newWindowAct.triggered.connect(self.__newWindow) 233 self.newWindowAct.triggered.connect(self.__newWindow)
234 self.fileActions.append(self.newWindowAct) 234 self.fileActions.append(self.newWindowAct)
235 235
236 self.restartAct = E5Action( 236 self.restartAct = E5Action(
237 self.tr('Restart'), 237 self.tr('Restart'),
238 UI.PixmapCache.getIcon("restart.png"), 238 UI.PixmapCache.getIcon("restart"),
239 self.tr('Restart'), 239 self.tr('Restart'),
240 0, 0, self, 'shell_restart') 240 0, 0, self, 'shell_restart')
241 self.restartAct.setStatusTip(self.tr( 241 self.restartAct.setStatusTip(self.tr(
242 'Restart the shell')) 242 'Restart the shell'))
243 self.restartAct.setWhatsThis(self.tr( 243 self.restartAct.setWhatsThis(self.tr(
247 self.restartAct.triggered.connect(self.__shell.doRestart) 247 self.restartAct.triggered.connect(self.__shell.doRestart)
248 self.fileActions.append(self.restartAct) 248 self.fileActions.append(self.restartAct)
249 249
250 self.clearRestartAct = E5Action( 250 self.clearRestartAct = E5Action(
251 self.tr('Restart and Clear'), 251 self.tr('Restart and Clear'),
252 UI.PixmapCache.getIcon("restartDelete.png"), 252 UI.PixmapCache.getIcon("restartDelete"),
253 self.tr('Restart and Clear'), 253 self.tr('Restart and Clear'),
254 Qt.Key_F4, 0, self, 'shell_clear_restart') 254 Qt.Key_F4, 0, self, 'shell_clear_restart')
255 self.clearRestartAct.setStatusTip(self.tr( 255 self.clearRestartAct.setStatusTip(self.tr(
256 'Clear the window and restart the shell')) 256 'Clear the window and restart the shell'))
257 self.clearRestartAct.setWhatsThis(self.tr( 257 self.clearRestartAct.setWhatsThis(self.tr(
270 self.editActGrp = createActionGroup(self) 270 self.editActGrp = createActionGroup(self)
271 self.copyActGrp = createActionGroup(self.editActGrp) 271 self.copyActGrp = createActionGroup(self.editActGrp)
272 272
273 self.cutAct = E5Action( 273 self.cutAct = E5Action(
274 QCoreApplication.translate('ViewManager', 'Cut'), 274 QCoreApplication.translate('ViewManager', 'Cut'),
275 UI.PixmapCache.getIcon("editCut.png"), 275 UI.PixmapCache.getIcon("editCut"),
276 QCoreApplication.translate('ViewManager', 'Cu&t'), 276 QCoreApplication.translate('ViewManager', 'Cu&t'),
277 QKeySequence(QCoreApplication.translate( 277 QKeySequence(QCoreApplication.translate(
278 'ViewManager', "Ctrl+X", "Edit|Cut")), 278 'ViewManager', "Ctrl+X", "Edit|Cut")),
279 QKeySequence(QCoreApplication.translate( 279 QKeySequence(QCoreApplication.translate(
280 'ViewManager', "Shift+Del", "Edit|Cut")), 280 'ViewManager', "Shift+Del", "Edit|Cut")),
290 self.cutAct.triggered.connect(self.__shell.cut) 290 self.cutAct.triggered.connect(self.__shell.cut)
291 self.editActions.append(self.cutAct) 291 self.editActions.append(self.cutAct)
292 292
293 self.copyAct = E5Action( 293 self.copyAct = E5Action(
294 QCoreApplication.translate('ViewManager', 'Copy'), 294 QCoreApplication.translate('ViewManager', 'Copy'),
295 UI.PixmapCache.getIcon("editCopy.png"), 295 UI.PixmapCache.getIcon("editCopy"),
296 QCoreApplication.translate('ViewManager', '&Copy'), 296 QCoreApplication.translate('ViewManager', '&Copy'),
297 QKeySequence(QCoreApplication.translate( 297 QKeySequence(QCoreApplication.translate(
298 'ViewManager', "Ctrl+C", "Edit|Copy")), 298 'ViewManager', "Ctrl+C", "Edit|Copy")),
299 QKeySequence(QCoreApplication.translate( 299 QKeySequence(QCoreApplication.translate(
300 'ViewManager', "Ctrl+Ins", "Edit|Copy")), 300 'ViewManager', "Ctrl+Ins", "Edit|Copy")),
310 self.copyAct.triggered.connect(self.__shell.copy) 310 self.copyAct.triggered.connect(self.__shell.copy)
311 self.editActions.append(self.copyAct) 311 self.editActions.append(self.copyAct)
312 312
313 self.pasteAct = E5Action( 313 self.pasteAct = E5Action(
314 QCoreApplication.translate('ViewManager', 'Paste'), 314 QCoreApplication.translate('ViewManager', 'Paste'),
315 UI.PixmapCache.getIcon("editPaste.png"), 315 UI.PixmapCache.getIcon("editPaste"),
316 QCoreApplication.translate('ViewManager', '&Paste'), 316 QCoreApplication.translate('ViewManager', '&Paste'),
317 QKeySequence(QCoreApplication.translate( 317 QKeySequence(QCoreApplication.translate(
318 'ViewManager', "Ctrl+V", "Edit|Paste")), 318 'ViewManager', "Ctrl+V", "Edit|Paste")),
319 QKeySequence(QCoreApplication.translate( 319 QKeySequence(QCoreApplication.translate(
320 'ViewManager', "Shift+Ins", "Edit|Paste")), 320 'ViewManager', "Shift+Ins", "Edit|Paste")),
330 self.pasteAct.triggered.connect(self.__shell.paste) 330 self.pasteAct.triggered.connect(self.__shell.paste)
331 self.editActions.append(self.pasteAct) 331 self.editActions.append(self.pasteAct)
332 332
333 self.clearAct = E5Action( 333 self.clearAct = E5Action(
334 QCoreApplication.translate('ViewManager', 'Clear'), 334 QCoreApplication.translate('ViewManager', 'Clear'),
335 UI.PixmapCache.getIcon("editDelete.png"), 335 UI.PixmapCache.getIcon("editDelete"),
336 QCoreApplication.translate('ViewManager', 'Clear'), 336 QCoreApplication.translate('ViewManager', 'Clear'),
337 QKeySequence(QCoreApplication.translate( 337 QKeySequence(QCoreApplication.translate(
338 'ViewManager', "Alt+Shift+C", "Edit|Clear")), 338 'ViewManager', "Alt+Shift+C", "Edit|Clear")),
339 0, 339 0,
340 self.copyActGrp, 'vm_edit_clear') 340 self.copyActGrp, 'vm_edit_clear')
738 """ 738 """
739 self.searchActGrp = createActionGroup(self) 739 self.searchActGrp = createActionGroup(self)
740 740
741 self.searchAct = E5Action( 741 self.searchAct = E5Action(
742 QCoreApplication.translate('ViewManager', 'Search'), 742 QCoreApplication.translate('ViewManager', 'Search'),
743 UI.PixmapCache.getIcon("find.png"), 743 UI.PixmapCache.getIcon("find"),
744 QCoreApplication.translate('ViewManager', '&Search...'), 744 QCoreApplication.translate('ViewManager', '&Search...'),
745 QKeySequence(QCoreApplication.translate( 745 QKeySequence(QCoreApplication.translate(
746 'ViewManager', "Ctrl+F", "Search|Search")), 746 'ViewManager', "Ctrl+F", "Search|Search")),
747 0, 747 0,
748 self, 'vm_search') 748 self, 'vm_search')
759 self.searchActions.append(self.searchAct) 759 self.searchActions.append(self.searchAct)
760 760
761 self.searchNextAct = E5Action( 761 self.searchNextAct = E5Action(
762 QCoreApplication.translate( 762 QCoreApplication.translate(
763 'ViewManager', 'Search next'), 763 'ViewManager', 'Search next'),
764 UI.PixmapCache.getIcon("findNext.png"), 764 UI.PixmapCache.getIcon("findNext"),
765 QCoreApplication.translate('ViewManager', 'Search &next'), 765 QCoreApplication.translate('ViewManager', 'Search &next'),
766 QKeySequence(QCoreApplication.translate( 766 QKeySequence(QCoreApplication.translate(
767 'ViewManager', "F3", "Search|Search next")), 767 'ViewManager', "F3", "Search|Search next")),
768 0, 768 0,
769 self, 'vm_search_next') 769 self, 'vm_search_next')
780 self.__searchWidget.on_findNextButton_clicked) 780 self.__searchWidget.on_findNextButton_clicked)
781 self.searchActions.append(self.searchNextAct) 781 self.searchActions.append(self.searchNextAct)
782 782
783 self.searchPrevAct = E5Action( 783 self.searchPrevAct = E5Action(
784 QCoreApplication.translate('ViewManager', 'Search previous'), 784 QCoreApplication.translate('ViewManager', 'Search previous'),
785 UI.PixmapCache.getIcon("findPrev.png"), 785 UI.PixmapCache.getIcon("findPrev"),
786 QCoreApplication.translate('ViewManager', 'Search &previous'), 786 QCoreApplication.translate('ViewManager', 'Search &previous'),
787 QKeySequence(QCoreApplication.translate( 787 QKeySequence(QCoreApplication.translate(
788 'ViewManager', "Shift+F3", "Search|Search previous")), 788 'ViewManager', "Shift+F3", "Search|Search previous")),
789 0, 789 0,
790 self, 'vm_search_previous') 790 self, 'vm_search_previous')
808 """ 808 """
809 self.viewActGrp = createActionGroup(self) 809 self.viewActGrp = createActionGroup(self)
810 810
811 self.zoomInAct = E5Action( 811 self.zoomInAct = E5Action(
812 QCoreApplication.translate('ViewManager', 'Zoom in'), 812 QCoreApplication.translate('ViewManager', 'Zoom in'),
813 UI.PixmapCache.getIcon("zoomIn.png"), 813 UI.PixmapCache.getIcon("zoomIn"),
814 QCoreApplication.translate('ViewManager', 'Zoom &in'), 814 QCoreApplication.translate('ViewManager', 'Zoom &in'),
815 QKeySequence(QCoreApplication.translate( 815 QKeySequence(QCoreApplication.translate(
816 'ViewManager', "Ctrl++", "View|Zoom in")), 816 'ViewManager', "Ctrl++", "View|Zoom in")),
817 QKeySequence(QCoreApplication.translate( 817 QKeySequence(QCoreApplication.translate(
818 'ViewManager', "Zoom In", "View|Zoom in")), 818 'ViewManager', "Zoom In", "View|Zoom in")),
827 self.zoomInAct.triggered.connect(self.__zoomIn) 827 self.zoomInAct.triggered.connect(self.__zoomIn)
828 self.viewActions.append(self.zoomInAct) 828 self.viewActions.append(self.zoomInAct)
829 829
830 self.zoomOutAct = E5Action( 830 self.zoomOutAct = E5Action(
831 QCoreApplication.translate('ViewManager', 'Zoom out'), 831 QCoreApplication.translate('ViewManager', 'Zoom out'),
832 UI.PixmapCache.getIcon("zoomOut.png"), 832 UI.PixmapCache.getIcon("zoomOut"),
833 QCoreApplication.translate('ViewManager', 'Zoom &out'), 833 QCoreApplication.translate('ViewManager', 'Zoom &out'),
834 QKeySequence(QCoreApplication.translate( 834 QKeySequence(QCoreApplication.translate(
835 'ViewManager', "Ctrl+-", "View|Zoom out")), 835 'ViewManager', "Ctrl+-", "View|Zoom out")),
836 QKeySequence(QCoreApplication.translate( 836 QKeySequence(QCoreApplication.translate(
837 'ViewManager', "Zoom Out", "View|Zoom out")), 837 'ViewManager', "Zoom Out", "View|Zoom out")),
846 self.zoomOutAct.triggered.connect(self.__zoomOut) 846 self.zoomOutAct.triggered.connect(self.__zoomOut)
847 self.viewActions.append(self.zoomOutAct) 847 self.viewActions.append(self.zoomOutAct)
848 848
849 self.zoomResetAct = E5Action( 849 self.zoomResetAct = E5Action(
850 QCoreApplication.translate('ViewManager', 'Zoom reset'), 850 QCoreApplication.translate('ViewManager', 'Zoom reset'),
851 UI.PixmapCache.getIcon("zoomReset.png"), 851 UI.PixmapCache.getIcon("zoomReset"),
852 QCoreApplication.translate('ViewManager', 'Zoom &reset'), 852 QCoreApplication.translate('ViewManager', 'Zoom &reset'),
853 QKeySequence(QCoreApplication.translate( 853 QKeySequence(QCoreApplication.translate(
854 'ViewManager', "Ctrl+0", "View|Zoom reset")), 854 'ViewManager', "Ctrl+0", "View|Zoom reset")),
855 0, 855 0,
856 self.viewActGrp, 'vm_view_zoom_reset') 856 self.viewActGrp, 'vm_view_zoom_reset')
865 self.zoomResetAct.triggered.connect(self.__zoomReset) 865 self.zoomResetAct.triggered.connect(self.__zoomReset)
866 self.viewActions.append(self.zoomResetAct) 866 self.viewActions.append(self.zoomResetAct)
867 867
868 self.zoomToAct = E5Action( 868 self.zoomToAct = E5Action(
869 QCoreApplication.translate('ViewManager', 'Zoom'), 869 QCoreApplication.translate('ViewManager', 'Zoom'),
870 UI.PixmapCache.getIcon("zoomTo.png"), 870 UI.PixmapCache.getIcon("zoomTo"),
871 QCoreApplication.translate('ViewManager', '&Zoom'), 871 QCoreApplication.translate('ViewManager', '&Zoom'),
872 QKeySequence(QCoreApplication.translate( 872 QKeySequence(QCoreApplication.translate(
873 'ViewManager', "Ctrl+#", "View|Zoom")), 873 'ViewManager', "Ctrl+#", "View|Zoom")),
874 0, 874 0,
875 self.viewActGrp, 'vm_view_zoom') 875 self.viewActGrp, 'vm_view_zoom')
889 Private method defining the user interface actions for the history 889 Private method defining the user interface actions for the history
890 commands. 890 commands.
891 """ 891 """
892 self.showHistoryAct = E5Action( 892 self.showHistoryAct = E5Action(
893 self.tr('Show History'), 893 self.tr('Show History'),
894 UI.PixmapCache.getIcon("history.png"), 894 UI.PixmapCache.getIcon("history"),
895 self.tr('&Show History...'), 895 self.tr('&Show History...'),
896 0, 0, 896 0, 0,
897 self, 'shell_show_history') 897 self, 'shell_show_history')
898 self.showHistoryAct.setStatusTip(self.tr( 898 self.showHistoryAct.setStatusTip(self.tr(
899 "Show the shell history in a dialog")) 899 "Show the shell history in a dialog"))
900 self.showHistoryAct.triggered.connect(self.__shell.showHistory) 900 self.showHistoryAct.triggered.connect(self.__shell.showHistory)
901 901
902 self.clearHistoryAct = E5Action( 902 self.clearHistoryAct = E5Action(
903 self.tr('Clear History'), 903 self.tr('Clear History'),
904 UI.PixmapCache.getIcon("historyClear.png"), 904 UI.PixmapCache.getIcon("historyClear"),
905 self.tr('&Clear History...'), 905 self.tr('&Clear History...'),
906 0, 0, 906 0, 0,
907 self, 'shell_clear_history') 907 self, 'shell_clear_history')
908 self.clearHistoryAct.setStatusTip(self.tr( 908 self.clearHistoryAct.setStatusTip(self.tr(
909 "Clear the shell history")) 909 "Clear the shell history"))
947 self.aboutQtAct.triggered.connect(self.__aboutQt) 947 self.aboutQtAct.triggered.connect(self.__aboutQt)
948 self.helpActions.append(self.aboutQtAct) 948 self.helpActions.append(self.aboutQtAct)
949 949
950 self.whatsThisAct = E5Action( 950 self.whatsThisAct = E5Action(
951 self.tr('What\'s This?'), 951 self.tr('What\'s This?'),
952 UI.PixmapCache.getIcon("whatsThis.png"), 952 UI.PixmapCache.getIcon("whatsThis"),
953 self.tr('&What\'s This?'), 953 self.tr('&What\'s This?'),
954 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")), 954 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")),
955 0, self, 'help_help_whats_this') 955 0, self, 'help_help_whats_this')
956 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help')) 956 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help'))
957 self.whatsThisAct.setWhatsThis(self.tr( 957 self.whatsThisAct.setWhatsThis(self.tr(
1248 """ 1248 """
1249 self.__statusBar = self.statusBar() 1249 self.__statusBar = self.statusBar()
1250 self.__statusBar.setSizeGripEnabled(True) 1250 self.__statusBar.setSizeGripEnabled(True)
1251 1251
1252 self.__sbZoom = E5ZoomWidget( 1252 self.__sbZoom = E5ZoomWidget(
1253 UI.PixmapCache.getPixmap("zoomOut.png"), 1253 UI.PixmapCache.getPixmap("zoomOut"),
1254 UI.PixmapCache.getPixmap("zoomIn.png"), 1254 UI.PixmapCache.getPixmap("zoomIn"),
1255 UI.PixmapCache.getPixmap("zoomReset.png"), 1255 UI.PixmapCache.getPixmap("zoomReset"),
1256 self.__statusBar) 1256 self.__statusBar)
1257 self.__statusBar.addPermanentWidget(self.__sbZoom) 1257 self.__statusBar.addPermanentWidget(self.__sbZoom)
1258 self.__sbZoom.setWhatsThis(self.tr( 1258 self.__sbZoom.setWhatsThis(self.tr(
1259 """<p>This part of the status bar allows zooming the shell.</p>""" 1259 """<p>This part of the status bar allows zooming the shell.</p>"""
1260 )) 1260 ))

eric ide

mercurial