how to import/read data from one plugin to another?

Mark Doliner mark at kingant.net
Mon Mar 30 02:48:51 EDT 2009


On Sun, Mar 29, 2009 at 11:44 PM, arun kumar <arunkumar0107 at gmail.com> wrote:
> i have a translation plugin (a libpurple plugin) which mainly
> translates the text typed by a user. Now i want to know the language
> to which the text needs to be translated. this is present in another
> plugin called lan_preference plugin( which is a pidgin plugin) this
> plugin is an UI  (similar to text replacement plugin ) where a user
> can simply enter the language. Now i want to read the language
> specified by the user in lan_pref plugin from translation plugin to
> use it to translate the text.......

You could have the lan_pref plugin call purple_prefs_set_string() to
set the language, then have the translation plugin watch the language
preference using purple_prefs_connect_callback().

But I wonder, does it make sense for that to be two separate plugins?
It seems like the translation plugin depends on the lan_pref plugin.
And the lan_pref plugin doesn't seem very useful without the
translation plugin.

-Mark




More information about the Devel mailing list