]> git.cworth.org Git - sup/commitdiff
added toggle all tagged feature (thanks to Marcus Williams)
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 5 Nov 2007 02:46:42 +0000 (02:46 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 5 Nov 2007 02:46:42 +0000 (02:46 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@667 5c8cc53c-5e98-4d25-b20a-d8db53a31250

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

index 357161a74e4238ffc896d7d65d0104eee0d1668c..4988c43b0d48bd003fad75aaee1f991380923448 100644 (file)
@@ -23,7 +23,8 @@ class ThreadIndexMode < LineCursorMode
     k.add :jump_to_next_new, "Jump to next new thread", :tab
     k.add :reply, "Reply to latest message in a thread", 'r'
     k.add :forward, "Forward latest message in a thread", 'f'
-    k.add :toggle_tagged, "Tag/untag current line", 't'
+    k.add :toggle_tagged, "Tag/untag selected thread", 't'
+    k.add :toggle_tagged_all, "Tag/untag all threads", 'T'
     k.add :apply_to_tagged, "Apply next command to all tagged threads", ';'
   end
 
@@ -320,6 +321,11 @@ class ThreadIndexMode < LineCursorMode
     update_text_for_line curpos
     cursor_down
   end
+  
+  def toggle_tagged_all
+    @threads.each { |t| @tags.toggle_tag_for t }
+    regen_text
+  end
 
   def apply_to_tagged; @tags.apply_to_tagged; end