* Added global settings dialog specific implementations
authorSergio Villar Senin <svillar@igalia.com>
Thu, 10 May 2007 11:54:50 +0000 (11:54 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Thu, 10 May 2007 11:54:50 +0000 (11:54 +0000)
        * Added the get_global_settings method to ModestPlatform

pmo-trunk-r1820

13 files changed:
src/gnome/Makefile.am
src/gnome/modest-gnome-global-settings-dialog.c [new file with mode: 0644]
src/gnome/modest-gnome-global-settings-dialog.h [new file with mode: 0644]
src/gnome/modest-platform.c
src/maemo/Makefile.am
src/maemo/modest-maemo-global-settings-dialog.c [new file with mode: 0644]
src/maemo/modest-maemo-global-settings-dialog.h [new file with mode: 0644]
src/maemo/modest-platform.c
src/modest-platform.h
src/modest-ui-actions.c
src/widgets/modest-global-settings-dialog-priv.h [new file with mode: 0644]
src/widgets/modest-global-settings-dialog.c
src/widgets/modest-global-settings-dialog.h

index 70c9d0b..d090eb7 100644 (file)
@@ -32,6 +32,8 @@ libmodest_ui_la_SOURCES=              \
        modest-icon-names.h           \
        modest-gnome-info-bar.c       \
        modest-gnome-info-bar.h       \
+       modest-gnome-global-settings-dialog.c \
+       modest-gnome-global-settings-dialog.h \
        modest-main-window.c          \
        modest-main-window-ui.h       \
        modest-msg-view-window.c      \
diff --git a/src/gnome/modest-gnome-global-settings-dialog.c b/src/gnome/modest-gnome-global-settings-dialog.c
new file mode 100644 (file)
index 0000000..21ac609
--- /dev/null
@@ -0,0 +1,282 @@
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /*HAVE_CONFIG_H*/
+
+#include <glib/gi18n.h>
+#include <gtk/gtkbox.h>
+#include <gtk/gtkvbox.h>
+#include <gtk/gtknotebook.h>
+#include <gtk/gtklabel.h>
+#include <gtk/gtkcheckbutton.h>
+#include <gtk/gtkhseparator.h>
+#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 other impl specific header files */
+
+/* 'private'/'protected' functions */
+static void modest_gnome_global_settings_dialog_class_init (ModestGnomeGlobalSettingsDialogClass *klass);
+static void modest_gnome_global_settings_dialog_init       (ModestGnomeGlobalSettingsDialog *obj);
+static void modest_gnome_global_settings_dialog_finalize   (GObject *obj);
+
+/* list my signals  */
+enum {
+       /* MY_SIGNAL_1, */
+       /* MY_SIGNAL_2, */
+       LAST_SIGNAL
+};
+
+static GtkWidget* create_updating_page  (ModestGnomeGlobalSettingsDialog *self);
+static GtkWidget* create_composing_page (ModestGnomeGlobalSettingsDialog *self);
+
+typedef struct _ModestGnomeGlobalSettingsDialogPrivate ModestGnomeGlobalSettingsDialogPrivate;
+struct _ModestGnomeGlobalSettingsDialogPrivate {
+};
+#define MODEST_GNOME_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE(o)      (G_TYPE_INSTANCE_GET_PRIVATE((o), \
+                                                           MODEST_TYPE_GNOME_GLOBAL_SETTINGS_DIALOG, \
+                                                           ModestGnomeGlobalSettingsDialogPrivate))
+/* globals */
+static GtkDialogClass *parent_class = NULL;
+
+/* uncomment the following if you have defined any signals */
+/* static guint signals[LAST_SIGNAL] = {0}; */
+
+GType
+modest_gnome_global_settings_dialog_get_type (void)
+{
+       static GType my_type = 0;
+       if (!my_type) {
+               static const GTypeInfo my_info = {
+                       sizeof(ModestGnomeGlobalSettingsDialogClass),
+                       NULL,           /* base init */
+                       NULL,           /* base finalize */
+                       (GClassInitFunc) modest_gnome_global_settings_dialog_class_init,
+                       NULL,           /* class finalize */
+                       NULL,           /* class data */
+                       sizeof(ModestGnomeGlobalSettingsDialog),
+                       1,              /* n_preallocs */
+                       (GInstanceInitFunc) modest_gnome_global_settings_dialog_init,
+                       NULL
+               };
+               my_type = g_type_register_static (MODEST_TYPE_GLOBAL_SETTINGS_DIALOG,
+                                                 "ModestGnomeGlobalSettingsDialog",
+                                                 &my_info, 0);
+       }
+       return my_type;
+}
+
+static void
+modest_gnome_global_settings_dialog_class_init (ModestGnomeGlobalSettingsDialogClass *klass)
+{
+       GObjectClass *gobject_class;
+       gobject_class = (GObjectClass*) klass;
+
+       parent_class            = g_type_class_peek_parent (klass);
+       gobject_class->finalize = modest_gnome_global_settings_dialog_finalize;
+
+       g_type_class_add_private (gobject_class, sizeof(ModestGnomeGlobalSettingsDialogPrivate));
+}
+
+static void
+modest_gnome_global_settings_dialog_init (ModestGnomeGlobalSettingsDialog *self)
+{
+       ModestGlobalSettingsDialogPrivate *ppriv;
+/*     GdkGeometry *geometry; */
+
+       ppriv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self);
+
+       ppriv->updating_page = create_updating_page (self);
+       ppriv->composing_page = create_composing_page (self);
+    
+       /* Add the notebook pages: */
+       gtk_notebook_append_page (GTK_NOTEBOOK (ppriv->notebook), ppriv->updating_page, 
+               gtk_label_new (_("mcen_ti_options_updating")));
+       gtk_notebook_append_page (GTK_NOTEBOOK (ppriv->notebook), ppriv->composing_page, 
+               gtk_label_new (_("mcen_ti_options_composing")));
+               
+       gtk_container_add (GTK_CONTAINER (GTK_DIALOG (self)->vbox), ppriv->notebook);
+       gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (self)->vbox), MODEST_MARGIN_HALF);
+       gtk_widget_show_all (ppriv->notebook);
+}
+
+static void
+modest_gnome_global_settings_dialog_finalize (GObject *obj)
+{
+/*     free/unref instance resources here */
+       G_OBJECT_CLASS(parent_class)->finalize (obj);
+}
+
+GtkWidget*
+modest_gnome_global_settings_dialog_new (void)
+{
+       return GTK_WIDGET(g_object_new(MODEST_TYPE_GNOME_GLOBAL_SETTINGS_DIALOG, NULL));
+}
+
+
+/* 
+ * Adds the two widgets to a new row in the table
+ */
+static void
+add_to_table (GtkTable *table,
+             GtkWidget *left,
+             GtkWidget *right)
+{
+       guint n_rows = 0;
+
+       g_object_get (G_OBJECT (table), "n-rows", &n_rows,NULL);
+
+       /* Attach label and value */
+       gtk_table_attach (table, 
+                         left, 0, 1, 
+                         n_rows, n_rows + 1, 
+                         GTK_SHRINK|GTK_FILL, 
+                         GTK_SHRINK|GTK_FILL, 
+                         0, 0);
+       gtk_table_attach (table, 
+                         right, 1, 2, 
+                         n_rows, n_rows + 1, 
+                         GTK_EXPAND|GTK_FILL, 
+                         GTK_SHRINK|GTK_FILL, 
+                         0, 0);
+}
+
+/* 
+ * We need this because the translations are comming without ":" 
+ */
+static GtkWidget *
+create_label (const gchar *text)
+{
+       gchar *label_name;
+       GtkWidget *label;
+
+       label_name = g_strdup_printf ("%s:", text);
+       label = gtk_label_new (label_name);
+       g_free (label_name);
+
+       return label;
+}
+
+/*
+ * Creates the updating page
+ */
+static GtkWidget*
+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);
+       table_limit = gtk_table_new (2, 2, FALSE);
+       /* FIXME: set proper values (HIG) */
+       gtk_table_set_row_spacings (GTK_TABLE (table_update), 6);
+       gtk_table_set_col_spacings (GTK_TABLE (table_update), 12);
+       gtk_table_set_row_spacings (GTK_TABLE (table_limit), 6);
+       gtk_table_set_col_spacings (GTK_TABLE (table_limit), 12);
+
+       /* Autoupdate */
+       label = create_label (_("mcen_fi_options_autoupdate"));
+       check = gtk_check_button_new ();
+       add_to_table (GTK_TABLE (table_update), label, check);
+
+       /* 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);
+       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);
+       add_to_table (GTK_TABLE (table_update), label, combo);
+
+       /* Add to vbox */
+       gtk_box_pack_start (GTK_BOX (vbox), table_update, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Separator */
+       gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Limits */
+       label = create_label (_("mcen_fi_advsetup_sizelimit"));
+       spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1000, 1, 5000, 1, 1, 16)), 
+                                   1, 0);
+       add_to_table (GTK_TABLE (table_limit), label, spin);
+
+       label = create_label (_("mcen_fi_options_playsound"));
+       check = gtk_check_button_new ();
+       add_to_table (GTK_TABLE (table_limit), label, check);
+
+       /* Add to vbox */
+       gtk_box_pack_start (GTK_BOX (vbox), table_limit, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       return vbox;
+}
+
+/*
+ * Creates the composing page
+ */
+static GtkWidget* 
+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);
+       /* FIXME: set proper values */
+       gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+       gtk_table_set_col_spacings (GTK_TABLE (table), 12);
+
+       /* 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);
+       add_to_table (GTK_TABLE (table), label, combo);
+
+       label = create_label (_("mcen_va_options_include_original_inreply"));
+       check = gtk_check_button_new ();
+       add_to_table (GTK_TABLE (table), label, check);
+
+       /* Add to vbox */
+       gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       return vbox;
+}
diff --git a/src/gnome/modest-gnome-global-settings-dialog.h b/src/gnome/modest-gnome-global-settings-dialog.h
new file mode 100644 (file)
index 0000000..a448c67
--- /dev/null
@@ -0,0 +1,64 @@
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __MODEST_GNOME_GLOBAL_SETTINGS_DIALOG_H__
+#define __MODEST_GNOME_GLOBAL_SETTINGS_DIALOG_H__
+
+#include "widgets/modest-global-settings-dialog.h"
+
+G_BEGIN_DECLS
+
+/* convenience macros */
+#define MODEST_TYPE_GNOME_GLOBAL_SETTINGS_DIALOG             (modest_gnome_global_settings_dialog_get_type())
+#define MODEST_GNOME_GLOBAL_SETTINGS_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_GNOME_GLOBAL_SETTINGS_DIALOG,ModestGnomeGlobalSettingsDialog))
+#define MODEST_GNOME_GLOBAL_SETTINGS_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_GNOME_GLOBAL_SETTINGS_DIALOG,ModestGnomeGlobalSettingsDialogClass))
+#define MODEST_IS_GNOME_GLOBAL_SETTINGS_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_GNOME_GLOBAL_SETTINGS_DIALOG))
+#define MODEST_IS_GNOME_GLOBAL_SETTINGS_DIALOG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_GNOME_GLOBAL_SETTINGS_DIALOG))
+#define MODEST_GNOME_GLOBAL_SETTINGS_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_GNOME_GLOBAL_SETTINGS_DIALOG,ModestGnomeGlobalSettingsDialogClass))
+
+typedef struct _ModestGnomeGlobalSettingsDialog      ModestGnomeGlobalSettingsDialog;
+typedef struct _ModestGnomeGlobalSettingsDialogClass ModestGnomeGlobalSettingsDialogClass;
+
+struct _ModestGnomeGlobalSettingsDialog {
+        ModestGlobalSettingsDialog parent;
+};
+
+struct _ModestGnomeGlobalSettingsDialogClass {
+       ModestGlobalSettingsDialogClass parent_class;
+};
+
+/* member functions */
+GType        modest_gnome_global_settings_dialog_get_type    (void) G_GNUC_CONST;
+
+GtkWidget*   modest_gnome_global_settings_dialog_new         (void);
+
+G_END_DECLS
+
+#endif /* __MODEST_GNOME_GLOBAL_SETTINGS_DIALOG_H__ */
+
index e2774a2..f7a35e3 100644 (file)
@@ -210,3 +210,9 @@ modest_platform_run_sort_dialog (GtkWindow *parent_window,
 {
        /* TODO */
 }
+
+GtkWidget
+modest_platform_get_global_settings_dialog ()
+{
+       /* TODO */
+}
index 0d9c19f..cd0b2de 100644 (file)
@@ -46,6 +46,8 @@ libmodest_ui_la_SOURCES=              \
        modest-account-view-window.c  \
        modest-address-book.c         \
        modest-icon-names.h           \
+       modest-maemo-global-settings-dialog.c \
+       modest-maemo-global-settings-dialog.h \
        modest-maemo-ui-constants.h \
        modest-main-window.c          \
        modest-main-window-ui.h       \
diff --git a/src/maemo/modest-maemo-global-settings-dialog.c b/src/maemo/modest-maemo-global-settings-dialog.c
new file mode 100644 (file)
index 0000000..c019a81
--- /dev/null
@@ -0,0 +1,277 @@
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /*HAVE_CONFIG_H*/
+
+#ifdef MODEST_HILDON_VERSION_0
+#include <hildon-widgets/hildon-caption.h>
+#include <hildon-widgets/hildon-number-editor.h>
+#else
+#include <hildon/hildon-caption.h>
+#include <hildon/hildon-number-editor.h>
+#endif /*MODEST_HILDON_VERSION_0*/
+
+#include <glib/gi18n.h>
+#include <gtk/gtkbox.h>
+#include <gtk/gtkvbox.h>
+#include <gtk/gtknotebook.h>
+#include <gtk/gtklabel.h>
+#include <gtk/gtkcheckbutton.h>
+#include <gtk/gtkhseparator.h>
+#include "widgets/modest-global-settings-dialog-priv.h"
+#include "widgets/modest-combo-box.h"
+#include "maemo/modest-maemo-global-settings-dialog.h"
+#include "widgets/modest-ui-constants.h"
+
+
+/* include other impl specific header files */
+
+/* 'private'/'protected' functions */
+static void modest_maemo_global_settings_dialog_class_init (ModestMaemoGlobalSettingsDialogClass *klass);
+static void modest_maemo_global_settings_dialog_init       (ModestMaemoGlobalSettingsDialog *obj);
+static void modest_maemo_global_settings_dialog_finalize   (GObject *obj);
+
+/* list my signals  */
+enum {
+       /* MY_SIGNAL_1, */
+       /* MY_SIGNAL_2, */
+       LAST_SIGNAL
+};
+
+static GtkWidget* create_updating_page  (ModestMaemoGlobalSettingsDialog *self);
+static GtkWidget* create_composing_page (ModestMaemoGlobalSettingsDialog *self);
+
+typedef struct _ModestMaemoGlobalSettingsDialogPrivate ModestMaemoGlobalSettingsDialogPrivate;
+struct _ModestMaemoGlobalSettingsDialogPrivate {
+};
+#define MODEST_MAEMO_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE(o)      (G_TYPE_INSTANCE_GET_PRIVATE((o), \
+                                                           MODEST_TYPE_MAEMO_GLOBAL_SETTINGS_DIALOG, \
+                                                           ModestMaemoGlobalSettingsDialogPrivate))
+/* globals */
+static GtkDialogClass *parent_class = NULL;
+
+/* uncomment the following if you have defined any signals */
+/* static guint signals[LAST_SIGNAL] = {0}; */
+
+GType
+modest_maemo_global_settings_dialog_get_type (void)
+{
+       static GType my_type = 0;
+       if (!my_type) {
+               static const GTypeInfo my_info = {
+                       sizeof(ModestMaemoGlobalSettingsDialogClass),
+                       NULL,           /* base init */
+                       NULL,           /* base finalize */
+                       (GClassInitFunc) modest_maemo_global_settings_dialog_class_init,
+                       NULL,           /* class finalize */
+                       NULL,           /* class data */
+                       sizeof(ModestMaemoGlobalSettingsDialog),
+                       1,              /* n_preallocs */
+                       (GInstanceInitFunc) modest_maemo_global_settings_dialog_init,
+                       NULL
+               };
+               my_type = g_type_register_static (MODEST_TYPE_GLOBAL_SETTINGS_DIALOG,
+                                                 "ModestMaemoGlobalSettingsDialog",
+                                                 &my_info, 0);
+       }
+       return my_type;
+}
+
+static void
+modest_maemo_global_settings_dialog_class_init (ModestMaemoGlobalSettingsDialogClass *klass)
+{
+       GObjectClass *gobject_class;
+       gobject_class = (GObjectClass*) klass;
+
+       parent_class            = g_type_class_peek_parent (klass);
+       gobject_class->finalize = modest_maemo_global_settings_dialog_finalize;
+
+       g_type_class_add_private (gobject_class, sizeof(ModestMaemoGlobalSettingsDialogPrivate));
+}
+
+static void
+modest_maemo_global_settings_dialog_init (ModestMaemoGlobalSettingsDialog *self)
+{
+       ModestGlobalSettingsDialogPrivate *ppriv;
+/*     GdkGeometry *geometry; */
+
+       ppriv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self);
+
+       ppriv->updating_page = create_updating_page (self);
+       ppriv->composing_page = create_composing_page (self);
+    
+       /* Add the notebook pages: */
+       gtk_notebook_append_page (GTK_NOTEBOOK (ppriv->notebook), ppriv->updating_page, 
+               gtk_label_new (_("mcen_ti_options_updating")));
+       gtk_notebook_append_page (GTK_NOTEBOOK (ppriv->notebook), ppriv->composing_page, 
+               gtk_label_new (_("mcen_ti_options_composing")));
+               
+       gtk_container_add (GTK_CONTAINER (GTK_DIALOG (self)->vbox), ppriv->notebook);
+       gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (self)->vbox), MODEST_MARGIN_HALF);
+       gtk_widget_show_all (ppriv->notebook);
+}
+
+static void
+modest_maemo_global_settings_dialog_finalize (GObject *obj)
+{
+/*     free/unref instance resources here */
+       G_OBJECT_CLASS(parent_class)->finalize (obj);
+}
+
+GtkWidget*
+modest_maemo_global_settings_dialog_new (void)
+{
+       return GTK_WIDGET(g_object_new(MODEST_TYPE_MAEMO_GLOBAL_SETTINGS_DIALOG, NULL));
+}
+
+
+/*
+ * Creates the updating page
+ */
+static GtkWidget*
+create_updating_page (ModestMaemoGlobalSettingsDialog *self)
+{
+       GtkWidget *vbox, *vbox_update, *vbox_limit, *caption;
+       GtkSizeGroup *size_group;
+       ModestPairList *list;
+       ModestGlobalSettingsDialogPrivate *ppriv;
+
+       ppriv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self);
+
+       vbox = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT);
+
+       vbox_update = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT);
+       size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+
+       /* Auto update */
+       ppriv->auto_update = gtk_check_button_new ();
+       caption = hildon_caption_new (size_group, 
+                                     _("mcen_fi_options_autoupdate"), 
+                                     ppriv->auto_update, 
+                                     NULL, 
+                                     HILDON_CAPTION_MANDATORY);
+       gtk_box_pack_start (GTK_BOX (vbox_update), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Connected via */
+       list = _modest_global_settings_dialog_get_connected_via ();
+       ppriv->connect_via = modest_combo_box_new (list, g_int_equal);
+       modest_pair_list_free (list);
+       caption = hildon_caption_new (size_group, 
+                                     _("mcen_fi_options_connectiontype"),
+                                     ppriv->connect_via, 
+                                     NULL, 
+                                     HILDON_CAPTION_MANDATORY);
+       gtk_box_pack_start (GTK_BOX (vbox_update), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Update interval */
+       list = _modest_global_settings_dialog_get_update_interval ();
+       ppriv->update_interval = modest_combo_box_new (list, g_int_equal);
+       modest_pair_list_free (list);
+       caption = hildon_caption_new (size_group, 
+                                     _("mcen_fi_options_updateinterval"),
+                                     ppriv->update_interval, 
+                                     NULL, 
+                                     HILDON_CAPTION_MANDATORY);
+       gtk_box_pack_start (GTK_BOX (vbox_update), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Add to vbox */
+       gtk_box_pack_start (GTK_BOX (vbox), vbox_update, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Separator */
+       gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Limits */
+       vbox_limit = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT);
+       size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+
+       /* Size limit */
+       ppriv->size_limit = hildon_number_editor_new (1, 5000);;
+       hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (ppriv->size_limit), 1000);;
+       caption = hildon_caption_new (size_group, 
+                                     _("mcen_fi_advsetup_sizelimit"), 
+                                     ppriv->size_limit, 
+                                     NULL, 
+                                     HILDON_CAPTION_MANDATORY);
+       gtk_box_pack_start (GTK_BOX (vbox_limit), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Play sound */
+       ppriv->play_sound = gtk_check_button_new ();
+       caption = hildon_caption_new (size_group, 
+                                     _("mcen_fi_options_playsound"), 
+                                     ppriv->play_sound, 
+                                     NULL, 
+                                     HILDON_CAPTION_MANDATORY);
+       gtk_box_pack_start (GTK_BOX (vbox_limit), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Add to vbox */
+       gtk_box_pack_start (GTK_BOX (vbox), vbox_limit, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       return vbox;
+}
+
+/*
+ * Creates the composing page
+ */
+static GtkWidget* 
+create_composing_page (ModestMaemoGlobalSettingsDialog *self)
+{
+       GtkWidget *vbox;
+       GtkSizeGroup *size_group;
+       ModestGlobalSettingsDialogPrivate *ppriv;
+       ModestPairList *list;
+       GtkWidget *caption;
+
+       ppriv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self);
+       size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+       vbox = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT);
+
+       /* Update interval */
+       list = _modest_global_settings_dialog_get_msg_formats ();
+       ppriv->msg_format = modest_combo_box_new (list, g_int_equal);
+       modest_pair_list_free (list);
+       caption = hildon_caption_new (size_group, 
+                                     _("mcen_fi_options_messageformat"),
+                                     ppriv->msg_format, 
+                                     NULL, 
+                                     HILDON_CAPTION_MANDATORY);
+       gtk_box_pack_start (GTK_BOX (vbox), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       /* Reply */
+       ppriv->include_reply = gtk_check_button_new ();
+       caption = hildon_caption_new (size_group, 
+                                     _("mcen_fi_options_playsound"), 
+                                     ppriv->include_reply, 
+                                     NULL, 
+                                     HILDON_CAPTION_MANDATORY);
+       gtk_box_pack_start (GTK_BOX (vbox), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
+
+       return vbox;
+}
diff --git a/src/maemo/modest-maemo-global-settings-dialog.h b/src/maemo/modest-maemo-global-settings-dialog.h
new file mode 100644 (file)
index 0000000..351807d
--- /dev/null
@@ -0,0 +1,64 @@
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __MODEST_MAEMO_GLOBAL_SETTINGS_DIALOG_H__
+#define __MODEST_MAEMO_GLOBAL_SETTINGS_DIALOG_H__
+
+#include "widgets/modest-global-settings-dialog.h"
+
+G_BEGIN_DECLS
+
+/* convenience macros */
+#define MODEST_TYPE_MAEMO_GLOBAL_SETTINGS_DIALOG             (modest_maemo_global_settings_dialog_get_type())
+#define MODEST_MAEMO_GLOBAL_SETTINGS_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_MAEMO_GLOBAL_SETTINGS_DIALOG,ModestMaemoGlobalSettingsDialog))
+#define MODEST_MAEMO_GLOBAL_SETTINGS_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_MAEMO_GLOBAL_SETTINGS_DIALOG,ModestMaemoGlobalSettingsDialogClass))
+#define MODEST_IS_MAEMO_GLOBAL_SETTINGS_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_MAEMO_GLOBAL_SETTINGS_DIALOG))
+#define MODEST_IS_MAEMO_GLOBAL_SETTINGS_DIALOG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_MAEMO_GLOBAL_SETTINGS_DIALOG))
+#define MODEST_MAEMO_GLOBAL_SETTINGS_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_MAEMO_GLOBAL_SETTINGS_DIALOG,ModestMaemoGlobalSettingsDialogClass))
+
+typedef struct _ModestMaemoGlobalSettingsDialog      ModestMaemoGlobalSettingsDialog;
+typedef struct _ModestMaemoGlobalSettingsDialogClass ModestMaemoGlobalSettingsDialogClass;
+
+struct _ModestMaemoGlobalSettingsDialog {
+        ModestGlobalSettingsDialog parent;
+};
+
+struct _ModestMaemoGlobalSettingsDialogClass {
+       ModestGlobalSettingsDialogClass parent_class;
+};
+
+/* member functions */
+GType        modest_maemo_global_settings_dialog_get_type    (void) G_GNUC_CONST;
+
+GtkWidget*   modest_maemo_global_settings_dialog_new         (void);
+
+G_END_DECLS
+
+#endif /* __MODEST_MAEMO_GLOBAL_SETTINGS_DIALOG_H__ */
+
index 6a7b7d7..d16e0c0 100644 (file)
@@ -33,6 +33,7 @@
 #include <modest-runtime.h>
 #include <modest-main-window.h>
 #include <modest-header-view.h>
+#include "maemo/modest-maemo-global-settings-dialog.h"
 
 #include <modest-hildon-includes.h>
 
@@ -768,3 +769,8 @@ gboolean modest_platform_set_update_interval (guint minutes)
        return TRUE;
 }
 
+GtkWidget * 
+modest_platform_get_global_settings_dialog ()
+{
+       return modest_maemo_global_settings_dialog_new ();
+}
index ac63446..46af1e2 100644 (file)
@@ -205,6 +205,8 @@ gboolean modest_platform_connect_and_wait (GtkWindow *parent_window);
  **/
 gboolean modest_platform_set_update_interval (guint minutes);
 
+GtkWidget* modest_platform_get_global_settings_dialog ();
+
 G_END_DECLS
 
 #endif /* __MODEST_PLATFORM_UTILS_H__ */
index 361ba20..d35242c 100644 (file)
@@ -2468,9 +2468,17 @@ modest_ui_actions_on_settings (GtkAction *action,
                               ModestWindow *win)
 {
        GtkWidget *dialog;
+       gint response;
 
-       dialog = modest_global_settings_dialog_new ();
+       dialog = modest_platform_get_global_settings_dialog ();
+       gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (win));
        gtk_widget_show (dialog);
-       gtk_dialog_run (GTK_DIALOG (dialog));
+
+       response = gtk_dialog_run (GTK_DIALOG (dialog));
+
+       if (response == GTK_RESPONSE_ACCEPT) {
+               g_message ("YES");
+       }
+
        gtk_widget_destroy (dialog);
 }
diff --git a/src/widgets/modest-global-settings-dialog-priv.h b/src/widgets/modest-global-settings-dialog-priv.h
new file mode 100644 (file)
index 0000000..1df131a
--- /dev/null
@@ -0,0 +1,64 @@
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __MODEST_GLOBAL_SETTINGS_DIALOG_PRIV_H__
+#define __MODEST_GLOBAL_SETTINGS_DIALOG_PRIV_H__
+
+#include <gtk/gtkwidget.h>
+#include "modest-pair.h"
+/* other include files */
+
+G_BEGIN_DECLS
+
+typedef struct _ModestGlobalSettingsDialogPrivate ModestGlobalSettingsDialogPrivate;
+struct _ModestGlobalSettingsDialogPrivate {
+       GtkWidget *notebook;
+       GtkWidget *updating_page;
+       GtkWidget *composing_page;
+
+       GtkWidget *auto_update;
+       GtkWidget *connect_via;
+       GtkWidget *update_interval;
+       GtkWidget *size_limit;
+       GtkWidget *play_sound;
+       GtkWidget *msg_format;
+       GtkWidget *include_reply;
+};
+#define MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE(o)      (G_TYPE_INSTANCE_GET_PRIVATE((o), \
+                                                           MODEST_TYPE_GLOBAL_SETTINGS_DIALOG, \
+                                                           ModestGlobalSettingsDialogPrivate))
+
+ModestPairList*   _modest_global_settings_dialog_get_connected_via   (void);
+ModestPairList*   _modest_global_settings_dialog_get_update_interval (void);
+ModestPairList*   _modest_global_settings_dialog_get_msg_formats     (void);
+
+G_END_DECLS
+
+#endif /* __MODEST_GLOBAL_SETTINGS_DIALOG_PRIV_H__ */
+
index cdcddff..c78ad96 100644 (file)
@@ -28,6 +28,9 @@
  */
 
 #include <glib/gi18n.h>
