diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-07-21 00:00:29 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-07-21 00:00:29 +0800 |
commit | 5dad2a9d035f4d6d31e5b4630946935ac3916d87 (patch) | |
tree | 9a8b6397d1c3521e4125358f97d198c5216e53cb /shell | |
parent | e4f6918a98bbd339e90b7a0fc5d5a54f903e8fa4 (diff) | |
download | gsoc2013-evolution-5dad2a9d035f4d6d31e5b4630946935ac3916d87.tar gsoc2013-evolution-5dad2a9d035f4d6d31e5b4630946935ac3916d87.tar.gz gsoc2013-evolution-5dad2a9d035f4d6d31e5b4630946935ac3916d87.tar.bz2 gsoc2013-evolution-5dad2a9d035f4d6d31e5b4630946935ac3916d87.tar.lz gsoc2013-evolution-5dad2a9d035f4d6d31e5b4630946935ac3916d87.tar.xz gsoc2013-evolution-5dad2a9d035f4d6d31e5b4630946935ac3916d87.tar.zst gsoc2013-evolution-5dad2a9d035f4d6d31e5b4630946935ac3916d87.zip |
Add interfaces to populate a folder's context menu. (Untested.)
svn path=/trunk/; revision=4240
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 16 | ||||
-rw-r--r-- | shell/Evolution-ShellComponent.idl | 4 | ||||
-rw-r--r-- | shell/evolution-shell-component.c | 68 | ||||
-rw-r--r-- | shell/evolution-shell-component.h | 33 |
4 files changed, 90 insertions, 31 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 2d78fd8f5a..1af4a5002f 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,21 @@ 2000-07-20 Ettore Perazzoli <ettore@helixcode.com> + * evolution-shell-component.c: New member + `populate_folder_context_menu' in + `EvolutionShellComponentPrivate'. + (impl_ShellComponent_populate_folder_context_menu): New, + implementation for + `Evolution::ShellComponent::populate_folder_context_menu'. + (corba_class_init): Install it. + (evolution_shell_component_new): New arg + @populate_folder_context_menu. + (evolution_shell_component_construct): Likewise. + + * Evolution-ShellComponent.idl: New method + `::populate_folder_context_menu'. + +2000-07-20 Ettore Perazzoli <ettore@helixcode.com> + * e-shell-view.c (e_shell_view_save_settings): Save the paned positions. (e_shell_view_load_settings): Restore them. diff --git a/shell/Evolution-ShellComponent.idl b/shell/Evolution-ShellComponent.idl index 7c95489889..90b72fea26 100644 --- a/shell/Evolution-ShellComponent.idl +++ b/shell/Evolution-ShellComponent.idl @@ -54,6 +54,10 @@ module Evolution { void async_remove_folder (in ShellComponentListener listener, in string physical_uri) raises (Busy); + + void populate_folder_context_menu (in Bonobo::UIHandler uih, + in string physical_uri, + in string type); }; interface ShellComponentListener { diff --git a/shell/evolution-shell-component.c b/shell/evolution-shell-component.c index 4069086c85..c3560b2776 100644 --- a/shell/evolution-shell-component.c +++ b/shell/evolution-shell-component.c @@ -40,9 +40,10 @@ static BonoboObjectClass *parent_class = NULL; struct _EvolutionShellComponentPrivate { GList *folder_types; /* EvolutionShellComponentFolderType */ - EvolutionShellComponentCreateViewFn create_view_fn; - EvolutionShellComponentCreateFolderFn create_folder_fn; - EvolutionShellComponentRemoveFolderFn remove_folder_fn; + EvolutionShellComponentCreateViewFn create_view_fn; + EvolutionShellComponentCreateFolderFn create_folder_fn; + EvolutionShellComponentRemoveFolderFn remove_folder_fn; + EvolutionShellComponentPopulateFolderContextMenu populate_folder_context_menu_fn; EvolutionShellClient *owner_client; @@ -263,6 +264,30 @@ impl_ShellComponent_async_remove_folder (PortableServer_Servant servant, (* priv->remove_folder_fn) (shell_component, physical_uri, listener, priv->closure); } +static void +impl_ShellComponent_populate_folder_context_menu (PortableServer_Servant servant, + const Bonobo_UIHandler corba_uih, + const CORBA_char *physical_uri, + const CORBA_char *type, + CORBA_Environment *ev) +{ + BonoboObject *bonobo_object; + EvolutionShellComponent *shell_component; + EvolutionShellComponentPrivate *priv; + BonoboUIHandler *uih; + + bonobo_object = bonobo_object_from_servant (servant); + shell_component = EVOLUTION_SHELL_COMPONENT (bonobo_object); + priv = shell_component->priv; + + uih = bonobo_ui_handler_new (); + bonobo_ui_handler_set_container (uih, corba_uih); + + (* priv->populate_folder_context_menu_fn) (shell_component, uih, physical_uri, type, priv->closure); + + bonobo_object_unref (BONOBO_OBJECT (uih)); +} + /* GtkObject methods. */ @@ -315,12 +340,13 @@ corba_class_init (void) base_epv->default_POA = NULL; epv = g_new0 (POA_Evolution_ShellComponent__epv, 1); - epv->_get_supported_types = impl_ShellComponent__get_supported_types; - epv->set_owner = impl_ShellComponent_set_owner; - epv->unset_owner = impl_ShellComponent_unset_owner; - epv->create_view = impl_ShellComponent_create_view; - epv->async_create_folder = impl_ShellComponent_async_create_folder; - epv->async_remove_folder = impl_ShellComponent_async_remove_folder; + epv->_get_supported_types = impl_ShellComponent__get_supported_types; + epv->set_owner = impl_ShellComponent_set_owner; + epv->unset_owner = impl_ShellComponent_unset_owner; + epv->create_view = impl_ShellComponent_create_view; + epv->async_create_folder = impl_ShellComponent_async_create_folder; + epv->async_remove_folder = impl_ShellComponent_async_remove_folder; + epv->populate_folder_context_menu = impl_ShellComponent_populate_folder_context_menu; vepv = &ShellComponent_vepv; vepv->_base_epv = base_epv; @@ -367,12 +393,14 @@ init (EvolutionShellComponent *shell_component) priv = g_new (EvolutionShellComponentPrivate, 1); - priv->folder_types = NULL; - priv->create_view_fn = NULL; - priv->create_folder_fn = NULL; - priv->remove_folder_fn = NULL; - priv->owner_client = NULL; - priv->closure = NULL; + priv->folder_types = NULL; + priv->create_view_fn = NULL; + priv->create_folder_fn = NULL; + priv->remove_folder_fn = NULL; + priv->populate_folder_context_menu_fn = NULL; + + priv->owner_client = NULL; + priv->closure = NULL; shell_component->priv = priv; } @@ -385,6 +413,7 @@ evolution_shell_component_construct (EvolutionShellComponent *shell_component, EvolutionShellComponentCreateViewFn create_view_fn, EvolutionShellComponentCreateFolderFn create_folder_fn, EvolutionShellComponentRemoveFolderFn remove_folder_fn, + EvolutionShellComponentPopulateFolderContextMenu populate_folder_context_menu_fn, void *closure) { EvolutionShellComponentPrivate *priv; @@ -397,9 +426,10 @@ evolution_shell_component_construct (EvolutionShellComponent *shell_component, priv = shell_component->priv; - priv->create_view_fn = create_view_fn; - priv->create_folder_fn = create_folder_fn; - priv->remove_folder_fn = remove_folder_fn; + priv->create_view_fn = create_view_fn; + priv->create_folder_fn = create_folder_fn; + priv->remove_folder_fn = remove_folder_fn; + priv->populate_folder_context_menu_fn = populate_folder_context_menu_fn; priv->closure = closure; @@ -427,6 +457,7 @@ evolution_shell_component_new (const EvolutionShellComponentFolderType folder_ty EvolutionShellComponentCreateViewFn create_view_fn, EvolutionShellComponentCreateFolderFn create_folder_fn, EvolutionShellComponentRemoveFolderFn remove_folder_fn, + EvolutionShellComponentPopulateFolderContextMenu populate_folder_context_menu_fn, void *closure) { EvolutionShellComponent *new; @@ -442,6 +473,7 @@ evolution_shell_component_new (const EvolutionShellComponentFolderType folder_ty corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (new), servant); evolution_shell_component_construct (new, folder_types, corba_object, create_view_fn, create_folder_fn, remove_folder_fn, + populate_folder_context_menu_fn, closure); return new; diff --git a/shell/evolution-shell-component.h b/shell/evolution-shell-component.h index c91d4bec97..095177b56d 100644 --- a/shell/evolution-shell-component.h +++ b/shell/evolution-shell-component.h @@ -87,6 +87,11 @@ typedef void (* EvolutionShellComponentRemoveFolderFn) (EvolutionShellComponent const char *physical_uri, const Evolution_ShellComponentListener listener, void *closure); +typedef void (* EvolutionShellComponentPopulateFolderContextMenu) (EvolutionShellComponent *shell_component, + BonoboUIHandler *uih, + const char *physical_uri, + const char *type, + void *closure); struct _EvolutionShellComponentFolderType { char *name; @@ -112,19 +117,21 @@ struct _EvolutionShellComponentClass { GtkType evolution_shell_component_get_type (void); -void evolution_shell_component_construct (EvolutionShellComponent *shell_component, - const EvolutionShellComponentFolderType folder_types[], - Evolution_ShellComponent corba_object, - EvolutionShellComponentCreateViewFn create_view_fn, - EvolutionShellComponentCreateFolderFn create_folder_fn, - EvolutionShellComponentRemoveFolderFn remove_folder_fn, - void *closure); -EvolutionShellComponent *evolution_shell_component_new (const EvolutionShellComponentFolderType folder_types[], - EvolutionShellComponentCreateViewFn create_view_fn, - EvolutionShellComponentCreateFolderFn create_folder_fn, - EvolutionShellComponentRemoveFolderFn remove_folder_fn, - void *closure); -EvolutionShellClient *evolution_shell_component_get_owner (EvolutionShellComponent *shell_component); +void evolution_shell_component_construct (EvolutionShellComponent *shell_component, + const EvolutionShellComponentFolderType folder_types[], + Evolution_ShellComponent corba_object, + EvolutionShellComponentCreateViewFn create_view_fn, + EvolutionShellComponentCreateFolderFn create_folder_fn, + EvolutionShellComponentRemoveFolderFn remove_folder_fn, + EvolutionShellComponentPopulateFolderContextMenu populate_folder_context_menu_fn, + void *closure); +EvolutionShellComponent *evolution_shell_component_new (const EvolutionShellComponentFolderType folder_types[], + EvolutionShellComponentCreateViewFn create_view_fn, + EvolutionShellComponentCreateFolderFn create_folder_fn, + EvolutionShellComponentRemoveFolderFn remove_folder_fn, + EvolutionShellComponentPopulateFolderContextMenu populate_folder_context_menu_fn, + void *closure); +EvolutionShellClient *evolution_shell_component_get_owner (EvolutionShellComponent *shell_component); #ifdef cplusplus } |