2007-07-19 [colin] 2.10.0cvs47
authorColin Leroy <colin@colino.net>
Thu, 19 Jul 2007 16:36:11 +0000 (16:36 +0000)
committerColin Leroy <colin@colino.net>
Thu, 19 Jul 2007 16:36:11 +0000 (16:36 +0000)
* configure.ac
* src/main.c
* src/prefs_common.c
* src/prefs_common.h
* src/wizard.c
* src/common/defs.h
* src/common/utils.c
Maemo: add an easy way to store data (mails
and IMAP/NNTP caches) on one of the SD cards,
and protect against unmounts if needed

ChangeLog
PATCHSETS
configure.ac
src/common/defs.h
src/common/utils.c
src/main.c
src/prefs_common.c
src/prefs_common.h
src/wizard.c

index c8dc0ea7a2e5dbd52fd499d02a31910981b9de29..849154370dcef12c8c34f631785b40bcd5506cb4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2007-07-19 [colin]     2.10.0cvs47
+
+       * configure.ac
+       * src/main.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/wizard.c
+       * src/common/defs.h
+       * src/common/utils.c
+               Maemo: add an easy way to store data (mails
+               and IMAP/NNTP caches) on one of the SD cards,
+               and protect against unmounts if needed
+
 2007-07-19 [paul]      2.10.0cvs46
 
        * src/Makefile.am
index 3f23b85656a111b4fedd35e86ab016f4dd139c6d..73b626c6e30b24288b5fde7f971b2c6168cffb84 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.155.2.69 -r 1.155.2.70 src/Makefile.am;  ) > 2.10.0cvs44.patchset
 ( cvs diff -u -r 1.155.2.70 -r 1.155.2.71 src/Makefile.am;  ) > 2.10.0cvs45.patchset
 ( cvs diff -u -r 1.155.2.71 -r 1.155.2.72 src/Makefile.am;  cvs diff -u -r 1.25.2.42 -r 1.25.2.43 src/stock_pixmap.c;  cvs diff -u -r 1.1.2.56 -r 1.1.2.57 src/wizard.c;  cvs diff -u -r 1.4.2.51 -r 1.4.2.52 src/gtk/about.c;  diff -u /dev/null src/pixmaps/claws-mail_logo-small.xpm;  ) > 2.10.0cvs46.patchset
+( cvs diff -u -r 1.654.2.2756 -r 1.654.2.2757 configure.ac;  cvs diff -u -r 1.115.2.158 -r 1.115.2.159 src/main.c;  cvs diff -u -r 1.204.2.141 -r 1.204.2.142 src/prefs_common.c;  cvs diff -u -r 1.103.2.87 -r 1.103.2.88 src/prefs_common.h;  cvs diff -u -r 1.1.2.57 -r 1.1.2.58 src/wizard.c;  cvs diff -u -r 1.9.2.40 -r 1.9.2.41 src/common/defs.h;  cvs diff -u -r 1.36.2.106 -r 1.36.2.107 src/common/utils.c;  ) > 2.10.0cvs47.patchset
index 02c655412eb78fd301e6c8340898aae960ebccf4..82043688477541b5bd53a84564fad33761c2d9b5 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=10
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=46
+EXTRA_VERSION=47
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
@@ -445,7 +445,7 @@ AC_ARG_ENABLE(maemo,
        [  --enable-maemo   Build for the Maemo platform [default=no]],
        [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
 if test $ac_cv_enable_maemo = yes; then
-       PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm, ac_cv_enable_maemo=yes,
+       PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
                  ac_cv_enable_maemo=no)
        AC_SUBST(MAEMO_CFLAGS)
        AC_SUBST(MAEMO_LIBS)
index cd608665a9db4ee02e8e3c8e59492309b670d8b6..a3441f36d3be23dce1c0a2bef8816bf65e313367 100644 (file)
 #define MARK_VERSION           2
 #define TAGS_VERSION           1
 
+#ifdef MAEMO
+#define MMC1_PATH "/media/mmc1"
+#define MMC2_PATH "/media/mmc2"
+#endif
+
 #ifdef G_OS_WIN32
 #  define ACTIONS_RC           "actionswinrc"
 #  define COMMAND_HISTORY      "command_history_win"
index f087d56c1abf5804faf2202f0d0f1320eaff10db..dd1c2e01fae8a3b45f94c72b360c5200b67f9da4 100644 (file)
@@ -1934,24 +1934,77 @@ const gchar *get_mail_base_dir(void)
 #endif
 }
 
