X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fgnome%2Fmodest-gnome-global-settings-dialog.c;h=a5cbca4452e4ad344234f988ccd7d017f9340b46;hb=703965f6f52fab28c9762f1b5603c6feeec5a680;hp=21ac609c039e64937b5553ed980c9c8a254c0bc1;hpb=18a79c74494767726e55fc1234dd9489e8f7268b;p=modest diff --git a/src/gnome/modest-gnome-global-settings-dialog.c b/src/gnome/modest-gnome-global-settings-dialog.c index 21ac609..a5cbca4 100644 --- a/src/gnome/modest-gnome-global-settings-dialog.c +++ b/src/gnome/modest-gnome-global-settings-dialog.c @@ -38,10 +38,12 @@ #include #include #include +#include +#include #include "widgets/modest-global-settings-dialog-priv.h" #include "widgets/modest-combo-box.h" #include "gnome/modest-gnome-global-settings-dialog.h" -#include "modest-ui-constants.h" +#include "widgets/modest-ui-constants.h" /* include other impl specific header files */ @@ -60,6 +62,7 @@ enum { static GtkWidget* create_updating_page (ModestGnomeGlobalSettingsDialog *self); static GtkWidget* create_composing_page (ModestGnomeGlobalSettingsDialog *self); +static ModestConnectedVia current_connection (void); typedef struct _ModestGnomeGlobalSettingsDialogPrivate ModestGnomeGlobalSettingsDialogPrivate; struct _ModestGnomeGlobalSettingsDialogPrivate { @@ -107,6 +110,8 @@ modest_gnome_global_settings_dialog_class_init (ModestGnomeGlobalSettingsDialogC gobject_class->finalize = modest_gnome_global_settings_dialog_finalize; g_type_class_add_private (gobject_class, sizeof(ModestGnomeGlobalSettingsDialogPrivate)); + + MODEST_GLOBAL_SETTINGS_DIALOG_CLASS (klass)->current_connection_func = current_connection; } static void @@ -196,7 +201,6 @@ create_updating_page (ModestGnomeGlobalSettingsDialog *self) { GtkWidget *vbox, *table_update, *table_limit; GtkWidget *label, *check, *combo, *spin; - ModestPairList *list; vbox = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT); table_update = gtk_table_new (3, 2, FALSE); @@ -214,16 +218,27 @@ create_updating_page (ModestGnomeGlobalSettingsDialog *self) /* Connected via */ label = create_label (_("mcen_fi_options_connectiontype")); - list = get_connected_via (); - combo = modest_combo_box_new (list, g_int_equal); - modest_pair_list_free (list); + + ModestGlobalSettingsDialogPrivate *ppriv = + MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self); + + /* Note: This ModestPairList* must exist for as long as the combo + * that uses it, because the ModestComboBox uses the ID opaquely, + * so it can't know how to manage its memory. */ + ppriv->connected_via_list = _modest_global_settings_dialog_get_connected_via (); + combo = modest_combo_box_new (ppriv->connected_via_list, g_int_equal); + add_to_table (GTK_TABLE (table_update), label, combo); /* Update interval */ label = create_label (_("mcen_fi_options_updateinterval")); - list = get_update_interval (); - combo = modest_combo_box_new (list, g_int_equal); - modest_pair_list_free (list); + + /* Note: This ModestPairList* must exist for as long as the combo + * that uses it, because the ModestComboBox uses the ID opaquely, + * so it can't know how to manage its memory. */ + ppriv->update_interval_list = _modest_global_settings_dialog_get_update_interval (); + combo = modest_combo_box_new (ppriv->update_interval_list, g_int_equal); + add_to_table (GTK_TABLE (table_update), label, combo); /* Add to vbox */ @@ -256,7 +271,6 @@ create_composing_page (ModestGnomeGlobalSettingsDialog *self) { GtkWidget *vbox, *table; GtkWidget *label, *check, *combo; - ModestPairList *list; vbox = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT); table = gtk_table_new (2, 2, FALSE); @@ -266,9 +280,16 @@ create_composing_page (ModestGnomeGlobalSettingsDialog *self) /* Update interval */ label = create_label (_("mcen_fi_options_messageformat")); - list = get_msg_formats (); - combo = modest_combo_box_new (list, g_int_equal); - modest_pair_list_free (list); + + ModestGlobalSettingsDialogPrivate *ppriv = + MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self); + + /* Note: This ModestPairList* must exist for as long as the combo + * that uses it, because the ModestComboBox uses the ID opaquely, + * so it can't know how to manage its memory. */ + ppriv->combo_msg_formats_list = _modest_global_settings_dialog_get_msg_formats (); + combo = modest_combo_box_new (ppriv->cmsg_formats_list, g_int_equal); + add_to_table (GTK_TABLE (table), label, combo); label = create_label (_("mcen_va_options_include_original_inreply")); @@ -280,3 +301,9 @@ create_composing_page (ModestGnomeGlobalSettingsDialog *self) return vbox; } + +static ModestConnectedVia +current_connection (void) +{ + return MODEST_CONNECTED_VIA_ANY; +}