From 93854369cad0f05406a3e619f0a3d415ad422c66 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Thu, 22 Mar 2007 17:23:23 +0000 Subject: [PATCH] 2007-03-22 [colin] 2.8.1cvs37 * src/folderview.c * src/folderview.h * src/mainwindow.c Try to prevent race conditions when changing the folder list * src/summaryview.c Fix possible red folder icon when switching from Small screen layout to any other --- ChangeLog | 12 ++++++++++++ PATCHSETS | 1 + configure.ac | 2 +- src/folderview.c | 28 ++++++++++++++++++++++++++++ src/folderview.h | 1 + src/mainwindow.c | 3 +++ src/summaryview.c | 14 +++++++++++++- 7 files changed, 59 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c81617f76..ef79d0399 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-03-22 [colin] 2.8.1cvs37 + + * src/folderview.c + * src/folderview.h + * src/mainwindow.c + Try to prevent race conditions when + changing the folder list + * src/summaryview.c + Fix possible red folder icon when + switching from Small screen layout + to any other + 2007-03-22 [colin] 2.8.1cvs36 * src/mainwindow.c diff --git a/PATCHSETS b/PATCHSETS index f8c26c59e..7ae96afdc 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2453,3 +2453,4 @@ ( cvs diff -u -r 1.654.2.2505 -r 1.654.2.2506 configure.ac; cvs diff -u -r 1.155.2.55 -r 1.155.2.56 src/Makefile.am; ) > 2.8.1cvs34.patchset ( cvs diff -u -r 1.654.2.2506 -r 1.654.2.2507 configure.ac; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 claws-mail.desktop; ) > 2.8.1cvs35.patchset ( cvs diff -u -r 1.274.2.179 -r 1.274.2.180 src/mainwindow.c; cvs diff -u -r 1.39.2.35 -r 1.39.2.36 src/mainwindow.h; cvs diff -u -r 1.79.2.53 -r 1.79.2.54 src/mh.c; cvs diff -u -r 1.395.2.288 -r 1.395.2.289 src/summaryview.c; cvs diff -u -r 1.36.2.99 -r 1.36.2.100 src/common/utils.c; cvs diff -u -r 1.20.2.12 -r 1.20.2.13 src/gtk/Makefile.am; ) > 2.8.1cvs36.patchset +( cvs diff -u -r 1.207.2.153 -r 1.207.2.154 src/folderview.c; cvs diff -u -r 1.20.2.19 -r 1.20.2.20 src/folderview.h; cvs diff -u -r 1.274.2.180 -r 1.274.2.181 src/mainwindow.c; cvs diff -u -r 1.395.2.289 -r 1.395.2.290 src/summaryview.c; ) > 2.8.1cvs37.patchset diff --git a/configure.ac b/configure.ac index 990e539f6..eecf76f7c 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=36 +EXTRA_VERSION=37 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/folderview.c b/src/folderview.c index 498cc777f..87d2c25b8 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -620,6 +620,7 @@ FolderView *folderview_create(void) folderview->target_list = gtk_target_list_new(folderview_drag_types, 2); folderview_list = g_list_append(folderview_list, folderview); + folderview->deferred_refresh_id = -1; return folderview; } @@ -706,6 +707,23 @@ void folderview_init(FolderView *folderview) } } +static gboolean folderview_defer_set(gpointer data) +{ + FolderView *folderview = (FolderView *)data; + MainWindow *mainwin = folderview->mainwin; + + if (!mainwin) + return FALSE; + if (mainwin->lock_count) + return TRUE; + + printf("doing deferred folderview_set now\n"); + folderview_set(folderview); + + folderview->deferred_refresh_id = -1; + return FALSE; +} + void folderview_set(FolderView *folderview) { GtkCTree *ctree = GTK_CTREE(folderview->ctree); @@ -715,6 +733,15 @@ void folderview_set(FolderView *folderview) if (!mainwin) return; + if (mainwin->lock_count) { + if (folderview->deferred_refresh_id == -1) + folderview->deferred_refresh_id = + g_timeout_add(500, folderview_defer_set, folderview); + printf("deferred folderview_set\n"); + return; + } + + inc_lock(); debug_print("Setting folder info...\n"); STATUSBAR_PUSH(mainwin, _("Setting folder info...")); @@ -741,6 +768,7 @@ void folderview_set(FolderView *folderview) gtk_clist_thaw(GTK_CLIST(ctree)); main_window_cursor_normal(mainwin); STATUSBAR_POP(mainwin); + inc_unlock(); } void folderview_set_all(void) diff --git a/src/folderview.h b/src/folderview.h index 3daccb895..489d6f437 100644 --- a/src/folderview.h +++ b/src/folderview.h @@ -78,6 +78,7 @@ struct _FolderView GtkTargetList *target_list; /* DnD */ FolderColumnState col_state[N_FOLDER_COLS]; gint col_pos[N_FOLDER_COLS]; + gint deferred_refresh_id; }; struct _FolderViewPopup diff --git a/src/mainwindow.c b/src/mainwindow.c index 67f2f4249..b8a3b4eeb 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -2340,6 +2340,9 @@ void main_window_set_menu_sensitive(MainWindow *mainwin) {"/Tools/Delete duplicated messages/In selected folder" , M_MSG_EXIST|M_ALLOW_DELETE}, {"/Configuration", M_UNLOCKED}, + {"/Configuration/Preferences for current account...", M_UNLOCKED}, + {"/Configuration/Create new account...", M_UNLOCKED}, + {"/Configuration/Edit accounts...", M_UNLOCKED}, {NULL, 0} }; diff --git a/src/summaryview.c b/src/summaryview.c index 46ee482af..42ed4051e 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -6465,8 +6465,18 @@ static gboolean summary_update_msg(gpointer source, gpointer data) static void summary_update_unread(SummaryView *summaryview, FolderItem *removed_item) { guint new, unread, unreadmarked, marked, total; - if (prefs_common.layout_mode != SMALL_LAYOUT) + static gboolean tips_initialized = FALSE; + + if (prefs_common.layout_mode != SMALL_LAYOUT) { + if (tips_initialized) { + summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN); + gtk_tooltips_set_tip(GTK_TOOLTIPS(summaryview->tips), + summaryview->folder_pixmap_eventbox, + NULL, NULL); + tips_initialized = FALSE; + } return; + } folder_count_total_msgs(&new, &unread, &unreadmarked, &marked, &total); if (removed_item) { total -= removed_item->total_msgs; @@ -6475,11 +6485,13 @@ static void summary_update_unread(SummaryView *summaryview, FolderItem *removed_ } if (new > 0 || unread > 0) { + tips_initialized = TRUE; summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN_HRM); gtk_tooltips_set_tip(GTK_TOOLTIPS(summaryview->tips), summaryview->folder_pixmap_eventbox, _("Go back to the folder list (You have unread messages)"), NULL); } else { + tips_initialized = TRUE; summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN); gtk_tooltips_set_tip(GTK_TOOLTIPS(summaryview->tips), summaryview->folder_pixmap_eventbox, -- 2.11.4.GIT