[evolution-exchange] Bug #594471 - Shouldn't call e_error_new/run with NULL 'parent'



commit f333e0aa93f8fbe2a1e0f72ff682aaf0c992cbd1
Author: Milan Crha <mcrha redhat com>
Date:   Tue Oct 13 16:31:37 2009 +0200

    Bug #594471 - Shouldn't call e_error_new/run with NULL 'parent'

 eplugin/exchange-account-setup.c       |   35 +++++++++++++----------
 eplugin/exchange-calendar.c            |   19 +++++++-----
 eplugin/exchange-config-listener.c     |    9 +++--
 eplugin/exchange-contacts.c            |   20 ++++++++-----
 eplugin/exchange-folder-subscription.c |   26 ++++++++++-------
 eplugin/exchange-folder.c              |   49 ++++++++++++++++++-------------
 eplugin/exchange-operations.c          |   11 ++++---
 7 files changed, 97 insertions(+), 72 deletions(-)
---
diff --git a/eplugin/exchange-account-setup.c b/eplugin/exchange-account-setup.c
index f1b64d3..66cbf54 100644
--- a/eplugin/exchange-account-setup.c
+++ b/eplugin/exchange-account-setup.c
@@ -236,7 +236,7 @@ org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data)
 	exchange_config_listener_get_offline_status (exchange_global_config_listener,
 								    &offline_status);
 	if (offline_status == OFFLINE_MODE) {
-		e_error_run (NULL, ERROR_DOMAIN ":exchange-settings-offline", NULL);
+		e_error_run (GTK_WINDOW (data->config->target->widget), ERROR_DOMAIN ":exchange-settings-offline", NULL);
 
 		return NULL;
 	}
@@ -251,7 +251,7 @@ org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data)
 
 	if (account && !exchange_oof_get (account, &oof_state, &message)) {
 
-		e_error_run (NULL, ERROR_DOMAIN ":state-read-error", NULL);
+		e_error_run (GTK_WINDOW (data->config->target->widget), ERROR_DOMAIN ":state-read-error", NULL);
 
                 return NULL;
         }
@@ -382,48 +382,53 @@ org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data)
 }
 
 static void
-print_error (const gchar *owa_url, E2kAutoconfigResult result)
+print_error (GtkWidget *parent, const gchar *owa_url, E2kAutoconfigResult result)
 {
+	const gchar *err_msg = NULL;
+
 	switch (result) {
 
 		case E2K_AUTOCONFIG_CANT_CONNECT:
-			e_error_run (NULL, ERROR_DOMAIN ":account-connect-error", "", NULL);
+			e_error_run (GTK_WINDOW (parent), ERROR_DOMAIN ":account-connect-error", "", NULL);
 			break;
 
 		case E2K_AUTOCONFIG_CANT_RESOLVE:
-			e_error_run (NULL, ERROR_DOMAIN ":account-resolve-error", "", NULL);
+			e_error_run (GTK_WINDOW (parent), ERROR_DOMAIN ":account-resolve-error", "", NULL);
 			break;
 
 		case E2K_AUTOCONFIG_AUTH_ERROR:
 		case E2K_AUTOCONFIG_AUTH_ERROR_TRY_NTLM:
 		case E2K_AUTOCONFIG_AUTH_ERROR_TRY_BASIC:
-			e_error_run (NULL, ERROR_DOMAIN ":password-incorrect", NULL);
+			err_msg = ERROR_DOMAIN ":password-incorrect";
 			break;
 
 		case E2K_AUTOCONFIG_AUTH_ERROR_TRY_DOMAIN:
-			e_error_run (NULL, ERROR_DOMAIN ":account-domain-error", NULL);
+			err_msg = ERROR_DOMAIN ":account-domain-error";
 			break;
 
 		case E2K_AUTOCONFIG_NO_OWA:
 		case E2K_AUTOCONFIG_NOT_EXCHANGE:
-			e_error_run (NULL, ERROR_DOMAIN ":account-wss-error", NULL);
+			err_msg = ERROR_DOMAIN ":account-wss-error";
 			break;
 
 		case E2K_AUTOCONFIG_CANT_BPROPFIND:
-			e_error_run (NULL, ERROR_DOMAIN ":connect-exchange-error",
+			e_error_run (GTK_WINDOW (parent), ERROR_DOMAIN ":connect-exchange-error",
 				     "http://support.novell.com/cgi-bin/search/searchtid.cgi?/ximian/ximian328.html";,
 				     NULL);
 			break;
 
 		case E2K_AUTOCONFIG_EXCHANGE_5_5:
-			e_error_run (NULL, ERROR_DOMAIN ":account-version-error", NULL);
+			err_msg = ERROR_DOMAIN ":account-version-error";
 			break;
 
 		default:
-			e_error_run (NULL, ERROR_DOMAIN ":configure-error", NULL);
+			err_msg = ERROR_DOMAIN ":configure-error";
 			break;
 
 	}
+
+	if (err_msg)
+		e_error_run (GTK_WINDOW (parent), err_msg, NULL);
 }
 
 static const gchar *
@@ -502,7 +507,7 @@ owa_authenticate_user(GtkWidget *button, EConfig *config)
 	g_free (key);
 
 	if (!valid && result != E2K_AUTOCONFIG_CANCELLED)
-		print_error (owa_url, result);
+		print_error (config->target->widget, owa_url, result);
 
 	camel_url_set_host (url, valid ? exchange_params->host : "");
 
@@ -845,7 +850,7 @@ org_gnome_exchange_check_options(EPlugin *epl, EConfigHookPageCheckData *data)
 }
 
 static void