+#ifdef MAEMO
+const gchar *prefs_common_get_data_root(void);
+gchar *last_data_root = NULL;
+#endif
+
 const gchar *get_news_cache_dir(void)
 {
        static gchar *news_cache_dir = NULL;
-
+#ifdef MAEMO
+       const gchar *data_root = prefs_common_get_data_root();
+       if (strcmp2(data_root, last_data_root)) {
+               g_free(news_cache_dir);
+               news_cache_dir = NULL;
+       }
+#endif
        if (!news_cache_dir)
+#ifndef MAEMO
                news_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                             NEWS_CACHE_DIR, NULL);
-
+#else
+       {
+               if (data_root) {
+                       news_cache_dir = g_strconcat(data_root, G_DIR_SEPARATOR_S,
+                                            "Claws", G_DIR_SEPARATOR_S, 
+                                            g_get_user_name(), G_DIR_SEPARATOR_S,
+                                            NEWS_CACHE_DIR, NULL);
+                       g_free(last_data_root);
+                       last_data_root = g_strdup(last_data_root);
+               } else {
+                       news_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
+                                            NEWS_CACHE_DIR, NULL);
+                       g_free(last_data_root);
+                       last_data_root = NULL;
+               }
+       }
+#endif
        return news_cache_dir;
 }
 
 const gchar *get_imap_cache_dir(void)
 {
        static gchar *imap_cache_dir = NULL;
+#ifdef MAEMO
+       const gchar *data_root = prefs_common_get_data_root();
+       if (strcmp2(data_root, last_data_root)) {
+               g_free(imap_cache_dir);
+               imap_cache_dir = NULL;
+       }
+#endif
 
        if (!imap_cache_dir)
+#ifndef MAEMO
                imap_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                             IMAP_CACHE_DIR, NULL);
+#else
+       {
+               if (data_root) {
+                       imap_cache_dir = g_strconcat(data_root, G_DIR_SEPARATOR_S,
+                                            "Claws", G_DIR_SEPARATOR_S, 
+                                            g_get_user_name(), G_DIR_SEPARATOR_S,
+                                            IMAP_CACHE_DIR, NULL);
+                       g_free(last_data_root);
+                       last_data_root = g_strdup(last_data_root);
+               } else {
+                       imap_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
+                                            IMAP_CACHE_DIR, NULL);
+                       g_free(last_data_root);
+                       last_data_root = NULL;
+               }
+       }
+#endif
 
        return imap_cache_dir;
 }
@@ -1959,10 +2012,34 @@ const gchar *get_imap_cache_dir(void)
 const gchar *get_mbox_cache_dir(void)
 {
        static gchar *mbox_cache_dir = NULL;
-
+#ifdef MAEMO
+       const gchar *data_root = prefs_common_get_data_root();
+       if (strcmp2(data_root, last_data_root)) {
+               g_free(mbox_cache_dir);
+               mbox_cache_dir = NULL;
+       }
+#endif
        if (!mbox_cache_dir)
+#ifndef MAEMO
                mbox_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                             MBOX_CACHE_DIR, NULL);
+#else
+       {
+               if (data_root) {
+                       mbox_cache_dir = g_strconcat(data_root, G_DIR_SEPARATOR_S,
+                                            "Claws", G_DIR_SEPARATOR_S, 
+                                            g_get_user_name(), G_DIR_SEPARATOR_S,
+                                            MBOX_CACHE_DIR, NULL);
+                       g_free(last_data_root);
+                       last_data_root = g_strdup(last_data_root);
+               } else {
+                       mbox_cache_dir = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
+                                            MBOX_CACHE_DIR, NULL);
+                       g_free(last_data_root);
+                       last_data_root = NULL;
+               }
+       }
+#endif
 
        return mbox_cache_dir;
 }
index ad73e27bdfa02e27207a85b23fc0fde3f122915a..9eec413f888fb8c9da1bfe220964b2902d32e119 100644 (file)
 #include <hildon-widgets/hildon-program.h>
 #include <gtk/gtkmain.h>
 #include <libosso.h>
+#include <libgnomevfs/gnome-vfs-volume.h>
+#include <libgnomevfs/gnome-vfs-volume-monitor.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
 
 #define OSSO_NAME    "claws_mail"
 #define OSSO_SERVICE "com.nokia."OSSO_NAME
