aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/face/ChangeLog16
-rw-r--r--plugins/face/Makefile.am4
-rw-r--r--plugins/face/face.c36
-rw-r--r--plugins/face/org-gnome-face-ui.xml12
-rw-r--r--plugins/face/org-gnome-face.eplug.xml32
5 files changed, 63 insertions, 37 deletions
diff --git a/plugins/face/ChangeLog b/plugins/face/ChangeLog
index 86a2af2140..c300752828 100644
--- a/plugins/face/ChangeLog
+++ b/plugins/face/ChangeLog
@@ -1,3 +1,19 @@
+2008-05-08 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fixes part of bug #525241 (EPluginUI)
+
+ * Makefile.am:
+ * org-gnome-face-ui.xml:
+ Remove org-gnome-face-ui.xml (obsolete).
+
+ * face.c (e_plugin_ui_init):
+ Initialization callback for EPluginUI. Adds a "face" action to
+ the EMsgComposer instance's "composer" action group.
+
+ * org-gnome-face.eplug.xml:
+ Replace the "bonobomenu" hook definition with a new one for
+ EPluginUI. Include the UI definition inline.
+
2008-03-11 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #513951
diff --git a/plugins/face/Makefile.am b/plugins/face/Makefile.am
index ec53eee1c2..8a44c94815 100644
--- a/plugins/face/Makefile.am
+++ b/plugins/face/Makefile.am
@@ -13,8 +13,7 @@ INCLUDES = -I. \
@EVO_PLUGIN_RULE@
plugin_DATA = \
- org-gnome-face.eplug \
- org-gnome-face-ui.xml
+ org-gnome-face.eplug
plugin_LTLIBRARIES = liborg-gnome-face.la
@@ -36,7 +35,6 @@ errordir = $(privdatadir)/errors
EXTRA_DIST = \
org-gnome-face.eplug.xml \
- org-gnome-face-ui.xml \
$(error_DATA)
BUILT_SOURCES = \
diff --git a/plugins/face/face.c b/plugins/face/face.c
index 45851bee18..f431bc50f4 100644
--- a/plugins/face/face.c
+++ b/plugins/face/face.c
@@ -33,16 +33,16 @@
#define d(x) x
-void org_gnome_composer_face (EPlugin * ep, EMMenuTargetWidget * target);
-int e_plugin_lib_configure (EPlugin * ep);
+gboolean e_plugin_ui_init (GtkUIManager *manager,
+ EMsgComposer *composer);
-void org_gnome_composer_face (EPlugin * ep, EMMenuTargetWidget * t)
+static void
+action_face_cb (GtkAction *action,
+ EMsgComposer *composer)
{
- EMsgComposer *composer;
gchar *filename, *file_contents;
GError *error = NULL;
- composer = (EMsgComposer *) t->target.widget;
filename = g_build_filename (e_get_user_data_dir (), "faces", NULL);
g_file_get_contents (filename, &file_contents, NULL, &error);
@@ -117,3 +117,29 @@ void org_gnome_composer_face (EPlugin * ep, EMMenuTargetWidget * t)
}
e_msg_composer_modify_header (composer, "Face", file_contents);
}
+
+static GtkActionEntry entries[] = {
+
+ { "face",
+ NULL,
+ N_("_Face"),
+ NULL,
+ NULL,
+ G_CALLBACK (action_face_cb) }
+};
+
+gboolean
+e_plugin_ui_init (GtkUIManager *manager,
+ EMsgComposer *composer)
+{
+ GtkhtmlEditor *editor;
+
+ editor = GTKHTML_EDITOR (composer);
+
+ /* Add actions to the "composer" action group. */
+ gtk_action_group_add_actions (
+ gtkhtml_editor_get_action_group (editor, "composer"),
+ entries, G_N_ELEMENTS (entries), composer);
+
+ return TRUE;
+}
diff --git a/plugins/face/org-gnome-face-ui.xml b/plugins/face/org-gnome-face-ui.xml
index 2bf2a75c65..e69de29bb2 100644
--- a/plugins/face/org-gnome-face-ui.xml
+++ b/plugins/face/org-gnome-face-ui.xml
@@ -1,12 +0,0 @@
-<Root>
- <commands>
- <cmd name="Face" _label="_Face"/>
- </commands>
- <menu>
- <submenu name="Insert">
- <placeholder name="Component">
- <menuitem name="Face" verb="" />
- </placeholder>
- </submenu>
- </menu>
-</Root>
diff --git a/plugins/face/org-gnome-face.eplug.xml b/plugins/face/org-gnome-face.eplug.xml
index cc56aac359..e84b93f809 100644
--- a/plugins/face/org-gnome-face.eplug.xml
+++ b/plugins/face/org-gnome-face.eplug.xml
@@ -1,22 +1,20 @@
<?xml version="1.0"?>
<e-plugin-list>
- <e-plugin id="org.gnome.evolution.face" type="shlib" _name="Face"
- location="@PLUGINDIR@/liborg-gnome-face@SOEXT@">
+ <e-plugin id="org.gnome.evolution.face" type="shlib" _name="Face" location="@PLUGINDIR@/liborg-gnome-face@SOEXT@">
- <author name="Sankar P" email="psankar@novell.com"/>
- <_description>Attach Face header to outgoing messages. First time the user needs to configure a 48*48 png image. It is base64 encoded and stored in ~/.evolution/faces This will be used in messages that are sent further.</_description>
+ <author name="Sankar P" email="psankar@novell.com"/>
+ <_description>Attach Face header to outgoing messages. First time the user needs to configure a 48*48 png image. It is base64 encoded and stored in ~/.evolution/faces This will be used in messages that are sent further.</_description>
- <hook class="org.gnome.evolution.mail.bonobomenu:1.0">
- <menu id="org.gnome.evolution.mail.composer" target="widget">
- <ui file="@PLUGINDIR@/org-gnome-face-ui.xml"/>
- <item
- type="item"
- verb="Face"
- path="/commands/Face"
- activate="org_gnome_composer_face"
- enable="one"
- />
- </menu>
- </hook>
- </e-plugin>
+ <hook class="org.gnome.evolution.ui:1.0">
+ <ui-manager id="org.gnome.evolution.composer">
+ <menubar name='main-menu'>
+ <menu action='insert-menu'>
+ <placeholder name="insert-menu-top">
+ <menuitem action="face"/>
+ </placeholder>
+ </menu>
+ </menubar>
+ </ui-manager>
+ </hook>
+ </e-plugin>
</e-plugin-list>