-set_oof_info (void)
+set_oof_info (GtkWidget *parent)
 {
 	ExchangeAccount *account;
 
@@ -853,7 +858,7 @@ set_oof_info (void)
 
 	if (account && !exchange_oof_set (account, oof_data->state, oof_data->message)) {
 
-		e_error_run (NULL, ERROR_DOMAIN ":state-update-error", NULL);
+		e_error_run (GTK_WINDOW (parent), ERROR_DOMAIN ":state-update-error", NULL);
 	}
 }
 
@@ -902,7 +907,7 @@ org_gnome_exchange_commit (EPlugin *epl, EConfigHookItemFactoryData *data)
 	}
 
 	/* Set oof data in exchange account */
-	set_oof_info ();
+	set_oof_info (data->config->target->widget);
 	destroy_oof_data ();
 	return;
 }
diff --git a/eplugin/exchange-calendar.c b/eplugin/exchange-calendar.c
index f9f7bd7..720b022 100644
--- a/eplugin/exchange-calendar.c
+++ b/eplugin/exchange-calendar.c
@@ -387,6 +387,7 @@ e_exchange_calendar_commit (EPlugin *epl, EConfigTarget *target)
 	ExchangeConfigListenerStatus status;
 	gint offline_status;
 	gboolean rename = FALSE;
+	const gchar *err_msg = NULL;
 
 	uri_text = e_source_get_uri (source);
 	if (uri_text && strncmp (uri_text, "exchange", 8)) {
@@ -501,31 +502,33 @@ e_exchange_calendar_commit (EPlugin *epl, EConfigTarget *target)
 		}
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_ALREADY_EXISTS:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-exists-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-exists-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-doesnt-exist-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-doesnt-exist-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_UNKNOWN_TYPE:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-unknown-type", NULL);
+		err_msg = ERROR_DOMAIN ":folder-unknown-type";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-perm-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-perm-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_OFFLINE:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-offline-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-offline-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_UNSUPPORTED_OPERATION:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-unsupported-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-unsupported-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-generic-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-generic-error";
 		break;
 	default:
 		break;
 	}
 
-done:
+	if (err_msg)
+		e_error_run (GTK_WINDOW (target->widget), err_msg, NULL);
+ done:
 	g_free (uri_text);
 	g_free (username);
 	if (authtype)
