2006-09-11 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Mon, 11 Sep 2006 13:39:31 +0000 (13:39 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Mon, 11 Sep 2006 13:39:31 +0000 (13:39 +0000)
* hildon-widgets/hildon-time-editor.c: When user clicked the clock
button, before launching the time picker try to validate the entered
values. Fixes #NB40055.

ChangeLog
hildon-widgets/hildon-time-editor.c

index c3fc64c..7efe20c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-09-11  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
+       * hildon-widgets/hildon-time-editor.c: When user clicked the clock
+       button, before launching the time picker try to validate the entered
+       values. Fixes #NB40055.
+
+2006-09-11  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
        [0.14.2-1 release]
 
        * configure.ac:
index 7e1e6b7..92d79af 100644 (file)
@@ -1583,15 +1583,22 @@ hildon_time_editor_icon_clicked(GtkWidget * widget, gpointer data)
     GtkWidget *picker;
     GtkWidget *parent;
     guint h, m, s, result;
+    HildonTimeEditorPrivate *priv;
 
     g_assert(HILDON_IS_TIME_EDITOR(data));
 
     editor = HILDON_TIME_EDITOR(data);
+    priv = HILDON_TIME_EDITOR_GET_PRIVATE(editor);
 
     /* icon is passive in duration editor mode */
     if (hildon_time_editor_get_duration_mode(editor))
         return FALSE;
 
+    /* Validate and do not launch if broken */
+    hildon_time_editor_validate(HILDON_TIME_EDITOR(data), FALSE);
+    if (priv->error_widget != NULL)
+        return FALSE;
+
     /* Launch HildonTimePicker dialog */
     parent = gtk_widget_get_ancestor(GTK_WIDGET(editor), GTK_TYPE_WINDOW);
     picker = hildon_time_picker_new(GTK_WINDOW(parent));