Hi!

I'd like to add the following patch that allows to specify an icon for the 
hardware detection confirmation dialog. Unfortunatelly, this means the 
Confirm module API will change. 

The new API is:

boolean Confirm::Detection(string class, string icon_name)

If the icon_name is nil, a fallback icon will be used (yast-hardware).

I will adapt all modules that reference the API in trunk (network, sound, tv, 
tune).

Any objections to commit?

Stano
Index: Confirm.ycp
===================================================================
--- Confirm.ycp	(revision 51750)
+++ Confirm.ycp	(working copy)
@@ -18,6 +18,7 @@
 
 textdomain "base";
 
+import "Icon";
 import "Label";
 import "Mode";
 import "Popup";
@@ -30,12 +31,18 @@
 /**
  * Confirm hardware detection (only in manual installation)
  * @param class hardware class (network cards)
+ * @param icon_name name of the icon. If nil, generic hardware icon will be used
  * @return true on continue
  */
-global define boolean Detection(string class) ``{
+global define boolean Detection(string class, string icon_name) ``{
 
     if(Linuxrc::manual () != true) return true;
 
+    if( icon_name == nil ) 
+	icon_name = "yast-hardware";
+
+    term icon    = Icon::Image ( icon_name, $[] );
+
     boolean result = detection_cache[class]:nil;
     if (result != nil) {
 	y2milestone ("Detection cached result: %1 -> %2", class, result);
@@ -62,7 +69,7 @@
 		// This is in information message. Next come the
 		// hardware class name (network cards).
 		`HVCenter(`Label(_("YaST2 will detect the following hardware:"))),
-		`HVCenter(`Heading(class)),
+		`HVCenter(`HBox(icon, `HSpacing(0.5), `Heading(class))),
 		`VSpacing(0.5)
 	    ))),
 	    `ButtonBox (

Reply via email to