diff --git a/eplugin/exchange-config-listener.c b/eplugin/exchange-config-listener.c
index dc6582b..1fafb8f 100644
--- a/eplugin/exchange-config-listener.c
+++ b/eplugin/exchange-config-listener.c
@@ -39,6 +39,7 @@
 #include <camel/camel-url.h>
 
 #include <e-util/e-error.h>
+#include <shell/e-shell.h>
 
 #include <libedataserver/e-source.h>
 #include <libedataserver/e-source-list.h>
@@ -901,7 +902,7 @@ exchange_config_listener_authenticate (ExchangeConfigListener *ex_conf_listener,
 		}
 
 		if (current_quota_usage) {
-			widget = e_error_new (NULL, error_code, current_quota_usage, NULL);
+			widget = e_error_new (e_shell_get_active_window (NULL), error_code, current_quota_usage, NULL);
 			g_signal_connect ((GtkDialog *)widget, "response",
 					  G_CALLBACK (gtk_widget_destroy), widget);
 			gtk_widget_show (widget);
@@ -929,7 +930,7 @@ exchange_config_listener_authenticate (ExchangeConfigListener *ex_conf_listener,
 				/* OOF state is set, check if user wants to set it back to in-office */
 				if (run_oof_dialog () == GTK_RESPONSE_YES)
 					if (!exchange_oof_set (account, FALSE, NULL))
-						e_error_run (NULL, "org-gnome-exchange-operations:state-update-error", NULL);
+						e_error_run (e_shell_get_active_window (NULL), "org-gnome-exchange-operations:state-update-error", NULL);
 			}
 		}
 	}
@@ -949,7 +950,7 @@ account_added (EAccountList *account_list, EAccount *account)
 	config_listener = EXCHANGE_CONFIG_LISTENER (account_list);
 	if (config_listener->priv->configured_account) {
 		/* Multiple accounts configured. */
-		e_error_run (NULL, "org-gnome-exchange-operations:single-account-error", NULL);
+		e_error_run (e_shell_get_active_window (NULL), "org-gnome-exchange-operations:single-account-error", NULL);
 		return;
 	}
 
@@ -1148,7 +1149,7 @@ account_changed (EAccountList *account_list, EAccount *account)
 	}
 
 	/* Nope. Let the user know we're ignoring him. */
