diff --git a/lib/sup/modes/thread_index_mode.rb b/lib/sup/modes/thread_index_mode.rb index 71d3fed64..3cd116dcd 100644 --- a/lib/sup/modes/thread_index_mode.rb +++ b/lib/sup/modes/thread_index_mode.rb @@ -135,7 +135,16 @@ def select t=nil, when_done=nil end def multi_select threads - threads.each { |t| select t } + tagged_no = @tags.number_of_tagged + if tagged_no > 1 + total_msg_no = 0 + threads.each { |t| total_msg_no += t.size } + if BufferManager.ask_yes_or_no "Are you sure, you want to open #{tagged_no} threads with #{total_msg_no} messages (y/n)?" + threads.each { |t| select t } + end + else + threads.each { |t| select t } + end end ## these two methods are called by thread-view-modes when the user diff --git a/lib/sup/tagger.rb b/lib/sup/tagger.rb index d02b04513..a027a72f2 100644 --- a/lib/sup/tagger.rb +++ b/lib/sup/tagger.rb @@ -16,7 +16,8 @@ def tag o; @tagged[o] = true; end def untag o; @tagged[o] = false; end def drop_all_tags; @tagged.clear; end def drop_tag_for o; @tagged.delete o; end - + def number_of_tagged; @tagged.select_by_value.size; end + def apply_to_tagged action=nil targets = @tagged.select_by_value num_tagged = targets.size