示例#1
0
 def add_actions_to_context_menu(self, menu):
     """Add actions to IPython widget context menu"""
     # See spyderlib/widgets/ipython.py for more details on this method
     inspect_action = create_action(
         self,
         _("Inspect current object"),
         QKeySequence(get_shortcut('console', 'inspect current object')),
         icon=get_std_icon('MessageBoxInformation'),
         triggered=self.inspect_object)
     clear_line_action = create_action(self,
                                       _("Clear line or block"),
                                       QKeySequence("Shift+Escape"),
                                       icon=get_icon('eraser.png'),
                                       triggered=self.clear_line)
     clear_console_action = create_action(
         self,
         _("Clear console"),
         QKeySequence(get_shortcut('console', 'clear shell')),
         icon=get_icon('clear.png'),
         triggered=self.clear_console)
     quit_action = create_action(self,
                                 _("&Quit"),
                                 icon='exit.png',
                                 triggered=self.exit_callback)
     add_actions(menu, (None, inspect_action, clear_line_action,
                        clear_console_action, None, quit_action))
     return menu
示例#2
0
文件: shell.py 项目: mikofski/spyder
 def setup_context_menu(self):
     """Reimplements ShellBaseWidget method"""
     ShellBaseWidget.setup_context_menu(self)
     self.copy_without_prompts_action = create_action(
         self,
         _("Copy without prompts"),
         icon=ima.icon('copywop'),
         triggered=self.copy_without_prompts)
     clear_line_action = create_action(
         self,
         _("Clear line"),
         QKeySequence(get_shortcut('console', 'Clear line')),
         icon=ima.icon('editdelete'),
         tip=_("Clear line"),
         triggered=self.clear_line)
     clear_action = create_action(self,
                                  _("Clear shell"),
                                  QKeySequence(
                                      get_shortcut('console',
                                                   'Clear shell')),
                                  icon=ima.icon('editclear'),
                                  tip=_("Clear shell contents "
                                        "('cls' command)"),
                                  triggered=self.clear_terminal)
     add_actions(self.menu, (self.copy_without_prompts_action,
                             clear_line_action, clear_action))
示例#3
0
 def add_actions_to_context_menu(self, menu):
     """Add actions to IPython widget context menu"""
     # See spyderlib/widgets/ipython.py for more details on this method
     inspect_action = create_action(self, _("Inspect current object"),
                                 QKeySequence(get_shortcut('console',
                                                 'inspect current object')),
                                 icon=get_std_icon('MessageBoxInformation'),
                                 triggered=self.inspect_object)
     clear_line_action = create_action(self, _("Clear line or block"),
                                       QKeySequence("Shift+Escape"),
                                       icon=get_icon('eraser.png'),
                                       triggered=self.clear_line)
     clear_console_action = create_action(self, _("Clear console"),
                                          QKeySequence(get_shortcut('console',
                                                            'clear shell')),
                                          icon=get_icon('clear.png'),
                                          triggered=self.clear_console)
     quit_action = create_action(self, _("&Quit"), icon='exit.png',
                                 triggered=self.exit_callback)
     add_actions(menu, (None, inspect_action, clear_line_action,
                        clear_console_action, None, quit_action))
     return menu
示例#4
0
 def setup_context_menu(self):
     """Reimplements ShellBaseWidget method"""
     ShellBaseWidget.setup_context_menu(self)
     self.copy_without_prompts_action = create_action(self,
                                  _("Copy without prompts"),
                                  icon=ima.icon('copywop'),
                                  triggered=self.copy_without_prompts)
     clear_line_action = create_action(self, _("Clear line"),
                                  QKeySequence(get_shortcut('console',
                                                            'Clear line')),
                                  icon=ima.icon('editdelete'),
                                  tip=_("Clear line"),
                                  triggered=self.clear_line)
     clear_action = create_action(self, _("Clear shell"),
                                  QKeySequence(get_shortcut('console',
                                                            'Clear shell')),
                                  icon=ima.icon('editclear'),
                                  tip=_("Clear shell contents "
                                        "('cls' command)"),
                                  triggered=self.clear_terminal)
     add_actions(self.menu, (self.copy_without_prompts_action,
                 clear_line_action, clear_action))
示例#5
0
def add_shortcut_to_tooltip(action, context, name):
    """Add the shortcut associated with a given action to its tooltip"""
    action.setToolTip(action.toolTip() + ' (%s)' %
                      get_shortcut(context=context, name=name))
示例#6
0
 def load(self):
     self.key = get_shortcut(self.context, self.name)
示例#7
0
def add_shortcut_to_tooltip(action, context, name):
    """Add the shortcut associated with a given action to its tooltip"""
    action.setToolTip(action.toolTip() +
                      ' (%s)' % get_shortcut(context=context, name=name))
示例#8
0
 def load(self):
     self.key = keystr2key(get_shortcut(self.context, self.name))
示例#9
0
 def load(self):
     self.key = keystr2key(get_shortcut(self.context, self.name))
示例#10
0
文件: shortcuts.py 项目: Mabai/spyder
 def load(self):
     self.key = get_shortcut(self.context, self.name)