-	e_error_run (NULL, "org-gnome-exchange-operations:apply-restart",
+	e_error_run (e_shell_get_active_window (NULL), "org-gnome-exchange-operations:apply-restart",
 		     priv->configured_name, NULL);
 
 	/* But note the new URI so if he changes something else, we
diff --git a/eplugin/exchange-contacts.c b/eplugin/exchange-contacts.c
index 7fb9f85..99c386c 100644
--- a/eplugin/exchange-contacts.c
+++ b/eplugin/exchange-contacts.c
@@ -418,6 +418,7 @@ e_exchange_contacts_commit (EPlugin *epl, EConfigTarget *target)
 	ExchangeAccountFolderResult result;
 	gint offline_status;
 	gboolean rename = FALSE;
+	const gchar *err_msg = NULL;
 
 	uri_text = e_source_get_uri (source);
 	if (uri_text && strncmp (uri_text, "exchange", 8)) {
@@ -512,30 +513,33 @@ e_exchange_contacts_commit (EPlugin *epl, EConfigTarget *target)
 		}
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_ALREADY_EXISTS:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-exists-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-exists-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-doesnt-exist-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-doesnt-exist-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_UNKNOWN_TYPE:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-unknown-type", NULL);
+		err_msg = ERROR_DOMAIN ":folder-unknown-type";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-perm-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-perm-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_OFFLINE:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-offline-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-offline-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_UNSUPPORTED_OPERATION:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-unsupported-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-unsupported-error";
 		break;
 	case EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR:
-		e_error_run (NULL, ERROR_DOMAIN ":folder-generic-error", NULL);
+		err_msg = ERROR_DOMAIN ":folder-generic-error";
 		break;
 	default:
 		break;
 	}
-done:
+
+	if (err_msg)
+		e_error_run (GTK_WINDOW (target->widget), err_msg, NULL);
+ done:
 	g_free (ruri);
 	g_free (username);
 	if (authtype)
diff --git a/eplugin/exchange-folder-subscription.c b/eplugin/exchange-folder-subscription.c
index 3371559..c180672 100644
--- a/eplugin/exchange-folder-subscription.c
+++ b/eplugin/exchange-folder-subscription.c
@@ -200,7 +200,7 @@ subscribe_to_folder (GtkWidget *dialog, gint response, gpointer data)
 			subscriber_email = exchange_account_get_email_id (subscription_info->account);
 			if (subscriber_email != NULL && *subscriber_email != '\0') {
 				if (g_str_equal (subscriber_email, user_email_address)) {
-					e_error_run (NULL, ERROR_DOMAIN ":folder-exists-error", NULL);
+					e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":folder-exists-error", NULL);
 					g_free (user_email_address);
 					gtk_widget_destroy (dialog);
 					destroy_subscription_info (subscription_info);
@@ -216,6 +216,7 @@ subscribe_to_folder (GtkWidget *dialog, gint response, gpointer data)
 
 		folder_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (subscription_info->folder_name_entry)));
 		if (user_email_address && folder_name) {
+			const gchar *err_msg = NULL;
 			result = exchange_account_discover_shared_folder (subscription_info->account,
 									  user_email_address,
 									  folder_name, &folder);
@@ -225,38 +226,41 @@ subscribe_to_folder (GtkWidget *dialog, gint response, gpointer data)
 				case EXCHANGE_ACCOUNT_FOLDER_OK:
 					exchange_account_rescan_tree (subscription_info->account);
 					if (!g_ascii_strcasecmp (e_folder_get_type_string (folder), "mail"))
-						e_error_run (NULL, ERROR_DOMAIN ":folder-restart-evo", NULL);
+						err_msg = ERROR_DOMAIN ":folder-restart-evo";
 					break;
 				case EXCHANGE_ACCOUNT_FOLDER_ALREADY_EXISTS:
-					e_error_run (NULL, ERROR_DOMAIN ":folder-exists-error", NULL);
+					err_msg = ERROR_DOMAIN ":folder-exists-error";
 					break;
 				case EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST:
-					e_error_run (NULL, ERROR_DOMAIN ":folder-doesnt-exist-error", NULL);
+					err_msg = ERROR_DOMAIN ":folder-doesnt-exist-error";
 					break;
 				case EXCHANGE_ACCOUNT_FOLDER_UNKNOWN_TYPE:
-					e_error_run (NULL, ERROR_DOMAIN ":folder-unknown-type", NULL);
+					err_msg = ERROR_DOMAIN ":folder-unknown-type";
 					break;
 				case EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED:
-					e_error_run (NULL, ERROR_DOMAIN ":folder-perm-error", NULL);
+					err_msg = ERROR_DOMAIN ":folder-perm-error";
 					break;
 				case EXCHANGE_ACCOUNT_FOLDER_OFFLINE:
-					e_error_run (NULL, ERROR_DOMAIN ":folder-offline-error", NULL);
+					err_msg = ERROR_DOMAIN ":folder-offline-error";
 					break;
 				case EXCHANGE_ACCOUNT_FOLDER_UNSUPPORTED_OPERATION:
-					e_error_run (NULL, ERROR_DOMAIN ":folder-unsupported-error", NULL);
+					err_msg = ERROR_DOMAIN ":folder-unsupported-error";
 					break;
 				case EXCHANGE_ACCOUNT_FOLDER_GC_NOTREACHABLE:
-					e_error_run (NULL, ERROR_DOMAIN ":folder-no-gc-error", NULL);
+					err_msg = ERROR_DOMAIN ":folder-no-gc-error";
 					break;
 				case EXCHANGE_ACCOUNT_FOLDER_NO_SUCH_USER:
-					e_error_run (NULL, ERROR_DOMAIN ":no-user-error", user_email_address, NULL);
+					e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":no-user-error", user_email_address, NULL);
 					break;
 				case EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR:
-					e_error_run (NULL, ERROR_DOMAIN ":folder-generic-error", NULL);
+					err_msg = ERROR_DOMAIN ":folder-generic-error";
 					break;
 				default:
 					break;
 			}
+
+			if (err_msg)
+				e_error_run (GTK_WINDOW (dialog), err_msg, NULL);
 		}
 
 		if (!folder) {
diff --git a/eplugin/exchange-folder.c b/eplugin/exchange-folder.c
index 5fe4345..dff8edb 100644
--- a/eplugin/exchange-folder.c
+++ b/eplugin/exchange-folder.c
@@ -35,6 +35,7 @@
 #include <camel/camel-folder.h>
 #include <mail/mail-mt.h>
 #include <mail/mail-ops.h>
+#include <shell/e-shell.h>
 
 #include "exchange-operations.h"
 #include "exchange-folder-subscription.h"
@@ -105,6 +106,7 @@ eex_folder_inbox_unsubscribe (const gchar *uri)
 	gchar *stored_path = NULL;
 	const gchar *inbox_uri = NULL;
 	const gchar *inbox_physical_uri = NULL;
+	const gchar *err_msg = NULL;
 	gchar *target_uri = NULL;
 	EFolder *inbox;
 	ExchangeAccountFolderResult result;
@@ -132,32 +134,37 @@ eex_folder_inbox_unsubscribe (const gchar *uri)
 		case EXCHANGE_ACCOUNT_FOLDER_OK:
 			break;
 		case EXCHANGE_ACCOUNT_FOLDER_ALREADY_EXISTS:
-			e_error_run (NULL, ERROR_DOMAIN ":folder-exists-error", NULL);
-			return;
+			err_msg = ERROR_DOMAIN ":folder-exists-error";
+			break;
 		case EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST:
-			e_error_run (NULL, ERROR_DOMAIN ":folder-doesnt-exist-error", NULL);
-			return;
+			err_msg = ERROR_DOMAIN ":folder-doesnt-exist-error";
+			break;
 		case EXCHANGE_ACCOUNT_FOLDER_UNKNOWN_TYPE:
-			e_error_run (NULL, ERROR_DOMAIN ":folder-unknown-type", NULL);
-			return;
+			err_msg = ERROR_DOMAIN ":folder-unknown-type";
+			break;
 		case EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED:
-			e_error_run (NULL, ERROR_DOMAIN ":folder-perm-error", NULL);
-			return;
+			err_msg = ERROR_DOMAIN ":folder-perm-error";
+			break;
 		case EXCHANGE_ACCOUNT_FOLDER_OFFLINE:
-			e_error_run (NULL, ERROR_DOMAIN ":folder-offline-error", NULL);
-			return;
+			err_msg = ERROR_DOMAIN ":folder-offline-error";
+			break;
 		case EXCHANGE_ACCOUNT_FOLDER_UNSUPPORTED_OPERATION:
-			e_error_run (NULL, ERROR_DOMAIN ":folder-unsupported-error", NULL);
-			return;
+			err_msg = ERROR_DOMAIN ":folder-unsupported-error";
+			break;
 		case EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR:
-			e_error_run (NULL, ERROR_DOMAIN ":folder-generic-error", NULL);
-			return;
+			err_msg = ERROR_DOMAIN ":folder-generic-error";
+			break;
 		case EXCHANGE_ACCOUNT_FOLDER_GC_NOTREACHABLE:
-			e_error_run (NULL, ERROR_DOMAIN ":folder-no-gc-error", NULL);
-			return;
+			err_msg = ERROR_DOMAIN ":folder-no-gc-error";
+			break;
 		case EXCHANGE_ACCOUNT_FOLDER_NO_SUCH_USER:
-			e_error_run (NULL, ERROR_DOMAIN ":no-user-error", NULL);
-			return;
+			err_msg = ERROR_DOMAIN ":no-user-error";
+			break;
+	}
+
+	if (err_msg) {
+		e_error_run (e_shell_get_active_window (NULL), err_msg, NULL);
+		return;
 	}
 
 	/* We need to get the physical uri for the Inbox */
@@ -284,7 +291,7 @@ eex_addresssbook_unsubscribe (ESource *source)
 		g_warning ("Config listener not found");
 		return;
 	} else if (mode == OFFLINE_MODE) {
-		e_error_run (NULL, ERROR_DOMAIN ":account-offline-generic", NULL);
+		e_error_run (e_shell_get_active_window (NULL), ERROR_DOMAIN ":account-offline-generic", NULL);
 		return;
 	}
 
