aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2008-01-10 17:31:07 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2008-01-10 17:31:07 +0800
commit510eb1f01695c5d92df90bb3a2d2fbbc2bec8f40 (patch)
treebd1ab6db455a33645abebb4c306a2999a707f356 /mail/em-utils.c
parente5cef658e433f10644bbccb74d10e4f1db4e4c24 (diff)
downloadgsoc2013-evolution-510eb1f01695c5d92df90bb3a2d2fbbc2bec8f40.tar.gz
gsoc2013-evolution-510eb1f01695c5d92df90bb3a2d2fbbc2bec8f40.tar.zst
gsoc2013-evolution-510eb1f01695c5d92df90bb3a2d2fbbc2bec8f40.zip
** Most of the errors are now non-intrusive
2008-01-10 Srinivasa Ragavan <sragavan@novell.com> ** Most of the errors are now non-intrusive * em-folder-utils.c: (emfu_copy_folder_selected), (emfu_delete_response), (em_folder_utils_delete_folder): * em-folder-view.c: (emfv_delete_msg_response): * em-utils.c: (em_utils_edit_filters), (em_utils_save_part_to_file), (em_utils_temp_save_part), (error_response), (em_utils_show_error_silent), (em_utils_show_info_silent): * em-utils.h: * mail-autofilter.c: (mail_filter_delete_uri): * mail-component.c: (mail_component_show_logger): * mail-mt.c: (mail_msg_free): * mail-session.c: (do_user_message): * mail-vfolder.c: (mail_vfolder_delete_uri), (vfolder_edit_rule): svn path=/trunk/; revision=34787
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r--mail/em-utils.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 552f7cc609..1e41708afa 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -79,6 +79,7 @@
#include "em-format-quote.h"
#include "em-account-editor.h"
#include "e-attachment.h"
+#include "e-activity-handler.h"
static void emu_save_part_done (CamelMimePart *part, char *name, int done, void *data);
@@ -299,7 +300,8 @@ em_utils_edit_filters (GtkWidget *parent)
g_free (system);
if (((RuleContext *) fc)->error) {
- e_error_run((GtkWindow *)parent, "mail:filter-load-error", ((RuleContext *)fc)->error, NULL);
+ GtkWidget *w = e_error_new((GtkWindow *)parent, "mail:filter-load-error", ((RuleContext *)fc)->error, NULL);
+ em_utils_show_error_silent (w);
return;
}
@@ -564,8 +566,9 @@ em_utils_save_part_to_file(GtkWidget *parent, const char *filename, CamelMimePar
dirname = g_path_get_dirname(filename);
if (g_mkdir_with_parents(dirname, 0777) == -1) {
- e_error_run((GtkWindow *)parent, "mail:no-create-path", filename, g_strerror(errno), NULL);
+ GtkWidget *w = e_error_new((GtkWindow *)parent, "mail:no-create-path", filename, g_strerror(errno), NULL);
g_free(dirname);
+ em_utils_show_error_silent (w);
return FALSE;
}
g_free(dirname);
@@ -578,7 +581,8 @@ em_utils_save_part_to_file(GtkWidget *parent, const char *filename, CamelMimePar
}
if (g_stat(filename, &st) != -1 && !S_ISREG(st.st_mode)) {
- e_error_run((GtkWindow *)parent, "mail:no-write-path-notfile", filename, NULL);
+ GtkWidget *w = e_error_new((GtkWindow *)parent, "mail:no-write-path-notfile", filename, NULL);
+ em_utils_show_error_silent (w);
return FALSE;
}
@@ -1275,10 +1279,12 @@ em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part, gboolean mode)
const char *filename;
char *tmpdir, *path, *utf8_mfilename = NULL, *mfilename = NULL;
int done;
+ GtkWidget *w;
tmpdir = e_mkdtemp("evolution-tmp-XXXXXX");
if (tmpdir == NULL) {
- e_error_run((GtkWindow *)parent, "mail:no-create-tmp-path", g_strerror(errno), NULL);
+ w = e_error_new((GtkWindow *)parent, "mail:no-create-tmp-path", g_strerror(errno), NULL);
+ em_utils_show_error_silent (w);
return NULL;
}
@@ -2214,3 +2220,27 @@ em_utils_clear_get_password_canceled_accounts_flag (void)
g_object_unref (iter);
}
}
+
+
+static void error_response(GtkObject *o, int button, void *data)
+{
+ gtk_widget_destroy((GtkWidget *)o);
+}
+
+void
+em_utils_show_error_silent (GtkWidget *widget)
+{
+ EActivityHandler *handler = mail_component_peek_activity_handler (mail_component_peek ());
+ if(!g_object_get_data ((GObject *) widget, "response-handled"))
+ g_signal_connect(widget, "response", G_CALLBACK(error_response), NULL);
+ e_activity_handler_make_error (handler, "mail", E_LOG_ERROR, widget);
+}
+
+void
+em_utils_show_info_silent (GtkWidget *widget)
+{
+ EActivityHandler *handler = mail_component_peek_activity_handler (mail_component_peek ());
+ if(!g_object_get_data ((GObject *) widget, "response-handled"))
+ g_signal_connect(widget, "response", G_CALLBACK(error_response), NULL);
+ e_activity_handler_make_error (handler, "mail", E_LOG_WARNINGS, widget);
+}