From 66777ceddacb0bc81031ecacc84ab64875532af2 Mon Sep 17 00:00:00 2001 From: Armin Burgmeier Date: Thu, 5 Jul 2007 12:58:00 +0000 Subject: [PATCH] 2007-07-05 Armin Burgmeier * 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. pmo-trunk-r2586 --- ChangeLog2 | 8 ++++++++ src/maemo/modest-account-settings-dialog.c | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog2 b/ChangeLog2 index 26a3aa1..50bc33e 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,3 +1,11 @@ +2007-07-05 Armin Burgmeier + + * 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 * src/modest-ui-actions.c: diff --git a/src/maemo/modest-account-settings-dialog.c b/src/maemo/modest-account-settings-dialog.c index c0d4d75..1f17596 100644 --- a/src/maemo/modest-account-settings-dialog.c +++ b/src/maemo/modest-account-settings-dialog.c @@ -80,6 +80,7 @@ typedef struct _ModestAccountSettingsDialogPrivate ModestAccountSettingsDialogPr struct _ModestAccountSettingsDialogPrivate { + guint initial_port; }; static void @@ -902,7 +903,7 @@ check_data (ModestAccountSettingsDialog *self) } } } - + /* TODO: The UI Spec wants us to check that the servernames are valid, * but does not specify how. */ @@ -920,7 +921,13 @@ on_response (GtkDialog *wizard_dialog, 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), @@ -1163,6 +1170,13 @@ void modest_account_settings_dialog_set_account_name (ModestAccountSettingsDialo 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; -- 1.7.9.5