@@ -338,7 +345,7 @@ eex_calendar_unsubscribe (ESource *source)
 		g_warning ("Config listener not found");
 		return;
 	} else if (mode == OFFLINE_MODE) {
-		e_error_run (NULL, ERROR_DOMAIN ":account-offline-generic", NULL);
+		e_error_run (e_shell_get_active_window (NULL), ERROR_DOMAIN ":account-offline-generic", NULL);
 		return;
 	}
 
@@ -390,7 +397,7 @@ call_folder_subscribe (const gchar *folder_name)
 		 * (like subscribing to other user's folders, unsubscribing
 		 * etc,) which can not be performed in offline mode
 		 */
-		e_error_run (NULL, ERROR_DOMAIN ":account-offline-generic", NULL);
+		e_error_run (e_shell_get_active_window (NULL), ERROR_DOMAIN ":account-offline-generic", NULL);
 		return;
 	}
 
diff --git a/eplugin/exchange-operations.c b/eplugin/exchange-operations.c
index 35ed781..d6ab918 100644
--- a/eplugin/exchange-operations.c
+++ b/eplugin/exchange-operations.c
@@ -27,6 +27,7 @@
 #include <e-folder-exchange.h>
 #include <exchange-hierarchy.h>
 #include <e-util/e-error.h>
