]> git.cworth.org Git - sup/blobdiff - lib/sup/modes/inbox-mode.rb
use default account values for name, sendmail, signature account fields, and properly...
[sup] / lib / sup / modes / inbox-mode.rb
index a69a67e2194eff93fe41481039729b567f9fea32..23da9795b438db83912ee943ff750d7e7f992997 100644 (file)
@@ -9,12 +9,20 @@ class InboxMode < ThreadIndexMode
   end
 
   def initialize
-    super [:inbox], [:inbox]
+    super [:inbox, :sent], { :label => :inbox }
+    raise "can't have more than one!" if defined? @@instance
+    @@instance = self
   end
 
+  def is_relevant? m; m.has_label? :inbox; end
+
+  ## label-list-mode wants to be able to raise us if the user selects
+  ## the "inbox" label, so we need to keep our singletonness around
+  def self.instance; @@instance; end
   def killable?; false; end
 
   def archive
+    return unless cursor_thread
     cursor_thread.remove_label :inbox
     hide_thread cursor_thread
     regen_text
@@ -44,17 +52,6 @@ class InboxMode < ThreadIndexMode
   def status
     super + "    #{Index.size} messages in index"
   end
-
-  def is_relevant? m; m.has_label? :inbox; end
-
-  def load_threads opts={}
-    n = opts[:num] || ThreadIndexMode::LOAD_MORE_THREAD_NUM
-    load_n_threads_background n, :label => :inbox,
-                                 :when_done => (lambda do |num|
-      opts[:when_done].call(num) if opts[:when_done]
-      BufferManager.flash "Added #{num} threads."
-    end)
-  end
 end
 
 end