+#include <gtk/gtknotebook.h>
+#include <gtk/gtkstock.h>
+#include <gtk/gtklabel.h>
 #include "modest-global-settings-dialog.h"
 #include "modest-defs.h"
 #include "modest-ui-constants.h"
@@ -39,20 +42,6 @@ static void modest_global_settings_dialog_class_init (ModestGlobalSettingsDialog
 static void modest_global_settings_dialog_init       (ModestGlobalSettingsDialog *obj);
 static void modest_global_settings_dialog_finalize   (GObject *obj);
 
-enum {
-       MODEST_CONNECTED_VIA_WLAN,
-       MODEST_CONNECTED_VIA_ANY
-};
-
-enum {
-       MODEST_UPDATE_INTERVAL_5_MIN,
-       MODEST_UPDATE_INTERVAL_10_MIN,
-       MODEST_UPDATE_INTERVAL_15_MIN,
-       MODEST_UPDATE_INTERVAL_30_MIN,
-       MODEST_UPDATE_INTERVAL_1_HOUR,
-       MODEST_UPDATE_INTERVAL_2_HOUR
-};
-
 /* list my signals  */
 enum {
        /* MY_SIGNAL_1, */
@@ -60,19 +49,6 @@ enum {
        LAST_SIGNAL
 };
 
-static GtkWidget* create_updating_page  (void);
-static GtkWidget* create_composing_page (void);
-
-typedef struct _ModestGlobalSettingsDialogPrivate ModestGlobalSettingsDialogPrivate;
-struct _ModestGlobalSettingsDialogPrivate {
-       GtkWidget *notebook;
-       GtkWidget *updating_page;
-       GtkWidget *composing_page;
-       gboolean   modified;
-};
-#define MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE(o)      (G_TYPE_INSTANCE_GET_PRIVATE((o), \
-                                                           MODEST_TYPE_GLOBAL_SETTINGS_DIALOG, \
-                                                           ModestGlobalSettingsDialogPrivate))
 /* globals */
 static GtkDialogClass *parent_class = NULL;
 