+#include <shell/e-shell.h>
 
 ExchangeConfigListener *exchange_global_config_listener=NULL;
 
@@ -239,26 +240,26 @@ exchange_operations_report_error (ExchangeAccount *account, ExchangeAccountResul
 
 	switch (result) {
 		case EXCHANGE_ACCOUNT_MAILBOX_NA:
-			widget = e_error_new (NULL, error_string, exchange_account_get_username (account), NULL);
+			widget = e_error_new (e_shell_get_active_window (NULL), error_string, exchange_account_get_username (account), NULL);
 			break;
 		case EXCHANGE_ACCOUNT_NO_MAILBOX:
-			widget = e_error_new (NULL, error_string, exchange_account_get_username (account),
+			widget = e_error_new (e_shell_get_active_window (NULL), error_string, exchange_account_get_username (account),
 					      account->exchange_server, NULL);
 			break;
 		case EXCHANGE_ACCOUNT_RESOLVE_ERROR:
 		case EXCHANGE_ACCOUNT_CONNECT_ERROR:
 		case EXCHANGE_ACCOUNT_UNKNOWN_ERROR:
-			widget = e_error_new (NULL, error_string, account->exchange_server, NULL);
+			widget = e_error_new (e_shell_get_active_window (NULL), error_string, account->exchange_server, NULL);
 			break;
 		case EXCHANGE_ACCOUNT_QUOTA_RECIEVE_ERROR:
 		case EXCHANGE_ACCOUNT_QUOTA_SEND_ERROR:
 		case EXCHANGE_ACCOUNT_QUOTA_WARN:
 			quota_value = g_strdup_printf ("%.2f", account->mbox_size);
-			widget = e_error_new (NULL, error_string, quota_value, NULL);
+			widget = e_error_new (e_shell_get_active_window (NULL), error_string, quota_value, NULL);
 			g_free (quota_value);
 			break;
 		default:
-			widget = e_error_new (NULL, error_string, NULL);
+			widget = e_error_new (e_shell_get_active_window (NULL), error_string, NULL);
 	}
 	g_signal_connect ((GtkDialog *)widget, "response", G_CALLBACK (gtk_widget_destroy), widget);
 	gtk_widget_show (widget);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]