From fdf8ed4bdb242fa0c86dc18038c0abb631a08ed0 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Thu, 19 Jul 2007 16:36:11 +0000 Subject: [PATCH] 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 --- ChangeLog | 13 +++ PATCHSETS | 1 + configure.ac | 4 +- src/common/defs.h | 5 ++ src/common/utils.c | 83 ++++++++++++++++++- src/main.c | 62 ++++++++++++++ src/prefs_common.c | 14 ++++ src/prefs_common.h | 3 + src/wizard.c | 197 ++++++++++++++++++++++++++++++++++++++++++++- 9 files changed, 373 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8dc0ea7a..849154370 100644 --- 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 diff --git a/PATCHSETS b/PATCHSETS index 3f23b8565..73b626c6e 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2700,3 +2700,4 @@ ( 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 diff --git a/configure.ac b/configure.ac index 02c655412..820436884 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/src/common/defs.h b/src/common/defs.h index cd608665a..a3441f36d 100644 --- a/src/common/defs.h +++ b/src/common/defs.h @@ -102,6 +102,11 @@ #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" diff --git a/src/common/utils.c b/src/common/utils.c index f087d56c1..dd1c2e01f 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -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; } diff --git a/src/main.c b/src/main.c index ad73e27bd..9eec413f8 100644 --- a/src/main.c +++ b/src/main.c @@ -119,6 +119,9 @@ #include #include #include +#include +#include +#include #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 diff --git a/src/prefs_common.c b/src/prefs_common.c index 94b3fa148..dee8f3bbc 100644 --- a/src/prefs_common.c +++ b/src/prefs_common.c @@ -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). diff --git a/src/prefs_common.h b/src/prefs_common.h index 1202b3fb3..dd2e99606 100644 --- a/src/prefs_common.h +++ b/src/prefs_common.h @@ -94,6 +94,9 @@ typedef enum struct _PrefsCommon { +#ifdef MAEMO + gchar *data_root; +#endif /* Receive */ gboolean use_extinc; gchar *extinc_cmd; diff --git a/src/wizard.c b/src/wizard.c index 52617611a..2adb493c6 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -62,6 +62,12 @@ #endif #include "prefs_common.h" +#ifdef MAEMO +#include +#include +#include +#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(_("Mailbox name:")); + 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, _("Mailbox name:"), - 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, _("Store data"), + 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 ( -- 2.25.1