Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Handle added messages in label-list-mode
@ 2009-09-12 21:04 Bo Borgerson
  2009-10-01 16:53 ` William Morgan
  0 siblings, 1 reply; 4+ messages in thread
From: Bo Borgerson @ 2009-09-12 21:04 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [sup-talk] [PATCH] Handle added messages in label-list-mode
  2009-09-12 21:04 [sup-talk] [PATCH] Handle added messages in label-list-mode Bo Borgerson
@ 2009-10-01 16:53 ` William Morgan
  2009-10-04 16:23   ` Bo Borgerson
  0 siblings, 1 reply; 4+ messages in thread
From: William Morgan @ 2009-10-01 16:53 UTC (permalink / raw)


Reformatted excerpts from Bo Borgerson's message of 2009-09-12:
> Register label-list-mode with the UpdateManager and handle added
> updates with a reload to keep unread message counts up to date

Branch label-list-mode-auto-update, merged into next. I'm a little
concerned with performance, but we'll see how it goes.

What do you think about handling labeled and deleted updates as well?
-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [sup-talk] [PATCH] Handle added messages in label-list-mode
  2009-10-01 16:53 ` William Morgan
@ 2009-10-04 16:23   ` Bo Borgerson
  2009-10-12 13:46     ` William Morgan
  0 siblings, 1 reply; 4+ messages in thread
From: Bo Borgerson @ 2009-10-04 16:23 UTC (permalink / raw)
  To: William Morgan; +Cc: sup-talk

Excerpts from William Morgan's message of Thu Oct 01 12:53:15 -0400 2009:
> Reformatted excerpts from Bo Borgerson's message of 2009-09-12:
> > Register label-list-mode with the UpdateManager and handle added
> > updates with a reload to keep unread message counts up to date
> 
> Branch label-list-mode-auto-update, merged into next.
> 

Hi William.  Thanks for looking at this.

> I'm a little concerned with performance, but we'll see how it goes.
> 

Yeah, I think I might be spoiled by my relatively few messages / labels.  If it
turns out to be an issue maybe it could be made toggle-able with a key-press?
(Default off / configurable)?

I actually use the label-list-mode as my "home" screen.  I like it to stay
up-to-date so I can quickly scan which labels have new messages.

Incidentally the recent discussion in another thread about making the inbox
more like other labels resonates with me.  My workflow for all other labels is
just to 'x' out when I'm done, but with the inbox I have to '$'ave and
'B'uffer-switch.

> What do you think about handling labeled and deleted updates as well?

Is there a way to label or delete threads without leaving the label-list-mode?
There's already a refresh when switching back to the label-list-mode from
elsewhere, I think, so any changes that are $aved should be reflected
immediately when you get back.  Labels added automatically in a
before-add-message hook should already be present when the 'added' update event
is received, right?

I'm not trying to argue against adding handlers for labeled and deleted
updates.  I just want to make sure I understand the use cases so I know how to
test.

Thanks,

Bo
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [sup-talk] [PATCH] Handle added messages in label-list-mode
  2009-10-04 16:23   ` Bo Borgerson
@ 2009-10-12 13:46     ` William Morgan
  0 siblings, 0 replies; 4+ messages in thread
From: William Morgan @ 2009-10-12 13:46 UTC (permalink / raw)
  To: sup-talk

Reformatted excerpts from Bo Borgerson's message of 2009-10-04:
> Is there a way to label or delete threads without leaving the
> label-list-mode?  There's already a refresh when switching back to the
> label-list-mode from elsewhere, I think, so any changes that are $aved
> should be reflected immediately when you get back.

That's a good point. Yeah, this is unnecessary until we make some major
interface redesigns.
-- 
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-12 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-12 21:04 [sup-talk] [PATCH] Handle added messages in label-list-mode Bo Borgerson
2009-10-01 16:53 ` William Morgan
2009-10-04 16:23   ` Bo Borgerson
2009-10-12 13:46     ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox