On Friday, July 13, 2012 10:41:12 PM UTC+3, nicolas wrote:
>
> Hi everydoby.
> I'm using Spyder for few weeks for small Python programs.
> I want to know if it's possible (ans then how) to add new shortcut in the
> Tools/External tools menu.
> There is only Python(x,y) (not active) and QtDesigner (active) on this
> menu, and I would like to add, for example QtLinguist.
>
Starting from 2.2.x in Internal Console:
>>> CMD = 'df'
>>> from spyderlib.utils.qthelpers import create_action
>>> from spyderlib.utils import programs
>>> from spyderlib.config import get_icon
>>> from spyderlib.utils.qthelpers import add_actions
>>> action = create_action(spy.window, "Launch '%s'" % CMD,
icon=get_icon('advanced.png'), triggered=lambda:
programs.start_file(programs.find_program(CMD)))
>>> add_actions(spy.window.external_tools_menu, [action])
On Linux this will add menu entry to run 'df' command, which (in my case)
is seen in console that I started Spyder from. You can place this code into
Spyder plugin http://code.google.com/p/spyderlib/wiki/SpyderPlugins to be
executed on load.
BTW, I can see that QtLinguist autodetection is in the source, so you
should have QtLinguist in the menu if `linguist` or `linguist-qt4`
executables are installed correctly.
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/spyderlib/-/GPPi0ilgGU4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/spyderlib?hl=en.