aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog25
-rw-r--r--calendar/Makefile.am13
-rw-r--r--calendar/calendar-errors.xml157
-rw-r--r--calendar/calendar-errors.xml.h106
-rw-r--r--calendar/gui/dialogs/cancel-comp.c40
-rw-r--r--calendar/gui/dialogs/delete-comp.c92
-rw-r--r--calendar/gui/dialogs/save-comp.c32
-rw-r--r--calendar/gui/dialogs/send-comp.c39
-rw-r--r--calendar/gui/e-tasks.c16
-rw-r--r--calendar/gui/gnome-cal.c16
10 files changed, 371 insertions, 165 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 506134211b..f4fe0fec20 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,8 +1,27 @@
+2004-05-25 Jeffrey Stedfast <fejj@novell.com>
+
+ * Makefile.am: Make calendar-errors.xml.h and install the xml
+ file.
+
+ * calendar-errors.xml: New error definitions file.
+
+ * gui/gnome-cal.c (backend_died_cb): Use e-error
+
+ * gui/e-tasks.c (backend_died_cb): Use e-error
+
+ * gui/dialogs/send-comp.c (send_component_dialog): Use e-error
+
+ * gui/dialogs/save-comp.c (save_component_dialog): Use e-error
+
+ * gui/dialogs/delete-comp.c (delete_component_dialog): Use e-error
+
+ * gui/dialogs/cancel-comp.c (cancel_component_dialog): Use e-error
+
2004-05-25 Sivaiah Nallagatla <snallagatla@novell.com>
- * common/authentication.c (auth_func_cb) : read the "auth-domain"
- property to use as component name for e-password calls instead of
- hard coded component name
+ * common/authentication.c (auth_func_cb): read the "auth-domain"
+ property to use as component name for e-password calls instead of
+ hard coded component name
2004-05-25 Trent Lloyd <lathiat@bur.st>
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 9e74d29e99..56acae59c8 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -6,7 +6,20 @@ endif
SUBDIRS = idl common gui importers $(CONDUIT_DIR)
+error_DATA = calendar-errors.xml
+error_i18n = $(error_DATA:.xml=.xml.h)
+errordir = $(privdatadir)/errors
+%.xml.h: %.xml
+ $(top_builddir)/e-util/e-error-tool $^
+
EXTRA_DIST = \
ChangeLog.pre-1-4 \
+ $(error_DATA) \
zones.h
+dist-hook:
+ cd $(distdir); rm -f $(BUILT_SOURCES)
+
+BUILT_SOURCES = $(error_i18n)
+
+CLEANFILES = $(BUILT_SOURCES)
diff --git a/calendar/calendar-errors.xml b/calendar/calendar-errors.xml
new file mode 100644
index 0000000000..14c36de2e2
--- /dev/null
+++ b/calendar/calendar-errors.xml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<error-list domain="calendar">
+
+ <error id="prompt-cancel-meeting" type="question" defult="GTK_RESPONSE_YES">
+ <primary>Would you like to send all the participants a cancellation notice?</primary>
+ <secondary>If you don't send a cancellation notice, the other participants may not know the meeting is canceled.</secondary>
+ <button label="Don't Send" response="GTK_RESPONSE_NO"/>
+ <button label="Send Notice" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-meeting" type="question" defult="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete this meeting?</primary>
+ <secondary>All information on this meeting will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-cancel-task" type="question" defult="GTK_RESPONSE_YES">
+ <primary>Would you like to send all the participants a cancellation notice?</primary>
+ <secondary>If you don't send a cancellation notice, the other participants may not know the task has been deleted.</secondary>
+ <button label="Don't Send" response="GTK_RESPONSE_NO"/>
+ <button label="Send Notice" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-task" type="question" defult="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete this task?</primary>
+ <secondary>All information on this task will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-cancel-journal" type="question" defult="GTK_RESPONSE_YES">
+ <primary>Would you like to send a cancellation notice for this journal entry?</primary>
+ <secondary>If you don't send a cancellation notice, the other participants may not know the journal has been deleted.</secondary>
+ <button label="Don't Send" response="GTK_RESPONSE_NO"/>
+ <button label="Send Notice" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-journal" type="question" defult="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete this journal entry?</primary>
+ <secondary>All information on this journal entry will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-titled-appointment" type="question" default="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete the appointment titled '{0}'?</primary>
+ <secondary>All information on this appointment will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-appointment" type="question" default="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete this appointment?</primary>
+ <secondary>All information on this appointment will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-named-task" type="question" default="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete the '{0}' task?</primary>
+ <secondary>All information on this task will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-task" type="question" default="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete this task?</primary>
+ <secondary>All information on this task will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-named-journal" type="question" default="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete the journal entry '{0}'?</primary>
+ <secondary>All information in this journal will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-journal" type="question" default="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete this journal entry?</primary>
+ <secondary>All information in this journal will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-appointments" type="question" default="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete these {0} appointments?</primary>
+ <secondary>All information on these appointments will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-tasks" type="question" default="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete these {0} tasks?</primary>
+ <secondary>All information on these tasks will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-delete-journals" type="question" default="GTK_RESPONSE_NO">
+ <primary>Are you sure you want to delete these {0} journal entries?</primary>
+ <secondary>All information in these journal entries will be deleted and can not be restored.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-save-appointment" type="question" default="GTK_RESPONSE_YES">
+ <title>Save Appointment</title>
+ <primary>Would you like to save your changes to this appointment?</primary>
+ <secondary>You have made changes to this appointment, but not yet saved them.</secondary>
+ <button label="Discard Changes" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="Save Changes" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-meeting-invite" type="question" default="GTK_RESPONSE_YES">
+ <primary>Would you like to send meeting invitations to participants?</primary>
+ <secondary>Email invitations will be sent to all participants and allow them to RSVP.</secondary>
+ <button label="Don't Send" response="GTK_RESPONSE_NO"/>
+ <button label="Send" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-send-updated-meeting-info" type="question" default="GTK_RESPONSE_YES">
+ <primary>Would you like to send updated meeting information to participants?</primary>
+ <secondary>Sending updated information allows other participants to keep their calendars up to date.</secondary>
+ <button label="Don't Send" response="GTK_RESPONSE_NO"/>
+ <button label="Send" response="GTK_RESPONSE_YES"/>
+ </error>
+
+
+ <error id="prompt-send-task" type="question" default="GTK_RESPONSE_YES">
+ <primary>Would you like to send this task to participants?</primary>
+ <secondary>Email invitations will be sent to all participants and allow them to accept this task.</secondary>
+ <button label="Don't Send" response="GTK_RESPONSE_NO"/>
+ <button label="Send" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="prompt-send-updated-task-info" type="question" default="GTK_RESPONSE_YES">
+ <primary>Would you like to send updated task information to participants?</primary>
+ <secondary>Sending updated information allows other participants to keep their task lists up to date.</secondary>
+ <button label="Don't Send" response="GTK_RESPONSE_NO"/>
+ <button label="Send" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="tasks-crashed" type="error">
+ <primary>The Evolution tasks have quit unexpectedly.</primary>
+ <secondary>Your tasks will not be available until Evolution is restarted.</secondary>
+ </error>
+
+ <error id="calendar-crashed" type="error">
+ <primary>The Evolution calendar has quit unexpectedly.</primary>
+ <secondary>Your calendars will not be available until Evolution is restarted.</secondary>
+ </error>
+
+</error-list>
diff --git a/calendar/calendar-errors.xml.h b/calendar/calendar-errors.xml.h
new file mode 100644
index 0000000000..cc4681c966
--- /dev/null
+++ b/calendar/calendar-errors.xml.h
@@ -0,0 +1,106 @@
+/* calendar:prompt-cancel-meeting primary */
+char *s = N_("Would you like to send all the participants a cancellation notice?");
+/* calendar:prompt-cancel-meeting secondary */
+char *s = N_("If you don't send a cancellation notice, the other participants may not know the meeting is canceled.");
+char *s = N_("Don't Send");
+char *s = N_("Send Notice");
+/* calendar:prompt-delete-meeting primary */
+char *s = N_("Are you sure you want to delete this meeting?");
+/* calendar:prompt-delete-meeting secondary */
+char *s = N_("All information on this meeting will be deleted and can not be restored.");
+/* calendar:prompt-cancel-task primary */
+char *s = N_("Would you like to send all the participants a cancellation notice?");
+/* calendar:prompt-cancel-task secondary */
+char *s = N_("If you don't send a cancellation notice, the other participants may not know the task has been deleted.");
+char *s = N_("Don't Send");
+char *s = N_("Send Notice");
+/* calendar:prompt-delete-task primary */
+char *s = N_("Are you sure you want to delete this task?");
+/* calendar:prompt-delete-task secondary */
+char *s = N_("All information on this task will be deleted and can not be restored.");
+/* calendar:prompt-cancel-journal primary */
+char *s = N_("Would you like to send a cancellation notice for this journal entry?");
+/* calendar:prompt-cancel-journal secondary */
+char *s = N_("If you don't send a cancellation notice, the other participants may not know the journal has been deleted.");
+char *s = N_("Don't Send");
+char *s = N_("Send Notice");
+/* calendar:prompt-delete-journal primary */
+char *s = N_("Are you sure you want to delete this journal entry?");
+/* calendar:prompt-delete-journal secondary */
+char *s = N_("All information on this journal entry will be deleted and can not be restored.");
+/* calendar:prompt-delete-titled-appointment primary */
+char *s = N_("Are you sure you want to delete the appointment titled '{0}'?");
+/* calendar:prompt-delete-titled-appointment secondary */
+char *s = N_("All information on this appointment will be deleted and can not be restored.");
+/* calendar:prompt-delete-appointment primary */
+char *s = N_("Are you sure you want to delete this appointment?");
+/* calendar:prompt-delete-appointment secondary */
+char *s = N_("All information on this appointment will be deleted and can not be restored.");
+/* calendar:prompt-delete-named-task primary */
+char *s = N_("Are you sure you want to delete the '{0}' task?");
+/* calendar:prompt-delete-named-task secondary */
+char *s = N_("All information on this task will be deleted and can not be restored.");
+/* calendar:prompt-delete-task primary */
+char *s = N_("Are you sure you want to delete this task?");
+/* calendar:prompt-delete-task secondary */
+char *s = N_("All information on this task will be deleted and can not be restored.");
+/* calendar:prompt-delete-named-journal primary */
+char *s = N_("Are you sure you want to delete the journal entry '{0}'?");
+/* calendar:prompt-delete-named-journal secondary */
+char *s = N_("All information in this journal will be deleted and can not be restored.");
+/* calendar:prompt-delete-journal primary */
+char *s = N_("Are you sure you want to delete this journal entry?");
+/* calendar:prompt-delete-journal secondary */
+char *s = N_("All information in this journal will be deleted and can not be restored.");
+/* calendar:prompt-delete-appointments primary */
+char *s = N_("Are you sure you want to delete these {0} appointments?");
+/* calendar:prompt-delete-appointments secondary */
+char *s = N_("All information on these appointments will be deleted and can not be restored.");
+/* calendar:prompt-delete-tasks primary */
+char *s = N_("Are you sure you want to delete these {0} tasks?");
+/* calendar:prompt-delete-tasks secondary */
+char *s = N_("All information on these tasks will be deleted and can not be restored.");
+/* calendar:prompt-delete-journals primary */
+char *s = N_("Are you sure you want to delete these {0} journal entries?");
+/* calendar:prompt-delete-journals secondary */
+char *s = N_("All information in these journal entries will be deleted and can not be restored.");
+/* calendar:prompt-save-appointment title */
+char *s = N_("Save Appointment");
+/* calendar:prompt-save-appointment primary */
+char *s = N_("Would you like to save your changes to this appointment?");
+/* calendar:prompt-save-appointment secondary */
+char *s = N_("You have made changes to this appointment, but not yet saved them.");
+char *s = N_("Discard Changes");
+char *s = N_("Save Changes");
+/* calendar:prompt-meeting-invite primary */
+char *s = N_("Would you like to send meeting invitations to participants?");
+/* calendar:prompt-meeting-invite secondary */
+char *s = N_("Email invitations will be sent to all participants and allow them to RSVP.");
+char *s = N_("Don't Send");
+char *s = N_("Send");
+/* calendar:prompt-send-updated-meeting-info primary */
+char *s = N_("Would you like to send updated meeting information to participants?");
+/* calendar:prompt-send-updated-meeting-info secondary */
+char *s = N_("Sending updated information allows other participants to keep their calendars up to date.");
+char *s = N_("Don't Send");
+char *s = N_("Send");
+/* calendar:prompt-send-task primary */
+char *s = N_("Would you like to send this task to participants?");
+/* calendar:prompt-send-task secondary */
+char *s = N_("Email invitations will be sent to all participants and allow them to accept this task.");
+char *s = N_("Don't Send");
+char *s = N_("Send");
+/* calendar:prompt-send-updated-task-info primary */
+char *s = N_("Would you like to send updated task information to participants?");
+/* calendar:prompt-send-updated-task-info secondary */
+char *s = N_("Sending updated information allows other participants to keep their task lists up to date.");
+char *s = N_("Don't Send");
+char *s = N_("Send");
+/* calendar:tasks-crashed primary */
+char *s = N_("The Evolution tasks have quit unexpectedly.");
+/* calendar:tasks-crashed secondary */
+char *s = N_("Your tasks will not be available until Evolution is restarted.");
+/* calendar:calendar-crashed primary */
+char *s = N_("The Evolution calendar has quit unexpectedly.");
+/* calendar:calendar-crashed secondary */
+char *s = N_("Your calendars will not be available until Evolution is restarted.");
diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c
index 3b72e5b31e..008f70e39e 100644
--- a/calendar/gui/dialogs/cancel-comp.c
+++ b/calendar/gui/dialogs/cancel-comp.c
@@ -27,6 +27,7 @@
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-uidefs.h>
#include <e-util/e-icon-factory.h>
+#include "widgets/misc/e-error.h"
#include "cancel-comp.h"
@@ -42,42 +43,34 @@
gboolean
cancel_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean deleting)
{
- GtkWidget *dialog;
ECalComponentVType vtype;
- char *str;
- gint response;
-
+ const char *id;
+
if (deleting && e_cal_get_save_schedules (client))
return TRUE;
-
+
vtype = e_cal_component_get_vtype (comp);
-
+
switch (vtype) {
case E_CAL_COMPONENT_EVENT:
if (deleting)
- str = g_strdup_printf (_("The event being deleted is a meeting, "
- "would you like to send a cancellation notice?"));
+ id = "calendar:prompt-delete-meeting";
else
- str = g_strdup_printf (_("Are you sure you want to cancel "
- "and delete this meeting?"));
+ id = "calendar:prompt-cancel-meeting";
break;
case E_CAL_COMPONENT_TODO:
if (deleting)
- str = g_strdup_printf (_("The task being deleted is assigned, "
- "would you like to send a cancellation notice?"));
+ id = "calendar:prompt-delete-task";
else
- str = g_strdup_printf (_("Are you sure you want to cancel "
- "and delete this task?"));
+ id = "calendar:prompt-cancel-task";
break;
case E_CAL_COMPONENT_JOURNAL:
if (deleting)
- str = g_strdup_printf (_("The journal entry being deleted is published, "
- "would you like to send a cancellation notice?"));
+ id = "calendar:prompt-delete-journal";
else
- str = g_strdup_printf (_("Are you sure you want to cancel "
- "and delete this journal entry?"));
+ id = "calendar:prompt-cancel-journal";
break;
default:
@@ -86,16 +79,7 @@ cancel_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, g
return FALSE;
}
- dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
-
- gtk_window_set_icon (GTK_WINDOW (dialog), e_icon_factory_get_icon("stock_calendar", 32));
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
+ if (e_error_run (parent, id, NULL) == GTK_RESPONSE_YES)
return TRUE;
else
return FALSE;
diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c
index 33e755193c..ed60def95e 100644
--- a/calendar/gui/dialogs/delete-comp.c
+++ b/calendar/gui/dialogs/delete-comp.c
@@ -27,6 +27,7 @@
#include <gtk/gtkmessagedialog.h>
#include <libgnome/gnome-i18n.h>
#include <e-util/e-icon-factory.h>
+#include "widgets/misc/e-error.h"
#include "../calendar-config.h"
#include "delete-comp.h"
@@ -60,11 +61,10 @@ delete_component_dialog (ECalComponent *comp,
int n_comps, ECalComponentVType vtype,
GtkWidget *widget)
{
- char *str;
- GtkWidget *dialog;
- const char *stock_icon;
- int ret;
-
+ const char *stock_icon, *id;
+ char *arg0 = NULL;
+ int response;
+
if (comp) {
g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), FALSE);
g_return_val_if_fail (n_comps == 1, FALSE);
@@ -81,76 +81,66 @@ delete_component_dialog (ECalComponent *comp,
if (comp) {
ECalComponentText summary;
- char *tmp;
-
+
vtype = e_cal_component_get_vtype (comp);
-
+
if (!consider_as_untitled) {
e_cal_component_get_summary (comp, &summary);
- tmp = g_strdup (summary.value);
- } else
- tmp = NULL;
-
+ arg0 = g_strdup (summary.value);
+ }
+
switch (vtype) {
case E_CAL_COMPONENT_EVENT:
stock_icon = "stock_calendar";
- if (tmp)
- str = g_strdup_printf (_("Are you sure you want to delete "
- "the appointment `%s'?"), tmp);
+ if (arg0)
+ id = "calendar:prompt-delete-titled-appointment";
else
- str = g_strdup (_("Are you sure you want to delete this "
- "untitled appointment?"));
+ id = "calendar:prompt-delete-appointment";
break;
case E_CAL_COMPONENT_TODO:
stock_icon = "stock_todo";
- if (tmp)
- str = g_strdup_printf (_("Are you sure you want to delete "
- "the task `%s'?"), tmp);
+ if (arg0)
+ id = "calendar:prompt-delete-named-task";
else
- str = g_strdup (_("Are you sure you want to delete this "
- "untitled task?"));
+ id = "calendar:prompt-delete-task";
break;
case E_CAL_COMPONENT_JOURNAL:
stock_icon = "stock_calendar";
- if (tmp)
- str = g_strdup_printf (_("Are you sure you want to delete "
- "the journal entry `%s'?"), tmp);
+ if (arg0)
+ id = "calendar:prompt-delete-named-journal";
else
- str = g_strdup (_("Are you sure want to delete this "
- "untitled journal entry?"));
+ id = "calendar:prompt-delete-journal";
break;
default:
g_message ("delete_component_dialog(): Cannot handle object of type %d",
vtype);
- g_free (tmp);
+ g_free (arg0);
return FALSE;
}
-
- g_free (tmp);
} else {
switch (vtype) {
case E_CAL_COMPONENT_EVENT:
- str = g_strdup_printf (ngettext("Are you sure you want to delete "
- "%d appointment?",
- "Are you sure you want to delete "
- "%d appointments?", n_comps), n_comps);
+ if (n_comps == 1)
+ id = "calendar:prompt-delete-appointment";
+ else
+ id = "calendar:prompt-delete-appointments";
break;
case E_CAL_COMPONENT_TODO:
- str = g_strdup_printf (ngettext("Are you sure you want to delete "
- "%d task?",
- "Are you sure you want to delete "
- "%d tasks?", n_comps), n_comps);
+ if (n_comps == 1)
+ id = "calendar:prompt-delete-task";
+ else
+ id = "calendar:prompt-delete-tasks";
break;
case E_CAL_COMPONENT_JOURNAL:
- str = g_strdup_printf (ngettext("Are you sure you want to delete "
- "%d journal entry?",
- "Are you sure you want to delete "
- "%d journal entries?", n_comps), n_comps);
+ if (n_comps == 1)
+ id = "calendar:prompt-delete-journal";
+ else
+ id = "calendar:prompt-delete-journals";
break;
default:
@@ -158,15 +148,13 @@ delete_component_dialog (ECalComponent *comp,
vtype);
return FALSE;
}
+
+ if (n_comps > 1)
+ arg0 = g_strdup_printf ("%d", n_comps);
}
-
- dialog = gtk_message_dialog_new ((GtkWindow *)gtk_widget_get_toplevel (widget),
- 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", str);
- gtk_dialog_add_buttons ((GtkDialog *) dialog, GTK_STOCK_NO, GTK_RESPONSE_CANCEL, GTK_STOCK_YES, GTK_RESPONSE_OK, NULL);
- gtk_window_set_icon (GTK_WINDOW (dialog), e_icon_factory_get_icon (stock_icon, 32));
- g_free (str);
- ret = gtk_dialog_run ((GtkDialog *) dialog) == GTK_RESPONSE_OK;
- gtk_widget_destroy (dialog);
-
- return ret;
+
+ response = e_error_run ((GtkWindow *) gtk_widget_get_toplevel (widget), id, arg0, NULL);
+ g_free (arg0);
+
+ return response == GTK_RESPONSE_YES;
}
diff --git a/calendar/gui/dialogs/save-comp.c b/calendar/gui/dialogs/save-comp.c
index e0e8ebb0be..47a4b7221c 100644
--- a/calendar/gui/dialogs/save-comp.c
+++ b/calendar/gui/dialogs/save-comp.c
@@ -23,14 +23,9 @@
#include <config.h>
#endif
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkstock.h>
-#include <e-util/e-icon-factory.h>
+#include "widgets/misc/e-error.h"
#include "save-comp.h"
-
/**
* save_component_dialog:
@@ -45,28 +40,5 @@
GtkResponseType
save_component_dialog (GtkWindow *parent)
{
- GtkWidget *dialog;
- gint r;
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
- _("This event has been changed, but has not been saved.\n\n"
- "Do you wish to save your changes?"));
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("_Discard Changes"),GTK_RESPONSE_NO,
- GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_YES,
- NULL);
-
- gtk_window_set_icon (GTK_WINDOW (dialog), e_icon_factory_get_icon("stock_calendar", 32));
- gtk_window_set_title (GTK_WINDOW (dialog), _("Save Event"));
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
-
- r = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- return r;
-
+ return e_error_run (parent, "calendar:prompt-save-appointment", NULL);
}
diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c
index 64343f113e..882368a4d6 100644
--- a/calendar/gui/dialogs/send-comp.c
+++ b/calendar/gui/dialogs/send-comp.c
@@ -22,11 +22,8 @@
#include <config.h>
#endif
-#include <glib.h>
#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include <e-util/e-icon-factory.h>
+#include "widgets/misc/e-error.h"
#include "send-comp.h"
@@ -42,11 +39,9 @@
gboolean
send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean new)
{
- GtkWidget *dialog;
ECalComponentVType vtype;
- char *str;
- gint response;
-
+ const char *id;
+
if (e_cal_get_save_schedules (client))
return FALSE;
@@ -55,23 +50,16 @@ send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gbo
switch (vtype) {
case E_CAL_COMPONENT_EVENT:
if (new)
- str = g_strdup_printf (_("The meeting information has "
- "been created. Send it?"));
+ id = "calendar:prompt-meeting-invite";
else
- str = g_strdup_printf (_("The meeting information has "
- "changed. Send an updated "
- "version?"));
+ id = "calendar:prompt-send-updated-meeting-info";
break;
case E_CAL_COMPONENT_TODO:
if (new)
- str = g_strdup_printf (_("The task assignment "
- "information has been "
- "created. Send it?"));
+ id = "calendar:prompt-send-task";
else
- str = g_strdup_printf (_("The task information has "
- "changed. Send an updated "
- "version?"));
+ id = "calendar:prompt-send-updated-task-info";
break;
default:
@@ -80,18 +68,7 @@ send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gbo
return FALSE;
}
- dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
- if (vtype == E_CAL_COMPONENT_EVENT)
- gtk_window_set_icon (GTK_WINDOW (dialog), e_icon_factory_get_icon ("stock_calendar", 32));
- else if (vtype == E_CAL_COMPONENT_TODO)
- gtk_window_set_icon (GTK_WINDOW (dialog), e_icon_factory_get_icon ("stock_todo", 32));
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
+ if (e_error_run (parent, id, NULL) == GTK_RESPONSE_YES)
return TRUE;
else
return FALSE;
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index 8669bb5c2c..07e2c9fdbd 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -34,6 +34,7 @@
#include <gal/menus/gal-view-factory-etable.h>
#include <gal/menus/gal-view-etable.h>
+#include "widgets/misc/e-error.h"
#include "e-util/e-categories-config.h"
#include "e-util/e-time-utils.h"
#include "e-util/e-url.h"
@@ -594,8 +595,6 @@ backend_died_cb (ECal *client, gpointer data)
ETasks *tasks;
ETasksPrivate *priv;
ESource *source;
- char *message;
- GtkWidget *dialog;
tasks = E_TASKS (data);
priv = tasks->priv;
@@ -608,15 +607,10 @@ backend_died_cb (ECal *client, gpointer data)
gtk_signal_emit (GTK_OBJECT (tasks), e_tasks_signals[SOURCE_REMOVED], source);
e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)), NULL);
-
- message = g_strdup_printf (_("The task backend for '%s' has crashed."), e_source_peek_name (source));
- dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))),
- 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
- message);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (message);
-
+
+ e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))),
+ "calendar:tasks-crashed", NULL);
+
g_object_unref (source);
}
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 0bc4deeb74..7c23ce00d9 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -47,6 +47,7 @@
#include <gal/menus/gal-view-factory-etable.h>
#include <gal/menus/gal-view-etable.h>
#include "widgets/menus/gal-view-menus.h"
+#include "widgets/misc/e-error.h"
#include "e-comp-editor-registry.h"
#include "dialogs/delete-error.h"
#include "dialogs/event-editor.h"
@@ -2027,10 +2028,9 @@ backend_died_cb (ECal *ecal, gpointer data)
{
GnomeCalendar *gcal;
GnomeCalendarPrivate *priv;
- GtkWidget *dialog;
ECalSourceType source_type;
ESource *source;
- char *message;
+ const char *id;
int i;
gcal = GNOME_CALENDAR (data);
@@ -2045,7 +2045,7 @@ backend_died_cb (ECal *ecal, gpointer data)
switch (source_type) {
case E_CAL_SOURCE_TYPE_EVENT:
- message = g_strdup_printf (_("The calendar backend for '%s' has crashed."), e_source_peek_name (source));
+ id = "calendar:calendar-crashed";
for (i = 0; i < GNOME_CAL_LAST_VIEW; i++)
e_calendar_view_set_status_message (priv->views[i], NULL);
@@ -2054,7 +2054,8 @@ backend_died_cb (ECal *ecal, gpointer data)
break;
case E_CAL_SOURCE_TYPE_TODO:
- message = g_strdup_printf (_("The task backend for '%s' has crashed."), e_source_peek_name (source));
+ id = "calendar:tasks-crashed";
+
e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL);
gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals[SOURCE_REMOVED], source_type, source);
@@ -2067,12 +2068,7 @@ backend_died_cb (ECal *ecal, gpointer data)
g_object_unref (source);
- dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))),
- 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
- message);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (message);
+ e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), id, NULL);
}
GtkWidget *