2008-02-12 [wwp] 3.3.0cvs7
authorTristan Chabredier <wwp@claws-mail.org>
Tue, 12 Feb 2008 10:44:26 +0000 (10:44 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Tue, 12 Feb 2008 10:44:26 +0000 (10:44 +0000)
* src/compose.c
* src/export.c
* src/folder.c
* src/folder.h
* src/foldersel.c
* src/foldersel.h
* src/imap_gtk.c
* src/import.c
* src/mainwindow.c
* src/messageview.c
* src/mh_gtk.c
* src/prefs_account.c
* src/prefs_filtering_action.c
* src/summaryview.c
* src/plugins/bogofilter/bogofilter_gtk.c
* src/plugins/spamassassin/spamassassin_gtk.c
Allow moving/copying folders to root folders when using
the folder selection dialog (it was not possible to
maemo users to reparent a subfolder to a root folder
at all).

19 files changed:
ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/export.c
src/folder.c
src/folder.h
src/foldersel.c
src/foldersel.h
src/imap_gtk.c
src/import.c
src/mainwindow.c
src/messageview.c
src/mh_gtk.c
src/plugins/bogofilter/bogofilter_gtk.c
src/plugins/spamassassin/spamassassin_gtk.c
src/prefs_account.c
src/prefs_filtering_action.c
src/summaryview.c

index 90c6c87..7638c40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2008-02-12 [wwp]       3.3.0cvs7
+
+       * src/compose.c
+       * src/export.c
+       * src/folder.c
+       * src/folder.h
+       * src/foldersel.c
+       * src/foldersel.h
+       * src/imap_gtk.c
+       * src/import.c
+       * src/mainwindow.c
+       * src/messageview.c
+       * src/mh_gtk.c
+       * src/prefs_account.c
+       * src/prefs_filtering_action.c
+       * src/summaryview.c
+       * src/plugins/bogofilter/bogofilter_gtk.c
+       * src/plugins/spamassassin/spamassassin_gtk.c
+               Allow moving/copying folders to root folders when using
+               the folder selection dialog (it was not possible to
+               maemo users to reparent a subfolder to a root folder
+               at all).
+
 2008-02-12 [fabien]    3.3.0cvs6
 
        * po/fr.po
index c6e8284..4f63f7d 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.155.2.83 -r 1.155.2.84 src/Makefile.am;  cvs diff -u -r 1.83.2.127 -r 1.83.2.128 src/mimeview.c;  cvs diff -u -r 1.30.2.47 -r 1.30.2.48 src/prefs_toolbar.c;  cvs diff -u -r 1.25.2.51 -r 1.25.2.52 src/stock_pixmap.c;  cvs diff -u -r 1.18.2.33 -r 1.18.2.34 src/stock_pixmap.h;  diff -u /dev/null src/pixmaps/mime_text_patch.xpm;  ) > 3.3.0cvs4.patchset
 ( cvs diff -u -r 1.115.2.185 -r 1.115.2.186 src/main.c;  ) > 3.3.0cvs5.patchset
 ( cvs diff -u -r 1.42.2.35 -r 1.42.2.36 po/fr.po;  ) > 3.3.0cvs6.patchset
+( cvs diff -u -r 1.382.2.436 -r 1.382.2.437 src/compose.c;  cvs diff -u -r 1.8.2.25 -r 1.8.2.26 src/export.c;  cvs diff -u -r 1.213.2.176 -r 1.213.2.177 src/folder.c;  cvs diff -u -r 1.87.2.53 -r 1.87.2.54 src/folder.h;  cvs diff -u -r 1.26.2.34 -r 1.26.2.35 src/foldersel.c;  cvs diff -u -r 1.4.12.5 -r 1.4.12.6 src/foldersel.h;  cvs diff -u -r 1.1.2.53 -r 1.1.2.54 src/imap_gtk.c;  cvs diff -u -r 1.13.2.24 -r 1.13.2.25 src/import.c;  cvs diff -u -r 1.274.2.232 -r 1.274.2.233 src/mainwindow.c;  cvs diff -u -r 1.94.2.170 -r 1.94.2.171 src/messageview.c;  cvs diff -u -r 1.2.2.29 -r 1.2.2.30 src/mh_gtk.c;  cvs diff -u -r 1.105.2.123 -r 1.105.2.124 src/prefs_account.c;  cvs diff -u -r 1.1.4.48 -r 1.1.4.49 src/prefs_filtering_action.c;  cvs diff -u -r 1.395.2.354 -r 1.395.2.355 src/summaryview.c;  cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/plugins/bogofilter/bogofilter_gtk.c;  cvs diff -u -r 1.23.2.46 -r 1.23.2.47 src/plugins/spamassassin/spamassassin_gtk.c;  ) > 3.3.0cvs7.patchset
index 198f31b..5ca3a4d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=6
+EXTRA_VERSION=7
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index ac42bb1..378d4e8 100644 (file)
@@ -6407,7 +6407,7 @@ static void compose_savemsg_select_cb(GtkWidget *widget, Compose *compose)
        FolderItem *dest;
        gchar * path;
 
