aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog10
-rw-r--r--shell/e-shell-view-menu.c14
-rw-r--r--shell/e-shell.c13
-rw-r--r--ui/ChangeLog6
-rw-r--r--ui/evolution.xml8
5 files changed, 48 insertions, 3 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 0847510387..31b5ca076c 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,13 @@
+2001-01-24 Jason Leach <jasonleach@usa.net>
+
+ (Fix #1252: Need a File->Close way to close a view)
+
+ * e-shell-view-menu.c (command_close): New function, destroys the
+ current view.
+
+ * e-shell.c (view_destroy_cb): Make sure shell settings get saved
+ when the last view is destroyed.
+
2001-01-24 Kjartan Maraas <kmaraas@gnome.org>
* importer/GNOME_Evolution_Importer.idl: Fix missing ';'.
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
index f396bf9f6d..ec2e2edfb2 100644
--- a/shell/e-shell-view-menu.c
+++ b/shell/e-shell-view-menu.c
@@ -82,6 +82,19 @@ folder_bar_mode_changed_cb (EShellView *shell_view,
/* Command callbacks. */
+
+static void
+command_close (BonoboUIComponent *uih,
+ void *data,
+ const char *path)
+{
+ EShellView *shell_view;
+
+ shell_view = E_SHELL_VIEW (data);
+
+ gtk_object_destroy (GTK_OBJECT (shell_view));
+}
+
static void
command_quit (BonoboUIComponent *uih,
void *data,
@@ -423,6 +436,7 @@ BonoboUIVerb file_verbs [] = {
BONOBO_UI_VERB ("FileImporter", show_import_wizard),
BONOBO_UI_VERB ("FileGoToFolder", command_goto_folder),
BONOBO_UI_VERB ("FileCreateFolder", command_create_folder),
+ BONOBO_UI_VERB ("FileClose", command_close),
BONOBO_UI_VERB ("FileExit", command_quit),
BONOBO_UI_VERB_END
diff --git a/shell/e-shell.c b/shell/e-shell.c
index fec2a2febd..8cecea7d4f 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -525,12 +525,21 @@ view_destroy_cb (GtkObject *object,
gpointer data)
{
EShell *shell;
+ int nviews;
g_assert (E_IS_SHELL_VIEW (object));
shell = E_SHELL (data);
- shell->priv->views = g_list_remove (
- shell->priv->views, object);
+
+ nviews = g_list_length (shell->priv->views);
+
+ /* If this is our last view, save settings now because in the
+ callback for no_views_left shell->priv->views will be NULL
+ and settings won't be saved because of that */
+ if (nviews - 1 == 0)
+ e_shell_save_settings (shell);
+
+ shell->priv->views = g_list_remove (shell->priv->views, object);
if (shell->priv->views == NULL) {
/* FIXME: This looks like a Bonobo bug to me. */
diff --git a/ui/ChangeLog b/ui/ChangeLog
index 0b8a655d6a..75e0352fb4 100644
--- a/ui/ChangeLog
+++ b/ui/ChangeLog
@@ -1,3 +1,9 @@
+2001-01-24 Jason Leach <jasonleach@usa.net>
+
+ (Fix #1252: Need a File->Close way to close a view)
+
+ * evolution.xml: new File->Close menu item and associated command.
+
2001-01-22 Not Zed <NotZed@Ximian.com>
* evolution-mail.xml: Removed the temporary get mail button.
diff --git a/ui/evolution.xml b/ui/evolution.xml
index 9aab46a111..f5eeb24e42 100644
--- a/ui/evolution.xml
+++ b/ui/evolution.xml
@@ -1,5 +1,8 @@
<Root>
<commands>
+ <cmd name="FileClose" _label="Close" _tip="Close this window"
+ pixtype="stock" pixname="Close" accel="*Control*w"/>
+
<cmd name="FileExit" _label="Exit" _tip="Exit the program"
pixtype="stock" pixname="Exit" accel="*Control*q"/>
@@ -76,8 +79,11 @@
<separator/>
+ <menuitem name="FileClose" verb=""
+ _label="_Close"/>
+
<menuitem name="FileExit" verb="" _label="E_xit"/>
-
+
</submenu>
<submenu name="Edit" _label="_Edit">