[evolution-rss] migrate to EAlert for error dialogs



commit a6a5401935591c3ee2b118840d19e3e2465943c8
Author: Lucian Langa <lucilanga gnome org>
Date:   Wed Dec 2 08:53:48 2009 +0200

    migrate to EAlert for error dialogs

 src/rss-config-factory.c |   45 +++++++++++++++++++++++++++++++++++++++++----
 src/rss.c                |   38 +++++++++++++++++++++++++++++++-------
 2 files changed, 72 insertions(+), 11 deletions(-)
---
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index aed9694..f5c069d 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -725,7 +725,11 @@ feeds_dialog_add(GtkDialog *d, gpointer data)
 
 	if (feed->dialog)
                 gtk_widget_destroy(feed->dialog);
+#if EVOLUTION_VERSION < 22904
 	msg_feeds = e_error_new(
+#else
+	msg_feeds = e_alert_new_dialog_for_args(
+#endif
 		GTK_WINDOW(rf->preferences),
 		"org-gnome-evolution-rss:rssmsg",
 		"",
@@ -990,7 +994,11 @@ remove_feed_dialog(gchar *msg)
   GtkWidget *checkbutton1;
   GtkWidget *dialog_action_area1;
 
+#if EVOLUTION_VERSION < 22904
   dialog1 = e_error_new(
+#else
+  dialog1 = e_alert_new_dialog_for_args(
+#endif
 		GTK_WINDOW(rf->preferences),
 		"org-gnome-evolution-rss:ask-delete-feed",
 		msg,
@@ -1063,8 +1071,13 @@ process_dialog_edit(add_feed *feed, gchar *url, gchar *feed_name)
 	gpointer md5;
 	CamelException ex;
 	CamelStore *store = rss_component_peek_local_store();
+	GtkWidget *msg_feeds;
 
-	GtkWidget *msg_feeds = e_error_new(
+#if EVOLUTION_VERSION < 22904
+	msg_feeds = e_error_new(
+#else
+	msg_feeds = e_alert_new_dialog_for_args(
+#endif
 		GTK_WINDOW(rf->preferences),
 		"org-gnome-evolution-rss:rssmsg",
 		"",
@@ -1149,7 +1162,11 @@ process_dialog_edit(add_feed *feed, gchar *url, gchar *feed_name)
 				camel_exception_init (&ex);
                                 camel_store_rename_folder (store, a, b, &ex);
                                 if (camel_exception_is_set (&ex)) {
-                                        e_error_run(NULL,
+#if EVOLUTION_VERSION < 22904
+                                        e_error_run(GTK_WINDOW(rf->preferences),
+#else
+                                        e_alert_run_dialog_for_args(GTK_WINDOW(rf->preferences),
+#endif
 						"mail:no-rename-folder",
 						a,
 						b,
@@ -1310,7 +1327,11 @@ import_opml(gchar *file)
 	}
         doc = src;
         msg = g_strdup(_("Importing feeds..."));
+#if EVOLUTION_VERSION < 22904
         import_dialog = e_error_new(
+#else
+        import_dialog = e_alert_new_dialog_for_args(
+#endif
 		GTK_WINDOW(rf->preferences),
 		"shell:importing",
 		msg,
@@ -1802,7 +1823,11 @@ export_opml(gchar *file)
 
 
         gchar *msg = g_strdup(_("Exporting feeds..."));
+#if EVOLUTION_VERSION < 22904
         import_dialog = e_error_new(
+#else
+        import_dialog = e_alert_new_dialog_for_args(
+#endif
 			GTK_WINDOW(rf->preferences),
 			"shell:importing",
 			msg,
@@ -1846,7 +1871,11 @@ export_opml(gchar *file)
                 fwrite(opml, strlen(opml), 1, f);
                 fclose(f);
         } else {
-                e_error_run(NULL,
+#if EVOLUTION_VERSION < 22904
+                e_error_run(GTK_WINDOW(rf->preferences),
+#else
+                e_alert_run_dialog_for_args(GTK_WINDOW(rf->preferences),
+#endif
                         "org-gnome-evolution-rss:feederr",
                         _("Error exporting feeds!"),
                         g_strerror(errno),
@@ -1934,7 +1963,11 @@ process_cookies(SoupCookieJar *jar)
 	ccurrent = 0;
 	ctotal = 0;
 	list = soup_cookie_jar_all_cookies(jar);
+#if EVOLUTION_VERSION < 22904
 	import_dialog = e_error_new(
+#else
+	import_dialog = e_alert_new_dialog_for_args(
+#endif
 			GTK_WINDOW(rf->preferences),
 			"shell:importing",
 			msg,
@@ -2121,7 +2154,11 @@ export_cb (GtkWidget *widget, gpointer data)
                 decorate_export_fs(export);
                 gtk_dialog_set_default_response (GTK_DIALOG (export), GTK_RESPONSE_OK);
                 if (g_hash_table_size(rf->hrname)<1) {
-                        e_error_run(NULL,
+#if EVOLUTION_VERSION < 22904
+                        e_error_run(GTK_WINDOW(export),
+#else
+                        e_alert_run_dialog_for_args(GTK_WINDOW(export),
+#endif
                                 "org-gnome-evolution-rss:generr",
                                 _("No RSS feeds configured!\nUnable to export."),
                                 NULL);
diff --git a/src/rss.c b/src/rss.c
index a51e466..08df600 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -364,10 +364,11 @@ rss_error(gpointer key, gchar *name, gchar *error, gchar *emsg)
 			windows = e_shell_get_watched_windows (shell);
 			parent = (windows != NULL) ? GTK_WINDOW (windows->data) : NULL;
 
-			ed  = e_error_new(parent, "org-gnome-evolution-rss:feederr",
-			             error, msg, NULL);
+			ed = e_alert_new_dialog_for_args(parent,
+					 "org-gnome-evolution-rss:feederr",
+					error, msg, NULL);
 #else
-			ed  = e_error_new(NULL, "org-gnome-evolution-rss:feederr",
+			ed = e_error_new(NULL, "org-gnome-evolution-rss:feederr",
 			             error, msg, NULL);
 #endif
 			newkey = g_strdup(key);
@@ -409,8 +410,9 @@ rss_error(gpointer key, gchar *name, gchar *error, gchar *emsg)
 		windows = e_shell_get_watched_windows (shell);
 		parent = (windows != NULL) ? GTK_WINDOW (windows->data) : NULL;
 
-                ed  = e_error_new(parent, "org-gnome-evolution-rss:feederr",
-                             error, msg, NULL);
+                ed  = e_alert_new_dialog_for_args(parent,
+				"org-gnome-evolution-rss:feederr",
+				error, msg, NULL);
 #else
                 ed  = e_error_new(NULL, "org-gnome-evolution-rss:feederr",
                              error, msg, NULL);
@@ -4175,7 +4177,12 @@ rss_delete_feed(gchar *full_path, gboolean folder)
         camel_exception_init (&ex);
 	rss_delete_folders (store, full_path, &ex);
 	if (camel_exception_is_set (&ex)) {
-		e_error_run(NULL,
+#if EVOLUTION_VERSION < 22904
+		e_error_run(e_shell_get_active_window (NULL),
+#else
+		e_alert_run_dialog_for_args(
+			e_shell_get_active_window (NULL),
+#endif
 			"mail:no-delete-folder", full_path, ex.desc, NULL);
 		camel_exception_clear (&ex);
 	}
@@ -4425,7 +4432,11 @@ update_status_icon(const char *channel, gchar *title)
 			g_queue_pop_head(status_msg);
 		g_queue_foreach(status_msg, flaten_status, flat_status_msg);
 		stext = g_markup_escape_text(flat_status_msg, strlen(flat_status_msg));
+#if GTK_VERSION >= 2016000
 		gtk_status_icon_set_tooltip_text (status_icon, stext);
+#else
+		gtk_status_icon_set_tooltip (status_icon, stext);
+#endif
 		g_free(stext);
 		gtk_status_icon_set_visible (status_icon, TRUE);
 		if (gconf_client_get_bool (rss_gconf, GCONF_KEY_BLINK_ICON, NULL)
@@ -4791,7 +4802,20 @@ org_gnome_evolution_rss(void *ep, EMPopupTargetSelect *t)
 	flabel		= status_label;
 #else
 
-	readrss_dialog = e_error_new(NULL, "org-gnome-evolution-rss:readrss",
+#if (EVOLUTION_VERSION >= 22900) //kb//
+	EShell *shell;
+	GtkWindow *parent;
+	GList *windows;
+
+	shell = e_shell_get_default ();
+	windows = e_shell_get_watched_windows (shell);
+	parent = (windows != NULL) ? GTK_WINDOW (windows->data) : NULL;
+
+	readrss_dialog = e_alert_new_dialog_for_args(parent,
+#else
+	readrss_dialog = e_error_new(NULL,
+#endif
+		"org-gnome-evolution-rss:readrss",
 		_("Reading RSS feeds..."), NULL);
 
 	g_signal_connect(readrss_dialog, "response", G_CALLBACK(readrss_dialog_cb), NULL);



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