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/e-shell.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/e-shell.c')
-rw-r--r-- | shell/e-shell.c | 106 |
1 files changed, 80 insertions, 26 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c index fb128c6081..0d3043d302 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -32,6 +32,10 @@ #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> +/* (For the displayName stuff.) */ +#include <gdk/gdkprivate.h> +#include <X11/Xlib.h> + #include <bonobo/bonobo-exception.h> #include <bonobo/bonobo-moniker-util.h> @@ -42,6 +46,7 @@ #include "e-activity-handler.h" #include "e-component-registry.h" +#include "e-corba-shortcuts.h" #include "e-corba-storage-registry.h" #include "e-folder-type-registry.h" #include "e-local-storage.h" @@ -83,11 +88,15 @@ struct _EShellPrivate { EComponentRegistry *component_registry; + /* ::StorageRegistry interface handler. */ ECorbaStorageRegistry *corba_storage_registry; /* <aggregate> */ /* ::Activity interface handler. */ EActivityHandler *activity_handler; /* <aggregate> */ + /* ::Shortcuts interface handler. */ + ECorbaShortcuts *corba_shortcuts; /* <aggregate> */ + /* This object handles going off-line. If the pointer is not NULL, it means we have a going-off-line process in progress. */ EShellOfflineHandler *offline_handler; @@ -119,14 +128,6 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -Bonobo_ConfigDatabase -e_shell_get_config_db (EShell *shell) -{ - g_return_val_if_fail (shell != NULL, CORBA_OBJECT_NIL); - - return shell->priv->db; -} - /* Callback for the folder selection dialog. */ @@ -187,6 +188,23 @@ folder_selection_dialog_folder_selected_cb (EShellFolderSelectionDialog *folder_ /* CORBA interface implementation. */ +static CORBA_char * +impl_Shell__get_displayName (PortableServer_Servant servant, + CORBA_Environment *ev) +{ + char *display_string; + CORBA_char *retval; + + display_string = DisplayString (gdk_display); + if (display_string == NULL) + return CORBA_string_dup (""); + + retval = CORBA_string_dup (display_string); + XFree (display_string); + + return retval; +} + static GNOME_Evolution_ShellComponent impl_Shell_getComponentByType (PortableServer_Servant servant, const CORBA_char *type, @@ -405,12 +423,30 @@ setup_activity_interface (EShell *shell) activity_handler = e_activity_handler_new (); - bonobo_object_add_interface (BONOBO_OBJECT (shell), - BONOBO_OBJECT (activity_handler)); + bonobo_object_add_interface (BONOBO_OBJECT (shell), BONOBO_OBJECT (activity_handler)); priv->activity_handler = activity_handler; } +/* Set up the ::Shortcuts interface. */ + +static void +setup_shortcuts_interface (EShell *shell) +{ + ECorbaShortcuts *corba_shortcuts; + EShellPrivate *priv; + + priv = shell->priv; + + g_assert (priv->shortcuts != NULL); + + corba_shortcuts = e_corba_shortcuts_new (priv->shortcuts); + + bonobo_object_add_interface (BONOBO_OBJECT (shell), BONOBO_OBJECT (corba_shortcuts)); + priv->corba_shortcuts = corba_shortcuts; +} + + /* Initialization of the storages. */ static gboolean @@ -694,6 +730,7 @@ destroy (GtkObject *object) /* No unreffing for these as they are aggregate. */ /* bonobo_object_unref (BONOBO_OBJECT (priv->corba_storage_registry)); */ /* bonobo_object_unref (BONOBO_OBJECT (priv->activity_handler)); */ + /* bonobo_object_unref (BONOBO_OBJECT (priv->corba_shortcuts)); */ /* FIXME. Maybe we should do something special here. */ if (priv->offline_handler != NULL) @@ -740,6 +777,7 @@ class_init (EShellClass *klass) gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); epv = & klass->epv; + epv->_get_displayName = impl_Shell__get_displayName; epv->getComponentByType = impl_Shell_getComponentByType; epv->createNewView = impl_Shell_createNewView; epv->handleURI = impl_Shell_handleURI; @@ -768,6 +806,7 @@ init (EShell *shell) priv->uri_schema_registry = NULL; priv->corba_storage_registry = NULL; priv->activity_handler = NULL; + priv->corba_shortcuts = NULL; priv->offline_handler = NULL; priv->crash_type_names = NULL; priv->line_status = E_SHELL_LINE_STATUS_ONLINE; @@ -843,7 +882,7 @@ e_shell_construct (EShell *shell, corba_object = bonobo_object_corba_objref (BONOBO_OBJECT (shell)); if (oaf_active_server_register (iid, corba_object) != OAF_REG_SUCCESS) { CORBA_exception_free (&ev); - return E_SHELL_CONSTRUCT_RESULT_GENERICERROR; + return E_SHELL_CONSTRUCT_RESULT_CANNOTREGISTER; } if (! show_splash) { @@ -861,6 +900,19 @@ e_shell_construct (EShell *shell, else setup_components (shell, NULL); + /* Set up the shortcuts. */ + + shortcut_path = g_concat_dir_and_file (local_directory, "shortcuts.xml"); + priv->shortcuts = e_shortcuts_new (priv->storage_set, + priv->folder_type_registry, + shortcut_path); + g_assert (priv->shortcuts != NULL); + + if (e_shortcuts_get_num_groups (priv->shortcuts) == 0) + e_shortcuts_add_default_group (priv->shortcuts); + + g_free (shortcut_path); + /* The local storage depends on the component registry. */ setup_local_storage (shell); @@ -868,25 +920,19 @@ e_shell_construct (EShell *shell, the components, as they might want to use it. */ setup_activity_interface (shell); - /* Now that we have a local storage and an ::Activity interface, we can - tell the components we are here. */ + /* Set up the shortcuts interface. This has to be done after the + shortcuts are actually initialized. */ + + setup_shortcuts_interface (shell); + + /* Now that we have a local storage and all the interfaces set up, we + can tell the components we are here. */ set_owner_on_components (shell); /* Run the intelligent importers to find see if any data needs importing. */ intelligent_importer_init (); - shortcut_path = g_concat_dir_and_file (local_directory, "shortcuts.xml"); - priv->shortcuts = e_shortcuts_new (priv->storage_set, - priv->folder_type_registry, - shortcut_path); - g_assert (priv->shortcuts != NULL); - - if (e_shortcuts_get_num_groups (priv->shortcuts) == 0) - e_shortcuts_add_default_group (priv->shortcuts); - - g_free (shortcut_path); - if (show_splash) gtk_widget_destroy (splash); @@ -1239,8 +1285,7 @@ e_shell_restore_from_settings (EShell *shell) priv = shell->priv; - num_views = bonobo_config_get_long_with_default (priv->db, - "/Shell/Views/NumberOfViews", 0, NULL); + num_views = bonobo_config_get_long_with_default (priv->db, "/Shell/Views/NumberOfViews", 0, NULL); if (num_views == 0) return FALSE; @@ -1500,6 +1545,15 @@ e_shell_go_online (EShell *shell, } +Bonobo_ConfigDatabase +e_shell_get_config_db (EShell *shell) +{ + g_return_val_if_fail (shell != NULL, CORBA_OBJECT_NIL); + + return shell->priv->db; +} + + void e_shell_unregister_all (EShell *shell) { |