aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-07-09 10:20:57 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-07-09 10:20:57 +0800
commit95d63098be0ef98971969262d3df4c9ed692aa79 (patch)
treea9bbad3c092e9f9ad0cfce960aac8bf7239dc6ad
parent70909df376a188a6ee1dac1fb34e1e260fa42c94 (diff)
downloadgsoc2013-evolution-95d63098be0ef98971969262d3df4c9ed692aa79.tar
gsoc2013-evolution-95d63098be0ef98971969262d3df4c9ed692aa79.tar.gz
gsoc2013-evolution-95d63098be0ef98971969262d3df4c9ed692aa79.tar.bz2
gsoc2013-evolution-95d63098be0ef98971969262d3df4c9ed692aa79.tar.lz
gsoc2013-evolution-95d63098be0ef98971969262d3df4c9ed692aa79.tar.xz
gsoc2013-evolution-95d63098be0ef98971969262d3df4c9ed692aa79.tar.zst
gsoc2013-evolution-95d63098be0ef98971969262d3df4c9ed692aa79.zip
Don't display the annoying "Cannot display..." view in the shell when
an error occurs while opening a view. Instead, avoid moving the selection to it. Not the ideal solution, but a definite improvement. svn path=/trunk/; revision=3995
-rw-r--r--shell/ChangeLog6
-rw-r--r--shell/e-shell-view.c48
2 files changed, 15 insertions, 39 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 6f9d490190..ca0a178947 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,11 @@
2000-07-08 Ettore Perazzoli <ettore@helixcode.com>
+ * e-shell-view.c (e_shell_view_display_uri): Don't update the
+ current URI if there are problems creating a view for it.
+ (show_error): Remove. Not used anymore.
+
+2000-07-08 Ettore Perazzoli <ettore@helixcode.com>
+
* e-shell-view-menu.c: Cleanup some unused menu items and added
"FIXMEs" for the ones we plan to add in the short term but are not
implemented yet.
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index ceea7ee97f..fc211e8727 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -34,6 +34,7 @@
#include "widgets/misc/e-clipped-label.h"
#include "e-util/e-util.h"
+#include "e-util/e-gui-utils.h"
#include "e-shell-constants.h"
#include "e-shell-folder-title-bar.h"
@@ -632,31 +633,6 @@ set_current_notebook_page (EShellView *shell_view,
bonobo_control_frame_control_activate (control_frame);
}
-static void
-show_error (EShellView *shell_view,
- const char *uri)
-{
- EShellViewPrivate *priv;
- GtkWidget *label;
- GtkNotebook *notebook;
- char *s;
-
- priv = shell_view->priv;
-
- s = g_strdup_printf (_("Cannot open location: %s"), uri);
- label = e_clipped_label_new (s);
- g_free (s);
-
- gtk_widget_show (label);
-
- notebook = GTK_NOTEBOOK (priv->notebook);
-
- gtk_notebook_remove_page (notebook, 0);
- gtk_notebook_prepend_page (notebook, label, NULL);
-
- set_current_notebook_page (shell_view, 0);
-}
-
/* Create a new view for @uri with @control. It assumes a view for @uri does not exist yet. */
static GtkWidget *
get_control_for_uri (EShellView *shell_view,
@@ -777,10 +753,8 @@ create_new_view_for_uri (EShellView *shell_view,
priv = shell_view->priv;
control = get_control_for_uri (shell_view, uri);
- if (control == NULL) {
- show_error (shell_view, uri);
+ if (control == NULL)
return FALSE;
- }
gtk_widget_show (control);
@@ -821,31 +795,27 @@ e_shell_view_display_uri (EShellView *shell_view,
}
retval = TRUE;
+
goto end;
}
- g_free (priv->uri);
- priv->uri = g_strdup (uri);
-
if (strncmp (uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) != 0) {
- show_error (shell_view, uri);
- return FALSE;
+ retval = FALSE;
+ goto end;
}
control = g_hash_table_lookup (priv->uri_to_control, uri);
if (control != NULL) {
g_assert (GTK_IS_WIDGET (control));
show_existing_view (shell_view, uri, control);
- retval = TRUE;
- goto end;
- }
-
- if (! create_new_view_for_uri (shell_view, uri)) {
- show_error (shell_view, uri);
+ } else if (! create_new_view_for_uri (shell_view, uri)) {
retval = FALSE;
goto end;
}
+ g_free (priv->uri);
+ priv->uri = g_strdup (uri);
+
retval = TRUE;
end: