2007-10-19 [colin] 3.0.2cvs92
[claws.git] / src / imap_gtk.c
index 6202c8aa5534aa16966b52785ce4f1ab6238315e..c080ff7bb493f0dac8d1357b3062bfe23d0184a9 100644 (file)
@@ -155,7 +155,7 @@ static void new_folder_cb(FolderView *folderview, guint action,
                (_("New folder"),
                 _("Input the name of new folder:\n"
                   "(if you want to create a folder to store subfolders\n"
-                  "and no mails, append '/' at the end of the name)"),
+                  "only and no mail, append '/' to the folder name)"),
                 _("NewFolder"));
        if (!new_folder) return;
        AUTORELEASE_STR(new_folder, {g_free(new_folder); return;});
@@ -257,7 +257,7 @@ static void rename_folder_cb(FolderView *folderview, guint action,
        g_free(old_id);
        g_free(new_id);
 
-       folder_item_prefs_save_config(item);
+       folder_item_prefs_save_config_recursive(item);
        folder_write_list();
 }
 
@@ -360,7 +360,7 @@ static void sync_cb(FolderView *folderview, guint action,
        folder_synchronise(item->folder);
 }
 
-void imap_gtk_synchronise(FolderItem *item)
+void imap_gtk_synchronise(FolderItem *item, gint days)
 {
        MainWindow *mainwin = mainwindow_get_mainwindow();
        FolderView *folderview = mainwin->folderview;
@@ -379,11 +379,14 @@ void imap_gtk_synchronise(FolderItem *item)
                GSList *cur;
                gint num = 0;
                gint total = item->total_msgs;
+               time_t t = time(NULL);
 
                mlist = folder_item_get_msg_list(item);
                for (cur = mlist; cur != NULL; cur = cur->next) {
                        MsgInfo *msginfo = (MsgInfo *)cur->data;
-                       imap_cache_msg(msginfo->folder, msginfo->msgnum);
+                       gint age = (t - msginfo->date_t) / (60*60*24);
+                       if (days == 0 || age <= days)
+                               imap_cache_msg(msginfo->folder, msginfo->msgnum);
                        statusbar_progress_all(num++,total, 100);
                        if (num % 100 == 0)
                                GTK_EVENTS_FLUSH();
@@ -399,7 +402,6 @@ void imap_gtk_synchronise(FolderItem *item)
        main_window_unlock(mainwin);
        inc_unlock();
        main_window_cursor_normal(mainwin);
-
 }
 
 static void chk_update_val(GtkWidget *widget, gpointer data)
@@ -464,7 +466,7 @@ static void subscribe_cb(FolderView *folderview, guint action,
                                        item->name); 
                        gchar *child_folder = input_dialog_combo(_("Subscribe"), 
                                        msg,
-                                       child_list->next?_("All of them"):child_list->data, child_list, TRUE);
+                                       child_list->next?_("All of them"):child_list->data, child_list);
                        g_free(msg);
                        if (child_folder && strcmp(child_folder, _("All of them"))) {
                                r = imap_subscribe(item->folder, NULL, child_folder, TRUE);
@@ -547,5 +549,5 @@ static void download_cb(FolderView *folderview, guint action,
        if (!folderview->selected) return;
 
        item = gtk_ctree_node_get_row_data(ctree, folderview->selected);
-       imap_gtk_synchronise(item);
+       imap_gtk_synchronise(item, 0);
 }