From 1168da7072a57fb9fc66be77df43e82392659c18 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 20 Jul 2000 07:32:34 +0000 Subject: Added/fixed support for multiple views. svn path=/trunk/; revision=4234 --- shell/ChangeLog | 10 ++++++++++ shell/e-shell-view-menu.c | 26 +++++++++++++++++++++++--- shell/e-shell.c | 6 +++++- shell/main.c | 23 ++--------------------- 4 files changed, 40 insertions(+), 25 deletions(-) diff --git a/shell/ChangeLog b/shell/ChangeLog index 827917697d..d857de8519 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,13 @@ +2000-07-20 Ettore Perazzoli + + * main.c (no_views_left_cb): Call `e_shell_quit()' on the shell + before getting out of the GTK+ main loop. + (view_delete_event_cb): Removed. + (idle_cb): Don't call it. + + * e-shell-view-menu.c (command_new_view): New, implementation of + the "New view" command. + 2000-07-16 Damon Chaplin * e-shortcuts-view.c (e_shortcuts_view_construct): created a model diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c index f1f966990e..42f6db342b 100644 --- a/shell/e-shell-view-menu.c +++ b/shell/e-shell-view-menu.c @@ -245,6 +245,22 @@ command_new_folder (BonoboUIHandler *uih, default_parent_folder); } +static void +command_new_view (BonoboUIHandler *uih, + void *data, + const char *path) +{ + EShellView *shell_view; + EShell *shell; + const char *current_uri; + + shell_view = E_SHELL_VIEW (data); + shell = e_shell_view_get_shell (shell_view); + current_uri = e_shell_view_get_current_uri (shell_view); + + e_shell_new_view (shell, current_uri); +} + /* Going to a folder. */ @@ -362,14 +378,18 @@ DEFINE_UNIMPLEMENTED (command_new_journal_entry) */ static GnomeUIInfo menu_file_new [] = { + { GNOME_APP_UI_ITEM, N_("View"), + NULL, command_new_view, NULL, + NULL, 0, 0, 'v', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, + { GNOME_APP_UI_ITEM, N_("_Folder"), NULL, command_new_folder, NULL, - NULL, 0, 0, 'e', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, + NULL, 0, 0, 'f', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, { GNOME_APP_UI_ITEM, N_("Evolution _Bar Shortcut"), NULL, command_new_shortcut, NULL, - NULL, 0, 0, 'e', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - + NULL, 0, 0, 's', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, + GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, N_("_Mail message (FIXME)"), diff --git a/shell/e-shell.c b/shell/e-shell.c index cd73795ee5..63c4b08f92 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -349,8 +349,12 @@ view_destroy_cb (GtkObject *object, shell = E_SHELL (data); shell->priv->views = g_list_remove (shell->priv->views, object); - if (shell->priv->views == NULL) + if (shell->priv->views == NULL) { + /* FIXME: This looks like a Bonobo bug to me. */ + bonobo_object_ref (BONOBO_OBJECT (shell)); gtk_signal_emit (GTK_OBJECT (shell), signals[NO_VIEWS_LEFT]); + bonobo_object_unref (BONOBO_OBJECT (shell)); + } } diff --git a/shell/main.c b/shell/main.c index 69816873c2..e614a7ce83 100644 --- a/shell/main.c +++ b/shell/main.c @@ -39,6 +39,7 @@ static EShell *shell; static void no_views_left_cb (EShell *shell, gpointer data) { + e_shell_quit (shell); gtk_main_quit (); } @@ -138,21 +139,6 @@ development_warning () gtk_object_destroy (GTK_OBJECT (warning_dialog)); } -static void -view_delete_event_cb (GtkWidget *widget, - GdkEventAny *event, - void *data) -{ - EShell *shell; - - shell = E_SHELL (data); - - gtk_widget_destroy (widget); - - /* FIXME we should keep track of the number of views and exit when all the views are gone. */ - e_shell_quit (shell); -} - static gint idle_cb (gpointer data) { @@ -178,13 +164,8 @@ idle_cb (gpointer data) gtk_signal_connect (GTK_OBJECT (shell), "destroy", GTK_SIGNAL_FUNC (destroy_cb), NULL); - if (! e_shell_restore_from_settings (shell)) { + if (! e_shell_restore_from_settings (shell)) view = e_shell_new_view (shell, STARTUP_URI); - /* FIXME: Do this for all the shell views even when the shell - is restored. */ - gtk_signal_connect (GTK_OBJECT (view), "delete_event", - GTK_SIGNAL_FUNC (view_delete_event_cb), shell); - } if (!getenv ("EVOLVE_ME_HARDER")) development_warning (); -- cgit v1.2.3