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 # not quite working, and not sure if i like it anyways
33 # def handle_unarchived_update sender, t
34 # Redwood::log "unarchived #{t.subj}"
39 super + " #{Index.size} messages in index"
42 def is_relevant? m; m.has_label? :inbox; end
44 def load_threads opts={}
45 n = opts[:num] || ThreadIndexMode::LOAD_MORE_THREAD_NUM
46 load_n_threads_background n, :label => :inbox,
47 :when_done => (lambda do |num|
48 opts[:when_done].call if opts[:when_done]
49 BufferManager.flash "Added #{num} threads."