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

Daniel Burrows dburrows@costa.debian.org
Tue, 26 Apr 2005 00:55:49 +0000


Author: dburrows
Date: Tue Apr 26 00:55:46 2005
New Revision: 3087

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/solution_dialog.cc
Log:
Display the solution examination dialog in inverse video, like other
dialog boxes.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Apr 26 00:55:46 2005
@@ -1,5 +1,9 @@
 2005-04-25  Daniel Burrows  <dburrows@debian.org>
 
+	* src/solution_dialog:
+
+	  Make the dialog "dialog colored" in the usual hacky way.
+
 	* src/solution_dialog.cc, src/ui.cc, src/ui.h:
 
 	  Add some pushable buttons to issue solution-viewing commands.

Modified: branches/aptitude-0.3/aptitude/src/solution_dialog.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/solution_dialog.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/solution_dialog.cc	Tue Apr 26 00:55:46 2005
@@ -23,6 +23,7 @@
 
 #include <aptitude.h>
 
+#include <vscreen/config/colors.h>
 #include <vscreen/config/keybindings.h>
 #include <vscreen/fragment.h>
 #include <vscreen/vs_button.h>
@@ -60,6 +61,8 @@
     cache_closed.connect(sigc::mem_fun(*this, &solution_dialog::update));
     cache_reloaded.connect(sigc::mem_fun(*this, &solution_dialog::handle_cache_reload));
 
+    set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
+
     update();
   }
 
@@ -67,7 +70,7 @@
   {
     if(!apt_cache_file)
       {
-	set_fragment(fragf("%s", _("The package cache is not available.")));
+	set_fragment(fragf("%R%s", _("The package cache is not available.")));
 	last_sol.nullify();
 	return;
       }
@@ -75,7 +78,7 @@
     if(!(*apt_cache_file)->resolver_exists())
       {
 	// This makes ASS-U-MPTIONS about how resolver_exists works.
-	set_fragment(fragf("%s", _("No packages are broken.")));
+	set_fragment(fragf("%R%s", _("No packages are broken.")));
 	last_sol.nullify();
 	return;
       }
@@ -90,17 +93,18 @@
 	last_sol=sol;
 
 	if(sol.get_actions().empty())
-	  set_fragment(fragf(_("Internal error: unexpected null solution.")));
+	  set_fragment(fragf("%R%s", _("Internal error: unexpected null solution.")));
 	else
-	  set_fragment(solution_fragment(sol));
+	  set_fragment(attr_fragment(solution_fragment(sol),
+				     get_color("DefaultWidgetBackground") | A_REVERSE));
       }
     catch(NoMoreSolutions)
       {
-	set_fragment(fragf(_("No resolution found.")));
+	set_fragment(fragf("%R%s", _("No resolution found.")));
       }
     catch(NoMoreTime)
       {
-	set_fragment(fragf(_("Time exhausted while searching for a solution (you can select \"Next Solution\" or press %s to try harder)."),
+	set_fragment(fragf(_("%RTime exhausted while searching for a solution (you can select \"Next Solution\" or press %s to try harder)."),
 			   global_bindings.keyname("NextSolution").c_str()));
       }
   }
@@ -116,6 +120,8 @@
 		     vs_table::EXPAND | vs_table::FILL,
 		     vs_table::FILL | vs_table::SHRINK);
 
+  t->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
+
   // TODO: for dialogs like this, I really should have support for
   // "wrapping" lines of buttons if they get too long, like fragments.
   vs_button *bprev=new vs_button(_("Previous"));
@@ -131,6 +137,11 @@
   bclose->pressed.connect(sigc::mem_fun(rval,
 					&vscreen_widget::destroy));
 
+  bprev->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
+  bnext->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
+  bapply->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
+  bclose->set_bg(get_color("DefaultWidgetBackground")|A_REVERSE);
+
   t->add_widget_opts(bprev,
 		     1, 0, 1, 1,
 		     vs_table::FILL, vs_table::FILL);