2006-10-07 [colin] 2.5.3cvs15
authorColin Leroy <colin@colino.net>
Sat, 7 Oct 2006 16:03:36 +0000 (16:03 +0000)
committerColin Leroy <colin@colino.net>
Sat, 7 Oct 2006 16:03:36 +0000 (16:03 +0000)
* src/folderview.c
* src/imap.c
* src/prefs_account.c
* src/wizard.c
Warn users *everywhere* if libetpan's not
linked in

ChangeLog
PATCHSETS
configure.ac
src/folderview.c
src/imap.c
src/prefs_account.c
src/wizard.c

index b1aaf36..e8e29c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-10-07 [colin]     2.5.3cvs15
+
+       * src/folderview.c
+       * src/imap.c
+       * src/prefs_account.c
+       * src/wizard.c
+               Warn users *everywhere* if libetpan's not
+               linked in
+
 2006-10-06 [mones]     2.5.3cvs14
 
        * po/de.po
index d2b5065..edc31f5 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.262 -r 1.395.2.263 src/summaryview.c;  cvs diff -u -r 1.1.2.46 -r 1.1.2.47 src/gtk/quicksearch.c;  ) > 2.5.3cvs12.patchset
 ( cvs diff -u -r 1.115.2.108 -r 1.115.2.109 src/main.c;  cvs diff -u -r 1.10.2.21 -r 1.10.2.22 src/prefs_gtk.c;  cvs diff -u -r 1.5.2.8 -r 1.5.2.9 src/prefs_gtk.h;  cvs diff -u -r 1.7.2.8 -r 1.7.2.9 src/common/sylpheed.c;  ) > 2.5.3cvs13.patchset
 ( cvs diff -u -r 1.58.2.25 -r 1.58.2.26 po/de.po;  cvs diff -u -r 1.60.2.35 -r 1.60.2.36 po/es.po;  ) > 2.5.3cvs14.patchset
+( cvs diff -u -r 1.207.2.129 -r 1.207.2.130 src/folderview.c;  cvs diff -u -r 1.179.2.132 -r 1.179.2.133 src/imap.c;  cvs diff -u -r 1.105.2.67 -r 1.105.2.68 src/prefs_account.c;  cvs diff -u -r 1.1.2.36 -r 1.1.2.37 src/wizard.c;  ) > 2.5.3cvs15.patchset
index 89d14df..8fd04e8 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=14
+EXTRA_VERSION=15
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c5ab94a..1e207d5 100644 (file)
@@ -1045,29 +1045,9 @@ void folderview_append_item(FolderItem *item)
 static void folderview_set_folders(FolderView *folderview)
 {
        GList *list;
-#ifndef HAVE_LIBETPAN
-       static gboolean missing_imap_warning = TRUE;
-#endif
        list = folder_get_list();
 
        for (; list != NULL; list = list->next) {
-#ifndef HAVE_LIBETPAN
-               if ((FOLDER(list->data))
-               &&  (FOLDER(list->data))->klass
-               &&  (FOLDER(list->data))->klass->type == F_IMAP
-               &&  missing_imap_warning) {
-                       missing_imap_warning = FALSE;
-                       alertpanel_error(
-                               _("You have one or more IMAP accounts "
-                                 "defined. However this version of "
-                                 "Sylpheed-Claws has been built without "
-                                 "IMAP support; your IMAP account(s) are "
-                                 "disabled.\n\n"
-                                 "You probably need to "
-                                 "install libetpan and recompile "
-                                 "Sylpheed-Claws."));
-               }
-#endif
                folderview_append_folder(folderview, FOLDER(list->data));
        }
 }
index afd5094..0efe2e7 100644 (file)
@@ -4315,6 +4315,19 @@ static void imap_item_set_xml(Folder *folder, FolderItem *item, XMLTag *tag);
 static Folder  *imap_folder_new        (const gchar    *name,
                                         const gchar    *path)
 {
+       static gboolean missing_imap_warning = TRUE;
+       if (missing_imap_warning) {
+               missing_imap_warning = FALSE;
+               alertpanel_error(
+                       _("You have one or more IMAP accounts "
+                         "defined. However this version of "
+                         "Sylpheed-Claws has been built without "
+                         "IMAP support; your IMAP account(s) are "
+                         "disabled.\n\n"
+                         "You probably need to "
+                         "install libetpan and recompile "
+                         "Sylpheed-Claws."));
+       }
        return NULL;
 }
 static gint    imap_create_tree        (Folder         *folder)
