Can the perl plugins be made configurable the same way the regular plugins are? Is there a common framework for plugin configurability or each plugin is on its own? I appreciate any pointers. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, they are, in exactly the same ways as normal plugins. There are example perl scripts in the source (but not in the tarball because they haven't been checked to still work, so you will need to grab them from viewmtn) which do this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, I was looking at SVN. I now downloaded the source tarball, but it has only 3 sample plugins and none of them have a sample for prefs usage. Is there another location for a more up to date source?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
viewmtn on the website has a couple more, but they aren't guaranteed to be fully up to date and as such don't ship in the tarball. I need to get around to finishing updating them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
but didn't find any additional files. Could you point me to the location? I would also appreciate if you can update us here when you update the plugins to work with pidgin.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am finally getting to try these and got some success. Couple of questions:
- I noticed purple_plugin_pref_set_format_type() C API so tried to use it from the perl plugin, but the pidgin version 2.0.x that I had was crashing (silently exiting) as soon as I open plugin configuration dialog. I upgraded to the new 2.2.1 version and now it doesn't crash anymore, but the dialog doesn't still open. What I noticed is that the corresponding perl API, which should have been Purple::PluginPref::set_format_type is not even listed. Is this the reason why it is not working? I am just trying to set the format type to select a multiline field. The enums for the format types are defined though, one for each in PurpleStringFormatType, e.g., Purple::String::Format::Type::MULTILINE.
- when the configuration window is closed, is there another notification sent to the plugin to update the local values? If not, the plugin should avoid storing them locally and obtain fresh values for each of the callbacks. What is the recommended approach here?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It would appear that purple_plugin_pref_set_format_type is in fact not exported to perl, that is trivial to fix though so I'll try to do that when I get home tonight. Feel free to file a ticket about it and assign it to me (if you can do that) and I'll take care of it.
I believe, but you will want to check this yourself, that the preference changes made to a PluginPref dialog are instantaneous, that is as soon as the user makes the change any further call to purple_prefs_get_* will get the new value. So there is not a notification of closure nor anything else, you should always get a pref value fresh each time you intend to use it, you never know who might have changed it or when.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I didn't know the right place to open the ticket, so I created under patch tracker and probably didn't get noticed by you. I just opened it here, but not sure how to assign it to you. Could you please take care of it?
Can the perl plugins be made configurable the same way the regular plugins are? Is there a common framework for plugin configurability or each plugin is on its own? I appreciate any pointers. Thanks.
Yes, they are, in exactly the same ways as normal plugins. There are example perl scripts in the source (but not in the tarball because they haven't been checked to still work, so you will need to grab them from viewmtn) which do this.
Thanks, I see a plugin_pref.pl under trunk. As you said it is still using the Gaim API. I will give it a try while replacing Gaim:: with Purple::.
"trunk" are you looking at svn? If so you shouldn't be, we haven't used svn in a long time. We use monotone now.
Yes, I was looking at SVN. I now downloaded the source tarball, but it has only 3 sample plugins and none of them have a sample for prefs usage. Is there another location for a more up to date source?
viewmtn on the website has a couple more, but they aren't guaranteed to be fully up to date and as such don't ship in the tarball. I need to get around to finishing updating them.
I looked under:
http://developer.pidgin.im/viewmtn/revision/browse/1c5a391126b5b506a29f0b9e34160d239cb783c6/libpurple/plugins
but didn't find any additional files. Could you point me to the location? I would also appreciate if you can update us here when you update the plugins to work with pidgin.
That's because you didn't descend far enough, continue down into perl/scripts and you will find them.
I am finally getting to try these and got some success. Couple of questions:
- I noticed purple_plugin_pref_set_format_type() C API so tried to use it from the perl plugin, but the pidgin version 2.0.x that I had was crashing (silently exiting) as soon as I open plugin configuration dialog. I upgraded to the new 2.2.1 version and now it doesn't crash anymore, but the dialog doesn't still open. What I noticed is that the corresponding perl API, which should have been Purple::PluginPref::set_format_type is not even listed. Is this the reason why it is not working? I am just trying to set the format type to select a multiline field. The enums for the format types are defined though, one for each in PurpleStringFormatType, e.g., Purple::String::Format::Type::MULTILINE.
- when the configuration window is closed, is there another notification sent to the plugin to update the local values? If not, the plugin should avoid storing them locally and obtain fresh values for each of the callbacks. What is the recommended approach here?
It would appear that purple_plugin_pref_set_format_type is in fact not exported to perl, that is trivial to fix though so I'll try to do that when I get home tonight. Feel free to file a ticket about it and assign it to me (if you can do that) and I'll take care of it.
I believe, but you will want to check this yourself, that the preference changes made to a PluginPref dialog are instantaneous, that is as soon as the user makes the change any further call to purple_prefs_get_* will get the new value. So there is not a notification of closure nor anything else, you should always get a pref value fresh each time you intend to use it, you never know who might have changed it or when.
Etan,
I didn't know the right place to open the ticket, so I created under patch tracker and probably didn't get noticed by you. I just opened it here, but not sure how to assign it to you. Could you please take care of it?
http://developer.pidgin.im/ticket/3781
Thanks,
Hari