From: Jose Dapena Paz Date: Mon, 16 Mar 2009 17:23:19 +0000 (+0000) Subject: Add support in security options view to check validity status of number X-Git-Tag: git_migration_finished~317 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=cc73115b2210bc9de90c00e1578c35fcc41e4c7c Add support in security options view to check validity status of number editor pmo-trunk-r8055 --- diff --git a/src/hildon2/modest-maemo-security-options-view.c b/src/hildon2/modest-maemo-security-options-view.c index 209e3eb..65bf10c 100644 --- a/src/hildon2/modest-maemo-security-options-view.c +++ b/src/hildon2/modest-maemo-security-options-view.c @@ -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 */ diff --git a/src/hildon2/modest-number-editor.c b/src/hildon2/modest-number-editor.c index de2a072..d24c77e 100644 --- a/src/hildon2/modest-number-editor.c +++ b/src/hildon2/modest-number-editor.c @@ -191,7 +191,7 @@ modest_number_editor_class_init (ModestNumberEditorClass *editor g_signal_new ("valid_changed", MODEST_TYPE_NUMBER_EDITOR, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ModestNumberEditorClass, valid_changed), - g_signal_accumulator_true_handled, NULL, + NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); } @@ -356,8 +356,8 @@ modest_number_editor_validate_value (ModestNumberEditor *editor, } if (priv->is_valid != is_valid) { - g_signal_emit (editor, ModestNumberEditor_signal[VALID_CHANGED], 0, is_valid); priv->is_valid = is_valid; + g_signal_emit (editor, ModestNumberEditor_signal[VALID_CHANGED], 0, is_valid); } }