@@ -131,6 +134,8 @@ struct _AppData {
     HildonWindow *window;
     osso_context_t *osso_context;
 };
+
+static GnomeVFSVolumeMonitor *volmon;
 #endif
 
 gchar *prog_version;
@@ -626,6 +631,35 @@ void main_set_show_at_startup(gboolean show)
        show_at_startup = show;
 }
 
+#ifdef MAEMO
+static void main_vol_mount_cb(GnomeVFSVolumeMonitor *vfs, GnomeVFSVolume *vol, MainWindow *mainwin)
+{
+       gchar *uri = gnome_vfs_volume_get_activation_uri (vol);
+       gchar *mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+       g_free (uri);
+       if (mount_path) {
+               if(!strcmp(mount_path, prefs_common.data_root)) {
+                       gtk_widget_set_sensitive(mainwin->window, TRUE);
+                       inc_unlock();
+               }
+       }
+       g_free(mount_path);
+}
+static void main_vol_unmount_cb(GnomeVFSVolumeMonitor *vfs, GnomeVFSVolume *vol, MainWindow *mainwin)
+{
+       gchar *uri = gnome_vfs_volume_get_activation_uri (vol);
+       gchar *mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+       g_free (uri);
+       if (mount_path) {
+               if(!strcmp(mount_path, prefs_common.data_root)) {
+                       gtk_widget_set_sensitive(mainwin->window, FALSE);
+                       inc_lock();
+               }
+       }
+       g_free(mount_path);
+}
+#endif
+
 int main(int argc, char *argv[])
 {
 #ifdef MAEMO
@@ -1049,6 +1083,34 @@ int main(int argc, char *argv[])
        
        static_mainwindow = mainwin;
 
+#ifdef MAEMO
+       if (prefs_common.data_root != NULL && *prefs_common.data_root != '\0') {
+               GnomeVFSVolume *vol = NULL;
+               gchar *uri, *mount_path;
+
+               volmon = gnome_vfs_get_volume_monitor();
+               vol = gnome_vfs_volume_monitor_get_volume_for_path(volmon, prefs_common.data_root);
+
+               uri = gnome_vfs_volume_get_activation_uri (vol);
+               mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+               g_free(uri);
+
+               if (vol == NULL || !gnome_vfs_volume_is_mounted(vol) 
+                   || strcmp(mount_path, prefs_common.data_root)) {
+                       alertpanel_error(_("Claws Mail can not start without its data volume (%s)."), 
+                               prefs_common.data_root);
+                       exit_claws(mainwin);
+                       exit(1);
+               }
+               g_free(mount_path);
+               gnome_vfs_volume_unref(vol);
+               g_signal_connect(G_OBJECT(volmon), 
+                               "volume-mounted", G_CALLBACK(main_vol_mount_cb), mainwin);
+               g_signal_connect(G_OBJECT(volmon), 
+                               "volume-unmounted", G_CALLBACK(main_vol_unmount_cb), mainwin);
+       }
+#endif
+
 #ifdef HAVE_STARTUP_NOTIFICATION
        startup_notification_complete(FALSE);
 #endif
index 94b3fa1481bf7ea95b55626eecb7dea83e75519b..dee8f3bbc13af7828da9b8f290fdeacf73d27d15 100644 (file)
@@ -139,6 +139,10 @@ static PrefParam param_os_specific[] = {
  */
 
 static PrefParam param[] = {
+#ifdef MAEMO
+       {"data_root", "", &prefs_common.data_root, P_STRING,
+        NULL, NULL, NULL},
+#endif
        /* Receive */
        {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
         NULL, NULL, NULL},
@@ -1377,6 +1381,16 @@ gboolean prefs_common_enable_log_status(void)
 {
        return prefs_common.enable_log_status;
 }
+
+#ifdef MAEMO
+const gchar *prefs_common_get_data_root(void)
+{
+       if (prefs_common.data_root && *prefs_common.data_root)
+               return prefs_common.data_root;
+       else
+               return NULL;
+}
+#endif
 /**
    return the translated name of a header, if the translate_header option is
    set, otherwise return the untranslated header name (header_name itself).
index 1202b3fb310f9c6f2bedd4b9359f413b404880a0..dd2e99606d1bb9e8bde552928a420f172d98d82e 100644 (file)
@@ -94,6 +94,9 @@ typedef enum
 
 struct _PrefsCommon
 {
+#ifdef MAEMO
+       gchar *data_root;
+#endif
        /* Receive */
        gboolean use_extinc;
        gchar *extinc_cmd;
index 52617611ae34f679e439a645f42c56098d970c47..2adb493c6dc7d0abef92e0c4abbc5a4a8412cac2 100644 (file)
 #endif
 #include "prefs_common.h"
 
+#ifdef MAEMO
+#include <libgnomevfs/gnome-vfs-volume.h>
+#include <libgnomevfs/gnome-vfs-volume-monitor.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
+#endif
+
 typedef enum
 {
        GO_BACK,
@@ -90,6 +96,7 @@ typedef struct
        GtkWidget *organization;
 
        GtkWidget *mailbox_name;
+       GtkWidget *mailbox_label;
        
        GtkWidget *smtp_server;
        GtkWidget *smtp_auth;
@@ -115,7 +122,17 @@ typedef struct
        GtkWidget *smtp_use_tls;
        GtkWidget *recv_use_tls;
 #endif
-       
+
+#ifdef MAEMO
+       GtkWidget *data_root_nokia_radiobtn;
+       GtkWidget *data_root_mmc1_radiobtn;
+       GtkWidget *data_root_mmc2_radiobtn;
+       GnomeVFSVolumeMonitor *volmon;
+       gulong volmon_mount_sigid;
+       gulong volmon_unmount_sigid;
+       GnomeVFSVolume *vol_mmc1;
+       GnomeVFSVolume *vol_mmc2;
+#endif 
        gboolean create_mailbox;
        gboolean finished;
        gboolean result;
@@ -578,6 +595,27 @@ static gboolean wizard_write_config(WizardWindow *wizard)
                return FALSE;
        }
 
+#ifdef MAEMO
+       g_free(prefs_common.data_root);
+       if (gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn)))
+               prefs_common.data_root = NULL;
+       else if (gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(wizard->data_root_mmc1_radiobtn)))
+               prefs_common.data_root = g_strdup(MMC1_PATH);
+       else if (gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(wizard->data_root_mmc2_radiobtn)))
+               prefs_common.data_root = g_strdup(MMC2_PATH);
+       if (wizard->volmon_mount_sigid)
+               g_signal_handler_disconnect(
+                                       G_OBJECT(wizard->volmon),
+                                       wizard->volmon_mount_sigid);
+       if (wizard->volmon_unmount_sigid)
+               g_signal_handler_disconnect(
+                                       G_OBJECT(wizard->volmon),
+                                       wizard->volmon_unmount_sigid);
+#endif
+
        if (!mailbox_ok) {
                if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4) {
                        mailbox_ok = setup_write_mailbox_path(wizard->mainwin, 
@@ -926,10 +964,85 @@ static GtkWidget* user_page (WizardWindow * wizard)
        return table;
 }
 
+#ifdef MAEMO
+static void wizard_vol_mount_cb(GnomeVFSVolumeMonitor *vfs, GnomeVFSVolume *vol, WizardWindow *wizard)
+{
+       gchar *uri = gnome_vfs_volume_get_activation_uri (vol);
+       gchar *mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+       g_free (uri);
+       if (mount_path) {
+               if(!strcmp(mount_path, MMC1_PATH)) {
+                       gtk_widget_set_sensitive(wizard->data_root_mmc1_radiobtn, TRUE);
+               }
+               if(!strcmp(mount_path, MMC2_PATH)) {
+                       gtk_widget_set_sensitive(wizard->data_root_mmc2_radiobtn, TRUE);
+               }
+       }
+       g_free(mount_path);
+}
+static void wizard_vol_unmount_cb(GnomeVFSVolumeMonitor *vfs, GnomeVFSVolume *vol, WizardWindow *wizard)
+{
+       gchar *uri = gnome_vfs_volume_get_activation_uri (vol);
+       gchar *mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+       g_free (uri);
+       if (mount_path) {
+               if(!strcmp(mount_path, MMC1_PATH)) {
+                       gtk_widget_set_sensitive(wizard->data_root_mmc1_radiobtn, FALSE);
+                       if (gtk_toggle_button_get_active(
+                               GTK_TOGGLE_BUTTON(wizard->data_root_mmc1_radiobtn))) {
+                               gtk_toggle_button_set_active(
+                                       GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn), TRUE);
+                       }
+               }
+               if(!strcmp(mount_path, MMC2_PATH)) {
+                       gtk_widget_set_sensitive(wizard->data_root_mmc2_radiobtn, FALSE);
+                       if (gtk_toggle_button_get_active(
+                               GTK_TOGGLE_BUTTON(wizard->data_root_mmc2_radiobtn))) {
+                               gtk_toggle_button_set_active(
+                                       GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn), TRUE);
+                       }
+               }
+       }
+       g_free(mount_path);
+}
+
+void data_root_changed         (GtkToggleButton        *toggle_btn,
+                                WizardWindow *wizard)
+{
+       gchar *name = g_path_get_basename(gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)));
+       gchar *path = NULL;
+       if (gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(wizard->data_root_nokia_radiobtn)))
+               gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), name);
+       else if (gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(wizard->data_root_mmc1_radiobtn))) {
+               path = g_strconcat(MMC1_PATH, G_DIR_SEPARATOR_S, 
+                                 "Claws", G_DIR_SEPARATOR_S, 
+                                 g_get_user_name(), G_DIR_SEPARATOR_S,
+                                 name, NULL);
+               gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), path);
+               g_free(path);
+       } else if (gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(wizard->data_root_mmc2_radiobtn))) {
+               path = g_strconcat(MMC2_PATH, G_DIR_SEPARATOR_S, 
+                                 "Claws", G_DIR_SEPARATOR_S, 
+                                 g_get_user_name(), G_DIR_SEPARATOR_S,
+                                 name, NULL);
+               gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), path);
+               g_free(path);
+       }
+       g_free(name);
+}
+#endif
+
 static GtkWidget* mailbox_page (WizardWindow * wizard)
 {
        GtkWidget *table = gtk_table_new(1,1, FALSE);
        GtkWidget *vbox;
+#ifdef MAEMO
+       GtkWidget *vbox2;
+       gchar *uri, *mount_path;
+#endif
        GtkWidget *hbox;
        GtkTooltips *tips = gtk_tooltips_new();
 
@@ -944,7 +1057,13 @@ static GtkWidget* mailbox_page (WizardWindow * wizard)
 
        hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+       wizard->mailbox_label = gtk_label_new(_("<span weight=\"bold\">Mailbox name:</span>"));
+       gtk_label_set_use_markup(GTK_LABEL(wizard->mailbox_label), TRUE);
+       if (GTK_IS_MISC(wizard->mailbox_label))                                               
+               gtk_misc_set_alignment(GTK_MISC(wizard->mailbox_label), 1, 0.5);              
        wizard->mailbox_name = gtk_entry_new();
+
        gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), tmpl.mailbox?tmpl.mailbox:"");
 
        gtk_tooltips_set_tip(GTK_TOOLTIPS(tips), wizard->mailbox_name,
@@ -952,9 +1071,69 @@ static GtkWidget* mailbox_page (WizardWindow * wizard)
                               "\"/home/john/Documents/Mail\""),
                             NULL);
 
