]> git.cworth.org Git - sup/commitdiff
fixed toggling of starred, new, etc.
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 9 Jan 2007 16:33:57 +0000 (16:33 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 9 Jan 2007 16:33:57 +0000 (16:33 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@237 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/thread-index-mode.rb

index 526912b34c1c9abc0bd3625e06d6e92285a87dc3..47fc4ccdd21dc660accd46f73a99bfdafc6fe620 100644 (file)
@@ -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