From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
Subject: Revert commit ba8381aed2cebaea13b8fc739a80bc63c7e153a3.

This would introduce new strings late past UI Freeze; and I feel the benefit
would be minimal when we already have the error messages otherwise, in
~/.xsession-errors. So revert that particular commit to preserve the old
behavior.

REVERTS:

 From ba8381aed2cebaea13b8fc739a80bc63c7e153a3 Mon Sep 17 00:00:00 2001
 From: Jiří Klimeš <jklimes@redhat.com>
 Date: Mon, 19 Mar 2012 10:02:45 +0000
 Subject: applet: show an error dialog on connection failures

 Show the user an error dialog, when connection activation failed, so that
 he knows what's the problem. This is useful mainly for situations when
 user is not allowed to perform an action, PolicyKit is misconfigured or
 something.
---
---
 src/applet-device-wifi.c            |   22 +++------------------
 src/applet.c                        |   33 +++++++-------------------------
 src/gconf-helpers/tests/Makefile.am |    2 -
 src/utils/utils.c                   |   37 ------------------------------------
 src/utils/utils.h                   |    7 ------
 5 files changed, 12 insertions(+), 89 deletions(-)

Index: b/src/applet-device-wifi.c
===================================================================
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -1682,15 +1682,8 @@ activate_existing_cb (NMClient *client,
                       GError *error,
                       gpointer user_data)
 {
-	if (error) {
-		const char *text = _("Failed to activate connection");
-		char *err_text = g_strdup_printf ("(%d) %s", error->code,
-		                                  error->message ? error->message : _("Unknown error"));
-
-		g_warning ("%s: %s", text, err_text);
-		utils_show_error_dialog (_("Connection failure"), text, err_text, FALSE, NULL);
-		g_free (err_text);
-	}
+	if (error)
+		g_warning ("Failed to activate connection: (%d) %s", error->code, error->message);
 	applet_schedule_update_icon (NM_APPLET (user_data));
 }
 
@@ -1701,15 +1694,8 @@ activate_new_cb (NMClient *client,
                  GError *error,
                  gpointer user_data)
 {
-	if (error) {
-		const char *text = _("Failed to add new connection");
-		char *err_text = g_strdup_printf ("(%d) %s", error->code,
-		                                  error->message ? error->message : _("Unknown error"));
-
-		g_warning ("%s: %s", text, err_text);
-		utils_show_error_dialog (_("Connection failure"), text, err_text, FALSE, NULL);
-		g_free (err_text);
-	}
+	if (error)
+		g_warning ("Failed to add new connection: (%d) %s", error->code, error->message);
 	applet_schedule_update_icon (NM_APPLET (user_data));
 }
 
