diff options
author | Not Zed <NotZed@Ximian.com> | 2005-05-13 19:08:46 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2005-05-13 19:08:46 +0800 |
commit | b28bcfc9e5c9febb0f4c6702e3a0426bd5e087c6 (patch) | |
tree | 0c119ed2c3fb2e7306164b61fa5643a45d643421 /e-util/e-popup.c | |
parent | 51490d54078a67793ab48584a4f672d0ae3d3bd4 (diff) | |
download | gsoc2013-evolution-b28bcfc9e5c9febb0f4c6702e3a0426bd5e087c6.tar gsoc2013-evolution-b28bcfc9e5c9febb0f4c6702e3a0426bd5e087c6.tar.gz gsoc2013-evolution-b28bcfc9e5c9febb0f4c6702e3a0426bd5e087c6.tar.bz2 gsoc2013-evolution-b28bcfc9e5c9febb0f4c6702e3a0426bd5e087c6.tar.lz gsoc2013-evolution-b28bcfc9e5c9febb0f4c6702e3a0426bd5e087c6.tar.xz gsoc2013-evolution-b28bcfc9e5c9febb0f4c6702e3a0426bd5e087c6.tar.zst gsoc2013-evolution-b28bcfc9e5c9febb0f4c6702e3a0426bd5e087c6.zip |
if we have a factory method supplied, call that as well. More flexible
2005-05-13 Not Zed <NotZed@Ximian.com>
* e-popup.c (emph_popup_factory): if we have a factory method
supplied, call that as well. More flexible popup building.
(emph_construct_menu): load factory def.
svn path=/trunk/; revision=29352
Diffstat (limited to 'e-util/e-popup.c')
-rw-r--r-- | e-util/e-popup.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/e-util/e-popup.c b/e-util/e-popup.c index cb505e0cb2..d812e01d31 100644 --- a/e-util/e-popup.c +++ b/e-util/e-popup.c @@ -685,7 +685,7 @@ e_popup_target_free(EPopup *ep, void *o) description="IMAP4 and IMAP4v1 mail store"> <hook class="org.gnome.mail.popupMenu:1.0" handler="HandlePopup"> - <menu id="any" target="select"> + <menu id="any" target="select" factory="funcspec"?> <item type="item|toggle|radio|image|submenu|bar" active @@ -693,7 +693,7 @@ e_popup_target_free(EPopup *ep, void *o) label="label" icon="foo" visible="select_one" - activate="ep_view_emacs"/> + activate="ep_view_emacs"/> * </menu> </extension> @@ -735,6 +735,9 @@ emph_popup_factory(EPopup *emp, void *data) if (menu->items) e_popup_add_items(emp, menu->items, menu->hook->hook.plugin->domain, NULL, menu->hook); + + if (menu->factory) + e_plugin_invoke(menu->hook->hook.plugin, menu->factory, emp->target); } static void @@ -753,6 +756,7 @@ emph_free_menu(struct _EPopupHookMenu *menu) g_slist_foreach(menu->items, (GFunc)emph_free_item, NULL); g_slist_free(menu->items); + g_free(menu->factory); g_free(menu->id); g_free(menu); } @@ -817,6 +821,9 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) ((EPluginHookClass *)G_OBJECT_GET_CLASS(eph))->id); goto error; } + + menu->factory = e_plugin_xml_prop(root, "factory"); + node = root->children; while (node) { if (0 == strcmp(node->name, "item")) { |