diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2008-05-09 02:11:40 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-05-09 02:11:40 +0800 |
commit | 116ed5dcc7bc07fc9a2e78aef4231bfe25fa9d0a (patch) | |
tree | 49a7516e812c322167681a65bfdca0285b336733 /plugins/face/face.c | |
parent | 3986fb032adb5b40ae86624f209524b3273d0148 (diff) | |
download | gsoc2013-evolution-116ed5dcc7bc07fc9a2e78aef4231bfe25fa9d0a.tar gsoc2013-evolution-116ed5dcc7bc07fc9a2e78aef4231bfe25fa9d0a.tar.gz gsoc2013-evolution-116ed5dcc7bc07fc9a2e78aef4231bfe25fa9d0a.tar.bz2 gsoc2013-evolution-116ed5dcc7bc07fc9a2e78aef4231bfe25fa9d0a.tar.lz gsoc2013-evolution-116ed5dcc7bc07fc9a2e78aef4231bfe25fa9d0a.tar.xz gsoc2013-evolution-116ed5dcc7bc07fc9a2e78aef4231bfe25fa9d0a.tar.zst gsoc2013-evolution-116ed5dcc7bc07fc9a2e78aef4231bfe25fa9d0a.zip |
** Fixes bug #525241 (EPluginUI)
2008-05-08 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #525241 (EPluginUI)
* e-util/Makefile.am:
Add e-plugin-ui.[ch].
* e-util/e-plugin.h (EPluginClass):
Add a "get_symbol" method for extracting arbitrary symbols
from an EPlugin. Implementation of the method is optional.
* e-util/e-plugin.c (e_plugin_get_symbol):
New function invokes the new "get_symbol" EPlugin method.
* e-util/e-plugin.c (epl_get_symbol):
New function implements the new "get_symbol" EPlugin method.
It extracts the given symbol name from the GModule.
* e-util/e-plugin-ui.[ch]:
New EPluginHook subclass that allows plugins to extend menus,
toolbars, and popups that are managed by GtkUIManager instead
of BonoboUI. Should eventually replace EMenu/EPopup.
* shell/main.c (main): Register the EPluginUIHook type.
* composer/e-msg-composer.c (msg_composer_destroy),
(msg_composer_init): Rip out the EMenu logic.
* composer/e-msg-composer.c (msg_composer_init):
Register the GtkUIManager with EPluginUI.
* plugins/face/Makefile.am:
* plugins/face/org-gnome-face-ui.xml:
Remove org-gnome-face-ui.xml (obsolete).
* plugins/face/face.c (e_plugin_ui_init):
Initialization callback for EPluginUI. Adds a "face" action to
the EMsgComposer instance's "composer" action group.
* plugins/face/org-gnome-face.eplug.xml:
Replace the "bonobomenu" hook definition with a new one for
EPluginUI. Include the UI definition inline.
svn path=/trunk/; revision=35485
Diffstat (limited to 'plugins/face/face.c')
-rw-r--r-- | plugins/face/face.c | 36 |
1 files changed, 31 insertions, 5 deletions
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; +} |