-       PACK_BOX(hbox, _("<span weight=\"bold\">Mailbox name:</span>"),
-                wizard->mailbox_name);
+       gtk_box_pack_start(GTK_BOX(hbox), wizard->mailbox_label, FALSE, FALSE, 0);
+       gtk_box_pack_start(GTK_BOX(hbox), wizard->mailbox_name, TRUE, TRUE, 0);
+
+#ifdef MAEMO
+       wizard->data_root_nokia_radiobtn = gtk_radio_button_new_with_label(NULL,
+               _("on internal memory"));
+       wizard->data_root_mmc1_radiobtn = gtk_radio_button_new_with_label_from_widget(
+               GTK_RADIO_BUTTON(wizard->data_root_nokia_radiobtn),
+               _("on /media/mmc1"));
+       wizard->data_root_mmc2_radiobtn = gtk_radio_button_new_with_label_from_widget(
+               GTK_RADIO_BUTTON(wizard->data_root_nokia_radiobtn),
+               _("on /media/mmc2"));
+               
+       g_signal_connect(G_OBJECT(wizard->data_root_nokia_radiobtn), "toggled",
+                        G_CALLBACK(data_root_changed), wizard);
+       g_signal_connect(G_OBJECT(wizard->data_root_mmc1_radiobtn), "toggled",
+                        G_CALLBACK(data_root_changed), wizard);
+       g_signal_connect(G_OBJECT(wizard->data_root_mmc2_radiobtn), "toggled",
+                        G_CALLBACK(data_root_changed), wizard);
+
+       wizard->volmon = gnome_vfs_get_volume_monitor();
+       wizard->vol_mmc1 = gnome_vfs_volume_monitor_get_volume_for_path(wizard->volmon, MMC1_PATH);
+       wizard->vol_mmc2 = gnome_vfs_volume_monitor_get_volume_for_path(wizard->volmon, MMC2_PATH);
+
+       uri = gnome_vfs_volume_get_activation_uri (wizard->vol_mmc1);
+       mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+       g_free(uri);
+       if (wizard->vol_mmc1 == NULL || !gnome_vfs_volume_is_mounted(wizard->vol_mmc1)
+           || strcmp(mount_path, MMC1_PATH)) {
+               gtk_widget_set_sensitive(wizard->data_root_mmc1_radiobtn, FALSE);
+       }
+       g_free(mount_path);
+
+       uri = gnome_vfs_volume_get_activation_uri (wizard->vol_mmc2);
+       mount_path = uri?gnome_vfs_get_local_path_from_uri (uri):NULL;
+       g_free(uri);
+       if (wizard->vol_mmc2 == NULL || !gnome_vfs_volume_is_mounted(wizard->vol_mmc2)
+           || strcmp(mount_path, MMC2_PATH)) {
+               gtk_widget_set_sensitive(wizard->data_root_mmc2_radiobtn, FALSE);
+       }
+       g_free(mount_path);
        
