summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnestas Kulik <ernestas.kulik@gmail.com>2016-04-17 15:01:22 +0300
committerCarlos Soriano <csoriano@gnome.org>2016-04-22 15:51:11 +0200
commitf1d120de5bfcf7d9c406af925ca826ec7631ee45 (patch)
treeccd1f47e91e4986b817dff748ae1bde62c13c4a5
parenta93e1a5014e2be9dcc30bb034471a94c7b6c328a (diff)
downloadnautilus-f1d120de5bfcf7d9c406af925ca826ec7631ee45.tar.gz
places-view: show an error dialog on failed connection
Since 474a6c2aa025fcd94bff50e3501a2eb41e4f0388, due to an overlook, no error is displayed if a connection to a server fails. This commit restores error reporting by connecting to the NautilusPlacesView show-error-message signal. https://bugzilla.gnome.org/show_bug.cgi?id=704872
-rw-r--r--src/nautilus-places-view.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index 44ea65dfb..f6214f880 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -104,6 +104,29 @@ loading_cb (NautilusView *view)
}
static void
+show_error_message_cb (NautilusGtkPlacesView *view,
+ const gchar *primary,
+ const gchar *secondary)
+{
+ GtkWidget *dialog;
+ GtkWidget *window;
+
+ window = gtk_widget_get_toplevel (GTK_WIDGET (view));
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (window),
+ GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ "%s", primary);
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ "%s", secondary);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+}
+
+static void
nautilus_places_view_finalize (GObject *object)
{
NautilusPlacesView *self = (NautilusPlacesView *)object;
@@ -348,6 +371,11 @@ nautilus_places_view_init (NautilusPlacesView *self)
G_CALLBACK (open_location_cb),
self);
+ g_signal_connect_swapped (priv->places_view,
+ "show-error-message",
+ G_CALLBACK (show_error_message_cb),
+ self);
+
}
NautilusPlacesView *