From 6823de81f37ab21ba2a9627ed09ecc52425ba1e0 Mon Sep 17 00:00:00 2001 From: Philip Van Hoof Date: Tue, 4 Jan 2005 11:52:21 +0000 Subject: Use standard error messages 2005-01-04 Philip Van Hoof * csv-format.c, rdf-format.c: Use standard error messages svn path=/trunk/; revision=28233 --- plugins/save-calendar/ChangeLog | 4 ++++ plugins/save-calendar/csv-format.c | 22 +++++----------------- plugins/save-calendar/rdf-format.c | 22 +++++----------------- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/plugins/save-calendar/ChangeLog b/plugins/save-calendar/ChangeLog index a8ee1d64a4..a14aacba12 100644 --- a/plugins/save-calendar/ChangeLog +++ b/plugins/save-calendar/ChangeLog @@ -1,3 +1,7 @@ +2005-01-04 Philip Van Hoof + + * csv-format.c, rdf-format.c: Use standard error messages + 2004-12-27 Philip Van Hoof * csv-format.c, rdf-format.c: Warning when overwriting file diff --git a/plugins/save-calendar/csv-format.c b/plugins/save-calendar/csv-format.c index 06124f1bd9..80a32d2386 100644 --- a/plugins/save-calendar/csv-format.c +++ b/plugins/save-calendar/csv-format.c @@ -40,6 +40,8 @@ #include #include +#include "widgets/misc/e-error.h" + #include "format-handler.h" typedef struct _CsvConfig CsvConfig; @@ -349,23 +351,9 @@ do_save_calendar_csv (FormatHandler *handler, EPlugin *ep, ECalPopupTargetSource uri = gnome_vfs_uri_new (dest_uri); result = gnome_vfs_open_uri (&handle, uri, GNOME_VFS_OPEN_READ); - if (result == GNOME_VFS_OK) { - GtkWidget *warning = - gtk_message_dialog_new_with_markup (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - _("File exists \"%s\".\n" - "Do you wish to overwrite it?"), dest_uri); - - gtk_dialog_add_button (GTK_DIALOG (warning), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); - gtk_dialog_add_button (GTK_DIALOG (warning), _("_Overwrite"), GTK_RESPONSE_YES); - - doit = FALSE; - if (gtk_dialog_run (GTK_DIALOG (warning)) == GTK_RESPONSE_YES) - doit = TRUE; - gtk_widget_destroy (warning); - } + if (result == GNOME_VFS_OK) + doit = e_error_run(gtk_widget_get_toplevel (GTK_WIDGET (target->selector)), + E_ERROR_ASK_FILE_EXISTS_OVERWRITE, dest_uri, NULL) == GTK_RESPONSE_OK; if (doit) { result = gnome_vfs_open_uri (&handle, uri, GNOME_VFS_OPEN_WRITE); diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c index bcacd1f373..eb8154f782 100644 --- a/plugins/save-calendar/rdf-format.c +++ b/plugins/save-calendar/rdf-format.c @@ -45,6 +45,8 @@ #include #include +#include "widgets/misc/e-error.h" + #include "format-handler.h" static void @@ -214,23 +216,9 @@ do_save_calendar_rdf (FormatHandler *handler, EPlugin *ep, ECalPopupTargetSource uri = gnome_vfs_uri_new (dest_uri); result = gnome_vfs_open_uri (&handle, uri, GNOME_VFS_OPEN_READ); - if (result == GNOME_VFS_OK) { - GtkWidget *warning = - gtk_message_dialog_new_with_markup (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - _("File exists \"%s\".\n" - "Do you wish to overwrite it?"), dest_uri); - - gtk_dialog_add_button (GTK_DIALOG (warning), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); - gtk_dialog_add_button (GTK_DIALOG (warning), _("_Overwrite"), GTK_RESPONSE_YES); - - doit = FALSE; - if (gtk_dialog_run (GTK_DIALOG (warning)) == GTK_RESPONSE_YES) - doit = TRUE; - gtk_widget_destroy (warning); - } + if (result == GNOME_VFS_OK) + doit = e_error_run(gtk_widget_get_toplevel (GTK_WIDGET (target->selector)), + E_ERROR_ASK_FILE_EXISTS_OVERWRITE, dest_uri, NULL) == GTK_RESPONSE_OK; if (doit) { result = gnome_vfs_open_uri (&handle, uri, GNOME_VFS_OPEN_WRITE); -- cgit v1.2.3