commit f8ba71567af8993326c94f8e9db026777b0b6143
parent 61e839c77d1bcbb74deaf0f09ea6a704b61e14a3
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date: Tue, 9 Jan 2007 16:33:57 +0000
fixed toggling of starred, new, etc.
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@237 5c8cc53c-5e98-4d25-b20a-d8db53a31250
Diffstat:
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -113,22 +113,28 @@ class ThreadIndexMode < LineCursorMode
end
end
- def toggle_starred t=@threads[curpos]
+ ## i always hate people who name things like this...
+ def actually_toggle_starred t=@threads[curpos]
if t.has_label? :starred # if ANY message has a star
t.remove_label :starred # remove from all
else
t.first.add_label :starred # add only to first
end
+ end
+
+ def toggle_starred
+ actually_toggle_starred
update_text_for_line curpos
cursor_down
end
def multi_toggle_starred threads
- threads.each { |t| toggle_starred t }
+ threads.each { |t| actually_toggle_starred t }
+ regen_text
end
- def toggle_archived
- return unless(t = @threads[curpos])
+ def toggle_archived
+ t = @threads[curpos] or return
t.toggle_label :inbox
update_text_for_line curpos
cursor_down
@@ -141,11 +147,13 @@ class ThreadIndexMode < LineCursorMode
def toggle_new
t = @threads[curpos] or return
+ t.toggle_label :unread
update_text_for_line curpos
cursor_down
end
def multi_toggle_new threads
+ threads.each { |t| t.toggle_label :unread }
regen_text
end