aboutsummaryrefslogtreecommitdiff
path: root/src/inc.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-09-14 02:49:29 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-09-14 02:49:29 +0000
commit7f69beae19a44f3e2df8097add8c89f34a01e058 (patch)
treec1e9fd7ac9708647d93f5197500d74f13fd179fb /src/inc.c
parent1c8ead7fa931806f3b17208afd191df27f08ffa9 (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/inc.c')
-rw-r--r--src/inc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/inc.c b/src/inc.c
index fff5766e..2b6b18a4 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -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;