From 0f8c6c783deb1b2d61c81f8fb27c63ba3ebadc1b Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 9 May 2000 15:37:57 +0000 Subject: Display the default inbox at startup, instead of an empty view. svn path=/trunk/; revision=2944 --- shell/ChangeLog | 17 +++++++++++++++++ shell/e-shell-view.c | 12 +++--------- shell/e-shell-view.h | 7 +++---- shell/e-shell.c | 5 ++++- shell/main.c | 17 ++++++++++++++++- 5 files changed, 43 insertions(+), 15 deletions(-) diff --git a/shell/ChangeLog b/shell/ChangeLog index c479f46f5b..90400d3fe1 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,20 @@ +2000-05-09 Ettore Perazzoli + + * e-shell.c (e_shell_new_view): Display the specified @uri in the + view. + + * e-shell-view.c (e_shell_view_construct): Removed arg @uri. + (e_shell_view_new): Likewise. + + * main.c: New string constant `STARTUP_URI', specifying the URI to + show in the startup view. + (new_view_idle_cb): New callback function to create a new view for + `STARTUP_URI' in the idle loop. We need to do this in the idle + loop because the CORBA stuff cannot work until the loop starts + running. + (main): Set `new_view_idle_cb' up as the idle callback instead of + creating the view right away. + 2000-05-09 Ettore Perazzoli * e-shell.c (setup_storages): Woops. Don't free the path before diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 8d83a9fca4..922d5c301c 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -247,8 +247,7 @@ init (EShellView *shell_view) void e_shell_view_construct (EShellView *shell_view, - EShell *shell, - const char *uri) + EShell *shell) { EShellViewPrivate *priv; @@ -256,7 +255,6 @@ e_shell_view_construct (EShellView *shell_view, g_return_if_fail (E_IS_SHELL_VIEW (shell_view)); g_return_if_fail (shell != NULL); g_return_if_fail (E_IS_SHELL (shell)); - g_return_if_fail (uri == NULL || ! g_path_is_absolute (uri)); gnome_app_construct (GNOME_APP (shell_view), "evolution", "Evolution"); @@ -265,24 +263,20 @@ e_shell_view_construct (EShellView *shell_view, gtk_object_ref (GTK_OBJECT (shell)); priv->shell = shell; - priv->uri = g_strdup (uri); - setup_widgets (shell_view); setup_menus (shell_view); } GtkWidget * -e_shell_view_new (EShell *shell, - const char *uri) +e_shell_view_new (EShell *shell) { GtkWidget *new; g_return_val_if_fail (shell != NULL, NULL); g_return_val_if_fail (E_IS_SHELL (shell), NULL); - g_return_val_if_fail (uri == NULL || ! g_path_is_absolute (uri), NULL); new = gtk_type_new (e_shell_view_get_type ()); - e_shell_view_construct (E_SHELL_VIEW (new), shell, uri); + e_shell_view_construct (E_SHELL_VIEW (new), shell); return new; } diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h index 2cd39ebec9..5fbef18228 100644 --- a/shell/e-shell-view.h +++ b/shell/e-shell-view.h @@ -61,10 +61,9 @@ struct _EShellViewClass { GtkType e_shell_view_get_type (void); void e_shell_view_construct (EShellView *shell_view, - EShell *shell, - const char *uri); -GtkWidget *e_shell_view_new (EShell *shell, - const char *uri); + EShell *shell); +GtkWidget *e_shell_view_new (EShell *shell); + gboolean e_shell_view_display_uri (EShellView *shell_view, const char *uri); diff --git a/shell/e-shell.c b/shell/e-shell.c index 1223fc3e33..fd61108a5f 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -254,11 +254,14 @@ e_shell_new_view (EShell *shell, g_return_val_if_fail (shell != NULL, NULL); g_return_val_if_fail (E_IS_SHELL (shell), NULL); - view = e_shell_view_new (shell, uri); + view = e_shell_view_new (shell); gtk_widget_show (view); gtk_signal_connect (GTK_OBJECT (view), "destroy", GTK_SIGNAL_FUNC (view_destroy_cb), shell); + if (uri != NULL) + e_shell_view_display_uri (E_SHELL_VIEW (view), uri); + shell->priv->views = g_list_prepend (shell->priv->views, view); return view; diff --git a/shell/main.c b/shell/main.c index 5ab33823e9..1cb31909c5 100644 --- a/shell/main.c +++ b/shell/main.c @@ -29,6 +29,9 @@ #include "e-shell.h" + +#define STARTUP_URI "evolution:/local/Inbox" + static void no_views_left_cb (EShell *shell, gpointer data) @@ -78,6 +81,18 @@ init_corba (int *argc, char **argv) #endif /* USING_OAF */ + +static gint +new_view_idle_cb (gpointer data) +{ + EShell *shell; + + shell = E_SHELL (data); + e_shell_new_view (shell, STARTUP_URI); + + return FALSE; +} + int main (int argc, char **argv) @@ -113,7 +128,7 @@ main (int argc, char **argv) gtk_signal_connect (GTK_OBJECT (shell), "destroy", GTK_SIGNAL_FUNC (destroy_cb), NULL); - e_shell_new_view (shell, NULL); + gtk_idle_add (new_view_idle_cb, shell); bonobo_main (); -- cgit v1.2.3