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

Daniel Burrows dburrows@costa.debian.org
Sun Jul 3 17:50:54 UTC 2005


Author: dburrows
Date: Sun Jul  3 17:50:51 2005
New Revision: 3587

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/ui.cc
Log:
Update ui.cc to handle the new pager API.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sun Jul  3 17:50:51 2005
@@ -1,5 +1,10 @@
 2005-07-03  Daniel Burrows  <dburrows@debian.org>
 
+	* src/ui.cc:
+
+	  Fix various places in the ui glue code to handle the new pager
+	  API.
+
 	* src/vscreen/vs_pager.cc, src/vscreen/vs_pager.h:
 
 	  Allow the encoding to be specified when a vs_pager is created

Modified: branches/aptitude-0.3/aptitude/src/ui.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/ui.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/ui.cc	Sun Jul  3 17:50:51 2005
@@ -181,19 +181,12 @@
   return sequence_fragment(frags);
 }
 
-// Search callback
-static void pager_do_search(const std::wstring &s, vs_pager *p)
-{
-  // FIXME: the pager should be converted to use wide characters.
-  p->search_for(transcode(s));
-}
-
 // Handles "search" dialogs for pagers
 static void pager_search(vs_pager *p)
 {
-  prompt_string(_("Search for:"),
+  prompt_string(transcode(_("Search for:")),
 		p->get_last_search(),
-		arg(sigc::bind(sigc::ptr_fun(pager_do_search), p)),
+		arg(sigc::mem_fun(*p, &vs_pager::search_for)),
 		NULL,
 		NULL,
 		NULL);
@@ -684,9 +677,14 @@
 
   snprintf(buf, 512, HELPDIR "/%s", _("help.txt"));
 
+  const char *encoding=P_("Encoding of help.txt|UTF-8");
+
   // Deal with missing localized docs.
   if(access(buf, R_OK)!=0)
-    strncpy(buf, HELPDIR "/help.txt", 512);
+    {
+      strncpy(buf, HELPDIR "/help.txt", 512);
+      encoding="UTF-8";
+    }
 
   vscreen_widget *w=vs_dialog_fileview(buf, NULL, arg(sigc::ptr_fun(pager_search)));
   w->show_all();




More information about the Aptitude-svn-commit mailing list