diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-11-04 05:58:46 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-11-04 05:58:46 +0800 |
commit | 7c64de04114bc7973273fad39c104c2fb33c79e1 (patch) | |
tree | d6f38645bdbf8fd49ac84ff7d38aabed7673abe4 | |
parent | 4943fa0e40f481dacb9f72c90110204a36f7b0e7 (diff) | |
download | gsoc2013-evolution-7c64de04114bc7973273fad39c104c2fb33c79e1.tar gsoc2013-evolution-7c64de04114bc7973273fad39c104c2fb33c79e1.tar.gz gsoc2013-evolution-7c64de04114bc7973273fad39c104c2fb33c79e1.tar.bz2 gsoc2013-evolution-7c64de04114bc7973273fad39c104c2fb33c79e1.tar.lz gsoc2013-evolution-7c64de04114bc7973273fad39c104c2fb33c79e1.tar.xz gsoc2013-evolution-7c64de04114bc7973273fad39c104c2fb33c79e1.tar.zst gsoc2013-evolution-7c64de04114bc7973273fad39c104c2fb33c79e1.zip |
Added a `--no-splash' option to the shell.
svn path=/trunk/; revision=6380
-rw-r--r-- | shell/ChangeLog | 19 | ||||
-rw-r--r-- | shell/e-shell.c | 31 | ||||
-rw-r--r-- | shell/e-shell.h | 6 | ||||
-rw-r--r-- | shell/main.c | 24 |
4 files changed, 60 insertions, 20 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 84e6db4f83..2890f725cc 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,22 @@ +2000-11-03 Ettore Perazzoli <ettore@helixcode.com> + + * main.c: New local static variables `evolution_directory', + `no_splash'. + (main): Removed local variable `evolution_directory'. Add a + `--no-splash' command-line option for setting the value of + `no_splash'. + (idle_cb): Use the static `evolution_directory'. Make the newly + created shell show the splash or not according to the value of + `no_splash'. + + * e-shell.c (setup_components): Deal with a NULL @splash + parameter. + (e_shell_construct): New arg `show_splash'. Don't create a splash + screen if FALSE; instead, pass NULL to `setup_components()' as the + @splash arg. + (e_shell_new): New arg `show_splash'. Pass it to + `e_shell_construct()'. + 2000-11-03 Dan Winship <danw@helixcode.com> * evolution-storage-listener.c (class_init): Fix the name of the diff --git a/shell/e-shell.c b/shell/e-shell.c index 6ae909a25f..ee49fc997a 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -399,7 +399,10 @@ setup_components (EShell *shell, icon_path = get_icon_path_for_component_info (info); icon_pixbuf = gdk_pixbuf_new_from_file (icon_path); - e_splash_add_icon (splash, icon_pixbuf); + + if (splash != NULL) + e_splash_add_icon (splash, icon_pixbuf); + gdk_pixbuf_unref (icon_pixbuf); g_free (icon_path); @@ -418,7 +421,8 @@ setup_components (EShell *shell, else g_print ("Evolution component activated successfully -- %s\n", info->iid); - e_splash_set_icon_highlight (splash, i, TRUE); + if (splash != NULL) + e_splash_set_icon_highlight (splash, i, TRUE); while (gtk_events_pending ()) gtk_main_iteration (); @@ -630,6 +634,7 @@ init (EShell *shell) * @shell: An EShell object to construct * @corba_object: A CORBA Object implementing the Evolution::Shell interface * @local_directory: Local directory for storing local information and folders + * @show_splash: Whether to display a splash screen. * * Construct @shell so that it uses the specified @local_directory and * @corba_object. @@ -637,7 +642,8 @@ init (EShell *shell) void e_shell_construct (EShell *shell, Evolution_Shell corba_object, - const char *local_directory) + const char *local_directory, + gboolean show_splash) { GtkWidget *splash; EShellPrivate *priv; @@ -649,8 +655,12 @@ e_shell_construct (EShell *shell, g_return_if_fail (local_directory != NULL); g_return_if_fail (g_path_is_absolute (local_directory)); - splash = e_splash_new (); - gtk_widget_show (splash); + if (! show_splash) { + splash = NULL; + } else { + splash = e_splash_new (); + gtk_widget_show (splash); + } while (gtk_events_pending ()) gtk_main_iteration (); @@ -671,7 +681,10 @@ e_shell_construct (EShell *shell, if (! setup_corba_storages (shell)) return; - setup_components (shell, E_SPLASH (splash)); + if (splash != NULL) + setup_components (shell, E_SPLASH (splash)); + else + setup_components (shell, NULL); /* The local storage depends on the component registry. */ setup_local_storage (shell); @@ -698,13 +711,15 @@ e_shell_construct (EShell *shell, /** * e_shell_new: * @local_directory: Local directory for storing local information and folders. + * @show_splash: Whether to display a splash screen. * * Create a new EShell. * * Return value: **/ EShell * -e_shell_new (const char *local_directory) +e_shell_new (const char *local_directory, + gboolean show_splash) { EShell *new; EShellPrivate *priv; @@ -721,7 +736,7 @@ e_shell_new (const char *local_directory) new = gtk_type_new (e_shell_get_type ()); corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (new), servant); - e_shell_construct (new, corba_object, local_directory); + e_shell_construct (new, corba_object, local_directory, show_splash); priv = new->priv; diff --git a/shell/e-shell.h b/shell/e-shell.h index b3a5d80c98..98545b396d 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -67,9 +67,11 @@ struct _EShellClass { GtkType e_shell_get_type (void); void e_shell_construct (EShell *shell, Evolution_Shell corba_object, - const char *local_directory); + const char *local_directory, + gboolean show_splash); -EShell *e_shell_new (const char *local_directory); +EShell *e_shell_new (const char *local_directory, + gboolean show_splash); EShellView *e_shell_new_view (EShell *shell, const char *uri); diff --git a/shell/main.c b/shell/main.c index 609a20502e..f71c0ce40d 100644 --- a/shell/main.c +++ b/shell/main.c @@ -37,7 +37,9 @@ #define STARTUP_URI "evolution:/local/Inbox" -static EShell *shell; +static EShell *shell = NULL; +static char *evolution_directory = NULL; +static gboolean no_splash = FALSE; static void no_views_left_cb (EShell *shell, gpointer data) @@ -111,11 +113,8 @@ static gint idle_cb (gpointer data) { EShellView *view; - char *evolution_directory; - evolution_directory = (char *) data; - - shell = e_shell_new (evolution_directory); + shell = e_shell_new (evolution_directory, ! no_splash); g_free (evolution_directory); if (shell == NULL) { @@ -141,14 +140,19 @@ idle_cb (gpointer data) int main (int argc, char **argv) { - char *evolution_directory; - - #ifdef ENABLE_NLS + struct poptOption options[] = { + { "no-splash", '\0', POPT_ARG_NONE, &no_splash, 0, N_("Disable."), NULL }, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, &oaf_popt_options, 0, NULL, NULL }, + POPT_AUTOHELP + { NULL, '\0', 0, NULL, 0, NULL, NULL } + }; + +#ifdef ENABLE_NLS bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR); textdomain (PACKAGE); - #endif +#endif - gnome_init_with_popt_table ("Evolution", VERSION, argc, argv, oaf_popt_options, 0, NULL); + gnome_init_with_popt_table ("Evolution", VERSION, argc, argv, options, 0, NULL); oaf_init (argc, argv); glade_gnome_init (); |