@@ -123,21 +99,8 @@ modest_global_settings_dialog_init (ModestGlobalSettingsDialog *self)
 
        priv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self);
 
-       priv->modified = FALSE;
        priv->notebook = gtk_notebook_new ();
-       priv->updating_page = create_updating_page ();
-       priv->composing_page = create_composing_page ();
-    
-       /* Add the notebook pages: */
-       gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), priv->updating_page, 
-               gtk_label_new (_("mcen_ti_options_updating")));
-       gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), priv->composing_page, 
-               gtk_label_new (_("mcen_ti_options_composing")));
-               
-       gtk_container_add (GTK_CONTAINER (GTK_DIALOG (self)->vbox), priv->notebook);
-       gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (self)->vbox), MODEST_MARGIN_HALF);
-       gtk_widget_show_all (priv->notebook);
-        
+           
        /* Add the buttons: */
        gtk_dialog_add_button (GTK_DIALOG (self), GTK_STOCK_OK, GTK_RESPONSE_OK);
        gtk_dialog_add_button (GTK_DIALOG (self), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
@@ -175,45 +138,6 @@ modest_global_settings_dialog_finalize (GObject *obj)
        G_OBJECT_CLASS(parent_class)->finalize (obj);
 }
 
-GtkWidget*
-modest_global_settings_dialog_new (void)
-{
-       return GTK_WIDGET(g_object_new(MODEST_TYPE_GLOBAL_SETTINGS_DIALOG, NULL));
-}
-
-/* 
- * Adds the two widgets to a new row in the table
- */
-static void
-add_to_table (GtkTable *table,
-             GtkWidget *left,
-             GtkWidget *right)
-{
-       guint n_rows = 0;
-
-       g_object_get (G_OBJECT (table), "n-rows", &n_rows,NULL);
-
-       /* Create label */
-       gtk_misc_set_alignment (GTK_MISC (left), 1.0, 0.0);
-
-       /* Create value */
-/*     gtk_misc_set_alignment (GTK_MISC (right), 0.0, 0.0); */
-
-       /* Attach label and value */
-       gtk_table_attach (table, 
-                         left, 0, 1, 
-                         n_rows, n_rows + 1, 
-                         GTK_SHRINK|GTK_FILL, 
-                         GTK_SHRINK|GTK_FILL, 
-                         0, 0);
-       gtk_table_attach (table, 
-                         right, 1, 2, 
-                         n_rows, n_rows + 1, 
-                         GTK_EXPAND|GTK_FILL, 
-                         GTK_SHRINK|GTK_FILL, 
-                         0, 0);
-}
-
 /*
  * Creates a pair list (number,string) and adds it to the given list
  */
