[Users] Flagging non-default accounts during compose?
Holger Berndt
berndth at gmx.de
Sat Aug 3 11:50:38 CEST 2013
Hello Ricardo,
On Mo, 29.07.2013 08:28, Ricardo Mones wrote:
> Would it be possible to add some submenu to compose windows' Edit
>menu (for example), whose options were able to modify compose text
>and/or subject on user invocation?
Any script that you put into .claws-mail/python-scripts/compose will
end up as a menu entry in the compose window under Tools / Python
scripts.
You also get access to the compose window's GtkUiManager object, so
alternatively, you can use that from
.claws-mail/python-scripts/auto/compose_any to insert menu items
at other places (see [1] for a few examples of doing this in the main
window - I didn't try it, but compose window should work analogous).
Another alternative would be to put it into the toolbar, which is
possible via the normal Claws Mail dialog. Shortcut assignment
is also possible.
As for subject or body modifications: For the subject, you have set()
and get() functions, an example can be seen in [2]. For the body, you
have access to the GtkTextView widget, which you can modify using the
normal PyGtk bindings. An example can be seen in [3].
Personally, I find the example in [3] quite interesting, because you
can not only do text replacement, but execute any Python code, and
e.g. attach automatically some standard path or whatever. I used to
use something similar in TheBat! many moons ago, which had a macro language with
fixed commands for that - so, with Python being a general purpose
language, it's even more flexible. IIRC the shortcut that I assigned
to invoking that script, CTRL-Space, also originates from the TheBat! default.
Holger
[1] http://git.claws-mail.org/?p=claws.git;a=blob;f=src/plugins/python/examples/auto/startup;h=8901cf0474f54ccd0016718e976ebf454c78fa8c;hb=HEAD
[2] http://git.claws-mail.org/?p=claws.git;a=blob;f=src/plugins/python/examples/auto/compose_any;h=b15f0f33860a4099208f6dfb82b487dd2d5dec9b;hb=HEAD
[3] http://git.claws-mail.org/?p=claws.git;a=blob;f=src/plugins/python/examples/compose/Macro-Expansion;h=80e98878220e6cd927e163838a6347233996d69f;hb=HEAD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20130803/9c16f8e0/attachment.sig>
More information about the Users
mailing list