GtkWidget *entry_user_username;
GtkWidget *entry_user_password;
GtkWidget *entry_user_email;
-/* GtkWidget *entry_incoming_port; */
GtkWidget *button_signature;
GtkWidget *page_complete_easysetup;
GtkWidget *page_incoming;
GtkWidget *caption_incoming;
GtkWidget *entry_incomingserver;
-/* GtkWidget *combo_incoming_security; */
-/* GtkWidget *checkbox_incoming_auth; */
GtkWidget *page_outgoing;
GtkWidget *entry_outgoingserver;
-/* GtkWidget *caption_outgoing_username; */
-/* GtkWidget *entry_outgoing_username; */
-/* GtkWidget *caption_outgoing_password; */
-/* GtkWidget *entry_outgoing_password; */
-/* GtkWidget *combo_outgoing_security; */
-/* GtkWidget *combo_outgoing_auth; */
-/* GtkWidget *entry_outgoing_port; */
GtkWidget *checkbox_outgoing_smtp_specific;
GtkWidget *button_outgoing_smtp_servers;
/* Show the window: */
modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
- GTK_WINDOW (priv->signature_dialog));
+ GTK_WINDOW (priv->signature_dialog),
+ GTK_WINDOW (self));
response = gtk_dialog_run (GTK_DIALOG (priv->signature_dialog));
gtk_widget_hide (priv->signature_dialog);
modest_connection_specific_smtp_window_fill_with_connections (smtp_win, priv->account_manager);
/* Show the window: */
- modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), GTK_WINDOW (smtp_win));
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+ GTK_WINDOW (smtp_win), GTK_WINDOW (self));
gtk_widget_show (GTK_WIDGET (smtp_win));
priv->modified = TRUE;
}
if (!account_title)
return FALSE; /* Should be prevented already anyway. */
- if (strcmp(account_title, priv->original_account_title) != 0) {
+ if (g_strcmp0 (account_title, priv->original_account_title) != 0) {
gboolean name_in_use;
/* Check the changed title: */
return TRUE;
}
-static void
+static gboolean
+on_delete_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ ModestDefaultAccountSettingsDialog *self = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG (user_data);
+ ModestDefaultAccountSettingsDialogPrivate *priv;
+ ModestSecurityOptionsView *incoming_sec, *outgoing_sec;
+
+ priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (self);
+
+ /* Check if security widgets changed */
+ incoming_sec = MODEST_SECURITY_OPTIONS_VIEW (priv->incoming_security);
+ outgoing_sec = MODEST_SECURITY_OPTIONS_VIEW (priv->outgoing_security);
+
+ return modest_security_options_view_changed (incoming_sec, priv->settings) ||
+ modest_security_options_view_changed (outgoing_sec, priv->settings) ||
+ priv->modified;
+}
+
+static void
on_response (GtkDialog *wizard_dialog,
gint response_id,
gpointer user_data)
modest_security_options_view_changed (outgoing_sec, priv->settings);
/* Warn about unsaved changes: */
- if (response_id == GTK_RESPONSE_CANCEL && (priv->modified || sec_changed)) {
+ if ((response_id == GTK_RESPONSE_CANCEL || response_id == GTK_RESPONSE_DELETE_EVENT) &&
+ (priv->modified || sec_changed)) {
GtkDialog *dialog = GTK_DIALOG (hildon_note_new_confirmation (GTK_WINDOW (self),
_("imum_nc_wizard_confirm_lose_changes")));
- /* TODO: These button names will be ambiguous, and not specified in the UI specification. */
-
+
const gint dialog_response = gtk_dialog_run (dialog);
gtk_widget_destroy (GTK_WIDGET (dialog));
-
+
if (dialog_response != GTK_RESPONSE_OK)
prevent_response = TRUE;
}
else if (response_id != GTK_RESPONSE_CANCEL && !check_data (self)) {
prevent_response = TRUE;
}
-
+
if (prevent_response) {
/* This is a nasty hack. murrayc. */
/* Don't let the dialog close */
} else {
modest_tny_account_store_set_send_mail_blocked (modest_runtime_get_account_store (), FALSE);
}
-
+
if (response_id == GTK_RESPONSE_OK) {
/* Try to save the changes if modified (NB #59251): */
if (priv->modified || sec_changed) {
transport_settings = modest_account_settings_get_transport_settings (priv->settings);
store_account_name = modest_server_account_settings_get_account_name (store_settings);
transport_account_name = modest_server_account_settings_get_account_name (transport_settings);
-
+
if (store_account_name) {
modest_account_mgr_notify_account_update (priv->account_manager,
store_account_name);
}
g_object_unref (store_settings);
g_object_unref (transport_settings);
-
+
modest_platform_information_banner(NULL, NULL, _("mcen_ib_advsetup_settings_saved"));
}
} else {
gtk_container_add (GTK_CONTAINER (dialog->vbox), GTK_WIDGET (priv->notebook));
gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), MODEST_MARGIN_HALF);
gtk_widget_show (GTK_WIDGET (priv->notebook));
-
+
/* Add the buttons: */
gtk_dialog_add_button (GTK_DIALOG(self), _("mcen_bd_dialog_ok"), GTK_RESPONSE_OK);
gtk_dialog_add_button (GTK_DIALOG(self), _("mcen_bd_dialog_cancel"), GTK_RESPONSE_CANCEL);
-
+
/* Connect to the dialog's response signal: */
- /* We use connect-before
- * so we can stop the signal emission,
+ /* We use connect-before
+ * so we can stop the signal emission,
* to stop the default signal handler from closing the dialog.
*/
- g_signal_connect (G_OBJECT (self), "response",
- G_CALLBACK (on_response), self);
-
+ g_signal_connect (G_OBJECT (self), "response", G_CALLBACK (on_response), self);
+ g_signal_connect (G_OBJECT (self), "delete-event", G_CALLBACK (on_delete_event), self);
+
priv->modified = FALSE;
- /* When this window is shown, hibernation should not be possible,
+ /* When this window is shown, hibernation should not be possible,
* because there is no sensible way to save the state: */
modest_window_mgr_prevent_hibernation_while_window_is_shown (
- modest_runtime_get_window_mgr (), GTK_WINDOW (self));
+ modest_runtime_get_window_mgr (), GTK_WINDOW (self));
/* Prevent sending mails while editing an account, to avoid hangs on unprotected locks
* while sending messages causes an error dialog and we have a lock */