GtkWidget *hbox_total;
gint *col_pos = folderview->col_pos;
+ debug_print("setting titles...\n");
gtk_widget_realize(folderview->ctree);
gtk_widget_show_all(folderview->scrolledwin);
gint i;
GtkWidget *scrolledwin = folderview->scrolledwin;
+ debug_print("creating tree...\n");
memset(titles, 0, sizeof(titles));
col_state = prefs_folder_column_get_config();
FolderItem *item = folderview_get_selected_item(folderview);
GtkWidget *scrolledwin = folderview->scrolledwin;
+ debug_print("recreating tree...\n");
gtk_widget_destroy(folderview->ctree);
folderview->ctree = ctree = folderview_ctree_create(folderview);
if (in_sub &&
(item->new_msgs > 0 ||
- (item->stype == F_QUEUE && item->total_msgs > 0))) {
+ (folder_has_parent_of_type(item, F_QUEUE) && item->total_msgs > 0))) {
return TRUE;
}
if (in_sub &&
(item->unread_msgs > 0 ||
- (item->stype == F_QUEUE && item->total_msgs > 0))) {
+ (folder_has_parent_of_type(item, F_QUEUE) && item->total_msgs > 0))) {
return TRUE;
}
mask = openmask = searchmask;
}
- if (item->stype == F_QUEUE && item->total_msgs > 0 &&
+ if (folder_has_parent_of_type(item, F_QUEUE) && item->total_msgs > 0 &&
prefs_common.display_folder_unread) {
str = g_strdup_printf("%s (%d%s)", name, item->total_msgs,
add_unread_mark ? "+" : "");
gtk_ctree_node_set_text(ctree, node, col_pos[F_COL_TOTAL], itos(item->total_msgs));
}
- if (item->stype == F_OUTBOX || item->stype == F_DRAFT ||
- item->stype == F_TRASH) {
+ if (folder_has_parent_of_type(item, F_OUTBOX) ||
+ folder_has_parent_of_type(item, F_DRAFT) ||
+ folder_has_parent_of_type(item, F_TRASH)) {
use_bold = use_color = FALSE;
- } else if (item->stype == F_QUEUE) {
+ } else if (folder_has_parent_of_type(item, F_QUEUE)) {
/* highlight queue folder if there are any messages */
use_bold = use_color = (item->total_msgs > 0);
} else {
FolderViewPopup *fpopup;
GtkItemFactory *fpopup_factory;
GtkWidget *popup;
+ FolderItem *special_trash = NULL;
+ PrefsAccount *ac;
if (!event) return FALSE;
if (fpopup->set_sensitivity != NULL)
fpopup->set_sensitivity(fpopup_factory, item);
- if (item == folder->trash &&
+ if (NULL != (ac = account_find_from_item(item)))
+ special_trash = account_get_special_folder(ac, F_TRASH);
+
+ if ((item == folder->trash || item == special_trash) &&
gtk_item_factory_get_item(fpopup_factory, "/Empty trash...") == NULL) {
gtk_item_factory_create_item(fpopup_factory, &folder_view_trash_popup_entries[0], folderview, 1);
gtk_item_factory_create_item(fpopup_factory, &folder_view_trash_popup_entries[1], folderview, 1);
- } else if (item != folder->trash) {
+ } else if (item != folder->trash && (special_trash == NULL || item != special_trash)) {
gtk_item_factory_delete_entry(fpopup_factory, &folder_view_trash_popup_entries[0]);
gtk_item_factory_delete_entry(fpopup_factory, &folder_view_trash_popup_entries[1]);
}
folderview->selected == folderview->opened);
SET_SENS("/Properties...", item->node->parent != NULL);
SET_SENS("/Processing...", item->node->parent != NULL);
- if (item == folder->trash) {
+ if (item == folder->trash || item == special_trash) {
GSList *msglist = folder_item_get_msg_list(item);
SET_SENS("/Empty trash...", msglist != NULL);
procmsg_msg_list_free(msglist);
{
if (!folderview->opened) return;
- gtkut_ctree_set_focus_row(GTK_CTREE(folderview->ctree),
- folderview->opened);
gtk_ctree_select(GTK_CTREE(folderview->ctree), folderview->opened);
}
gtk_ctree_node_set_row_data(ctree, node, item);
if (normal_style)
gtk_ctree_node_set_row_style(ctree, node, normal_style);
- folderview_sort_folders(folderview, folderview->selected, item->folder);
+ folderview_sort_folders(folderview, parent_node, item->folder);
gtk_clist_thaw(GTK_CLIST(ctree));
}
GSList *mlist = NULL;
GSList *cur = NULL;
if (!folderview->selected) return;
-
+ FolderItem *special_trash = NULL;
+ PrefsAccount *ac;
+
item = gtk_ctree_node_get_row_data(ctree, folderview->selected);
g_return_if_fail(item != NULL);
g_return_if_fail(item->folder != NULL);
- if (item != item->folder->trash) return;
+
+ if (NULL != (ac = account_find_from_item(item)))
+ special_trash = account_get_special_folder(ac, F_TRASH);
+
+ if (item != item->folder->trash && item != special_trash) return;
if (prefs_common.ask_on_clean) {
if (alertpanel(_("Empty trash"),
- _("Empty all messages in trash?"),
+ _("Delete all messages in trash?"),
GTK_STOCK_YES, GTK_STOCK_NO, NULL) != G_ALERTDEFAULT)
return;
}
folderview_sort_folders(folderview,
gtk_ctree_find_by_row_data(GTK_CTREE(folderview->ctree),
- NULL, folder_item_parent(new_folder)), new_folder->folder);
+ NULL, to_folder), new_folder->folder);
folderview_select(folderview, new_folder);
} else {
statusbar_verbosity_set(FALSE);
{
GtkCTree *ctree = GTK_CTREE(folderview->ctree);
FolderItem *item;
+ gchar *id, *title;
if (!folderview->selected) return;
g_return_if_fail(item != NULL);
g_return_if_fail(item->folder != NULL);
- prefs_filtering_open(&item->prefs->processing,
- _("Processing configuration"), NULL, NULL);
+ id = folder_item_get_identifier(item);
+ title = g_strdup_printf (_("Processing configuration for folder %s"), id);
+ g_free (id);
+
+ prefs_filtering_open(&item->prefs->processing, title, NULL, NULL);
+ g_free (title);
}
void folderview_set_target_folder_color(gint color_op)
} else {
/* comes from folderview */
char *source;
+ gboolean folder_is_normal = TRUE;
source = data->data + 17;
if (gtk_clist_get_selection_info
item = gtk_ctree_node_get_row_data(GTK_CTREE(widget), node);
src_item = folder_find_item_from_identifier(source);
- if (!item || item->no_select || !src_item || src_item->stype != F_NORMAL) {
+ folder_is_normal =
+ src_item != NULL &&
+ src_item->stype == F_NORMAL &&
+ !folder_has_parent_of_type(src_item, F_OUTBOX) &&
+ !folder_has_parent_of_type(src_item, F_DRAFT) &&
+ !folder_has_parent_of_type(src_item, F_QUEUE) &&
+ !folder_has_parent_of_type(src_item, F_TRASH);
+ if (!item || item->no_select || !src_item
+ || !folder_is_normal) {
gtk_drag_finish(drag_context, FALSE, FALSE, time);
return;
}