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

Daniel Burrows dburrows@costa.debian.org
Sat, 02 Jul 2005 14:15:34 +0000


Author: dburrows
Date: Sat Jul  2 14:15:31 2005
New Revision: 3538

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/download_screen.cc
   branches/aptitude-0.3/aptitude/src/download_screen.h
Log:
Update the download-screen class for wide characters.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sat Jul  2 14:15:31 2005
@@ -1,5 +1,9 @@
 2005-07-02  Daniel Burrows  <dburrows@debian.org>
 
+	* src/download_screen.cc, src/download_screen.h:
+
+	  Update the download-screen class for wide characters.
+
 	* src/download_item.cc, src/download_item.h:
 
 	  Update the download-item class for wide characters.

Modified: branches/aptitude-0.3/aptitude/src/download_screen.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/download_screen.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/download_screen.cc	Sat Jul  2 14:15:31 2005
@@ -31,6 +31,7 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/acquire-worker.h>
 
+#include <vscreen/transcode.h>
 #include <vscreen/vscreen.h>
 #include <vscreen/vs_util.h>
 
@@ -57,7 +58,8 @@
 	   _("Please insert the disc labeled \"%s\" into the drive \"%s\""),
 	   Media.c_str(), Drive.c_str());
 
-  popup_widget(vs_dialog_ok(buf, arg(sigc::ptr_fun(vscreen_exitmain)),
+  popup_widget(vs_dialog_ok(transcode(buf),
+			    arg(sigc::ptr_fun(vscreen_exitmain)),
 			    get_style("MediaChange")));
 
   CRITICAL_EXIT
@@ -180,7 +182,8 @@
 
   snprintf(buf, 256, _("Downloaded %sB in %ss (%sB/s)."), SizeToStr(FetchedBytes).c_str(), TimeToStr(ElapsedTime).c_str(), SizeToStr(CurrentCPS).c_str());
 
-  popup_widget(vs_dialog_ok(buf, arg(sigc::ptr_fun(vscreen_exitmain))));
+  popup_widget(vs_dialog_ok(transcode(buf),
+			    arg(sigc::ptr_fun(vscreen_exitmain))));
 
   CRITICAL_EXIT
 
@@ -230,12 +233,12 @@
 }
 #endif
 
-bool download_screen::handle_char(chtype ch)
+bool download_screen::handle_key(const key &k)
 {
-  if(global_bindings.key_matches(ch, "Quit"))
+  if(global_bindings.key_matches(k, "Quit"))
     cancelled=true;
   else
-    return vs_tree::handle_char(ch);
+    return vs_tree::handle_key(k);
 
   return true;
 }

Modified: branches/aptitude-0.3/aptitude/src/download_screen.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/download_screen.h	(original)
+++ branches/aptitude-0.3/aptitude/src/download_screen.h	Sat Jul  2 14:15:31 2005
@@ -61,9 +61,9 @@
   download_tree():vs_subtree_generic(true) {}
 
   void paint(vs_tree *win, int y, bool hierarchical, const style &style)
-  {vs_subtree_generic::paint(win, y, hierarchical, "ERROR: SHOULD NOT APPEAR");}
-  const char * tag() const {return "download tree";}
-  const char * label() const {return "download tree";}
+  {vs_subtree_generic::paint(win, y, hierarchical, L"ERROR: SHOULD NOT APPEAR");}
+  const wchar_t * tag() {return L"download tree";}
+  const wchar_t * label() {return L"download tree";}
 };
 
 class download_screen:public vs_tree, public pkgAcquireStatus
@@ -95,7 +95,7 @@
   }
 
 protected:
-  bool handle_char(chtype ch);
+  bool handle_key(const key &k);
 
 public:
   download_screen():prev(NULL),finished(false),cancelled(false) {contents=new download_tree; set_root(contents);}