Add support in security options view to check validity status of number
[modest] / src / hildon2 / modest-maemo-security-options-view.c
index 209e3eb..65bf10c 100644 (file)
@@ -221,12 +221,23 @@ on_entry_changed (GtkEditable *editable,
        } else {
                missing = FALSE;
        }
+
+       if (!missing && ppriv->full && !modest_number_editor_is_valid (MODEST_NUMBER_EDITOR (ppriv->port_view)))
+               missing = TRUE;
        
        /* Emit a signal to notify if mandatory data is missing */
        g_signal_emit_by_name (G_OBJECT (self), "missing_mandatory_data", 
                               missing, NULL);
 }
 
+void
+on_valid_changed (ModestNumberEditor *editor,
+                 gboolean valid,
+                 ModestSecurityOptionsView *self)
+{
+       on_entry_changed (NULL, (gpointer) self);
+}
+
 static void
 create_outgoing_security (ModestSecurityOptionsView* self,
                          GtkSizeGroup *title_size_group,
@@ -313,6 +324,8 @@ create_outgoing_security (ModestSecurityOptionsView* self,
                                  G_CALLBACK (on_auth_changed), self);
                g_signal_connect (G_OBJECT (ppriv->user_entry), "changed",
                                  G_CALLBACK (on_entry_changed), self);
+               g_signal_connect (G_OBJECT (ppriv->port_view), "valid-changed",
+                                           G_CALLBACK (on_valid_changed), self);
        }
 
        /* Initialize widgets */