2007-03-20 [colin] 2.8.1cvs25
authorColin Leroy <colin@colino.net>
Tue, 20 Mar 2007 17:39:33 +0000 (17:39 +0000)
committerColin Leroy <colin@colino.net>
Tue, 20 Mar 2007 17:39:33 +0000 (17:39 +0000)
* src/folder.c
* src/folder.h
* src/prefs_account.c
* src/wizard.c
Fix default inbox weirdnesses (after wizard,
if path is Mail, mailbox identifier is #mh/Mailbox,
and when creating new accounts)

ChangeLog
PATCHSETS
configure.ac
src/folder.c
src/folder.h
src/prefs_account.c
src/wizard.c

index 09dc51f144cc610bfc03ae3b2bb6a6b5e255868b..35cdf004825efa12441ad61cdd77538aac77e667 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-03-20 [colin]     2.8.1cvs25
+
+       * src/folder.c
+       * src/folder.h
+       * src/prefs_account.c
+       * src/wizard.c
+               Fix default inbox weirdnesses (after wizard,
+               if path is Mail, mailbox identifier is #mh/Mailbox,
+               and when creating new accounts)
+
 2007-03-20 [colin]     2.8.1cvs24
 
        * src/account.c
index c37efd4c79a031dea9acc4e7ce3140a1383c5707..e83856526460ea6b8aa141a8b487ad242ba688e9 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.115.2.142 -r 1.115.2.143 src/main.c;  ) > 2.8.1cvs22.patchset
 ( cvs diff -u -r 1.179.2.158 -r 1.179.2.159 src/imap.c;  cvs diff -u -r 1.1.4.6 -r 1.1.4.7 src/remotefolder.h;  ) > 2.8.1cvs23.patchset
 ( cvs diff -u -r 1.61.2.59 -r 1.61.2.60 src/account.c;  ) > 2.8.1cvs24.patchset
+( cvs diff -u -r 1.213.2.135 -r 1.213.2.136 src/folder.c;  cvs diff -u -r 1.87.2.37 -r 1.87.2.38 src/folder.h;  cvs diff -u -r 1.105.2.87 -r 1.105.2.88 src/prefs_account.c;  cvs diff -u -r 1.1.2.51 -r 1.1.2.52 src/wizard.c;  ) > 2.8.1cvs25.patchset
index 9c32e9102ced6743565d712afa5c7a328dc58fbd..30d1897604fbb0e201443c75865f3b6b46323298 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=24
+EXTRA_VERSION=25
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 09d9fcb732ff3b8c81a490eb71e22940c07d965e..04f67551431fc20986be7eae652a3f4264e83d61 100644 (file)
@@ -1406,6 +1406,26 @@ FolderItem *folder_get_default_inbox(void)
        return NULL;
 }
 
+FolderItem *folder_get_default_inbox_for_class(FolderType type)
+{
+       GList *flist;
+
+       for (flist = folder_list; flist != NULL; flist = g_list_next(flist)) {
+               Folder * folder = FOLDER(flist->data);
+
+               if (folder == NULL)
+                       continue;
+               if (folder->inbox == NULL)
+                       continue;
+               if (folder->klass->type != type)
+                       continue;
+
+               return folder->inbox;
+       }
+
+       return NULL;
+}
+
 FolderItem *folder_get_default_outbox(void)
 {
        GList *flist;
index 1ab437e61e32038521ccbf54fa4302b8dde79d92..9fda41658bfe4ba7b9b7944746e337a86db3013f 100644 (file)
@@ -757,6 +757,7 @@ FolderItem *folder_find_item_from_identifier        (const gchar    *identifier);
 gchar     *folder_item_get_name                (FolderItem     *item);
 
 FolderItem *folder_get_default_inbox   (void);
+FolderItem *folder_get_default_inbox_for_class(FolderType type);
 FolderItem *folder_get_default_outbox  (void);
 FolderItem *folder_get_default_draft   (void);
 FolderItem *folder_get_default_queue   (void);
index 7e90d141a87266fc0ea23fbc4da9573292aacee3..32cdb1d606ef0b806fd2e04a4c8813d52ab39e96 100644 (file)
@@ -778,12 +778,24 @@ static void create_widget_func(PrefsPage * _page,
                g_free(buf);
                def_ac = account_get_default();
                if (def_ac) {
+                       FolderItem *item = folder_get_default_inbox_for_class(F_MH);
                        gtk_entry_set_text(GTK_ENTRY(basic.name_entry),
                                           def_ac->name ? def_ac->name : "");
                        gtk_entry_set_text(GTK_ENTRY(basic.addr_entry),
                                           def_ac->address ? def_ac->address : "");
                        gtk_entry_set_text(GTK_ENTRY(basic.org_entry),
                                           def_ac->organization ? def_ac->organization : "");
+                       if (!item) {
+                               item = folder_get_default_inbox();
+                       }
+                       if (item) {
+                               gchar *id = folder_item_get_identifier(item);
+                               gtk_entry_set_text(GTK_ENTRY(receive.inbox_entry),
+                                       id);
+                               gtk_entry_set_text(GTK_ENTRY(receive.local_inbox_entry),
+                                       id);
+                               g_free(id);
+                       }
                }
        } else
                prefs_set_dialog(param);
index 7a74bb5d06e97740971c17a1362380e78c65906a..a30596f51d6e1c47439507fc55b5afea89c361df 100644 (file)
@@ -556,6 +556,7 @@ static gboolean wizard_write_config(WizardWindow *wizard)
        GList *account_list = NULL;
        GtkWidget *menu, *menuitem;
        gchar *smtp_server, *recv_server;
+       gchar *tmp;
        gint smtp_port, recv_port;
 #ifdef USE_OPENSSL                     
        SSLType smtp_ssl_type, recv_ssl_type;
@@ -685,8 +686,10 @@ static gboolean wizard_write_config(WizardWindow *wizard)
                                gtk_entry_get_text(GTK_ENTRY(wizard->organization)));
        prefs_account->smtp_server = g_strdup(smtp_server);
 
+       tmp = g_path_get_basename(gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)));
        prefs_account->inbox = g_strdup_printf("#mh/%s/inbox",
-                       g_path_get_basename(gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name))));
+                       (tmp && !strcmp("Mail", tmp))?_("Mailbox"):tmp);
+       g_free(tmp);
        prefs_account->local_inbox = g_strdup(prefs_account->inbox);
 
        if (prefs_account->protocol != A_LOCAL)
@@ -1336,8 +1339,14 @@ set_sens:
                                current_page > 0);
                gtk_dialog_set_response_sensitive (dialog, GO_FORWARD, 
                                current_page < (num_pages - 1));
-               gtk_dialog_set_response_sensitive (dialog, FINISHED, 
-                               current_page == (num_pages - 1));
+               if (current_page == (num_pages -1)) {
+                       gtk_dialog_set_response_sensitive (dialog, FINISHED, TRUE);
+                       gtk_dialog_set_default_response(GTK_DIALOG(wizard->window), FINISHED);
+               } else {
+                       gtk_dialog_set_response_sensitive (dialog, FINISHED, FALSE);
+                       gtk_dialog_set_default_response(GTK_DIALOG(wizard->window), GO_FORWARD);
+               }
+
        }
 }