diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-08-05 12:33:57 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-08-05 12:33:57 +0800 |
commit | bd2f1603e5eb577e9b57ecf02701e5bfbfebb9b0 (patch) | |
tree | 6fbd2491f8b7814f1e280d2727e0ec130079e83f /shell/evolution-shell-client.c | |
parent | 90b888b8af55c61c3af7d8356c4314aed2913a90 (diff) | |
download | gsoc2013-evolution-bd2f1603e5eb577e9b57ecf02701e5bfbfebb9b0.tar.gz gsoc2013-evolution-bd2f1603e5eb577e9b57ecf02701e5bfbfebb9b0.tar.zst gsoc2013-evolution-bd2f1603e5eb577e9b57ecf02701e5bfbfebb9b0.zip |
Add some padding to the label so that the title doesn't move around when
* e-shell-folder-title-bar.c (e_shell_folder_title_bar_construct):
Add some padding to the label so that the title doesn't move
around when you switch between pop-up and non-pop-up folder bar.
Also, change all the GtkLabels to be GtkClippedLabels instead.
(e_shell_folder_title_bar_set_title): Updated to use
EClippedLabels instead of GtkLabels.
(e_shell_folder_title_bar_set_folder_bar_label): Likewise.
* e-shell.c (impl_Shell__get_displayName): New, implementation for
the `displayName' attribute.
* Evolution-Shell.idl: Added readonly attribute `displayName' to
get the canonicalized X11 display name for the shell.
* e-shell.c (e_shell_construct): Ooops. Return
`E_SHELL_CONSTRUCT_RESULT_CANNOTREGISTER' if the OAF registration
fails, not `E_SHELL_CONSTRUCT_RESULT_GENERICERROR'.
* e-shortcuts-view.c (rename_group_cb): Get the toplevel from the
shortcuts view, not the widget.
(rename_shortcut_cb): Likewise.
(show_new_group_dialog): Changed to use `e_request_string()'.
* evolution-test-component.c: Add the %FALSE value for the
`user_creatable' field in the `folder_types' entry.
* evolution-shell-client.c: New member `shortcuts_interface' in
`EvolutionShellClientPrivate'.
(destroy): Unref it if not CORBA_OBJECT_NIL.
(init): Init to CORBA_OBJECT_NIL.
(query_shell_interface): New helper function to query an interface
on the shell and spit out warnings if it fails.
(evolution_shell_client_construct): Use it to query the ::Activity
interface. Also query the ::Shortcuts interface and set the
`shortcuts_interface' member to point to it.
* e-shell.c: New member `corba_shortcuts' in `EShellPrivate'.
(init): Init to NULL.
(setup_shortcuts_interface): Helper function to add the
::Shortcuts CORBA interface to the shell.
(e_shell_construct): Call it.
* e-corba-shortcuts.c, e-corba-shortcuts.h: New objects
implementing the `Evolution::Shortcuts' CORBA interface.
* Evolution-Shortcuts.idl: New interface for accessing the
shortcuts in the shell.
* e-shell.c (e_shell_get_config_db): Moved down.
svn path=/trunk/; revision=11689
Diffstat (limited to 'shell/evolution-shell-client.c')
-rw-r--r-- | shell/evolution-shell-client.c | 80 |
1 files changed, 65 insertions, 15 deletions
diff --git a/shell/evolution-shell-client.c b/shell/evolution-shell-client.c index ff737de4c5..f3aaf036d7 100644 --- a/shell/evolution-shell-client.c +++ b/shell/evolution-shell-client.c @@ -36,6 +36,7 @@ struct _EvolutionShellClientPrivate { GNOME_Evolution_Activity activity_interface; + GNOME_Evolution_Shortcuts shortcuts_interface; }; #define PARENT_TYPE bonobo_object_client_get_type () @@ -56,6 +57,38 @@ struct _FolderSelectionListenerServant { }; typedef struct _FolderSelectionListenerServant FolderSelectionListenerServant; + +/* Helper functions. */ + +static CORBA_Object +query_shell_interface (EvolutionShellClient *shell_client, + const char *interface_name) +{ + CORBA_Environment ev; + CORBA_Object interface_object; + EvolutionShellClientPrivate *priv; + + priv = shell_client->priv; + + CORBA_exception_init (&ev); + + interface_object = Bonobo_Unknown_queryInterface (bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)), + interface_name, &ev); + + if (ev._major != CORBA_NO_EXCEPTION) { + g_warning ("EvolutionShellClient: Error querying interface %s on %p -- %s", + interface_name, shell_client, ev._repo_id); + interface_object = CORBA_OBJECT_NIL; + } else if (CORBA_Object_is_nil (interface_object, &ev)) { + g_warning ("No interface %s for ShellClient %p", interface_name, shell_client); + } + + CORBA_exception_free (&ev); + + return interface_object; +} + + static void impl_FolderSelectionListener_selected (PortableServer_Servant servant, const CORBA_char *uri, @@ -238,6 +271,15 @@ destroy (GtkObject *object) CORBA_Object_release (priv->activity_interface, &ev); } + if (priv->shortcuts_interface != CORBA_OBJECT_NIL) { + Bonobo_Unknown_unref (priv->shortcuts_interface, &ev); + if (ev._major != CORBA_NO_EXCEPTION) + g_warning ("EvolutionShellClient::destroy: " + "Error unreffing the ::Shortcuts interface -- %s\n", + ev._repo_id); + CORBA_Object_release (priv->shortcuts_interface, &ev); + } + CORBA_exception_free (&ev); g_free (priv); @@ -264,7 +306,8 @@ init (EvolutionShellClient *shell_client) EvolutionShellClientPrivate *priv; priv = g_new (EvolutionShellClientPrivate, 1); - priv->activity_interface = CORBA_OBJECT_NIL; + priv->activity_interface = CORBA_OBJECT_NIL; + priv->shortcuts_interface = CORBA_OBJECT_NIL; shell_client->priv = priv; } @@ -281,7 +324,6 @@ void evolution_shell_client_construct (EvolutionShellClient *shell_client, GNOME_Evolution_Shell corba_shell) { - CORBA_Environment ev; EvolutionShellClientPrivate *priv; g_return_if_fail (shell_client != NULL); @@ -290,22 +332,11 @@ evolution_shell_client_construct (EvolutionShellClient *shell_client, bonobo_object_construct (BONOBO_OBJECT (shell_client), (CORBA_Object) corba_shell); - CORBA_exception_init (&ev); - priv = shell_client->priv; g_return_if_fail (priv->activity_interface == CORBA_OBJECT_NIL); - priv->activity_interface = Bonobo_Unknown_queryInterface (bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)), - "IDL:GNOME/Evolution/Activity:1.0", - &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("EvolutionShellClient: Error querying interface ::Activity -- %s", ev._repo_id); - priv->activity_interface = CORBA_OBJECT_NIL; - } else if (CORBA_Object_is_nil (priv->activity_interface, &ev)) { - g_warning ("No ::Activity interface for ShellClient %p", shell_client); - } - - CORBA_exception_free (&ev); + priv->activity_interface = query_shell_interface (shell_client, "IDL:GNOME/Evolution/Activity:1.0"); + priv->shortcuts_interface = query_shell_interface (shell_client, "IDL:GNOME/Evolution/Shortcuts:1.0"); } /** @@ -384,6 +415,25 @@ evolution_shell_client_get_activity_interface (EvolutionShellClient *shell_clien return shell_client->priv->activity_interface; } +/** + * evolution_shell_client_get_activity_interface: + * @shell_client: An EvolutionShellClient object + * + * Get the GNOME::Evolution::Shortcuts for the shell associated to + * @shell_client. + * + * Return value: A CORBA Object represeting the GNOME::Evolution::Shortcuts + * interface. + **/ +GNOME_Evolution_Shortcuts +evolution_shell_client_get_shortcuts_interface (EvolutionShellClient *shell_client) +{ + g_return_val_if_fail (shell_client != NULL, CORBA_OBJECT_NIL); + g_return_val_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client), CORBA_OBJECT_NIL); + + return shell_client->priv->shortcuts_interface; +} + /** * evolution_shell_client_get_local_storage: |