index 9b0cfbd..e943a9c 100644 (file)
@@ -74,6 +74,8 @@ struct BasicProtocol {
        GtkWidget *combobox;
        GtkWidget *label;
        GtkWidget *descrlabel;
+       GtkWidget *no_imap_warn_icon;
+       GtkWidget *no_imap_warn_label;
 };
 
 static struct Basic {
@@ -1060,6 +1062,8 @@ static void prefs_account_basic_create(void)
        GtkWidget *optmenubox;
        GtkWidget *optmenu;
        GtkWidget *optlabel;
+       GtkWidget *no_imap_warn_icon;
+       GtkWidget *no_imap_warn_label;
        GtkWidget *serv_table;
        GtkWidget *recvserv_label;
        GtkWidget *smtpserv_label;
@@ -1189,11 +1193,21 @@ static void prefs_account_basic_create(void)
        gtk_label_set_justify(GTK_LABEL(optlabel), GTK_JUSTIFY_CENTER);
        gtk_box_pack_start(GTK_BOX (optmenubox), optlabel, FALSE, FALSE, 0);
 
+       no_imap_warn_icon = gtk_image_new_from_stock
+                        (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR);
+       no_imap_warn_label = gtk_label_new(_("<span weight=\"bold\">Warning: this version of Sylpheed-Claws\n"
+                         "has been built without IMAP support.</span>"));
+       gtk_label_set_use_markup(GTK_LABEL(no_imap_warn_label), TRUE);
+
+       gtk_box_pack_start(GTK_BOX (optmenubox), no_imap_warn_icon, FALSE, FALSE, 0);
+       gtk_box_pack_start(GTK_BOX (optmenubox), no_imap_warn_label, FALSE, FALSE, 0);
        /* Set up a struct to store pointers to necessary widgets */
        protocol_optmenu = g_new(struct BasicProtocol, 1);
        protocol_optmenu->combobox = optmenu;
        protocol_optmenu->label = optlabel;
        protocol_optmenu->descrlabel = label;
+       protocol_optmenu->no_imap_warn_icon = no_imap_warn_icon;
+       protocol_optmenu->no_imap_warn_label = no_imap_warn_label;
 
        serv_table = gtk_table_new (6, 4, FALSE);
        gtk_widget_show (serv_table);
@@ -2689,6 +2703,15 @@ static void prefs_account_protocol_set_optmenu(PrefParam *pparam)
                g_free(label);
                gtk_widget_hide(optmenu);
                gtk_widget_show(optlabel);
+#ifndef HAVE_LIBETPAN
+               if (protocol == A_IMAP4) {
+                       gtk_widget_show(protocol_optmenu->no_imap_warn_icon);
+                       gtk_widget_show(protocol_optmenu->no_imap_warn_label);
+               } else {
+                       gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+                       gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
+               }
+#endif
        }
 }
 
@@ -2839,11 +2862,16 @@ static void prefs_account_set_optmenu_from_string(PrefParam *pparam)
 static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
 {
        RecvProtocol protocol;
+       struct BasicProtocol *protocol_optmenu = (struct BasicProtocol *)basic.protocol_optmenu;
 
        protocol = combobox_get_active_data(combobox);
 
+       gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+       gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
        switch(protocol) {
        case A_NNTP:
+               gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+               gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
                gtk_widget_show(basic.nntpserv_label);
                gtk_widget_show(basic.nntpserv_entry);
                gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
@@ -2930,6 +2958,8 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(receive.imapdir_entry);
                break;
        case A_LOCAL:
+               gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+               gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
                gtk_widget_hide(basic.nntpserv_label);
                gtk_widget_hide(basic.nntpserv_entry);
                gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
@@ -3012,6 +3042,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(receive.imapdir_entry);
                break;
        case A_IMAP4:
+#ifndef HAVE_LIBETPAN
+               gtk_widget_show(protocol_optmenu->no_imap_warn_icon);
+               gtk_widget_show(protocol_optmenu->no_imap_warn_label);
+#endif
                gtk_widget_hide(basic.nntpserv_label);
                gtk_widget_hide(basic.nntpserv_entry);
                gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
@@ -3097,6 +3131,8 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_show(receive.imapdir_entry);
                break;
        case A_NONE:
+               gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+               gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
                gtk_widget_hide(basic.nntpserv_label);
                gtk_widget_hide(basic.nntpserv_entry);
                gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
@@ -3179,6 +3215,8 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                break;
        case A_POP3:
        default:
+               gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+               gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
                gtk_widget_hide(basic.nntpserv_label);
                gtk_widget_hide(basic.nntpserv_entry);
                gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
index 48f4885..ae059fe 100644 (file)
@@ -108,7 +108,7 @@ typedef struct
        GtkWidget *recv_password_label;
        GtkWidget *recv_imap_label;
        GtkWidget *recv_imap_subdir;
-
+       GtkWidget *no_imap_warning;
 #ifdef USE_OPENSSL
        GtkWidget *smtp_use_ssl;
        GtkWidget *recv_use_ssl;
@@ -945,10 +945,13 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_show(wizard->recv_password);
                gtk_widget_show(wizard->recv_username_label);
                gtk_widget_show(wizard->recv_password_label);
+               gtk_widget_hide(wizard->no_imap_warning);
                gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Server address:</span>"));
                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);
        } else if (protocol == A_IMAP4) {
+#ifdef HAVE_LIBETPAN
                text = get_default_server(wizard, "imap");
                gtk_entry_set_text(GTK_ENTRY(wizard->recv_server), text);
                gtk_widget_show(wizard->recv_imap_label);
@@ -957,19 +960,33 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_show(wizard->recv_password);
                gtk_widget_show(wizard->recv_username_label);
                gtk_widget_show(wizard->recv_password_label);
+               gtk_widget_hide(wizard->no_imap_warning);
                gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Server address:</span>"));
                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);
