aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/delete-comp.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2001-01-03 02:16:45 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-01-03 02:16:45 +0800
commit59b1e25cfdb4253a94df4392d1e2fb69a6901515 (patch)
tree4bf75e92066b0762ac1653320bc98ca61af1657f /calendar/gui/dialogs/delete-comp.c
parent59c0cc7f80c6e5ff909a296fd1dbdaa8af66cda6 (diff)
downloadgsoc2013-evolution-59b1e25cfdb4253a94df4392d1e2fb69a6901515.tar.gz
gsoc2013-evolution-59b1e25cfdb4253a94df4392d1e2fb69a6901515.tar.zst
gsoc2013-evolution-59b1e25cfdb4253a94df4392d1e2fb69a6901515.zip
Do not compose strings so that they can be localized correctly. Also,
2001-01-02 Federico Mena Quintero <federico@helixcode.com> * gui/dialogs/delete-comp.c (delete_component_dialog): Do not compose strings so that they can be localized correctly. Also, convert from UTF8 into the font's encoding. Fixes bug #1030. * gui/e-calendar-table.c (delete_component): Pass the widget argument to delete_component_dialog(). * gui/e-day-view.c (e_day_view_on_delete_appointment): Likewise. * gui/e-week-view.c (e_week_view_on_delete_appointment): Likewise. * gui/event-editor.c (file_delete_cb): Likewise. * gui/calendar-commands.c: Use BONOBO_UI_VERB() instead of BONOBO_UI_UNSAFE_VERB(). Guess what, all of our handler signatures were wrong. * gui/event-editor.c: Likewise. * gui/dialogs/task-editor.c: Likewise. * gui/goto-dialog.glade: Added some spacing between the month/year widgets and the calendar widget. svn path=/trunk/; revision=7211
Diffstat (limited to 'calendar/gui/dialogs/delete-comp.c')
-rw-r--r--calendar/gui/dialogs/delete-comp.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c
index 6133e0d908..97e1b69cd6 100644
--- a/calendar/gui/dialogs/delete-comp.c
+++ b/calendar/gui/dialogs/delete-comp.c
@@ -24,6 +24,7 @@
#endif
#include <gnome.h>
+#include <gal/widgets/e-unicode.h>
#include "delete-comp.h"
@@ -31,6 +32,8 @@
/**
* delete_component_dialog:
* @comp: A calendar component.
+ * @widget: A widget to use as a basis for conversion from UTF8 into font
+ * encoding.
*
* Pops up a dialog box asking the user whether he wants to delete a particular
* calendar component.
@@ -38,31 +41,47 @@
* Return value: TRUE if the user clicked Yes, FALSE otherwise.
**/
gboolean
-delete_component_dialog (CalComponent *comp)
+delete_component_dialog (CalComponent *comp, GtkWidget *widget)
{
CalComponentText summary;
CalComponentVType vtype;
- char *str;
- char *type;
+ char *str, *tmp;
GtkWidget *dialog;
g_return_val_if_fail (comp != NULL, FALSE);
g_return_val_if_fail (IS_CAL_COMPONENT (comp), FALSE);
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
vtype = cal_component_get_vtype (comp);
cal_component_get_summary (comp, &summary);
switch (vtype) {
case CAL_COMPONENT_EVENT:
- type = _("Are you sure you want to delete the appointment");
+ if (summary.value)
+ str = g_strdup_printf (_("Are you sure you want to delete the appointment "
+ "`%s'?"), summary.value);
+ else
+ str = g_strdup (_("Are you sure you want to delete this "
+ "untitled appointment?"));
break;
case CAL_COMPONENT_TODO:
- type = _("Are you sure you want to delete the task");
+ if (summary.value)
+ str = g_strdup_printf (_("Are you sure you want to delete the task "
+ "`%s'?"), summary.value);
+ else
+ str = g_strdup (_("Are you sure you want to delete this "
+ "untitled task?"));
break;
case CAL_COMPONENT_JOURNAL:
- type = _("Are you sure you want to delete the journal entry");
+ if (summary.value)
+ str = g_strdup_printf (_("Are you sure you want to delete the journal entry "
+ "`%s'?"), summary.value);
+ else
+ str = g_strdup (_("Are you sure want to delete this "
+ "untitled journal entry?"));
break;
default:
@@ -70,16 +89,19 @@ delete_component_dialog (CalComponent *comp)
return FALSE;
}
- if (summary.value)
- str = g_strdup_printf ("%s `%s'?", type, summary.value);
- else
- str = g_strdup_printf ("%s?", type);
-
- dialog = gnome_question_dialog_modal (str, NULL, NULL);
+ tmp = e_utf8_to_gtk_string (widget, str);
g_free (str);
- if (gnome_dialog_run (GNOME_DIALOG (dialog)) == GNOME_YES)
- return TRUE;
- else
+ if (tmp) {
+ dialog = gnome_question_dialog_modal (tmp, NULL, NULL);
+ g_free (tmp);
+
+ if (gnome_dialog_run (GNOME_DIALOG (dialog)) == GNOME_YES)
+ return TRUE;
+ else
+ return FALSE;
+ } else {
+ g_message ("delete_component_dialog(): Could not convert the string from UTF8");
return FALSE;
+ }
}