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

Daniel Burrows dburrows@costa.debian.org
Thu Jul 7 15:36:32 UTC 2005


Author: dburrows
Date: Thu Jul  7 15:36:29 2005
New Revision: 3632

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/view_changelog.cc
Log:
Add support for searching for text in the changelog viewer.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Thu Jul  7 15:36:29 2005
@@ -1,3 +1,9 @@
+2005-07-07  Daniel Burrows  <dburrows@debian.org>
+
+	* src/view_changelog.cc:
+
+	  Add support for searching for text in the changelog viewer.
+
 2005-07-05 Rubén Porras <nahoo@inicia.es>
 
 	* New spanish help file help-es.txt

Modified: branches/aptitude-0.3/aptitude/src/view_changelog.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/view_changelog.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/view_changelog.cc	Thu Jul  7 15:36:29 2005
@@ -18,6 +18,8 @@
 //   Boston, MA 02111-1307, USA.
 
 #include <vscreen/config/colors.h>
+#include <vscreen/config/keybindings.h>
+#include <vscreen/transcode.h>
 #include <vscreen/vs_pager.h>
 #include <vscreen/vs_scrollbar.h>
 #include <vscreen/vs_table.h>
@@ -38,10 +40,30 @@
 // Needed to make sure the changelog is properly cleaned up.
 {
   pkg_changelog *cl;
+
+
+  void do_search()
+  {
+    prompt_string(transcode(_("Search for:")),
+		  L"",
+		  arg(sigc::mem_fun(*this, &vs_pager::search_for)),
+		  NULL,
+		  NULL,
+		  NULL);
+  }
+
+  void do_repeat_search()
+  {
+    search_for(L"");
+  }
 public:
   pkg_changelog_screen(pkg_changelog *_cl, vscreen_widget *owner=NULL, int x=0, int y=0, int width=0, int height=0):
     vs_file_pager(_cl->get_filename()),cl(_cl)
   {
+    connect_key("Search", &global_bindings,
+		sigc::mem_fun(*this, &pkg_changelog_screen::do_search));
+    connect_key("ReSearch", &global_bindings,
+		sigc::mem_fun(*this, &pkg_changelog_screen::do_repeat_search));
   }
 
   virtual ~pkg_changelog_screen() {delete cl;}




More information about the Aptitude-svn-commit mailing list