+#else
+               gtk_widget_hide(wizard->recv_imap_label);
+               gtk_widget_hide(wizard->recv_imap_subdir);
+               gtk_widget_hide(wizard->recv_username);
+               gtk_widget_hide(wizard->recv_password);
+               gtk_widget_hide(wizard->recv_username_label);
+               gtk_widget_hide(wizard->recv_password_label);
+               gtk_widget_show(wizard->no_imap_warning);
+               gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, FALSE);
+#endif
        } else if (protocol == A_LOCAL) {
                gtk_entry_set_text(GTK_ENTRY(wizard->recv_server), tmpl.mboxfile?tmpl.mboxfile:"");
                gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Local mailbox:</span>"));
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
+               gtk_widget_hide(wizard->no_imap_warning);
                gtk_widget_hide(wizard->recv_imap_label);
                gtk_widget_hide(wizard->recv_imap_subdir);
                gtk_widget_hide(wizard->recv_username);
                gtk_widget_hide(wizard->recv_password);
                gtk_widget_hide(wizard->recv_username_label);
                gtk_widget_hide(wizard->recv_password_label);
+               gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
        }
 }
 
@@ -1001,12 +1018,12 @@ static GtkWidget* recv_page (WizardWindow * wizard)
        g_signal_connect(G_OBJECT(menuitem), "activate",
                         G_CALLBACK(wizard_protocol_changed),
                         wizard);
-#ifdef HAVE_LIBETPAN
+
        MENUITEM_ADD (menu, menuitem, _("IMAP"), A_IMAP4);
        g_signal_connect(G_OBJECT(menuitem), "activate",
                         G_CALLBACK(wizard_protocol_changed),
                         wizard);
-#endif
+
        MENUITEM_ADD (menu, menuitem, _("Local mbox file"), A_LOCAL);
        g_signal_connect(G_OBJECT(menuitem), "activate",
                         G_CALLBACK(wizard_protocol_changed),
@@ -1017,18 +1034,12 @@ static GtkWidget* recv_page (WizardWindow * wizard)
        case A_POP3: 
                index = 0;
                break;
-#ifdef HAVE_LIBETPAN
        case A_IMAP4:
                index = 1;
                break;
        case A_LOCAL:
                index = 2;
                break;
-#else
-       case A_LOCAL:
-               index = 1;
-               break;
-#endif
        default:
                index = 0;
        }
@@ -1091,6 +1102,13 @@ static GtkWidget* recv_page (WizardWindow * wizard)
 
        i++;
        
+       wizard->no_imap_warning = gtk_label_new(_(
+                         "<span weight=\"bold\">Warning: this version of Sylpheed-Claws\n"
+                         "has been built without IMAP support.</span>"));
+       gtk_label_set_use_markup(GTK_LABEL(wizard->no_imap_warning), TRUE);
+       gtk_table_attach(GTK_TABLE(table), wizard->no_imap_warning,                           
+                        0,2,i,i+1, GTK_EXPAND|GTK_FILL, 0, 0, 0);            
+       
        return table;
 }