@@ -232,8 +156,8 @@ add_to_modest_pair_list (const gint num, const gchar *str, GSList **list)
 /*
  * Gets a list of pairs 
  */
-static ModestPairList *
-get_connected_via (void)
+ModestPairList *
+_modest_global_settings_dialog_get_connected_via (void)
 {
        GSList *list = NULL;
 
@@ -250,8 +174,8 @@ get_connected_via (void)
 /*
  * Gets a list of pairs of update intervals
  */
-static ModestPairList *
-get_update_interval (void)
+ModestPairList *
+_modest_global_settings_dialog_get_update_interval (void)
 {
        GSList *list = NULL;
 
@@ -277,87 +201,11 @@ get_update_interval (void)
        return (ModestPairList *) g_slist_reverse (list);
 }
 
-/* 
- * We need this because the translations are comming without ":" 
- */
-static GtkWidget *
-create_label (const gchar *text)
-{
-       gchar *label_name;
-       GtkWidget *label;
-
-       label_name = g_strdup_printf ("%s:", text);
-       label = gtk_label_new (label_name);
-       g_free (label_name);
-
-       return label;
-}
-
-/*
- * Creates the updating page
- */
-static GtkWidget*
-create_updating_page (void)
-{
-       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);
-       table_limit = gtk_table_new (2, 2, FALSE);
-       /* FIXME: set proper values */
-       gtk_table_set_row_spacings (GTK_TABLE (table_update), 6);
-       gtk_table_set_col_spacings (GTK_TABLE (table_update), 12);
-       gtk_table_set_row_spacings (GTK_TABLE (table_limit), 6);
-       gtk_table_set_col_spacings (GTK_TABLE (table_limit), 12);
-
-       /* Autoupdate */
-       label = create_label (_("mcen_fi_options_autoupdate"));
-       check = gtk_check_button_new ();
-       add_to_table (GTK_TABLE (table_update), label, check);
-
-       /* 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);
-       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);
-       add_to_table (GTK_TABLE (table_update), label, combo);
-
-       /* Add to vbox */
-       gtk_box_pack_start (GTK_BOX (vbox), table_update, FALSE, FALSE, MODEST_MARGIN_HALF);
-
-       /* Separator */
-       gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, MODEST_MARGIN_HALF);
-
-       /* Limits */
-       label = create_label (_("mcen_fi_advsetup_sizelimit"));
-       spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1000, 1, 5000, 1, 1, 16)), 
-                                   1, 0);
-       add_to_table (GTK_TABLE (table_limit), label, spin);
-
-       label = create_label (_("mcen_fi_options_playsound"));
-       check = gtk_check_button_new ();
-       add_to_table (GTK_TABLE (table_limit), label, check);
-
-       /* Add to vbox */
-       gtk_box_pack_start (GTK_BOX (vbox), table_limit, FALSE, FALSE, MODEST_MARGIN_HALF);
-
-       return vbox;
-}
-
 /*
  * Gets a list of pairs 
  */