+       gnome_vfs_volume_unref(wizard->vol_mmc1);
+       gnome_vfs_volume_unref(wizard->vol_mmc2);
+       wizard->vol_mmc1 = NULL;
+       wizard->vol_mmc2 = NULL;
+
+       wizard->volmon_mount_sigid = g_signal_connect(G_OBJECT(wizard->volmon), 
+                                       "volume-mounted", G_CALLBACK(wizard_vol_mount_cb), wizard);
+       wizard->volmon_unmount_sigid = g_signal_connect(G_OBJECT(wizard->volmon), 
+                                       "volume-unmounted", G_CALLBACK(wizard_vol_unmount_cb), wizard);
+
+       vbox2 = gtk_vbox_new(FALSE, VSPACING_NARROW);
+       gtk_box_pack_start (GTK_BOX(vbox2), wizard->data_root_nokia_radiobtn, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX(vbox2), wizard->data_root_mmc1_radiobtn, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX(vbox2), wizard->data_root_mmc2_radiobtn, FALSE, FALSE, 0);
+
+       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+       PACK_BOX(hbox, _("<span weight=\"bold\">Store data</span>"),
+                vbox2);
+#endif
+
        return table;
 }
 
@@ -1085,6 +1264,8 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
                g_free(text);
+               gtk_widget_show(wizard->mailbox_label);
+               gtk_widget_show(wizard->mailbox_name);
        } else if (protocol == A_IMAP4) {
 #ifdef HAVE_LIBETPAN
                text = get_default_server(wizard, "imap");
@@ -1105,6 +1286,8 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
                g_free(text);
+               gtk_widget_hide(wizard->mailbox_label);
+               gtk_widget_hide(wizard->mailbox_name);
 #else
                gtk_widget_hide(wizard->recv_imap_label);
                gtk_widget_hide(wizard->recv_imap_subdir);
@@ -1114,6 +1297,8 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_hide(wizard->recv_username_label);
                gtk_widget_hide(wizard->recv_password_label);
                gtk_widget_show(wizard->no_imap_warning);
+               gtk_widget_hide(wizard->mailbox_label);
+               gtk_widget_hide(wizard->mailbox_name);
 #ifdef USE_OPENSSL
                gtk_widget_hide(wizard->recv_use_ssl);
                gtk_widget_hide(wizard->recv_use_tls);
@@ -1136,6 +1321,8 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_hide(wizard->recv_use_ssl);
                gtk_widget_hide(wizard->recv_use_tls);
 #endif
+               gtk_widget_show(wizard->mailbox_label);
+               gtk_widget_show(wizard->mailbox_name);
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
        }
 }
@@ -1309,10 +1496,12 @@ wizard_response_cb (GtkDialog * dialog, int response, gpointer data)
                        (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
        gboolean skip_mailbox_page = FALSE;
        
+#ifndef MAEMO
        if (protocol == A_IMAP4) {
                skip_mailbox_page = TRUE;
        }
-       
+#endif
+
        num_pages = g_slist_length(wizard->pages);
 
        current_page = gtk_notebook_get_current_page (