Re: [Evolution-hackers] Getting started with extensions/plugins



On Thu, 2016-08-18 at 16:55 +0100, Stephen Finucane wrote:
tl;dr: Are there any resources available for someone interested in
creating a new plugin for Evolution?

        Hi,
those you found are basically it. The preferred way is to write a
module (and there an EExtension descendant), rather than an EPlugin.
You can see the current modules at the sources:
https://git.gnome.org/browse/evolution/tree/modules/
and also the old plugins:
https://git.gnome.org/browse/evolution/tree/plugins/

Some bigger extensions are 3rd-party plugins like evolution-rss,
evolution-mapi and evolution-ews, though they might be too large for a
study.

Are there any resources or sample plugins that I could look at to get
started here?

I updated the wiki page and added an example module there.
https://wiki.gnome.org/Apps/Evolution/Extensions#Example_Module

It doesn't use autotools, it uses cmake instead. I plan to use cmake
for the core evolution products in some not so distant future, thus
this was a good opportunity to learn the cmake a bit more for me.

When looking around the code I realized that the ECompEditor (it's used
to editor events/tasks/memos) was not extensible, thus I made it so for
3.21.91. That's also the reason why the example module requires current
development version of the evolution-data-server and evolution, even I
didn't write an extension for it.

What I want:

* "Schedule meeting" button in the New Meeting window, like so:

You can do it yourself for example when you change the m-msg-composer-
extension.c to not extend E_TYPE_MSG_COMPOSER, but E_TYPE_COMP_EDITOR
instead (see line 130). Then you can connect to "notify::component" of
the ECompEditor and do some stuff when it changes, like checking
whether your actions should be shown or not in the UI. Getting values
from the editor will be harder. You might call something like
   e_comp_editor_fill_component (....);
and act based on its result. The component, if the call will be
successful, will contain data from the editor.
https://git.gnome.org/browse/evolution/tree/calendar/gui/e-comp-editor.h#n97

 * "Join meeting" link in an Events context event

This one is covered in the example module, see src/m-calendar-ui.c,
function action_calendar_event_cb().

 * "Join online" button in alerts (don't know if Evolution has these?)

It has the dialog, it's shown by an evolution-alarm-notify background
process, but the dialog itself is not extensible. It's defined in a .ui
file, which makes it harder to make it extensible. Checking the content
and placing the button on an exact place would be also a challenge from
the coding point of view, I'm afraid. Changing the .ui file is not that
hard, but it won't survive the evolution update.

I hope this will be helpful for you. Feel free to ask more, if needed.
We can extend the wiki page too, based on your feedback.

        Thanks and bye,
        Milan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]