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

Daniel Burrows dburrows@costa.debian.org
Wed, 27 Apr 2005 12:30:23 +0000


Author: dburrows
Date: Wed Apr 27 12:30:20 2005
New Revision: 3139

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/vs_util.cc
   branches/aptitude-0.3/aptitude/src/vscreen/vs_util.h
Log:
Allow raw fragments to be passed into vs_dialog_string.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Wed Apr 27 12:30:20 2005
@@ -1,5 +1,10 @@
 2005-04-27  Daniel Burrows  <dburrows@debian.org>
 
+	* src/vscreen/vs_util.cc, src/vscreen/vs_util.h:
+
+	  Add a vs_dialog_string variant that allows raw fragments to be
+	  passed.
+
 	* src/download_bar.cc, src/download_list.cc:
 
 	  Word the question less awkwardly.

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_util.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_util.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_util.cc	Wed Apr 27 12:30:20 2005
@@ -315,7 +315,7 @@
   thestrslot(e->get_text());
 }
 
-vscreen_widget *vs_dialog_string(string msg,
+vscreen_widget *vs_dialog_string(vscreen_widget *msg,
 				 string deflt,
 				 slotarg<sigc::slot1<void, string> > slot,
 				 slotarg<sigc::slot0<void> > cancel_slot,
@@ -324,19 +324,18 @@
 				 int attr)
 {
   vs_table *t=new vs_table;
-  vs_label *l=new vs_label(msg, attr);
   vs_editline *e=new vs_editline(rootwin.getmaxx()-6, "", deflt, history);
   vs_button *bok=new vs_button(_("Ok")), *bcancel=new vs_button(_("Cancel"));
   vs_frame *f=new vs_frame(t);
   vs_center *c=new vs_center(f);
 
-  l->set_bg(attr);
+  msg->set_bg(attr);
   f->set_bg(attr);
   t->set_bg(attr);
   bok->set_bg(attr);
   bcancel->set_bg(attr);
 
-  t->add_widget(l, 0, 0, 1, 2);
+  t->add_widget(msg, 0, 0, 1, 2);
   t->add_widget(e, 1, 0, 1, 2);
   t->add_widget_opts(bok, 2, 0, 1, 1,
 		     vs_table::ALIGN_CENTER|vs_table::SHRINK,
@@ -365,6 +364,40 @@
   return c;
 }
 
+vscreen_widget *vs_dialog_string(fragment *msg,
+				 string deflt,
+				 slotarg<sigc::slot1<void, string> > slot,
+				 slotarg<sigc::slot0<void> > cancel_slot,
+				 slotarg<sigc::slot1<void, string> > changed_slot,
+				 vs_editline::history_list *history,
+				 int attr)
+{
+  return vs_dialog_string(new vs_label(msg),
+			  deflt,
+			  slot,
+			  cancel_slot,
+			  changed_slot,
+			  history,
+			  attr);
+}
+
+vscreen_widget *vs_dialog_string(string msg,
+				 string deflt,
+				 slotarg<sigc::slot1<void, string> > slot,
+				 slotarg<sigc::slot0<void> > cancel_slot,
+				 slotarg<sigc::slot1<void, string> > changed_slot,
+				 vs_editline::history_list *history,
+				 int attr)
+{
+  return vs_dialog_string(new vs_label(msg, attr),
+			  deflt,
+			  slot,
+			  cancel_slot,
+			  changed_slot,
+			  history,
+			  attr);
+}
+
 vscreen_widget *vs_dialog_string(string msg,
 				 string deflt,
 				 slotarg<sigc::slot1<void, string> > slot,

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_util.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_util.h	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_util.h	Wed Apr 27 12:30:20 2005
@@ -117,6 +117,14 @@
 				   slotarg<sigc::slot1<void, vs_pager *> > searchslot,
 				   int attr);
 
+vscreen_widget *vs_dialog_string(fragment *msg,
+				 std::string deflt,
+				 slotarg<sigc::slot1<void, std::string> > okslot,
+				 slotarg<sigc::slot0<void> > cancel_slot,
+				 slotarg<sigc::slot1<void, std::string> > changed_slot,
+				 vs_editline::history_list *history,
+				 int attr);
+
 vscreen_widget *vs_dialog_string(std::string msg,
 				 std::string deflt,
 				 slotarg<sigc::slot1<void, std::string> > okslot,
@@ -124,6 +132,7 @@
 				 slotarg<sigc::slot1<void, std::string> > changed_slot,
 				 vs_editline::history_list *history,
 				 int attr);
+
 vscreen_widget *vs_dialog_string(std::string msg,
 				 std::string deflt,
 				 slotarg<sigc::slot1<void, std::string> > slot,