[Aptitude-svn-commit] r4127 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows at costa.debian.org
Tue Sep 20 05:48:29 UTC 2005


Author: dburrows
Date: Tue Sep 20 05:48:25 2005
New Revision: 4127

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/solution_screen.cc
Log:
Make pushing Enter on a solution item pop up the corresponding package (what I generally want).

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Sep 20 05:48:25 2005
@@ -1,5 +1,11 @@
 2005-09-19  Daniel Burrows  <dburrows at debian.org>
 
+	* src/solutions_screen.cc:
+
+	  Make pressing Enter (or whatever is bound to InfoScreen) on an
+	  action solution item pop up the information screen about the
+	  corresponding version.
+
 	* doc/en/aptitude.xml, src/cmdline/cmdline_resolver.cc:
 
 	  Make the version score tweaking default to 0.

Modified: branches/aptitude-0.3/aptitude/src/solution_screen.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/solution_screen.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/solution_screen.cc	Tue Sep 20 05:48:25 2005
@@ -20,7 +20,9 @@
 #include "solution_screen.h"
 
 #include "aptitude.h"
+#include "pkg_info_screen.h"
 #include "solution_fragment.h"
+#include "ui.h"
 
 #include <generic/aptitude_resolver_universe.h>
 #include <generic/problemresolver/exceptions.h>
@@ -279,6 +281,30 @@
     return ver;
   }
 
+  bool dispatch_key(const key &k, vs_tree *owner)
+  {
+    if(global_bindings.key_matches(k, "InfoScreen"))
+      {
+	pkgCache::VerIterator real_ver = ver.get_ver();
+	pkgCache::PkgIterator pkg = ver.get_pkg();
+
+	if(real_ver.end())
+	  real_ver = ver.get_package().current_version().get_ver();
+
+	if(real_ver.end())
+	  real_ver = pkg.VersionList();
+
+	// Show information about the corresponding package/version.
+	insert_main_widget(make_info_screen(pkg, real_ver),
+			   ssprintf(_("%s info"), pkg.Name()),
+			   "",
+			   ssprintf(_("Information about %s"), pkg.Name()));
+	return true;
+      }
+    else
+      return solution_item::dispatch_key(k, owner);
+  }
+
   void paint(vs_tree *win, int y, bool hierarchical, const style &st)
   {
     unsigned int basex = hierarchical ? 2*get_depth() : 0;



More information about the Aptitude-svn-commit mailing list