aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog11
-rw-r--r--e-util/e-plugin.c58
-rw-r--r--e-util/e-plugin.h8
3 files changed, 38 insertions, 39 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 0c5834debc..06a841a3d7 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,14 @@
+2007-12-04 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #500210
+
+ * e-plugin.h:
+ * e-plugin.c: (e_plugin_configure), (e_plugin_is_configurable),
+ (epl_configure), (e_plugin_get_configure_widget),
+ (epl_get_configure_widget): Removed old configure functions,
+ replaced by get_configure_widget functions, to be able show
+ plugin configuration in a tab of plugin manager.
+
2007-12-03 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #392747
diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c
index 054298a942..0a87513adf 100644
--- a/e-util/e-plugin.c
+++ b/e-util/e-plugin.c
@@ -685,18 +685,20 @@ e_plugin_enable(EPlugin *ep, int state)
}
/**
-* e_plugin_configure:
-* @ep:
-*
-*
-**/
-
-void
-e_plugin_configure (EPlugin *ep)
+ * e_plugin_get_configure_widget
+ *
+ * @param ep EPlugin of our interest.
+ * @return Configure widget or NULL if there is no configure option for the plugin.
+ *
+ * Plugin itself should have implemented "e_plugin_lib_get_configure_widget" function
+ * of prototype EPluginLibGetConfigureWidgetFunc.
+ **/
+GtkWidget *
+e_plugin_get_configure_widget (EPlugin *ep)
{
EPluginClass *ptr;
ptr = ((EPluginClass *)G_OBJECT_GET_CLASS(ep));
- ptr->configure (ep);
+ return ptr->get_configure_widget (ep);
}
/**
@@ -929,37 +931,23 @@ epl_construct(EPlugin *ep, xmlNodePtr root)
return 0;
}
-gboolean
-e_plugin_is_configurable (EPlugin *ep)
+static GtkWidget *
+epl_get_configure_widget (EPlugin *ep)
{
- EPluginLibConfigureFunc configure;
-
- pd(printf ("\n epl_configure \n"));
+ EPluginLibGetConfigureWidgetFunc get_configure_widget;
- if (epl_loadmodule(ep) != 0) {
- pd(printf ("\n epl_loadmodule \n"));
- return FALSE;
- }
+ pd (printf ("\n epl_get_configure_widget \n"));
- if (g_module_symbol(epl->module, "e_plugin_lib_configure", (void *)&configure)) {
- pd(printf ("\n g_module_symbol is loaded\n"));
- return TRUE;
+ if (epl_loadmodule (ep) != 0) {
+ pd (printf ("\n epl_loadmodule \n"));
+ return NULL;
}
- return FALSE;
-}
-
-static void
-epl_configure (EPlugin *ep)
-{
- EPluginLibConfigureFunc configure;
-
- pd(printf ("\n epl_configure \n"));
- /* Probably we dont need a load_module */
- if (g_module_symbol(epl->module, "e_plugin_lib_configure", (void *)&configure)) {
- pd(printf ("\n g_module_symbol is loaded\n"));
- configure (epl);
+ if (g_module_symbol (epl->module, "e_plugin_lib_get_configure_widget", (void *)&get_configure_widget)) {
+ pd (printf ("\n g_module_symbol is loaded\n"));
+ return (GtkWidget*) get_configure_widget (epl);
}
+ return NULL;
}
static void
@@ -1009,7 +997,7 @@ epl_class_init(EPluginClass *klass)
klass->construct = epl_construct;
klass->invoke = epl_invoke;
klass->enable = epl_enable;
- klass->configure = epl_configure;
+ klass->get_configure_widget = epl_get_configure_widget;
klass->type = "shlib";
}
diff --git a/e-util/e-plugin.h b/e-util/e-plugin.h
index 1d628dacd4..07795d0ca8 100644
--- a/e-util/e-plugin.h
+++ b/e-util/e-plugin.h
@@ -5,6 +5,7 @@
#include <glib.h>
#include <glib-object.h>
#include <libxml/tree.h>
+#include <gtk/gtkwidget.h>
/* ********************************************************************** */
@@ -85,7 +86,7 @@ struct _EPluginClass {
int (*construct)(EPlugin *, xmlNodePtr root);
void *(*invoke)(EPlugin *, const char *name, void *data);
void (*enable)(EPlugin *, int state);
- void (*configure)(EPlugin *);
+ GtkWidget *(*get_configure_widget)(EPlugin *);
};
GType e_plugin_get_type(void);
@@ -99,9 +100,8 @@ void e_plugin_register_type(GType type);
void *e_plugin_invoke(EPlugin *ep, const char *name, void *data);
void e_plugin_enable(EPlugin *eph, int state);
-void e_plugin_configure (EPlugin *eph);
-gboolean e_plugin_is_configurable (EPlugin *ep);
+GtkWidget *e_plugin_get_configure_widget (EPlugin *ep);
/* static helpers */
/* maps prop or content to 'g memory' */
@@ -123,7 +123,7 @@ typedef void *(*EPluginLibFunc)(EPluginLib *ep, void *data);
* initialised. In the future it may also be called when the plugin
* is disabled. */
typedef int (*EPluginLibEnableFunc)(EPluginLib *ep, int enable);
-typedef int (*EPluginLibConfigureFunc)(EPluginLib *ep);
+typedef void *(*EPluginLibGetConfigureWidgetFunc)(EPluginLib *ep);
/**
* struct _EPluginLib -