From: wmorgan Date: Sun, 1 Apr 2007 04:07:56 +0000 (+0000) Subject: alternate starred color X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=a8f066da110aef455b7ad6c5e533607090994321;p=sup alternate starred color git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@355 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/History.txt b/History.txt index 723b6d8..eda41f9 100644 --- a/History.txt +++ b/History.txt @@ -1,5 +1,8 @@ == 0.0.8 / XXXX * Maildir support. +* Renamed sup-import => sup-sync with a brand new interface. +* Added a sup-dump, to enable backing up and rebuilding indices from + scratch (e.g. when Ferret upgrades break index formats). * More bugfixes. Will they ever end? == 0.0.7 / 2007-02-12 diff --git a/bin/sup b/bin/sup index b2c16dc..00f0b3d 100644 --- a/bin/sup +++ b/bin/sup @@ -83,6 +83,8 @@ begin Ncurses::A_BOLD c.add :starred_patina_color, Ncurses::COLOR_YELLOW, Ncurses::COLOR_GREEN, Ncurses::A_BOLD + c.add :alternate_starred_patina_color, Ncurses::COLOR_YELLOW, + Ncurses::COLOR_BLUE, Ncurses::A_BOLD c.add :snippet_color, Ncurses::COLOR_CYAN, Ncurses::COLOR_BLACK c.add :option_color, Ncurses::COLOR_WHITE, Ncurses::COLOR_BLACK c.add :tagged_color, Ncurses::COLOR_YELLOW, Ncurses::COLOR_BLACK, diff --git a/doc/TODO b/doc/TODO index 0876942..83c22bb 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,13 +1,11 @@ for 0.0.8 --------- _ split out threading & message chunk parsing to a separate library -_ ferret upgrade script (dump & restore) _ nice little startup config program _ bugfix: when one new message comes into an imap folder, we don't catch it until a reload _ bugfix: triggering a pageup when cursor scrolling up jumps to the bottom of the page rather than the next line -_ bugfix: stars on messages with blue backgrounds still have green bgs _ bugfix: m in thread-view-mode when a person is not selected should open up a blank compose-mode rather than do nothing _ Net::SMTP support (cuz I'm going to need it soon) @@ -15,6 +13,8 @@ _ bugfix: add new message counts until keypress _ bugfix: attachment filenames sometimes not detected (filename=) _ bugfix: final logging messages to stdout? _ bugfix: mbox directory shouldn't generate an exception, just an error +x bugfix: stars on messages with blue backgrounds still have green bgs +x ferret upgrade script (dump & restore) x bugfix: mark messages as read immediately when t-v-m is opened x compose in thread-view-mode auto-fills in person x bugfix: 'N' in thread-view-mode (expand only new messages) crashes diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb index 3ef7d81..fc6b720 100644 --- a/lib/sup/modes/thread-view-mode.rb +++ b/lib/sup/modes/thread-view-mode.rb @@ -3,7 +3,7 @@ module Redwood class ThreadViewMode < LineCursorMode ## this holds all info we need to lay out a message class Layout - attr_accessor :top, :bot, :prev, :next, :depth, :width, :state, :color, :orig_new + attr_accessor :top, :bot, :prev, :next, :depth, :width, :state, :color, :star_color, :orig_new end DATE_FORMAT = "%B %e %Y %l:%M%P" @@ -53,6 +53,7 @@ class ThreadViewMode < LineCursorMode @layout[m] = Layout.new @layout[m].state = initial_state_for m @layout[m].color = altcolor ? :alternate_patina_color : :message_patina_color + @layout[m].star_color = altcolor ? :alternate_starred_patina_color : :starred_patina_color @layout[m].orig_new = m.has_label? :unread altcolor = !altcolor if latest_date.nil? || m.date > latest_date @@ -297,7 +298,7 @@ private l = @layout[m] or next # TODO: figure out why this is nil sometimes ## build the patina - text = chunk_to_lines m, l.state, @text.length, depth, parent, @layout[m].color + text = chunk_to_lines m, l.state, @text.length, depth, parent, @layout[m].color, @layout[m].star_color l.top = @text.length l.bot = @text.length + text.length # updated below @@ -334,7 +335,7 @@ private end end - def message_patina_lines m, state, start, parent, prefix, color + def message_patina_lines m, state, start, parent, prefix, color, star_color prefix_widget = [color, prefix] widget = case state @@ -345,7 +346,7 @@ private end imp_widget = if m.has_label?(:starred) - [:starred_patina_color, "* "] + [star_color, "* "] else [color, " "] end @@ -405,7 +406,7 @@ private p.longname + (ContactManager.is_contact?(p) ? " (#{ContactManager.alias_for p})" : "") end - def chunk_to_lines chunk, state, start, depth, parent=nil, color=nil + def chunk_to_lines chunk, state, start, depth, parent=nil, color=nil, star_color=nil prefix = " " * INDENT_SPACES * depth case chunk when :fake_root @@ -413,7 +414,7 @@ private when nil [[[:missing_message_color, "#{prefix}"]]] when Message - message_patina_lines(chunk, state, start, parent, prefix, color) + + message_patina_lines(chunk, state, start, parent, prefix, color, star_color) + (chunk.is_draft? ? [[[:draft_notification_color, prefix + " >>> This message is a draft. To edit, hit 'e'. <<<"]]] : []) when Message::Attachment [[[:mime_color, "#{prefix}+ MIME attachment #{chunk.content_type}#{chunk.desc ? ' (' + chunk.desc + ')': ''}"]]]