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-28 11:40:25 +0200
commit5c2b3e14b1a4eec248ec3c1aa0e4bd99545e2c3d (patch)
tree68b0f7cfafbd54afc6e2ef3e27332247fdea3954
parent4999304803ea3fdb223fc9093bbc4267b8e75564 (diff)
downloadnautilus-5c2b3e14b1a4eec248ec3c1aa0e4bd99545e2c3d.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 *