diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-09-14 02:49:29 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-09-14 02:49:29 +0000 |
commit | 7f69beae19a44f3e2df8097add8c89f34a01e058 (patch) | |
tree | c1e9fd7ac9708647d93f5197500d74f13fd179fb /src | |
parent | 1c8ead7fa931806f3b17208afd191df27f08ffa9 (diff) |
block notify if a new message is read on receiving.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1899 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/inc.c | 18 | ||||
-rw-r--r-- | src/inc.h | 1 | ||||
-rw-r--r-- | src/summaryview.c | 15 |
3 files changed, 23 insertions, 11 deletions
@@ -62,6 +62,7 @@ static GList *inc_dialog_list = NULL; static guint inc_lock_count = 0; +static gboolean block_notify = FALSE; static GdkPixbuf *current_pixbuf; static GdkPixbuf *error_pixbuf; @@ -154,20 +155,17 @@ static void inc_finished(MainWindow *mainwin, gint new_messages) if (prefs_common.scan_all_after_inc) new_messages += folderview_check_new(NULL); - if (new_messages > 0) { + if (new_messages > 0 && !block_notify) { gchar buf[1024]; g_snprintf(buf, sizeof(buf), _("Sylpheed: %d new messages"), new_messages); trayicon_set_tooltip(buf); trayicon_set_notify(TRUE); - } else { -#if 0 - trayicon_set_tooltip(NULL); - trayicon_set_notify(FALSE); -#endif } + inc_block_notify(FALSE); + if (new_messages <= 0 && !prefs_common.scan_all_after_inc) return; if (prefs_common.open_inbox_on_inc) { @@ -1408,6 +1406,14 @@ gboolean inc_is_active(void) return FALSE; } +void inc_block_notify(gboolean block) +{ + if (!block) + block_notify = FALSE; + else if (inc_is_active()) + block_notify = TRUE; +} + void inc_cancel_all(void) { GList *cur; @@ -90,6 +90,7 @@ void inc_all_account_mail (MainWindow *mainwin, gint inc_pop_before_smtp (PrefsAccount *account); gboolean inc_is_active (void); +void inc_block_notify (gboolean notify); void inc_cancel_all (void); diff --git a/src/summaryview.c b/src/summaryview.c index 32b464c7..f3359b96 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -2715,9 +2715,11 @@ static void summary_display_msg_full(SummaryView *summaryview, if (val == 0 && (new_window || !prefs_common.mark_as_read_on_new_window)) { - if (MSG_IS_NEW(msginfo->flags) && - summaryview->folder_item->new > 0) - summaryview->folder_item->new--; + if (MSG_IS_NEW(msginfo->flags)) { + if (summaryview->folder_item->new > 0) + summaryview->folder_item->new--; + inc_block_notify(TRUE); + } if (MSG_IS_UNREAD(msginfo->flags) && summaryview->folder_item->unread > 0) summaryview->folder_item->unread--; @@ -2976,8 +2978,11 @@ static void summary_mark_row_as_read(SummaryView *summaryview, GET_MSG_INFO(msginfo, iter); - if (MSG_IS_NEW(msginfo->flags) && summaryview->folder_item->new > 0) - summaryview->folder_item->new--; + if (MSG_IS_NEW(msginfo->flags)) { + if (summaryview->folder_item->new > 0) + summaryview->folder_item->new--; + inc_block_notify(TRUE); + } if (MSG_IS_UNREAD(msginfo->flags) && summaryview->folder_item->unread > 0) summaryview->folder_item->unread--; |