Browse files

Create Keyboard Accelerator for MenuBar

  • Loading branch information...
1 parent cf2bb28 commit b0f2f4d1f83182fad14b00a50a4bdad0a3d64cd4 @Carreau Carreau committed with fperez Oct 10, 2011
Showing with 27 additions and 27 deletions.
  1. +27 −27 IPython/frontend/qt/console/qtconsoleapp.py
View
54 IPython/frontend/qt/console/qtconsoleapp.py
@@ -324,25 +324,25 @@ def findSlavesTabs(self,tab):
# menu bar, or give them an option to remove it
def initMenuBar(self):
#create menu in the order they should appear in the menu bar
- self.fileMenu = self.menuBar().addMenu("File")
- self.editMenu = self.menuBar().addMenu("Edit")
- self.fontMenu = self.menuBar().addMenu("Font")
- self.windowMenu = self.menuBar().addMenu("Window")
- self.magicMenu = self.menuBar().addMenu("Magic")
+ self.fileMenu = self.menuBar().addMenu("&File")
+ self.editMenu = self.menuBar().addMenu("&Edit")
+ self.fontMenu = self.menuBar().addMenu("F&ont")
+ self.windowMenu = self.menuBar().addMenu("&Window")
+ self.magicMenu = self.menuBar().addMenu("&Magic")
# please keep the Help menu in Mac Os even if empty. It will
# automatically contain a search field to search inside menus and
# please keep it spelled in English, as long as Qt Doesn't support
# a QAction.MenuRole like HelpMenuRole otherwise it will loose
# this search field fonctionnality
- self.helpMenu = self.menuBar().addMenu("Help")
+ self.helpMenu = self.menuBar().addMenu("&Help")
# sould wrap every line of the following block into a try/except,
# as we are not sure of instanciating a _frontend which support all
# theses actions, but there might be a better way
try:
- self.print_action = QtGui.QAction("Print",
+ self.print_action = QtGui.QAction("&Print",
self,
shortcut="Ctrl+P",
triggered=self.print_action_active_frontend)
@@ -351,7 +351,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (print), skipping")
try:
- self.export_action=QtGui.QAction("Export",
+ self.export_action=QtGui.QAction("E&xport",
self,
shortcut="Ctrl+S",
triggered=self.export_action_active_frontend
@@ -361,7 +361,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (Export), skipping")
try:
- self.select_all_action = QtGui.QAction("Select All",
+ self.select_all_action = QtGui.QAction("Select &All",
self,
shortcut="Ctrl+A",
triggered=self.select_all_active_frontend
@@ -371,7 +371,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (select all), skipping")
try:
- self.undo_action = QtGui.QAction("Undo",
+ self.undo_action = QtGui.QAction("&Undo",
self,
shortcut="Ctrl+Z",
statusTip="Undo last action if possible",
@@ -382,7 +382,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (undo), skipping")
try:
- self.redo_action = QtGui.QAction("Redo",
+ self.redo_action = QtGui.QAction("&Redo",
self,
shortcut="Ctrl+Shift+Z",
statusTip="Redo last action if possible",
@@ -392,7 +392,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (redo), skipping")
try:
- self.increase_font_size = QtGui.QAction("Increase Font Size",
+ self.increase_font_size = QtGui.QAction("&Increase Font Size",
self,
shortcut="Ctrl++",
triggered=self.increase_font_size_active_frontend
@@ -402,7 +402,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (increase font size), skipping")
try:
- self.decrease_font_size = QtGui.QAction("Decrease Font Size",
+ self.decrease_font_size = QtGui.QAction("&Decrease Font Size",
self,
shortcut="Ctrl+-",
triggered=self.decrease_font_size_active_frontend
@@ -412,7 +412,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (decrease font size), skipping")
try:
- self.reset_font_size = QtGui.QAction("Reset Font Size",
+ self.reset_font_size = QtGui.QAction("&Reset Font Size",
self,
shortcut="Ctrl+0",
triggered=self.reset_font_size_active_frontend
@@ -422,7 +422,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (reset font size), skipping")
try:
- self.reset_action = QtGui.QAction("Reset",
+ self.reset_action = QtGui.QAction("&Reset",
self,
statusTip="Clear all varible from workspace",
triggered=self.reset_magic_active_frontend)
@@ -431,7 +431,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (reset), skipping")
try:
- self.history_action = QtGui.QAction("History",
+ self.history_action = QtGui.QAction("&History",
self,
statusTip="show command history",
triggered=self.history_magic_active_frontend)
@@ -440,7 +440,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (history), skipping")
try:
- self.save_action = QtGui.QAction("Export History ",
+ self.save_action = QtGui.QAction("E&xport History ",
self,
statusTip="Export History as Python File",
triggered=self.save_magic_active_frontend)
@@ -449,7 +449,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (save), skipping")
try:
- self.clear_action = QtGui.QAction("Clear",
+ self.clear_action = QtGui.QAction("&Clear",
self,
statusTip="Clear the console",
triggered=self.clear_magic_active_frontend)
@@ -458,7 +458,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action, skipping")
try:
- self.who_action = QtGui.QAction("Who",
+ self.who_action = QtGui.QAction("&Who",
self,
statusTip="List interactive variable",
triggered=self.who_magic_active_frontend)
@@ -467,7 +467,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (who), skipping")
try:
- self.who_ls_action = QtGui.QAction("Who ls",
+ self.who_ls_action = QtGui.QAction("Wh&o ls",
self,
statusTip="Return a list of interactive variable",
triggered=self.who_ls_magic_active_frontend)
@@ -476,7 +476,7 @@ def initMenuBar(self):
self.log.error("trying to add unexisting action (who_ls), skipping")
try:
- self.whos_action = QtGui.QAction("Whos",
+ self.whos_action = QtGui.QAction("Who&s",
self,
statusTip="List interactive variable with detail",
triggered=self.whos_magic_active_frontend)
@@ -987,18 +987,18 @@ def init_window_shortcut(self):
statusTip="Cahange to next tab",
triggered=self.window.nextTab)
- self.fullScreenAct = QtGui.QAction("Full Screen",
+ self.fullScreenAct = QtGui.QAction("&Full Screen",
self.window,
shortcut="Ctrl+Meta+Space",
statusTip="Toggle between Fullscreen and Normal Size",
triggered=self.toggleFullScreen)
- self.tabAndNewKernelAct =QtGui.QAction("Tab with New kernel",
+ self.tabAndNewKernelAct =QtGui.QAction("Tab with &New kernel",
self.window,
shortcut="Ctrl+T",
triggered=self.createTabWithNewFrontend)
self.window.windowMenu.addAction(self.tabAndNewKernelAct)
- self.tabSameKernalAct =QtGui.QAction("Tab with Same kernel",
+ self.tabSameKernalAct =QtGui.QAction("Tab with Sa&me kernel",
self.window,
shortcut="Ctrl+Shift+T",
triggered=self.createTabAttachedToCurrentTabKernel)
@@ -1009,18 +1009,18 @@ def init_window_shortcut(self):
# know the shortcut or if the windows manager assign it in
# other platform.
if sys.platform == 'darwin':
- self.minimizeAct = QtGui.QAction("Minimize",
+ self.minimizeAct = QtGui.QAction("Mini&mize",
self.window,
shortcut="Ctrl+m",
statusTip="Minimize the window/Restore Normal Size",
triggered=self.toggleMinimized)
- self.maximizeAct = QtGui.QAction("Maximize",
+ self.maximizeAct = QtGui.QAction("Ma&ximize",
self.window,
shortcut="Ctrl+Shift+M",
statusTip="Maximize the window/Restore Normal Size",
triggered=self.toggleMaximized)
- self.onlineHelpAct = QtGui.QAction("Open Online Help",
+ self.onlineHelpAct = QtGui.QAction("Open Online &Help",
self.window,
triggered=self._open_online_help)

0 comments on commit b0f2f4d

Please sign in to comment.