-static ModestPairList *
-get_msg_formats (void)
+ModestPairList *
+_modest_global_settings_dialog_get_msg_formats (void)
 {
        GSList *list = NULL;
 
@@ -370,37 +218,3 @@ get_msg_formats (void)
 
        return (ModestPairList *) g_slist_reverse (list);
 }
-
-
-/*
- * Creates the composing page
- */
-static GtkWidget* 
-create_composing_page (void)
-{
-       GtkWidget *vbox, *table;
-       GtkWidget *label, *check, *combo;
-       ModestPairList *list;
-
-       vbox = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT);
-       table = gtk_table_new (2, 2, FALSE);
-       /* FIXME: set proper values */
-       gtk_table_set_row_spacings (GTK_TABLE (table), 6);
-       gtk_table_set_col_spacings (GTK_TABLE (table), 12);
-
-       /* 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);
-       add_to_table (GTK_TABLE (table), label, combo);
-
-       label = create_label (_("mcen_va_options_include_original_inreply"));
-       check = gtk_check_button_new ();
-       add_to_table (GTK_TABLE (table), label, check);
-
-       /* Add to vbox */
-       gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, MODEST_MARGIN_HALF);
-
-       return vbox;
-}
index 1eb9ea2..d1338ef 100644 (file)
@@ -30,7 +30,8 @@
 #ifndef __MODEST_GLOBAL_SETTINGS_DIALOG_H__
 #define __MODEST_GLOBAL_SETTINGS_DIALOG_H__
 
