#include "folder.h"
#include "inc.h"
#include "statusbar.h"
+#include "toolbar.h"
typedef enum
{
gint n_entries;
gint i;
- debug_print(_("Creating folder view...\n"));
+ debug_print("Creating folder view...\n");
folderview = g_new0(FolderView, 1);
titles[COL_FOLDER] = _("Folder");
GtkCTree *ctree = GTK_CTREE(folderview->ctree);
MainWindow *mainwin = folderview->mainwin;
- debug_print(_("Setting folder info...\n"));
+ debug_print("Setting folder info...\n");
STATUSBAR_PUSH(mainwin, _("Setting folder info..."));
main_window_cursor_wait(mainwin);
void folderview_rescan_tree(Folder *folder)
{
GtkWidget *window;
+ AlertValue avalue;
g_return_if_fail(folder != NULL);
if (!folder->scan_tree) return;
+ avalue = alertpanel
+ (_("Rescan folder tree"),
+ _("All previous settings for each folders will be lost.\n"
+ "Continue?"),
+ _("Yes"), _("No"), NULL);
+ if (avalue != G_ALERTDEFAULT) return;
+
inc_lock();
window = label_window_create(_("Rescanning folder tree..."));
inc_unlock();
}
+#if 0
void folderview_rescan_all(void)
{
GList *list;
gtk_widget_destroy(window);
inc_unlock();
}
+#endif
void folderview_check_new(Folder *folder)
{
folder_write_list();
}
-void folderview_check_new_all()
+void folderview_check_new_all(void)
{
GList *list;
GtkWidget *window;
+ FolderView *folderview;
+
+ folderview = (FolderView *)folderview_list->data;
inc_lock();
- window = label_window_create(_("Checking all folders for new messages..."));
+ main_window_lock(folderview->mainwin);
+ window = label_window_create
+ (_("Checking for new messages in all folders..."));
list = folder_get_list();
for (; list != NULL; list = list->next) {
folderview_set_all();
gtk_widget_destroy(window);
+ main_window_unlock(folderview->mainwin);
inc_unlock();
}
{
GtkCTree *ctree = GTK_CTREE(folderview->ctree);
GtkStyle *style = NULL;
+ GtkStyle *color_style = NULL;
FolderItem *item;
GdkPixmap *xpm, *openxpm;
GdkBitmap *mask, *openmask;
gtk_ctree_node_set_foreground(ctree, node, NULL);
- if (use_bold && use_color)
+ if (use_bold && use_color) {
style = bold_color_style;
- else if (use_bold) {
+ } else if (use_bold) {
style = bold_style;
if (item->op_count > 0) {
style = bold_tgtfold_style;
}
- }
- else if (use_color) {
+ } else if (use_color) {
style = normal_color_style;
gtk_ctree_node_set_foreground(ctree, node,
&folderview->color_new);
- }
- else if (item->op_count > 0) {
+ } else if (item->op_count > 0) {
style = bold_tgtfold_style;
+ } else if (item->prefs->color > 0) {
+ GdkColor gdk_color;
+
+ gtkut_convert_int_to_gdk_color(item->prefs->color, &gdk_color);
+ color_style = gtk_style_copy(gtk_widget_get_style(GTK_WIDGET(ctree)));
+ color_style->fg[GTK_STATE_NORMAL] = gdk_color;
+ style = color_style;
} else {
style = normal_style;
}
static void folderview_update_item_foreach_func(gpointer key, gpointer val,
gpointer data)
{
- folderview_update_item((FolderItem *)key, FALSE);
+ folderview_update_item((FolderItem *)key, (gboolean)data);
}
-void folderview_update_item_foreach(GHashTable *table)
+void folderview_update_item_foreach(GHashTable *table, gboolean update_summary)
{
- g_hash_table_foreach(table, folderview_update_item_foreach_func, NULL);
+ g_hash_table_foreach(table, folderview_update_item_foreach_func,
+ (gpointer)update_summary);
}
static gboolean folderview_gnode_func(GtkCTree *ctree, guint depth,
/* CLAWS: set compose button type: news folder items
* always have a news folder as parent */
if (item->folder)
- main_window_toolbar_set_compose_button
- (folderview->mainwin,
+ toolbar_set_compose_button
+ (folderview->mainwin->toolbar,
item->folder->type == F_NEWS ?
COMPOSEBUTTON_NEWS : COMPOSEBUTTON_MAIL);
if (item->path)
- debug_print(_("Folder %s is selected\n"), item->path);
+ debug_print("Folder %s is selected\n", item->path);
if (!GTK_CTREE_ROW(row)->children)
gtk_ctree_expand(ctree, row);
folder_item_apply_processing(item);
- debug_print(_("done.\n"));
+ debug_print("done.\n");
STATUSBAR_POP(folderview->mainwin);
main_window_cursor_normal(folderview->mainwin);
}
/* Show messages */
+ summary_set_prefs_from_folderitem(folderview->summaryview, item);
opened = summary_show(folderview->summaryview, item);
folder_clean_cache_memory();