diff options
author | Jonathon Jongsma <jonathon@quotidian.org> | 2009-11-25 07:04:09 +0800 |
---|---|---|
committer | Jonathon Jongsma <jonathon@quotidian.org> | 2009-12-01 03:31:19 +0800 |
commit | 007a734e88eef70451ab12777481e70c52b96ac0 (patch) | |
tree | 123a696f11d2bd76329962a9c960814333b04764 | |
parent | 0da239224f119664577c0d5dc47cab2632b083be (diff) | |
download | gsoc2013-evolution-007a734e88eef70451ab12777481e70c52b96ac0.tar.gz gsoc2013-evolution-007a734e88eef70451ab12777481e70c52b96ac0.tar.zst gsoc2013-evolution-007a734e88eef70451ab12777481e70c52b96ac0.zip |
port addressbook/ to use new EError API
https://bugzilla.gnome.org/show_bug.cgi?id=602963
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 20 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-quick-add.c | 5 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 3 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-model.c | 3 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.c | 10 | ||||
-rw-r--r-- | addressbook/printing/Makefile.am | 1 | ||||
-rw-r--r-- | addressbook/util/addressbook.c | 4 |
8 files changed, 37 insertions, 15 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index fbe8e57434..2973730788 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2344,7 +2344,11 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) width = gdk_pixbuf_get_width (pixbuf); if ((height > 96 || width > 96)) { - prompt_response = e_error_run (GTK_WINDOW (editor->app), "addressbook:prompt-resize", NULL); + prompt_response = + e_error_run_dialog_for_args + (GTK_WINDOW (editor->app), + "addressbook:prompt-resize", + NULL); if (prompt_response == GTK_RESPONSE_YES) { if ( width > height) { @@ -2769,7 +2773,9 @@ categories_clicked (GtkWidget *button, EContactEditor *editor) g_free (categories); return; }else if (!(dialog = GTK_DIALOG (e_categories_dialog_new (categories)))) { - e_error_run (GTK_WINDOW (editor->app), "addressbook:edit-categories", NULL); + e_error_run_dialog_for_args (GTK_WINDOW (editor->app), + "addressbook:edit-categories", + NULL); g_free (categories); return; } @@ -3055,7 +3061,9 @@ save_contact (EContactEditor *ce, gboolean should_close) return; if (ce->target_editable && !e_book_is_writable (ce->source_book)) { - if (e_error_run (GTK_WINDOW (ce->app), "addressbook:prompt-move", NULL) == GTK_RESPONSE_NO) + if (e_error_run_dialog_for_args (GTK_WINDOW (ce->app), + "addressbook:prompt-move", + NULL) == GTK_RESPONSE_NO) return; } @@ -3201,8 +3209,10 @@ e_contact_editor_is_valid (EABEditor *editor) if (validation_error) { g_string_append (errmsg, "."); - e_error_run (GTK_WINDOW (ce->app), "addressbook:generic-error", - _("Invalid contact."), errmsg->str, NULL); + e_error_run_dialog_for_args (GTK_WINDOW (ce->app), + "addressbook:generic-error", + _("Invalid contact."), errmsg->str, + NULL); g_string_free (errmsg, TRUE); return FALSE; } diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 6c134192cd..ced2f2ec12 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -129,7 +129,10 @@ merge_cb (EBook *book, EBookStatus status, gpointer closure) if (e_book_is_writable (book)) eab_merging_book_add_contact (book, qa->contact, NULL, NULL); else - e_error_run (e_shell_get_active_window (NULL), "addressbook:error-read-only", e_source_peek_name (e_book_get_source (book)), NULL); + e_error_run_dialog_for_args (e_shell_get_active_window (NULL), + "addressbook:error-read-only", + e_source_peek_name (e_book_get_source (book)), + NULL); if (qa->cb) qa->cb (qa->contact, qa->closure); diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 8e92d28532..dff1b3da83 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -262,7 +262,8 @@ contact_list_editor_contact_exists (EContactListModel *model, if (!e_contact_list_model_has_email (model, email)) return FALSE; - return (e_error_run (e_shell_get_active_window (NULL), tag, email, NULL) != GTK_RESPONSE_YES); + return (e_error_run_dialog_for_args (e_shell_get_active_window (NULL), + tag, email, NULL) != GTK_RESPONSE_YES); } static void diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c index a5fc9937ac..87fd8e8fec 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -153,7 +153,8 @@ e_contact_list_model_add_email (EContactListModel *model, g_return_if_fail (email != NULL); if (e_contact_list_model_has_email (model, email)) - if (e_error_run (e_shell_get_active_window (NULL), tag, email, NULL) != GTK_RESPONSE_YES) + if (e_error_run_dialog_for_args (e_shell_get_active_window + (NULL), tag, email, NULL) != GTK_RESPONSE_YES) return; destination = e_destination_new (); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 2cb8094ff1..3e10722c00 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -894,7 +894,7 @@ backend_died (EAddressbookView *view) model = e_addressbook_view_get_model (view); book = e_addressbook_model_get_book (model); - e_error_run ( + e_error_run_dialog_for_args ( GTK_WINDOW (shell_window), "addressbook:backend-died", e_book_get_uri (book), NULL); @@ -1013,7 +1013,9 @@ delete_contacts_cb (EBook *book, EBookStatus status, gpointer closure) case E_BOOK_ERROR_CANCELLED : break; case E_BOOK_ERROR_PERMISSION_DENIED : - e_error_run (e_shell_get_active_window (NULL), "addressbook:contact-delete-error-perm", NULL); + e_error_run_dialog_for_args (e_shell_get_active_window (NULL), + "addressbook:contact-delete-error-perm", + NULL); break; default : /* Unknown error */ diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index e445b05d40..e80e65575f 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -86,7 +86,9 @@ eab_error_dialog (const gchar *msg, EBookStatus status) status_str = status_to_string [status]; if (status_str) - e_error_run (e_shell_get_active_window (NULL), "addressbook:generic-error", msg, _(status_str), NULL); + e_error_run_dialog_for_args (e_shell_get_active_window (NULL), + "addressbook:generic-error", + msg, _(status_str), NULL); } void @@ -145,7 +147,7 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status) } } - dialog = e_error_new ((GtkWindow *) parent, "addressbook:load-error", label_string, NULL); + dialog = e_error_new_dialog_for_args ((GtkWindow *) parent, "addressbook:load-error", label_string, NULL); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (dialog); @@ -187,13 +189,13 @@ eab_search_result_dialog (GtkWidget *parent, g_return_if_reached (); } - e_error_run ((GtkWindow *) parent, "addressbook:search-error", str, NULL); + e_error_run_dialog_for_args ((GtkWindow *) parent, "addressbook:search-error", str, NULL); } gint eab_prompt_save_dialog (GtkWindow *parent) { - return e_error_run (parent, "addressbook:prompt-save", NULL); + return e_error_run_dialog_for_args (parent, "addressbook:prompt-save", NULL); } static gchar * diff --git a/addressbook/printing/Makefile.am b/addressbook/printing/Makefile.am index f47b815079..217a4288fb 100644 --- a/addressbook/printing/Makefile.am +++ b/addressbook/printing/Makefile.am @@ -41,6 +41,7 @@ contact_print_test_LDADD = \ libecontactprint.la \ $(top_builddir)/addressbook/util/libeabutil.la \ $(top_builddir)/e-util/libeutil.la \ + $(top_builddir)/shell/libeshell.la \ $(EVOLUTION_ADDRESSBOOK_LIBS) EXTRA_DIST = \ diff --git a/addressbook/util/addressbook.c b/addressbook/util/addressbook.c index 59d87659c7..6e70e5f3f3 100644 --- a/addressbook/util/addressbook.c +++ b/addressbook/util/addressbook.c @@ -108,7 +108,9 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure) goto done; } } else if (status == E_BOOK_ERROR_INVALID_SERVER_VERSION) { - e_error_run (e_shell_get_active_window (NULL), "addressbook:server-version", NULL); + e_error_run_dialog_for_args (e_shell_get_active_window (NULL), + "addressbook:server-version", + NULL); status = E_BOOK_ERROR_OK; goto done; } else if (status == E_BOOK_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD) { |