Index: b/src/applet.c
===================================================================
--- a/src/applet.c
+++ b/src/applet.c
@@ -501,15 +501,8 @@ add_and_activate_cb (NMClient *client,
 {
 	NMApplet *applet = NM_APPLET (user_data);
 
-	if (error) {
-		const char *text = _("Failed to add/activate connection");
-		char *err_text = g_strdup_printf ("(%d) %s", error->code,
-		                                  error->message ? error->message : _("Unknown error"));
-
-		g_warning ("%s: %s", text, err_text);
-		utils_show_error_dialog (_("Connection failure"), text, err_text, FALSE, NULL);
-		g_free (err_text);
-	}
+	if (error)
+		g_warning ("Failed to add/activate connection: (%d) %s", error->code, error->message);
 
 	applet_schedule_update_icon (applet);
 	applet_schedule_update_menu (applet);
@@ -549,13 +542,10 @@ disconnect_cb (NMDevice *device, GError
 	NMApplet *applet = NM_APPLET (user_data);
 
 	if (error) {
-		const char *text = _("Device disconnect failed");
-		char *err_text = g_strdup_printf ("(%d) %s", error->code,
-		                                  error->message ? error->message : _("Unknown error"));
-
-		g_warning ("%s: %s: %s", __func__, text, err_text);
-		utils_show_error_dialog (_("Disconnect failure"), text, err_text, FALSE, NULL);
-		g_free (err_text);
+		g_warning ("%s: device disconnect failed: (%d) %s",
+		           __func__,
+		           error ? error->code : -1,
+		           error && error->message ? error->message : "(unknown)");
 	}
 
 	applet_schedule_update_icon (applet);
@@ -577,15 +567,8 @@ activate_connection_cb (NMClient *client
                         GError *error,
                         gpointer user_data)
 {
-	if (error) {
-		const char *text = _("Connection activation failed");
-		char *err_text = g_strdup_printf ("(%d) %s", error->code,
-		                                  error->message ? error->message : _("Unknown error"));
-
-		g_warning ("%s: %s", text, err_text);
-		utils_show_error_dialog (_("Connection failure"), text, err_text, FALSE, NULL);
-		g_free (err_text);
-	}
+	if (error)
+		g_warning ("Connection activation failed: %s", error->message);
 
 	applet_schedule_update_icon (NM_APPLET (user_data));
 }
Index: b/src/gconf-helpers/tests/Makefile.am
===================================================================
--- a/src/gconf-helpers/tests/Makefile.am
+++ b/src/gconf-helpers/tests/Makefile.am
@@ -12,14 +12,12 @@ test_upgrade_SOURCES = \
 test_upgrade_CPPFLAGS = \
 	-I ${srcdir}/../ \
 	-DTESTDIR=\"$(srcdir)\" \
-	$(GTK_CFLAGS) \
 	$(NMA_CFLAGS) \
 	$(GCONF_CFLAGS) \
 	$(GNOME_KEYRING_CFLAGS)
 
 test_upgrade_LDADD = \
 	${builddir}/../libgconf-helpers-test.la \
-	$(GTK_CFLAGS) \
 	$(NMA_LIBS) \
 	$(GNOME_KEYRING_LIBS)
 
Index: b/src/utils/utils.c
===================================================================
--- a/src/utils/utils.c
+++ b/src/utils/utils.c
@@ -24,7 +24,6 @@
 #include <string.h>
 #include <netinet/ether.h>
 #include <glib.h>
-#include <gtk/gtk.h>
 
 #include <nm-setting-connection.h>
 #include <nm-utils.h>
@@ -354,39 +353,3 @@ utils_create_keyring_add_attr_list (NMCo
 	                                            setting_key);
 	return attrs;
 }
-
-void
-utils_show_error_dialog (const char *title,
-                         const char *text1,
-                         const char *text2,
-                         gboolean modal,
-                         GtkWindow *parent)
-{
-	GtkWidget *err_dialog;
-
-	g_return_if_fail (text1 != NULL);
-
-	err_dialog = gtk_message_dialog_new (parent,
-	                                     GTK_DIALOG_DESTROY_WITH_PARENT,
-	                                     GTK_MESSAGE_ERROR,
-	                                     GTK_BUTTONS_CLOSE,
-	                                     "%s",
-	                                     text1);
-
-	if (text2)
-		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (err_dialog), text2);
-	if (title)
-		gtk_window_set_title (GTK_WINDOW (err_dialog), title);
-
-	if (modal) {
-		gtk_dialog_run (GTK_DIALOG (err_dialog));
-		gtk_widget_destroy (err_dialog);
-	} else {
-		g_signal_connect (err_dialog, "delete-event", G_CALLBACK (gtk_widget_destroy), NULL);
-		g_signal_connect (err_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
-
-		gtk_widget_show_all (err_dialog);
-		gtk_window_present (GTK_WINDOW (err_dialog));
-	}
-}
-
Index: b/src/utils/utils.h
===================================================================
--- a/src/utils/utils.h
+++ b/src/utils/utils.h
@@ -24,7 +24,6 @@
 #define UTILS_H
 
 #include <glib.h>
-#include <gtk/gtk.h>
 #include <nm-connection.h>
 #include <nm-device.h>
 #include <net/ethernet.h>
@@ -58,12 +57,6 @@ GnomeKeyringAttributeList *utils_create_
                                                                const char *setting_key,
                                                                char **out_display_name);
 
-void utils_show_error_dialog (const char *title,
-                              const char *text1,
-                              const char *text2,
-                              gboolean modal,
-                              GtkWindow *parent);
-
 #define NMA_ERROR (g_quark_from_static_string ("nma-error-quark"))
 
 typedef enum  {
