From b6c919243e98e9a509018e2cec0fff62d945be7d Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 5 Oct 2001 19:43:23 +0000 Subject: Also `gdk_flush()'. (idle_cb): If the user doesn't specify at least one * main.c (quit_box_new): Also `gdk_flush()'. (idle_cb): If the user doesn't specify at least one `evolution:' URI, restore from the settings. [Fixes #6093.] svn path=/trunk/; revision=13459 --- shell/ChangeLog | 6 ++++++ shell/main.c | 48 ++++++++++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/shell/ChangeLog b/shell/ChangeLog index fb3a22e426..00c4cf0d92 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,9 @@ +2001-10-05 Ettore Perazzoli + + * main.c (quit_box_new): Also `gdk_flush()'. + (idle_cb): If the user doesn't specify at least one `evolution:' + URI, restore from the settings. [Fixes #6093.] + 2001-10-05 Ettore Perazzoli * evolution-shell-component.c: New member `ping_timeout_id' in diff --git a/shell/main.c b/shell/main.c index 2e6d95e612..5260ea5696 100644 --- a/shell/main.c +++ b/shell/main.c @@ -53,6 +53,7 @@ #include "e-util/e-gtk-utils.h" +#include "e-shell-constants.h" #include "e-setup.h" #include "e-shell.h" @@ -94,6 +95,7 @@ quit_box_new (void) /* For some reason, the window fails to update without this sometimes. */ gtk_widget_queue_draw (window); + gdk_flush (); while (gtk_events_pending ()) gtk_main_iteration (); @@ -203,7 +205,8 @@ idle_cb (void *data) GNOME_Evolution_Shell corba_shell; CORBA_Environment ev; EShellConstructResult result; - gboolean restored; + GSList *p; + gboolean have_evolution_uri; CORBA_exception_init (&ev); @@ -219,11 +222,6 @@ idle_cb (void *data) gtk_signal_connect (GTK_OBJECT (shell), "destroy", GTK_SIGNAL_FUNC (destroy_cb), NULL); - if (uri_list == NULL) - restored = e_shell_restore_from_settings (shell); - else - restored = FALSE; - if (!getenv ("EVOLVE_ME_HARDER")) development_warning (); @@ -240,8 +238,6 @@ idle_cb (void *data) gtk_main_quit (); return FALSE; } - - restored = FALSE; break; default: @@ -254,28 +250,40 @@ idle_cb (void *data) } - if (! restored && uri_list == NULL) { - const char *uri = E_SHELL_VIEW_DEFAULT_URI; + have_evolution_uri = FALSE; + for (p = uri_list; p != NULL; p = p->next) { + const char *uri; - GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev); - if (ev._major != CORBA_NO_EXCEPTION) - g_warning ("CORBA exception %s when requesting URI -- %s", ev._repo_id, uri); - } else { - GSList *p; - - for (p = uri_list; p != NULL; p = p->next) { - char *uri; + uri = (const char *) p->data; + if (strncmp (uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0) + have_evolution_uri = TRUE; + } - uri = (char *) p->data; + if (! have_evolution_uri) { + if (! e_shell_restore_from_settings (shell)) { + const char *uri; + uri = E_SHELL_VIEW_DEFAULT_URI; GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev); if (ev._major != CORBA_NO_EXCEPTION) g_warning ("CORBA exception %s when requesting URI -- %s", ev._repo_id, uri); } + } + + for (p = uri_list; p != NULL; p = p->next) { + const char *uri; - g_slist_free (uri_list); + uri = (const char *) p->data; + GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev); + if (ev._major != CORBA_NO_EXCEPTION) + g_warning ("CORBA exception %s when requesting URI -- %s", ev._repo_id, uri); + + if (strncmp (uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0) + have_evolution_uri = TRUE; } + g_slist_free (uri_list); + CORBA_Object_release (corba_shell, &ev); CORBA_exception_free (&ev); -- cgit v1.2.3