* Removed maemo ui constants
authorSergio Villar Senin <svillar@igalia.com>
Wed, 9 May 2007 10:53:08 +0000 (10:53 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 9 May 2007 10:53:08 +0000 (10:53 +0000)
* Added modest ui constants
* Added Tools->Settings handler
* Added very first implementation of global settings dialog
* Fixed a compilation error in Sardine. Added -DMAEMO_CHANGES

pmo-trunk-r1799

18 files changed:
src/Makefile.am
src/gnome/modest-main-window-ui.h
src/gnome/ui/modest-main-window-ui.xml
src/maemo/easysetup/modest-easysetup-wizard.c
src/maemo/modest-account-settings-dialog.c
src/maemo/modest-account-view-window.c
src/maemo/modest-connection-specific-smtp-edit-window.c
src/maemo/modest-connection-specific-smtp-window.c
src/maemo/modest-maemo-ui-constants.h [deleted file]
src/maemo/modest-main-window-ui.h
src/maemo/modest-signature-editor-dialog.c
src/modest-ui-actions.c
src/modest-ui-actions.h
src/widgets/Makefile.am
src/widgets/modest-global-settings-dialog.c [new file with mode: 0644]
src/widgets/modest-global-settings-dialog.h [new file with mode: 0644]
src/widgets/modest-ui-constants.h [new file with mode: 0644]
src/widgets/modest-window.c

index 3802668..d3001a4 100644 (file)
@@ -11,6 +11,7 @@ INCLUDES=\
        $(MODEST_LIBTINYMAIL_MAEMO_CFLAGS) \
        -I$(MODEST_PLATFORM) \
        -DPREFIX=\"@prefix@\" \
+       -DMAEMO_CHANGES \
        -DMODEST_LOCALEDIR=\"$(MODEST_LOCALEDIR)\" \
        -DMODEST_PLATFORM=\"$(MODEST_PLATFORM)\" \
        -DPIXMAP_PREFIX=\"${datadir}/pixmaps/modest/\" \
index fa80679..29a4e08 100644 (file)
@@ -89,6 +89,7 @@ static const GtkActionEntry modest_action_entries [] = {
        { "OptionsAddToContacts", NULL, N_("A_dd to accounts"), NULL, N_("Add selection to accounts"), G_CALLBACK (modest_ui_actions_on_add_to_contacts) },
        { "OptionsAccounts",  NULL, N_("_Accounts"), NULL, N_("Manage accounts"), G_CALLBACK (modest_ui_actions_on_accounts) },
        { "OptionsContacts",  NULL, N_("_Contacts"), NULL, N_("Manage contacts"), NULL },
+       { "OptionsSettings",        NULL,      N_("mcen_me_inbox_options"),                   NULL, NULL, G_CALLBACK (modest_ui_actions_on_settings) },
 
        /* HELP */
        { "HelpAbout", GTK_STOCK_ABOUT, N_("About"), NULL, N_("About Modest"), G_CALLBACK (modest_ui_actions_on_about) },
index e27f4de..66f8397 100644 (file)
@@ -71,6 +71,8 @@
       <menuitem name="OptionsAccountsMenu" action="OptionsAccounts"/>
       <separator/>
       <menuitem name="OptionsContactsMenu" action="OptionsContacts"/>
+      <separator/>
+      <menuitem name="OptionsSettingsMenu" action="OptionsSettings"/>
     </menu>
 
     <menu name="HelpMenu" action="Help">
index 0e72a8e..4a7d9b0 100644 (file)
@@ -26,7 +26,7 @@
 #include "modest-account-mgr-helpers.h"
 #include "modest-runtime.h" /* For modest_runtime_get_account_mgr(). */
 #include "maemo/modest-connection-specific-smtp-window.h"
-#include "maemo/modest-maemo-ui-constants.h"
+#include "widgets/modest-ui-constants.h"
 #include "maemo/modest-account-settings-dialog.h"
 #include <gconf/gconf-client.h>
 #include <string.h> /* For strlen(). */
index f87de49..ffb5a13 100644 (file)
@@ -28,7 +28,7 @@
 #include "modest-runtime.h" /* For modest_runtime_get_account_mgr(). */
 #include "maemo/modest-connection-specific-smtp-window.h"
 #include "maemo/modest-signature-editor-dialog.h"
-#include <maemo/modest-maemo-ui-constants.h>
+#include "widgets/modest-ui-constants.h"
 #include <gconf/gconf-client.h>
 #include <string.h> /* For strlen(). */
 
index 869600e..61f50ae 100644 (file)
@@ -39,7 +39,7 @@
 #include "modest-tny-platform-factory.h"
 #include "maemo/easysetup/modest-easysetup-wizard.h"
 #include "maemo/modest-account-settings-dialog.h"
-#include "maemo/modest-maemo-ui-constants.h"
+#include "widgets/modest-ui-constants.h"
 
 /* 'private'/'protected' functions */
 static void                            modest_account_view_window_class_init   (ModestAccountViewWindowClass *klass);
index 5fa75b8..cc66446 100644 (file)
@@ -1,7 +1,7 @@
 /* connection-specific-smtp-window.c */
 
 #include "modest-connection-specific-smtp-edit-window.h"
-#include "maemo/modest-maemo-ui-constants.h"
+#include "widgets/modest-ui-constants.h"
 #include "modest-hildon-includes.h"
 #include "modest-runtime.h"
 
index 6315cd1..9610fc9 100644 (file)
@@ -3,7 +3,7 @@
 #include "modest-connection-specific-smtp-window.h"
 #include "modest-connection-specific-smtp-edit-window.h"
 #include <modest-account-mgr-helpers.h>
-#include <maemo/modest-maemo-ui-constants.h>
+#include "widgets/modest-ui-constants.h"
 
 #include <modest-runtime.h>
 #include <tny-maemo-conic-device.h>
diff --git a/src/maemo/modest-maemo-ui-constants.h b/src/maemo/modest-maemo-ui-constants.h
deleted file mode 100644 (file)
index 9938252..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (c) 2007, 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_UI_CONSTANTS_H__
-#define __MODEST_MAEMO_UI_CONSTANTS_H__
-
-/* These are based on an email on the maemo-developers mailing list from Dirk-Jan Binnema, 
- * title "RE: Standard widget spacing and padding?":
- */
-#define MODEST_MARGIN_DEFAULT 6
-#define MODEST_MARGIN_DOUBLE 12
-#define MODEST_MARGIN_TRIPLE 18
-#define MODEST_MARGIN_HALF 3
-#define MODEST_MARGIN_NONE 0
-
-#endif /*__MODEST_MAEMO_UI_CONSTANTS_H__*/
index 0ba4b8b..8234741 100644 (file)
@@ -90,7 +90,7 @@ static const GtkActionEntry modest_action_entries [] = {
        { "RemoveAttachment", NULL, N_("mcen_me_viewer_remove_attachments"), NULL, NULL, G_CALLBACK (modest_ui_actions_remove_attachments) },
        
        /* Tools */
-       { "ToolsSettings",        NULL,      N_("mcen_me_inbox_options"),                     NULL, NULL,  NULL },
+       { "ToolsSettings",        NULL,      N_("mcen_me_inbox_options"),                     NULL, NULL, G_CALLBACK (modest_ui_actions_on_settings) },
        { "ToolsAccounts",        NULL,      N_("mcen_me_inbox_accounts"),                NULL, NULL,  G_CALLBACK(modest_ui_actions_on_accounts) },
        { "ToolsSMTPServers",     NULL,      N_("mcen_me_inbox_globalsmtpservers"),                NULL, NULL,  NULL },
        { "ToolsSendReceive", NULL, N_("mcen_me_inbox_sendandreceive") }, /* submenu */
index 76281e8..acc9c6b 100644 (file)
@@ -1,7 +1,7 @@
 /* connection-specific-smtp-window.c */
 
 #include "modest-signature-editor-dialog.h"
-#include "maemo/modest-maemo-ui-constants.h"
+#include "widgets/modest-ui-constants.h"
 #include "modest-hildon-includes.h"
 #include "widgets/modest-serversecurity-combo-box.h"
 #include "widgets/modest-secureauth-combo-box.h"
index 26bdbbb..fd09f13 100644 (file)
 
 #ifdef MODEST_PLATFORM_MAEMO
 #include "maemo/modest-osso-state-saving.h"
-#include "maemo/modest-maemo-ui-constants.h"
 #endif /* MODEST_PLATFORM_MAEMO */
 
-
+#include "widgets/modest-ui-constants.h"
 #include <widgets/modest-main-window.h>
 #include <widgets/modest-msg-view-window.h>
 #include <widgets/modest-account-view-window.h>
 #include <widgets/modest-details-dialog.h>
 #include <widgets/modest-attachments-view.h>
-
+#include "widgets/modest-global-settings-dialog.h"
 #include "modest-account-mgr-helpers.h"
 #include "modest-mail-operation.h"
 #include "modest-text-utils.h"
@@ -445,7 +444,7 @@ open_msg_func (const GObject *obj, const TnyMsg *msg, gpointer user_data)
                else
                        win = modest_msg_view_window_new ((TnyMsg *) msg, account);
        }
-               
+       
        /* Register and show new window */
        if (win != NULL) {
                mgr = modest_runtime_get_window_mgr ();
@@ -2463,3 +2462,14 @@ modest_ui_actions_remove_attachments (GtkAction *action,
        }
 }
 
+void 
+modest_ui_actions_on_settings (GtkAction *action, 
+                              ModestWindow *win)
+{
+       GtkWidget *dialog;
+
+       dialog = modest_global_settings_dialog_new ();
+       gtk_widget_show (dialog);
+       gtk_dialog_run (GTK_DIALOG (dialog));
+       gtk_widget_destroy (dialog);
+}
index 83287ce..ebd94d9 100644 (file)
@@ -75,6 +75,8 @@ void     modest_ui_actions_on_details       (GtkAction *action, ModestWindow *wi
 
 void     modest_ui_actions_on_move_to       (GtkAction *action, ModestWindow *win);
 
+void     modest_ui_actions_on_settings      (GtkAction *action, ModestWindow *win);
+
 /**
  * modest_ui_actions_toggle_folders_view:
  * @action: the #GtkAction
index 485c07e..637f0c7 100644 (file)
@@ -28,6 +28,8 @@ libmodest_widgets_la_SOURCES=          \
        modest-combo-box.h             \
        modest-folder-view.c           \
        modest-folder-view.h           \
+       modest-global-settings-dialog.c \
+       modest-global-settings-dialog.h \
        modest-header-view-render.c    \
        modest-header-view.c           \
        modest-header-view.h           \
diff --git a/src/widgets/modest-global-settings-dialog.c b/src/widgets/modest-global-settings-dialog.c
new file mode 100644 (file)
index 0000000..bea91cf
--- /dev/null
@@ -0,0 +1,181 @@
+/* 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.
+ */
+
+#include <glib/gi18n.h>
+#include "modest-global-settings-dialog.h"
+#include "modest-defs.h"
+#include "modest-ui-constants.h"
+/* include other impl specific header files */
+
+/* 'private'/'protected' functions */
+static void modest_global_settings_dialog_class_init (ModestGlobalSettingsDialogClass *klass);
+static void modest_global_settings_dialog_init       (ModestGlobalSettingsDialog *obj);
+static void modest_global_settings_dialog_finalize   (GObject *obj);
+/* list my signals  */
+enum {
+       /* MY_SIGNAL_1, */
+       /* MY_SIGNAL_2, */
+       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;
+
+/* uncomment the following if you have defined any signals */
+/* static guint signals[LAST_SIGNAL] = {0}; */
+
+GType
+modest_global_settings_dialog_get_type (void)
+{
+       static GType my_type = 0;
+       if (!my_type) {
+               static const GTypeInfo my_info = {
+                       sizeof(ModestGlobalSettingsDialogClass),
+                       NULL,           /* base init */
+                       NULL,           /* base finalize */
+                       (GClassInitFunc) modest_global_settings_dialog_class_init,
+                       NULL,           /* class finalize */
+                       NULL,           /* class data */
+                       sizeof(ModestGlobalSettingsDialog),
+                       1,              /* n_preallocs */
+                       (GInstanceInitFunc) modest_global_settings_dialog_init,
+                       NULL
+               };
+               my_type = g_type_register_static (GTK_TYPE_DIALOG,
+                                                 "ModestGlobalSettingsDialog",
+                                                 &my_info, 0);
+       }
+       return my_type;
+}
+
+static void
+modest_global_settings_dialog_class_init (ModestGlobalSettingsDialogClass *klass)
+{
+       GObjectClass *gobject_class;
+       gobject_class = (GObjectClass*) klass;
+
+       parent_class            = g_type_class_peek_parent (klass);
+       gobject_class->finalize = modest_global_settings_dialog_finalize;
+
+       g_type_class_add_private (gobject_class, sizeof(ModestGlobalSettingsDialogPrivate));
+
+       /* signal definitions go here, e.g.: */
+/*     signals[MY_SIGNAL_1] = */
+/*             g_signal_new ("my_signal_1",....); */
+/*     signals[MY_SIGNAL_2] = */
+/*             g_signal_new ("my_signal_2",....); */
+/*     etc. */
+}
+
+static void
+modest_global_settings_dialog_init (ModestGlobalSettingsDialog *self)
+{
+       ModestGlobalSettingsDialogPrivate *priv;
+
+       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 (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);
+    
+/*     /\* Connect to the dialog's response signal: *\/ */
+/*     /\* 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);  */
+
+       /* Set title */
+       gtk_window_set_title (GTK_WINDOW (self), _("mcen_ti_options"));
+}
+
+static void
+modest_global_settings_dialog_finalize (GObject *obj)
+{
+/*     free/unref instance resources here */
+       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));
+}
+
+/* insert many other interesting function implementations */
+/* such as modest_global_settings_dialog_do_something, or modest_global_settings_dialog_has_foo */
+
+static GtkWidget*
+create_updating_page (void)
+{
+       GtkWidget *box;
+
+       box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
+
+       return box;
+}
+
+static GtkWidget* 
+create_composing_page (void)
+{
+       GtkWidget *box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
+
+       box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
+
+       return box;
+}
diff --git a/src/widgets/modest-global-settings-dialog.h b/src/widgets/modest-global-settings-dialog.h
new file mode 100644 (file)
index 0000000..1eb9ea2
--- /dev/null
@@ -0,0 +1,75 @@
+/* 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_H__
+#define __MODEST_GLOBAL_SETTINGS_DIALOG_H__
+
+#include <gtk/gtk.h>
+/* other include files */
+
+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_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))
+
+typedef struct _ModestGlobalSettingsDialog      ModestGlobalSettingsDialog;
+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);
+
+/* 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); */
+
+
+G_END_DECLS
+
+#endif /* __MODEST_GLOBAL_SETTINGS_DIALOG_H__ */
+
diff --git a/src/widgets/modest-ui-constants.h b/src/widgets/modest-ui-constants.h
new file mode 100644 (file)
index 0000000..0566ee4
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright (c) 2007, 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_UI_CONSTANTS_H__
+#define __MODEST_MAEMO_UI_CONSTANTS_H__
+
+/* These are based on an email on the maemo-developers mailing list from Dirk-Jan Binnema, 
+ * title "RE: Standard widget spacing and padding?":
+ */
+
+#ifdef MODEST_PLATFORM_MAEMO 
+#define MODEST_MARGIN_DEFAULT 6
+#define MODEST_MARGIN_DOUBLE 12
+#define MODEST_MARGIN_TRIPLE 18
+#define MODEST_MARGIN_HALF 3
+#define MODEST_MARGIN_NONE 0
+/* TODO: review this values with GNOME HIG */
+#else
+#define MODEST_MARGIN_DEFAULT 6
+#define MODEST_MARGIN_DOUBLE 12
+#define MODEST_MARGIN_TRIPLE 18
+#define MODEST_MARGIN_HALF 3
+#define MODEST_MARGIN_NONE 0
+#endif
+
+#endif /*__MODEST_MAEMO_UI_CONSTANTS_H__*/
index 79aad9a..07629b0 100644 (file)
@@ -156,7 +156,9 @@ modest_window_set_active_account (ModestWindow *self, const gchar *active_accoun
                return;
        else {
                g_free (priv->active_account);
-               priv->active_account = g_strdup (active_account);
+               priv->active_account = NULL;
+               if (active_account)
+                       priv->active_account = g_strdup (active_account);
        }
 }