-       dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL);
+       dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
        if (!dest) return;
 
        path = folder_item_get_identifier(dest);
index c8efe52..0f8a774 100644 (file)
@@ -271,7 +271,7 @@ static void export_srcsel_cb(GtkWidget *widget, gpointer data)
 {
        FolderItem *src;
 
-       src = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL);
+       src = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE);
        if (src && src->path)
                gtk_entry_set_text(GTK_ENTRY(src_entry), src->path);
 }
index 215c53f..dc3cf2f 100644 (file)
@@ -1297,7 +1297,7 @@ FolderClass *folder_get_class_from_string(const gchar *str)
        return NULL;
 }
 
-static gchar *folder_get_identifier(Folder *folder)
+gchar *folder_get_identifier(Folder *folder)
 {
        gchar *type_str;
 
index 52f2aff..8ea1089 100644 (file)
@@ -780,6 +780,7 @@ FolderItem *folder_find_item_from_real_path (const gchar    *path);
 FolderClass *folder_get_class_from_string      (const gchar    *str);
 FolderItem *folder_find_child_item_by_name     (FolderItem     *item,
                                                 const gchar    *name);
+gchar     *folder_get_identifier               (Folder *folder);
 gchar      *folder_item_get_identifier         (FolderItem     *item);
 FolderItem *folder_find_item_from_identifier   (const gchar    *identifier);
 gchar     *folder_item_get_name                (FolderItem     *item);
@@ -798,9 +799,6 @@ FolderItem *folder_get_default_processing (void);
 void folder_set_missing_folders                (void);
 void folder_unref_account_all          (PrefsAccount   *account);
 
-/* return value is locale encoded file name */
-gchar *folder_item_get_path            (FolderItem     *item);
-
 gint   folder_item_open                        (FolderItem     *item);
 gint   folder_item_close               (FolderItem     *item);
 gint   folder_item_scan                        (FolderItem     *item);
@@ -847,7 +845,7 @@ void        folder_item_change_msg_flags    (FolderItem     *item,
                                         MsgPermFlags    newflags);
 gboolean folder_item_is_msg_changed    (FolderItem     *item,
                                         MsgInfo        *msginfo);
-/* return value is locale chaset */
+/* return value is locale charset */
 gchar * folder_item_get_identifier     (FolderItem * item);
 
 void folder_clean_cache_memory         (FolderItem *protected_item);
index 011202d..ceb028d 100644 (file)
@@ -81,6 +81,7 @@ static GtkWidget *entry;
 static GtkWidget *ok_button;
 static GtkWidget *cancel_button;
 static GtkWidget *new_button;
+static gboolean   root_selectable;
 
 static FolderItem *folder_item;
 static FolderItem *selected_item;
@@ -140,9 +141,10 @@ static gboolean tree_view_folder_item_func (GtkTreeModel     *model,
                                                 FolderItemSearch *data);
 
 FolderItem *foldersel_folder_sel(Folder *cur_folder, FolderSelectionType type,
-                                const gchar *default_folder)
+                                const gchar *default_folder, gboolean can_sel_mailbox)
 {
        selected_item = NULL;
+       root_selectable = can_sel_mailbox;
 
        if (!window) {
                foldersel_create();
@@ -198,7 +200,7 @@ FolderItem *foldersel_folder_sel(Folder *cur_folder, FolderSelectionType type,
        gtk_tree_store_clear(tree_store);
 
        if (!cancelled &&
-           selected_item && selected_item->path) {
+           selected_item && (selected_item->path || root_selectable)) {
                folder_item = selected_item;
                return folder_item;
        } else
@@ -477,6 +479,7 @@ static void foldersel_set_tree(Folder *cur_folder, FolderSelectionType type)
        gtk_tree_view_expand_all(GTK_TREE_VIEW(treeview));
 }
 
+#include "localfolder.h"
 static gboolean foldersel_selected(GtkTreeSelection *selection,
                                   GtkTreeModel *model, GtkTreePath *path,
                                   gboolean currently_selected, gpointer data)
@@ -499,6 +502,14 @@ static gboolean foldersel_selected(GtkTreeSelection *selection,
                id = folder_item_get_identifier(selected_item);
                gtk_entry_set_text(GTK_ENTRY(entry), id);
                g_free(id);
+       } else
+       if (root_selectable && selected_item && selected_item->folder &&
+                       (FOLDER_TYPE(selected_item->folder) == F_MH ||
+                        FOLDER_TYPE(selected_item->folder) == F_MBOX ||
+                        FOLDER_TYPE(selected_item->folder) == F_IMAP)) {
+               gchar *id = folder_get_identifier(selected_item->folder);
+               gtk_entry_set_text(GTK_ENTRY(entry), id);
+               g_free(id);
        } else
                gtk_entry_set_text(GTK_ENTRY(entry), "");
 
index 5d16eb9..fa775a0 100644 (file)
@@ -34,6 +34,7 @@ typedef enum
 
 FolderItem *foldersel_folder_sel(Folder                        *cur_folder,
                                 FolderSelectionType     type,
-                                const gchar            *default_folder);
+                                const gchar            *default_folder,
+                                gboolean                        can_sel_mailbox);
 
 #endif /* __FOLDERSEL_H__ */
index 496ace7..d80c057 100644 (file)
@@ -269,7 +269,7 @@ static void move_folder_cb(FolderView *folderview, guint action, GtkWidget *widg
        if (!from_folder || from_folder->folder->klass != imap_get_class())
                return;
 
-       to_folder = foldersel_folder_sel(from_folder->folder, FOLDER_SEL_MOVE, NULL);
+       to_folder = foldersel_folder_sel(from_folder->folder, FOLDER_SEL_MOVE, NULL, TRUE);
        if (!to_folder)
                return;
        
index 389f795..43cd56c 100644 (file)
@@ -275,7 +275,7 @@ static void import_destsel_cb(GtkWidget *widget, gpointer data)
        FolderItem *dest;
        gchar *path;
 
-       dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL);
+       dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
        if (!dest)
                 return;
        path = folder_item_get_identifier(dest);
index 1ef7cf0..f68637e 100644 (file)
@@ -4269,7 +4269,7 @@ static void goto_folder_cb(MainWindow *mainwin, guint action,
 {
        FolderItem *to_folder;
 
-       to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL);
+       to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE);
 
        if (to_folder)
                folderview_select(mainwin->folderview, to_folder);
index 9a93853..539a1e9 100644 (file)
@@ -2195,7 +2195,7 @@ static void goto_folder_cb(gpointer data, guint action, GtkWidget *widget)
        FolderItem *to_folder;
        messageview->updating = FALSE;
 
-       to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL);
+       to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE);
 
        if (to_folder) {
                folderview_select(messageview->mainwin->folderview, to_folder);
index 6081a7b..b3f8886 100644 (file)
@@ -279,7 +279,7 @@ static void move_folder_cb(FolderView *folderview, guint action, GtkWidget *widg
        if (!from_folder || from_folder->folder->klass != mh_get_class())
                return;
 
-       to_folder = foldersel_folder_sel(from_folder->folder, FOLDER_SEL_MOVE, NULL);
+       to_folder = foldersel_folder_sel(from_folder->folder, FOLDER_SEL_MOVE, NULL, TRUE);
        if (!to_folder)
                return;
        
index a52c52b..0505462 100644 (file)
@@ -69,7 +69,7 @@ static void foldersel_cb(GtkWidget *widget, gpointer data)
        gchar *item_id;
        gint newpos = 0;
        
-       item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL);
+       item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
        if (item && (item_id = folder_item_get_identifier(item)) != NULL) {
                gtk_editable_delete_text(GTK_EDITABLE(entry), 0, -1);
                gtk_editable_insert_text(GTK_EDITABLE(entry), item_id, strlen(item_id), &newpos);
index 0903d85..c90744f 100644 (file)
@@ -113,7 +113,7 @@ static void foldersel_cb(GtkWidget *widget, gpointer data)
        gchar *item_id;
        gint newpos = 0;
        
-       item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL);
+       item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
        if (item && (item_id = folder_item_get_identifier(item)) != NULL) {
                gtk_editable_delete_text(GTK_EDITABLE(page->save_folder), 0, -1);
                gtk_editable_insert_text(GTK_EDITABLE(page->save_folder), item_id, strlen(item_id), &newpos);
index 85aaa1c..ae19907 100644 (file)
@@ -3456,7 +3456,7 @@ static void prefs_account_select_folder_cb(GtkWidget *widget, gpointer data)
        FolderItem *item;
        gchar *id;
 
-       item = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL);
+       item = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
        if (item && item->path) {
                id = folder_item_get_identifier(item);
                if (id) {
index 4b75a01..cd767a4 100644 (file)
@@ -1228,7 +1228,7 @@ static void prefs_filtering_action_select_dest(void)
        FolderItem *dest;
        gchar * path;
 
-       dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL);
+       dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
        if (!dest) return;
 
        path = folder_item_get_identifier(dest);
index c9486c4..902103a 100644 (file)
@@ -4283,7 +4283,7 @@ void summary_move_to(SummaryView *summaryview)
            FOLDER_TYPE(summaryview->folder_item->folder) == F_NEWS) return;
 
        to_folder = foldersel_folder_sel(summaryview->folder_item->folder,
-                                        FOLDER_SEL_MOVE, NULL);
+                                        FOLDER_SEL_MOVE, NULL, FALSE);
        summary_move_selected_to(summaryview, to_folder);
 }
 
@@ -4364,7 +4364,7 @@ void summary_copy_to(SummaryView *summaryview)
        if (!summaryview->folder_item) return;
 
        to_folder = foldersel_folder_sel(summaryview->folder_item->folder,
-                                        FOLDER_SEL_COPY, NULL);
+                                        FOLDER_SEL_COPY, NULL, FALSE);
        summary_copy_selected_to(summaryview, to_folder);
 }