2006-10-05 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Wed, 4 Oct 2006 08:01:37 +0000 (08:01 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Wed, 4 Oct 2006 08:01:37 +0000 (08:01 +0000)
* hildon-widgets/hildon-time-editor.c
(validated_conversion): Modifications to check the '-'
input and change value to the default min. Fixes NB#40059.

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

index 40c03f1..331950f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-05  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
+       * hildon-widgets/hildon-time-editor.c
+       (validated_conversion): Modifications to check the '-' 
+       input and change value to the default min. Fixes NB#40059.
+
 2006-10-04  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
        * hildon-widgets/hildon-set-password-dialog.c: Turning off the
index be620d4..8020160 100644 (file)
@@ -1287,7 +1287,7 @@ static gint validated_conversion(HildonTimeEditorPrivate *priv,
         value = strtol(text, &tail, 10);
 
         /* Check if conversion succeeded */
-        if (tail[0] == 0)
+        if ((tail[0] == 0) && !(text[0] == '-'))
         {    
             if (value > max) {
                 g_string_printf(error_string, _("ckct_ib_maximum_value"), max);
@@ -1305,6 +1305,16 @@ static gint validated_conversion(HildonTimeEditorPrivate *priv,
             return value;
         }
         /* We'll handle failed conversions soon */
+       else
+       {
+           if ((tail[0] == '-') || (text[0] == '-'))
+              {
+               g_string_printf(error_string, _("ckct_ib_minimum_value"), min);
+               priv->error_widget = field;
+               *error_code = MIN_VALUE;
+               return min;
+             }
+       }
     }
     else if (allow_intermediate) 
         return -1;  /* Empty field while user is still editing. No error, but