-#include <gtk/gtk.h>
+#include <gtk/gtkdialog.h>
+#include "widgets/modest-global-settings-dialog-priv.h"
 /* other include files */
 
 G_BEGIN_DECLS
@@ -38,7 +39,7 @@ G_BEGIN_DECLS
 /* convenience macros */
 #define MODEST_TYPE_GLOBAL_SETTINGS_DIALOG             (modest_global_settings_dialog_get_type())
 #define MODEST_GLOBAL_SETTINGS_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_GLOBAL_SETTINGS_DIALOG,ModestGlobalSettingsDialog))
-#define MODEST_GLOBAL_SETTINGS_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_GLOBAL_SETTINGS_DIALOG,GtkDialog))
+#define MODEST_GLOBAL_SETTINGS_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_GLOBAL_SETTINGS_DIALOG,ModestGlobalSettingsDialogClass))
 #define MODEST_IS_GLOBAL_SETTINGS_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_GLOBAL_SETTINGS_DIALOG))
 #define MODEST_IS_GLOBAL_SETTINGS_DIALOG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_GLOBAL_SETTINGS_DIALOG))
 #define MODEST_GLOBAL_SETTINGS_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_GLOBAL_SETTINGS_DIALOG,ModestGlobalSettingsDialogClass))
@@ -48,26 +49,29 @@ typedef struct _ModestGlobalSettingsDialogClass ModestGlobalSettingsDialogClass;
 
 struct _ModestGlobalSettingsDialog {
         GtkDialog parent;
-       /* insert public members, if any */
 };
 
 struct _ModestGlobalSettingsDialogClass {
        GtkDialogClass parent_class;
-       /* insert signal callback declarations, eg. */
-       /* void (* my_event) (ModestGlobalSettingsDialog* obj); */
 };
 
