[Aptitude-devel] r3050 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows@costa.debian.org
Sat, 23 Apr 2005 00:14:11 +0000


Author: dburrows
Date: Sat Apr 23 00:14:08 2005
New Revision: 3050

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/broken_indicator.cc
Log:
Display keeps too...we're in business now!

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sat Apr 23 00:14:08 2005
@@ -1,5 +1,10 @@
 2005-04-22  Daniel Burrows  <dburrows@debian.org>
 
+	* src/broken_indicator.cc:
+
+	  Also display keeps, don't display ungrammatical text for
+	  singular actions, and move the key hints to the next line.
+
 	* src/pkg_view.cc, src/ui.cc:
 
 	  Move the broken indicator into the status bar area.

Modified: branches/aptitude-0.3/aptitude/src/broken_indicator.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/broken_indicator.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/broken_indicator.cc	Sat Apr 23 00:14:08 2005
@@ -143,38 +143,55 @@
 
 	    char buf[512];
 
-	    if(install_count>0)
+	    if(install_count>1)
 	      {
 		snprintf(buf, 512, _("%d installs"),
 			 install_count);
 		suggestions.push_back(text_fragment(buf));
 	      }
+	    else if(install_count == 1)
+	      suggestions.push_back(text_fragment(_("1 install")));
 
-	    if(remove_count>0)
+	    if(remove_count>1)
 	      {
 		snprintf(buf, 512, _("%d removals"),
 			 remove_count);
 		suggestions.push_back(text_fragment(buf));
 	      }
+	    else if(remove_count == 1)
+	      suggestions.push_back(text_fragment(_("1 removal")));
 
-	    if(upgrade_count>0)
+	    if(keep_count>1)
+	      {
+		snprintf(buf, 512, _("%d keeps"),
+			 keep_count);
+		suggestions.push_back(text_fragment(buf));
+	      }
+	    else if(keep_count == 1)
+	      suggestions.push_back(text_fragment(_("1 keep")));
+
+	    if(upgrade_count>1)
 	      {
 		snprintf(buf, 512, _("%d upgrades"),
 			 upgrade_count);
 		suggestions.push_back(text_fragment(buf));
 	      }
+	    else if(upgrade_count == 1)
+	      suggestions.push_back(text_fragment(_("1 upgrade")));
 
-	    if(downgrade_count>0)
+	    if(downgrade_count>1)
 	      {
 		snprintf(buf, 512, _("%d downgrades"),
 			 upgrade_count);
 		suggestions.push_back(text_fragment(buf));
 	      }
+	    else if(downgrade_count == 1)
+	      suggestions.push_back(text_fragment(_("1 downgrade")));
 
 	    fragments.push_back(join_fragments(suggestions,
 					       ","));
 
-	    fragments.push_back(fragf("  "));
+	    fragments.push_back(newline_fragment());
 
 	    vector<fragment *> key_hints;
 
@@ -192,7 +209,7 @@
 
 	    fragment *f=sequence_fragment(fragments);
 	    f->set_attr(get_color("Error"));
-	    set_fragment(f);
+	    set_fragment(hardwrapbox(f));
 	  }
       }
     catch(NoMoreTime)