aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-02 03:51:00 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-02 03:51:00 +0800
commitfddcc93ac6158fc2ac3ede1c0020ff97e7bd561d (patch)
tree460add5d737597e2d61ec3ea53cd0b87fb733fca
parenta30e1451bd268321533adf68715f7515e0ba880b (diff)
downloadgsoc2013-evolution-fddcc93ac6158fc2ac3ede1c0020ff97e7bd561d.tar.gz
gsoc2013-evolution-fddcc93ac6158fc2ac3ede1c0020ff97e7bd561d.tar.zst
gsoc2013-evolution-fddcc93ac6158fc2ac3ede1c0020ff97e7bd561d.zip
Cleanup up templates using EPluginUI callback feature.
-rw-r--r--plugins/templates/org-gnome-templates.eplug.xml6
-rw-r--r--plugins/templates/templates.c37
2 files changed, 14 insertions, 29 deletions
diff --git a/plugins/templates/org-gnome-templates.eplug.xml b/plugins/templates/org-gnome-templates.eplug.xml
index b4b8a81039..7c19a6ea23 100644
--- a/plugins/templates/org-gnome-templates.eplug.xml
+++ b/plugins/templates/org-gnome-templates.eplug.xml
@@ -10,8 +10,10 @@
<author name="Diego Escalante Urrelo" email="diegoe@gnome.org"/>
<hook class="org.gnome.evolution.ui:1.0">
- <ui-manager id="org.gnome.evolution.shell"/>
- <ui-manager id="org.gnome.evolution.composer">
+ <ui-manager id="org.gnome.evolution.shell"
+ callback="init_shell_actions"/>
+ <ui-manager id="org.gnome.evolution.composer"
+ callback="init_composer_actions">
<menubar name='main-menu'>
<placeholder name='pre-edit-menu'>
<menu action='file-menu'>
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index fa693dc074..f6832695d7 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -68,10 +68,14 @@ enum {
CLUE_N_COLUMNS
};
-GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl);
-
-gboolean e_plugin_ui_init (GtkUIManager *ui_manager, GObject *object);
-gint e_plugin_lib_enable (EPlugin *plugin, gboolean enabled);
+GtkWidget * e_plugin_lib_get_configure_widget
+ (EPlugin *plugin);
+gboolean init_composer_actions (GtkUIManager *ui_manager,
+ EMsgComposer *composer);
+gboolean init_shell_actions (GtkUIManager *ui_manager,
+ EShellWindow *shell_window);
+gint e_plugin_lib_enable (EPlugin *plugin,
+ gboolean enabled);
/* Thanks to attachment reminder plugin for this*/
static void commit_changes (UIData *ui);
@@ -764,7 +768,7 @@ exit:
em_utils_uids_free (uids);
}
-static gboolean
+gboolean
init_composer_actions (GtkUIManager *ui_manager,
EMsgComposer *composer)
{
@@ -780,7 +784,7 @@ init_composer_actions (GtkUIManager *ui_manager,
return TRUE;
}
-static gboolean
+gboolean
init_shell_actions (GtkUIManager *ui_manager,
EShellWindow *shell_window)
{
@@ -807,27 +811,6 @@ init_shell_actions (GtkUIManager *ui_manager,
return TRUE;
}
-gboolean
-e_plugin_ui_init (GtkUIManager *ui_manager,
- GObject *object)
-{
- /* XXX This is a scenario I hadn't considered when designing
- * EPluginUI: two different UI manager IDs with different
- * closures sharing the same plugin entry point. We know
- * the closures are both GObjects so we query the type.
- * Awkward, but it should work for now. */
-
- if (E_IS_MSG_COMPOSER (object))
- return init_composer_actions (
- ui_manager, E_MSG_COMPOSER (object));
-
- if (E_IS_SHELL_WINDOW (object))
- return init_shell_actions (
- ui_manager, E_SHELL_WINDOW (object));
-
- return FALSE;
-}
-
gint
e_plugin_lib_enable (EPlugin *plugin,
gboolean enabled)