-/* member functions */
-GType        modest_global_settings_dialog_get_type    (void) G_GNUC_CONST;
-
-/* typical parameter-less _new function */
-/* if this is a kind of GtkWidget, it should probably return at GtkWidget* */
-GtkWidget*   modest_global_settings_dialog_new         (void);
+/* Global settings */
+typedef enum _ModestConnectedVia {
+       MODEST_CONNECTED_VIA_WLAN,
+       MODEST_CONNECTED_VIA_ANY
+} ModestConnectedVia;
 
-/* fill in other public functions, eg.: */
-/*     void       modest_global_settings_dialog_do_something (ModestGlobalSettingsDialog *self, const gchar* param); */
-/*     gboolean   modest_global_settings_dialog_has_foo      (ModestGlobalSettingsDialog *self, gint value); */
+typedef enum _ModestUpdateInterval {
+       MODEST_UPDATE_INTERVAL_5_MIN,
+       MODEST_UPDATE_INTERVAL_10_MIN,
+       MODEST_UPDATE_INTERVAL_15_MIN,
+       MODEST_UPDATE_INTERVAL_30_MIN,
+       MODEST_UPDATE_INTERVAL_1_HOUR,
+       MODEST_UPDATE_INTERVAL_2_HOUR
+} ModestUpdateInterval;
 
+/* member functions */
+GType        modest_global_settings_dialog_get_type    (void) G_GNUC_CONST;
 
 G_END_DECLS