From 68d3608b81c2a980cd13352badfcfcfe59477c94 Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Tue, 24 Nov 2009 18:11:23 -0600 Subject: port plugins to use new EError API https://bugzilla.gnome.org/show_bug.cgi?id=602963 --- plugins/backup-restore/backup-restore.c | 14 ++++++++++---- plugins/groupwise-features/camel-gw-listener.c | 7 +++++-- plugins/groupwise-features/mail-retract.c | 4 +++- plugins/groupwise-features/process-meeting.c | 10 +++++++--- plugins/groupwise-features/proxy-login.c | 12 +++++++++--- plugins/groupwise-features/proxy.c | 16 ++++++++++++---- plugins/groupwise-features/share-folder.c | 7 +++++-- plugins/itip-formatter/itip-formatter.c | 17 ++++++++++------- plugins/mailing-list-actions/mailing-list-actions.c | 10 +++++----- plugins/save-calendar/save-calendar.c | 2 +- 10 files changed, 67 insertions(+), 32 deletions(-) diff --git a/plugins/backup-restore/backup-restore.c b/plugins/backup-restore/backup-restore.c index f02e0d8565..19905a6537 100644 --- a/plugins/backup-restore/backup-restore.c +++ b/plugins/backup-restore/backup-restore.c @@ -101,11 +101,15 @@ dialog_prompt_user(GtkWindow *parent, const gchar *string, const gchar *tag, con va_list ap; gint button; guint32 mask = 0; + EError *error = NULL; va_start(ap, arg0); - mbox = e_error_newv(parent, tag, arg0, ap); + error = e_error_newv(tag, arg0, ap); va_end(ap); + mbox = e_error_new_dialog (parent, error); + e_error_free (error); + check = gtk_check_button_new_with_mnemonic (string); /* We should hardcode this to true */ gtk_toggle_button_set_active ((GtkToggleButton *)check, TRUE); @@ -184,7 +188,7 @@ action_settings_backup_cb (GtkAction *action, g_free (path); } } else { - e_error_run ( + e_error_run_dialog_for_args ( GTK_WINDOW (shell_window), "org.gnome.backup-restore:insufficient-permissions", NULL); } @@ -220,7 +224,7 @@ action_settings_restore_cb (GtkAction *action, if (mask & BR_OK) restore (path, mask & BR_START); } else { - e_error_run ( + e_error_run_dialog_for_args ( GTK_WINDOW (shell_window), "org.gnome.backup-restore:invalid-backup", NULL); } @@ -327,7 +331,9 @@ backup_restore_commit (EPlugin *ep, EMConfigTargetAccount *target) if (state) { if (!file || !sanity_check (file)) { - e_error_run ((GtkWindow *)assistant, "org.gnome.backup-restore:invalid-backup", NULL); + e_error_run_dialog_for_args ((GtkWindow *)assistant, + "org.gnome.backup-restore:invalid-backup", + NULL); } else { restore (file, TRUE); } diff --git a/plugins/groupwise-features/camel-gw-listener.c b/plugins/groupwise-features/camel-gw-listener.c index 52b37fc92a..27bd49e36c 100644 --- a/plugins/groupwise-features/camel-gw-listener.c +++ b/plugins/groupwise-features/camel-gw-listener.c @@ -542,7 +542,9 @@ get_addressbook_names_from_server (gchar *source_url) /*FIXME: This error message should be relocated to addressbook and should reflect * that it actually failed to get the addressbooks*/ - e_error_run (e_shell_get_active_window (NULL), "mail:gw-accountsetup-error", poa_address, NULL); + e_error_run_dialog_for_args (e_shell_get_active_window (NULL), + "mail:gw-accountsetup-error", poa_address, + NULL); return NULL; } @@ -654,7 +656,8 @@ add_addressbook_sources (EAccount *account) if (!is_frequent_contacts) { /* display warning message */ - e_error_run (e_shell_get_active_window (NULL), "addressbook:gw-book-list-init", NULL); + e_error_run_dialog_for_args (e_shell_get_active_window (NULL), + "addressbook:gw-book-list-init", NULL); } return TRUE; } diff --git a/plugins/groupwise-features/mail-retract.c b/plugins/groupwise-features/mail-retract.c index 1de2dfdead..cffc371454 100644 --- a/plugins/groupwise-features/mail-retract.c +++ b/plugins/groupwise-features/mail-retract.c @@ -100,7 +100,9 @@ gw_retract_mail_cb (GtkAction *action, EShellView *shell_view) if (n == GTK_RESPONSE_YES) { if (e_gw_connection_retract_request (cnc, id, NULL, FALSE, FALSE) != E_GW_CONNECTION_STATUS_OK ) - e_error_run (GTK_WINDOW (e_shell_view_get_shell_window (shell_view)), "org.gnome.evolution.message.retract:retract-failure", NULL); + e_error_run_dialog_for_args (GTK_WINDOW (e_shell_view_get_shell_window (shell_view)), + "org.gnome.evolution.message.retract:retract-failure", + NULL); else { GtkWidget *dialog; dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, _("Message retracted successfully")); diff --git a/plugins/groupwise-features/process-meeting.c b/plugins/groupwise-features/process-meeting.c index e1e5e185ee..611213bd42 100644 --- a/plugins/groupwise-features/process-meeting.c +++ b/plugins/groupwise-features/process-meeting.c @@ -176,7 +176,8 @@ process_meeting (ECalendarView *cal_view, icalparameter_partstat status) else msg = "org.gnome.evolution.process_meeting:recurrence-decline"; - response = e_error_run (GTK_WINDOW (gtk_widget_get_toplevel ((GtkWidget *)cal_view)), msg, NULL); + response = e_error_run_dialog_for_args (GTK_WINDOW (gtk_widget_get_toplevel ((GtkWidget *)cal_view)), + msg, NULL); if (response == GTK_RESPONSE_YES) { icalproperty *prop; const gchar *uid = icalcomponent_get_uid (r_data->icalcomp); @@ -346,7 +347,9 @@ object_created_cb (CompEditor *ce, gpointer data) gtk_widget_hide (GTK_WIDGET (ce)); - response = e_error_run (GTK_WINDOW (gtk_widget_get_toplevel ((GtkWidget *)ce)), "org.gnome.evolution.process_meeting:resend-retract", NULL); + response = e_error_run_dialog_for_args (GTK_WINDOW (gtk_widget_get_toplevel ((GtkWidget *)ce)), + "org.gnome.evolution.process_meeting:resend-retract", + NULL); if (response == GTK_RESPONSE_NO) { free_thread_data (data); return; @@ -389,7 +392,8 @@ gw_resend_meeting_cb (GtkAction *action, EShellView *shell_view) else msg = "org.gnome.evolution.process_meeting:resend"; - response = e_error_run (GTK_WINDOW (e_shell_view_get_shell_window (shell_view)), msg, NULL); + response = e_error_run_dialog_for_args (GTK_WINDOW (e_shell_view_get_shell_window (shell_view)), + msg, NULL); if (response == GTK_RESPONSE_YES) { mod = CALOBJ_MOD_ALL; } else if (response == GTK_RESPONSE_CANCEL) { diff --git a/plugins/groupwise-features/proxy-login.c b/plugins/groupwise-features/proxy-login.c index 8a8c103614..684dcd6d38 100644 --- a/plugins/groupwise-features/proxy-login.c +++ b/plugins/groupwise-features/proxy-login.c @@ -320,7 +320,9 @@ proxy_soap_login (gchar *email, GtkWindow *error_parent) if (email[i]=='@') name = g_strndup(email, i); else { - e_error_run (error_parent, "org.gnome.evolution.proxy-login:invalid-user",email ,NULL); + e_error_run_dialog_for_args (error_parent, + "org.gnome.evolution.proxy-login:invalid-user", + email, NULL); return; } @@ -328,7 +330,9 @@ proxy_soap_login (gchar *email, GtkWindow *error_parent) If so, it is violating the (li)unix philosophy of User creation. So dont care about that scenario*/ if (e_account_list_find (accounts, E_ACCOUNT_FIND_ID_ADDRESS, email) != NULL) { - e_error_run (error_parent, "org.gnome.evolution.proxy-login:already-loggedin", email, NULL); + e_error_run_dialog_for_args (error_parent, + "org.gnome.evolution.proxy-login:already-loggedin", + email, NULL); g_free (name); return; } @@ -363,7 +367,9 @@ proxy_soap_login (gchar *email, GtkWindow *error_parent) g_free (parent_source_url); camel_url_free (parent); } else { - e_error_run (error_parent, "org.gnome.evolution.proxy-login:invalid-user",email ,NULL); + e_error_run_dialog_for_args (error_parent, + "org.gnome.evolution.proxy-login:invalid-user", + email, NULL); return; } diff --git a/plugins/groupwise-features/proxy.c b/plugins/groupwise-features/proxy.c index 7e2aea30bf..bac1f9ba80 100644 --- a/plugins/groupwise-features/proxy.c +++ b/plugins/groupwise-features/proxy.c @@ -330,7 +330,9 @@ proxy_dialog_store_widgets_data (EAccount *account, gint32 dialog, GtkWindow *pa tmp = destinations; if (!tmp) { - e_error_run (parent, "org.gnome.evolution.proxy:no-user",NULL ,NULL); + e_error_run_dialog_for_args (parent, + "org.gnome.evolution.proxy:no-user", + NULL, NULL); return -1; } @@ -342,11 +344,15 @@ proxy_dialog_store_widgets_data (EAccount *account, gint32 dialog, GtkWindow *pa continue; if (g_strrstr (email, "@") == NULL) { - e_error_run (parent, "org.gnome.evolution.proxy:invalid-user", email, NULL); + e_error_run_dialog_for_args (parent, + "org.gnome.evolution.proxy:invalid-user", + email, NULL); return -1; } if (! g_ascii_strcasecmp(e_gw_connection_get_user_email (prd->cnc), email)) { - e_error_run (parent, "org.gnome.evolution.proxy:invalid-user", email, NULL); + e_error_run_dialog_for_args (parent, + "org.gnome.evolution.proxy:invalid-user", + email, NULL); return -1; } @@ -365,7 +371,9 @@ proxy_dialog_store_widgets_data (EAccount *account, gint32 dialog, GtkWindow *pa return 0; } - e_error_run (parent, "org.gnome.evolution.proxy:user-is-proxy",email ,NULL); + e_error_run_dialog_for_args (parent, + "org.gnome.evolution.proxy:user-is-proxy", + email, NULL); return -1; } } diff --git a/plugins/groupwise-features/share-folder.c b/plugins/groupwise-features/share-folder.c index 9a39678e77..c7850c50e7 100644 --- a/plugins/groupwise-features/share-folder.c +++ b/plugins/groupwise-features/share-folder.c @@ -339,10 +339,13 @@ add_clicked(GtkButton *button, ShareFolder *sf) email = e_destination_get_email (tmp->data); /* You can't share a folder with yourself*/ if (g_strrstr (email, "@") == NULL || (!g_ascii_strcasecmp (email , self_email))) - e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (button))), "org.gnome.evolution.mail_shared_folder:invalid-user",email ,NULL); + e_error_run_dialog_for_args (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (button))), + "org.gnome.evolution.mail_shared_folder:invalid-user", + email, NULL); else { if (!g_ascii_strcasecmp (email, "" )) { - e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (button))), "org.gnome.evolution.mail_shared_folder:no-user",NULL); + e_error_run_dialog_for_args (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (button))), + "org.gnome.evolution.mail_shared_folder:no-user", NULL); return; } diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 5c50ea9124..d6c06fbdf8 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -1319,9 +1319,10 @@ update_attendee_status (struct _itip_puri *pitip) if ((a->status == ICAL_PARTSTAT_DELEGATED) && (del_prop = find_attendee (org_icalcomp, itip_strip_mailto (a->delto))) && !(find_attendee (icalcomp, itip_strip_mailto (a->delto)))) { gint response; delegate = icalproperty_get_attendee (del_prop); - response = e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (pitip->view)), "org.gnome.itip-formatter:add-delegate", - itip_strip_mailto (a->value), - itip_strip_mailto (delegate), NULL); + response = e_error_run_dialog_for_args (GTK_WINDOW (gtk_widget_get_toplevel (pitip->view)), + "org.gnome.itip-formatter:add-delegate", + itip_strip_mailto (a->value), + itip_strip_mailto (delegate), NULL); if (response == GTK_RESPONSE_YES) { icalcomponent_add_property (icalcomp, icalproperty_new_clone (del_prop)); e_cal_component_rescan (comp); @@ -1337,9 +1338,10 @@ update_attendee_status (struct _itip_puri *pitip) gint response; if (a->delfrom && *a->delfrom) { - response = e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (pitip->view)), "org.gnome.itip-formatter:add-delegate", - itip_strip_mailto (a->delfrom), - itip_strip_mailto (a->value), NULL); + response = e_error_run_dialog_for_args (GTK_WINDOW (gtk_widget_get_toplevel (pitip->view)), + "org.gnome.itip-formatter:add-delegate", + itip_strip_mailto (a->delfrom), + itip_strip_mailto (a->value), NULL); if (response == GTK_RESPONSE_YES) { /* Already declared in this function */ icalproperty *prop = find_attendee (icalcomp, itip_strip_mailto (a->value)); @@ -1356,7 +1358,8 @@ update_attendee_status (struct _itip_puri *pitip) } } - response = e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (pitip->view)), "org.gnome.itip-formatter:add-unknown-attendee", NULL); + response = e_error_run_dialog_for_args (GTK_WINDOW (gtk_widget_get_toplevel (pitip->view)), + "org.gnome.itip-formatter:add-unknown-attendee", NULL); if (response == GTK_RESPONSE_YES) { change_status (icalcomp, itip_strip_mailto (a->value), a->status); diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c index 428bb187a7..9e88b356bd 100644 --- a/plugins/mailing-list-actions/mailing-list-actions.c +++ b/plugins/mailing-list-actions/mailing-list-actions.c @@ -122,7 +122,7 @@ emla_list_action_do (CamelFolder *folder, if (!header) { /* there was no header matching the action */ - e_error_run (parent, MESSAGE_NO_HEADER, NULL); + e_error_run_dialog_for_args (parent, MESSAGE_NO_HEADER, NULL); goto exit; } @@ -131,7 +131,7 @@ emla_list_action_do (CamelFolder *folder, if (action == EMLA_ACTION_POST) { while (*headerpos == ' ') headerpos++; if (g_ascii_strcasecmp (headerpos, "NO") == 0) { - e_error_run (parent, MESSAGE_POSTING_NOT_ALLOWED, NULL); + e_error_run_dialog_for_args (parent, MESSAGE_POSTING_NOT_ALLOWED, NULL); goto exit; } } @@ -141,7 +141,7 @@ emla_list_action_do (CamelFolder *folder, /* skip whitespace */ while (*headerpos == ' ') headerpos++; if (*headerpos != '<' || (end = strchr (headerpos++, '>')) == NULL) { - e_error_run ( + e_error_run_dialog_for_args ( parent, MESSAGE_MALFORMED_HEADER, emla_action_headers[t].header, header, NULL); goto exit; @@ -154,7 +154,7 @@ emla_list_action_do (CamelFolder *folder, if (emla_action_headers[t].interactive) send_message_response = GTK_RESPONSE_NO; else - send_message_response = e_error_run ( + send_message_response = e_error_run_dialog_for_args ( parent, MESSAGE_ASK_SEND_MESSAGE, url, NULL); @@ -188,7 +188,7 @@ emla_list_action_do (CamelFolder *folder, } /* if we got here, there's no valid action */ - e_error_run (parent, MESSAGE_NO_ACTION, header, NULL); + e_error_run_dialog_for_args (parent, MESSAGE_NO_ACTION, header, NULL); exit: g_object_unref (action_data->reader); diff --git a/plugins/save-calendar/save-calendar.c b/plugins/save-calendar/save-calendar.c index 7c41a74089..ab6afad801 100644 --- a/plugins/save-calendar/save-calendar.c +++ b/plugins/save-calendar/save-calendar.c @@ -239,7 +239,7 @@ open_for_writing (GtkWindow *parent, const gchar *uri, GError **error) if (err && err->code == G_IO_ERROR_EXISTS) { g_clear_error (&err); - if (e_error_run (parent, E_ERROR_ASK_FILE_EXISTS_OVERWRITE, uri, NULL) == GTK_RESPONSE_OK) { + if (e_error_run_dialog_for_args (parent, E_ERROR_ASK_FILE_EXISTS_OVERWRITE, uri, NULL) == GTK_RESPONSE_OK) { fostream = g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &err); if (err && fostream) { -- cgit v1.2.3