2007-04-01 [colin] 2.8.1cvs80
authorColin Leroy <colin@colino.net>
Sun, 1 Apr 2007 11:27:30 +0000 (11:27 +0000)
committerColin Leroy <colin@colino.net>
Sun, 1 Apr 2007 11:27:30 +0000 (11:27 +0000)
* src/prefs_account.c
If no MH mailbox exist, when creating a POP/Local
account, just create and use the default one
instead of bailing with a "Mailbox doesn't exist"
error

ChangeLog
PATCHSETS
configure.ac
src/prefs_account.c

index 592188e5ee0fc6fe0897fd68acca1bdfd0509f14..a8300afdf6ce24aac9f36132b42e7d2c6e7d8233 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-04-01 [colin]     2.8.1cvs80
+
+       * src/prefs_account.c
+               If no MH mailbox exist, when creating a POP/Local
+               account, just create and use the default one 
+               instead of bailing with a "Mailbox doesn't exist"
+               error
+
 2007-03-31 [colin]     2.8.1cvs79
 
        * src/prefs_account.c
 2007-03-31 [colin]     2.8.1cvs79
 
        * src/prefs_account.c
index b64701541015dec41c167e2504230b54e6ef4bc0..cde770077a40332b5c7dcbb7413fcb60d6a1a32c 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.207.2.158 -r 1.207.2.159 src/folderview.c;  cvs diff -u -r 1.204.2.128 -r 1.204.2.129 src/prefs_common.c;  cvs diff -u -r 1.103.2.78 -r 1.103.2.79 src/prefs_common.h;  ) > 2.8.1cvs77.patchset
 ( cvs diff -u -r 1.105.2.89 -r 1.105.2.90 src/prefs_account.c;  ) > 2.8.1cvs78.patchset
 ( cvs diff -u -r 1.105.2.90 -r 1.105.2.91 src/prefs_account.c;  cvs diff -u -r 1.30.2.32 -r 1.30.2.33 src/prefs_toolbar.c;  cvs diff -u -r 1.9.2.34 -r 1.9.2.35 src/common/defs.h;  ) > 2.8.1cvs79.patchset
 ( cvs diff -u -r 1.207.2.158 -r 1.207.2.159 src/folderview.c;  cvs diff -u -r 1.204.2.128 -r 1.204.2.129 src/prefs_common.c;  cvs diff -u -r 1.103.2.78 -r 1.103.2.79 src/prefs_common.h;  ) > 2.8.1cvs77.patchset
 ( cvs diff -u -r 1.105.2.89 -r 1.105.2.90 src/prefs_account.c;  ) > 2.8.1cvs78.patchset
 ( cvs diff -u -r 1.105.2.90 -r 1.105.2.91 src/prefs_account.c;  cvs diff -u -r 1.30.2.32 -r 1.30.2.33 src/prefs_toolbar.c;  cvs diff -u -r 1.9.2.34 -r 1.9.2.35 src/common/defs.h;  ) > 2.8.1cvs79.patchset
+( cvs diff -u -r 1.105.2.91 -r 1.105.2.92 src/prefs_account.c;  ) > 2.8.1cvs80.patchset
index 97d5f49fc8350884613655b5e65559618ffe56c6..63d2c5fb80fddb3d62fc6df6324b54ddadd5b819 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=79
+EXTRA_VERSION=80
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 59e5d9f64f64ec5fd6183bcfbf0f12bae985ec6b..cd41db7977ad275417f8527478b51a2e77edce36 100644 (file)
 #include "remotefolder.h"
 #include "base64.h"
 #include "combobox.h"
 #include "remotefolder.h"
 #include "base64.h"
 #include "combobox.h"
+#include "setup.h"
 
 static gboolean cancelled;
 static gboolean new_account;
 
 static gboolean cancelled;
 static gboolean new_account;
+static gboolean create_mailbox;
 
 static PrefsAccount tmp_ac_prefs;
 
 
 static PrefsAccount tmp_ac_prefs;
 
@@ -773,6 +775,7 @@ static void create_widget_func(PrefsPage * _page,
 
        tmp_ac_prefs = *ac_prefs;
 
 
        tmp_ac_prefs = *ac_prefs;
 
+       create_mailbox = FALSE;
        if (new_account) {
                PrefsAccount *def_ac;
                gchar *buf;
        if (new_account) {
                PrefsAccount *def_ac;
                gchar *buf;
@@ -800,6 +803,8 @@ static void create_widget_func(PrefsPage * _page,
                                gtk_entry_set_text(GTK_ENTRY(receive.local_inbox_entry),
                                        id);
                                g_free(id);
                                gtk_entry_set_text(GTK_ENTRY(receive.local_inbox_entry),
                                        id);
                                g_free(id);
+                       } else {
+                               create_mailbox = TRUE;
                        }
                }
        } else
                        }
                }
        } else
@@ -2647,6 +2652,19 @@ static gint prefs_account_apply(void)
                GtkWidget *inbox_entry = (protocol == A_POP3 ? receive.inbox_entry : receive.local_inbox_entry );
                const gchar *mailbox = gtk_entry_get_text(GTK_ENTRY(inbox_entry));
                FolderItem *inbox =  folder_find_item_from_identifier(mailbox);
                GtkWidget *inbox_entry = (protocol == A_POP3 ? receive.inbox_entry : receive.local_inbox_entry );
                const gchar *mailbox = gtk_entry_get_text(GTK_ENTRY(inbox_entry));
                FolderItem *inbox =  folder_find_item_from_identifier(mailbox);
+               if (!inbox && create_mailbox) {
+                       gchar *id = NULL;
+                       setup_write_mailbox_path(mainwindow_get_mainwindow(), "Mail");
+                       id = folder_item_get_identifier(folder_get_default_inbox_for_class(F_MH));
+                       gtk_entry_set_text(GTK_ENTRY(receive.inbox_entry),
+                               id);
+                       gtk_entry_set_text(GTK_ENTRY(receive.local_inbox_entry),
+                               id);
+                       g_free(id);
+                       mailbox = gtk_entry_get_text(GTK_ENTRY(inbox_entry));
+                       create_mailbox = FALSE;
+                       inbox =  folder_find_item_from_identifier(mailbox);
+               }
                if (inbox == NULL) {
                        alertpanel_error(_("The default inbox folder doesn't exist."));
                        return -1;
                if (inbox == NULL) {
                        alertpanel_error(_("The default inbox folder doesn't exist."));
                        return -1;