+2007-07-05 Armin Burgmeier <armin@openismus.com>
+
+ * src/maemo/modest-account-settings-dialog.c: Remember custom port
+ number at the beginning of the dialog and set the modified flag at the
+ end if the port number has changed. This is necessary because
+ HildonNumberEditor does not support notification when the value has
+ changed.
+
2007-07-05 Murray Cumming <murrayc@murrayc.com>
* src/modest-ui-actions.c:
struct _ModestAccountSettingsDialogPrivate
{
+ guint initial_port;
};
static void
}
}
}
-
+
/* TODO: The UI Spec wants us to check that the servernames are valid,
* but does not specify how.
*/
enable_buttons (self);
gboolean prevent_response = FALSE;
-
+
+ /* Set modified flag when the port number changed */
+ gint port_num = hildon_number_editor_get_value (
+ HILDON_NUMBER_EDITOR (self->entry_incoming_port));
+ if(ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE(self)->initial_port != port_num)
+ self->modified = TRUE;
+
/* Warn about unsaved changes: */
if (response_id == GTK_RESPONSE_CANCEL && self->modified) {
GtkDialog *dialog = GTK_DIALOG (hildon_note_new_confirmation (GTK_WINDOW (self),
hildon_number_editor_set_value (
HILDON_NUMBER_EDITOR (dialog->entry_incoming_port), port_num);
}
+
+ /* HildonNumberEditor has no changed signal, so we do not get
+ * notified when the port number changes. Instead we check
+ * whether the number has changed before the dialog is closed. */
+ ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE(dialog)->initial_port =
+ hildon_number_editor_get_value (
+ HILDON_NUMBER_EDITOR (dialog->entry_incoming_port));
}
ModestServerAccountData *outgoing_account = account_data->transport_account;