5 class InboxMode < ThreadIndexMode
7 ## overwrite toggle_archived with archive
8 k.add :archive, "Archive thread (remove from inbox)", 'a'
12 super [:inbox], [:inbox]
15 def killable?; false; end
18 cursor_thread.remove_label :inbox
19 hide_thread cursor_thread
23 def multi_archive threads
24 threads.each { |t| remove_label_and_hide_thread t, :inbox }
28 def handle_archived_update sender, t
29 hide_thread t if contains_thread? t
32 def handle_unarchived_update sender, t
33 ## XXX todo: fill me in
37 super + " #{Index.size} messages in index"
40 def is_relevant? m; m.has_label? :inbox; end
42 def load_threads opts={}
43 n = opts[:num] || ThreadIndexMode::LOAD_MORE_THREAD_NUM
44 load_n_threads_background n, :label => :inbox,
45 :when_done => (lambda do |num|
46 opts[:when_done].call if opts[:when_done]
47 BufferManager.flash "Added #{num} threads."