Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: gigabo@gmail.com (Bo Borgerson)
Subject: [sup-talk] [PATCH] Handle added messages in label-list-mode
Date: Sat, 12 Sep 2009 17:04:05 -0400	[thread overview]
Message-ID: <1252789445-30193-1-git-send-email-gigabo@gmail.com> (raw)

Register label-list-mode with the UpdateManager and handle added
updates with a reload to keep unread message counts up to date
---
 lib/sup/modes/label-list-mode.rb |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/lib/sup/modes/label-list-mode.rb b/lib/sup/modes/label-list-mode.rb
index d94f56f..f0084a9 100644
--- a/lib/sup/modes/label-list-mode.rb
+++ b/lib/sup/modes/label-list-mode.rb
@@ -31,9 +31,15 @@ EOS
     @text = []
     @unread_only = false
     super
+    UpdateManager.register self
     regen_text
   end
 
+  def cleanup
+    UpdateManager.unregister self
+    super
+  end
+
   def lines; @text.length end
   def [] i; @text[i] end
 
@@ -52,6 +58,10 @@ EOS
     reload # make sure unread message counts are up-to-date
   end
 
+  def handle_added_update sender, m
+    reload
+  end
+
 protected
 
   def toggle_show_unread_only
-- 
1.6.0.4



             reply	other threads:[~2009-09-12 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-12 21:04 Bo Borgerson [this message]
2009-10-01 16:53 ` William Morgan
2009-10-04 16:23   ` Bo Borgerson
2009-10-12 13:46     ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1252789445-30193-1-git-send-email-gigabo@gmail.com \
    --to=gigabo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox