X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-account-settings-dialog.c;h=31ddbf636128fa5a90ebfa6105a458602a689b55;hb=7e7be75d6f353df4d1c605d5df3011457f51a926;hp=ce3dd19b2e0ec1aaf470a04b47e3006730aa2a82;hpb=54954202742a0fde0fc9abe866aa650fea0e21b9;p=modest diff --git a/src/maemo/modest-account-settings-dialog.c b/src/maemo/modest-account-settings-dialog.c index ce3dd19..31ddbf6 100644 --- a/src/maemo/modest-account-settings-dialog.c +++ b/src/maemo/modest-account-settings-dialog.c @@ -19,9 +19,9 @@ #include "maemo/easysetup/modest-easysetup-country-combo-box.h" #include "maemo/easysetup/modest-easysetup-provider-combo-box.h" #include "maemo/easysetup/modest-easysetup-servertype-combo-box.h" -#include "maemo/easysetup/modest-easysetup-serversecurity-combo-box.h" -#include "maemo/easysetup/modest-easysetup-secureauth-combo-box.h" -#include "maemo/easysetup/modest-validating-entry.h" +#include "widgets/modest-easysetup-serversecurity-combo-box.h" +#include "widgets/modest-easysetup-secureauth-combo-box.h" +#include "widgets/modest-validating-entry.h" #include "widgets/modest-retrieve-combo-box.h" #include "widgets/modest-limit-retrieve-combo-box.h" #include "modest-text-utils.h" @@ -96,6 +96,9 @@ modest_account_settings_dialog_finalize (GObject *object) if (self->account_manager) g_object_unref (G_OBJECT (self->account_manager)); + + if (self->specific_window) + gtk_widget_destroy (self->specific_window); G_OBJECT_CLASS (modest_account_settings_dialog_parent_class)->finalize (object); } @@ -499,30 +502,24 @@ enable_widget_for_togglebutton (GtkWidget *widget, GtkToggleButton* button) /* Set the starting sensitivity: */ on_toggle_button_changed (button, widget); } - -static void -on_smtp_servers_window_hide (GtkWindow *window, gpointer user_data) -{ - /* Destroy the window when it is closed: */ - gtk_widget_destroy (GTK_WIDGET (window)); -} static void on_button_outgoing_smtp_servers (GtkButton *button, gpointer user_data) { ModestAccountSettingsDialog * self = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data); - /* Show the window: */ - /* TODO: Retrieve the chosen settings, - * so we can supply them when creating the connection somehow. - */ - GtkWidget *window = GTK_WIDGET (modest_connection_specific_smtp_window_new ()); - gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (self)); - gtk_window_set_modal (GTK_WINDOW (window), TRUE); - gtk_widget_show (window); - - g_signal_connect (G_OBJECT (window), "hide", - G_CALLBACK (on_smtp_servers_window_hide), self); + /* Create the window if necessary: */ + if (!(self->specific_window)) { + self->specific_window = GTK_WIDGET (modest_connection_specific_smtp_window_new ()); + modest_connection_specific_smtp_window_fill_with_connections ( + MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (self->specific_window), self->account_manager, + self->account_name); + } + + /* Show the window: */ + gtk_window_set_transient_for (GTK_WINDOW (self->specific_window), GTK_WINDOW (self)); + gtk_window_set_modal (GTK_WINDOW (self->specific_window), TRUE); + gtk_widget_show (self->specific_window); } static void @@ -1133,7 +1130,12 @@ save_configuration (ModestAccountSettingsDialog *dialog) return FALSE; } - return TRUE; + /* Save connection-specific SMTP server accounts: */ + if (dialog->specific_window) + return modest_connection_specific_smtp_window_save_server_accounts ( + MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (dialog->specific_window), account_name); + else + return TRUE; } static gboolean entry_is_empty (GtkWidget *entry)