aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/comp-editor-page.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2002-10-09 01:58:08 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2002-10-09 01:58:08 +0800
commit155223435b0a80bcc8fa3a6ff0b03d2031ae2403 (patch)
treef07a33bdadfa139fe0b2e58b8c3366f874850d09 /calendar/gui/dialogs/comp-editor-page.c
parent00c1d84f673924046b9eecf478c6ec5f87ab3b18 (diff)
downloadgsoc2013-evolution-155223435b0a80bcc8fa3a6ff0b03d2031ae2403.tar
gsoc2013-evolution-155223435b0a80bcc8fa3a6ff0b03d2031ae2403.tar.gz
gsoc2013-evolution-155223435b0a80bcc8fa3a6ff0b03d2031ae2403.tar.bz2
gsoc2013-evolution-155223435b0a80bcc8fa3a6ff0b03d2031ae2403.tar.lz
gsoc2013-evolution-155223435b0a80bcc8fa3a6ff0b03d2031ae2403.tar.xz
gsoc2013-evolution-155223435b0a80bcc8fa3a6ff0b03d2031ae2403.tar.zst
gsoc2013-evolution-155223435b0a80bcc8fa3a6ff0b03d2031ae2403.zip
Fixes #11434
2002-10-08 Rodrigo Moya <rodrigo@ximian.com> Fixes #11434 * gui/dialogs/comp-editor-page.[ch] (comp_editor_page_display_validation_error): new function. * gui/dialogs/event-page.c (event_page_fill_component): * gui/dialogs/recurrence-page.c (fill_component): * gui/dialogs/task-details-page.c (task_details_page_fill_component): * gui/dialogs/task-page.c (task_page_fill_component): added checks for all date values, and return FALSE if we find some invalid date/times. * gui/dialogs/comp-editor.c (save_comp): activate the page that returns error in fill_component. svn path=/trunk/; revision=18352
Diffstat (limited to 'calendar/gui/dialogs/comp-editor-page.c')
-rw-r--r--calendar/gui/dialogs/comp-editor-page.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c
index b1fabf28be..d2de97586e 100644
--- a/calendar/gui/dialogs/comp-editor-page.c
+++ b/calendar/gui/dialogs/comp-editor-page.c
@@ -23,6 +23,10 @@
#endif
#include <gtk/gtksignal.h>
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include "comp-editor-page.h"
@@ -384,3 +388,34 @@ comp_editor_page_notify_dates_changed (CompEditorPage *page,
comp_editor_page_signals[DATES_CHANGED],
dates);
}
+
+/**
+ * comp_editor_page_display_validation_error:
+ * @page: An editor page.
+ * @msg: Error message to display.
+ * @field: Widget that caused the validation error.
+ *
+ * Displays an error message about a validation problem in the
+ * given field. Once the error message has been displayed, the
+ * focus is set to the widget that caused the validation error.
+ */
+void
+comp_editor_page_display_validation_error (CompEditorPage *page,
+ const char *msg,
+ GtkWidget *field)
+{
+ GtkWidget *dialog;
+ char *real_msg;
+
+ g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
+ g_return_if_fail (msg != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (field));
+
+ real_msg = g_strdup_printf (_("Validation error: %s"), msg);
+ dialog = gnome_error_dialog (real_msg);
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
+ gtk_widget_grab_focus (field);
+
+ g_free (real_msg);
+}