[gnome-boxes] wizard: Present OS logos



commit b1810a7ff1dbbc5e174392351ec5f60fbb1b35c8
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat Feb 11 06:31:38 2012 +0200

    wizard: Present OS logos
    
    If we have the logo for an OS, use it to represent it at the 'Source' and
    'Preparation' pages. Because of legal implications we must get explicit
    permissions from each OS vendor to use and ship their logo.
    
    Thanks to Karen Sandler and Fedora legal for prompt action on prividing
    detailed but clear advice on usage of trademarks and logos. The following
    email nicely summarizes the whole issue with trademark usage:
    
    http://lists.fedoraproject.org/pipermail/advisory-board/2012-February/011360.html
    
    Currently we have Debian, Fedora and Ubuntu logos. We have been given
    explicit permission for each logo by their respective trademark owners
    except for Debian's, for which its policy seems too liberal to require
    any permission: http://www.debian.org/logos/
    
    Hopefully we'll soon have the permission to use Red Hat logo too. If
    someone can tell me who and how to contact for Windows logos, do let me
    know please.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=670003

 data/gtk-style.css         |    5 +++
 data/icons/Makefile.am     |    3 ++
 data/icons/debianbuzz.svg  |   86 ++++++++++++++++++++++++++++++++++++++++++++
 data/icons/fedora1.svg     |   21 +++++++++++
 data/icons/ubuntuhardy.svg |   27 ++++++++++++++
 src/util.vala              |   45 +++++++++++++++++++++++
 src/wizard-source.vala     |    7 +++-
 src/wizard.vala            |   15 ++++++--
 8 files changed, 204 insertions(+), 5 deletions(-)
---
diff --git a/data/gtk-style.css b/data/gtk-style.css
index ff83949..2b70788 100644
--- a/data/gtk-style.css
+++ b/data/gtk-style.css
@@ -48,6 +48,11 @@
     color: #d8d8d8;
 }
 
+.boxes-logo-notice-label {
+    color: #989898;
+    font-style: italic;
+}
+
 .boxes-source-label {
     font-size: 11;
     font-weight: bold;
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index 1de9a4e..80ce456 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -27,6 +27,9 @@ imagesdir = $(datadir)/gnome-boxes/pixmaps
 images_DATA =					\
 	boxes-create.png			\
 	boxes-grid.png				\
+	debianbuzz.svg				\
+	fedora1.svg				\
+	ubuntuhardy.svg				\
 	$(NULL)
 
 EXTRA_DIST =					\
diff --git a/data/icons/debianbuzz.svg b/data/icons/debianbuzz.svg
new file mode 100644
index 0000000..5fa3e1f
--- /dev/null
+++ b/data/icons/debianbuzz.svg
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 10.0, SVG Export Plug-In . SVG Version: 3.0.0 Build 77)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"    "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"; [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/";>
+	<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/";>
+	<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/";>
+	<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/";>
+	<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/";>
+	<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/";>
+	<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/";>
+	<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/";>
+	<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/";>
+	<!ENTITY ns_svg "http://www.w3.org/2000/svg";>
+	<!ENTITY ns_xlink "http://www.w3.org/1999/xlink";>
+]>
+<svg 
+	 xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" i:viewOrigin="262 450" i:rulerOrigin="0 0" i:pageBounds="0 792 612 0"
+	 xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/";
+	 width="87.041" height="108.445" viewBox="0 0 87.041 108.445" overflow="visible" enable-background="new 0 0 87.041 108.445"
+	 xml:space="preserve">
+	<metadata>
+		<variableSets  xmlns="&ns_vars;">
+			<variableSet  varSetName="binding1" locked="none">
+				<variables></variables>
+				<v:sampleDataSets  xmlns="&ns_custom;" xmlns:v="&ns_vars;"></v:sampleDataSets>
+			</variableSet>
+		</variableSets>
+		<sfw  xmlns="&ns_sfw;">
+			<slices></slices>
+			<sliceSourceBounds  y="341.555" x="262" width="87.041" height="108.445" bottomLeftOrigin="true"></sliceSourceBounds>
+		</sfw>
+	</metadata>
+	<g id="Layer_1" i:layer="yes" i:dimmedPercent="50" i:rgbTrio="#4F008000FFFF">
+		<g>
+			<path i:knockout="Off" fill="#D70751" d="M51.986,57.297c-1.797,0.025,0.34,0.926,2.686,1.287
+				c0.648-0.506,1.236-1.018,1.76-1.516C54.971,57.426,53.484,57.434,51.986,57.297"/>
+			<path i:knockout="Off" fill="#D70751" d="M61.631,54.893c1.07-1.477,1.85-3.094,2.125-4.766c-0.24,1.192-0.887,2.221-1.496,3.307
+				c-3.359,2.115-0.316-1.256-0.002-2.537C58.646,55.443,61.762,53.623,61.631,54.893"/>
+			<path i:knockout="Off" fill="#D70751" d="M65.191,45.629c0.217-3.236-0.637-2.213-0.924-0.978
+				C64.602,44.825,64.867,46.932,65.191,45.629"/>
+			<path i:knockout="Off" fill="#D70751" d="M45.172,1.399c0.959,0.172,2.072,0.304,1.916,0.533
+				C48.137,1.702,48.375,1.49,45.172,1.399"/>
+			<path i:knockout="Off" fill="#D70751" d="M47.088,1.932l-0.678,0.14l0.631-0.056L47.088,1.932"/>
+			<path i:knockout="Off" fill="#D70751" d="M76.992,46.856c0.107,2.906-0.85,4.316-1.713,6.812l-1.553,0.776
+				c-1.271,2.468,0.123,1.567-0.787,3.53c-1.984,1.764-6.021,5.52-7.313,5.863c-0.943-0.021,0.639-1.113,0.846-1.541
+				c-2.656,1.824-2.131,2.738-6.193,3.846l-0.119-0.264c-10.018,4.713-23.934-4.627-23.751-17.371
+				c-0.107,0.809-0.304,0.607-0.526,0.934c-0.517-6.557,3.028-13.143,9.007-15.832c5.848-2.895,12.704-1.707,16.893,2.197
+				c-2.301-3.014-6.881-6.209-12.309-5.91c-5.317,0.084-10.291,3.463-11.951,7.131c-2.724,1.715-3.04,6.611-4.227,7.507
+				C31.699,56.271,36.3,61.342,44.083,67.307c1.225,0.826,0.345,0.951,0.511,1.58c-2.586-1.211-4.954-3.039-6.901-5.277
+				c1.033,1.512,2.148,2.982,3.589,4.137c-2.438-0.826-5.695-5.908-6.646-6.115c4.203,7.525,17.052,13.197,23.78,10.383
+				c-3.113,0.115-7.068,0.064-10.566-1.229c-1.469-0.756-3.467-2.322-3.11-2.615c9.182,3.43,18.667,2.598,26.612-3.771
+				c2.021-1.574,4.229-4.252,4.867-4.289c-0.961,1.445,0.164,0.695-0.574,1.971c2.014-3.248-0.875-1.322,2.082-5.609l1.092,1.504
+				c-0.406-2.696,3.348-5.97,2.967-10.234c0.861-1.304,0.961,1.403,0.047,4.403c1.268-3.328,0.334-3.863,0.66-6.609
+				c0.352,0.923,0.814,1.904,1.051,2.878c-0.826-3.216,0.848-5.416,1.262-7.285c-0.408-0.181-1.275,1.422-1.473-2.377
+				c0.029-1.65,0.459-0.865,0.625-1.271c-0.324-0.186-1.174-1.451-1.691-3.877c0.375-0.57,1.002,1.478,1.512,1.562
+				c-0.328-1.929-0.893-3.4-0.916-4.88c-1.49-3.114-0.527,0.415-1.736-1.337c-1.586-4.947,1.316-1.148,1.512-3.396
+				c2.404,3.483,3.775,8.881,4.404,11.117c-0.48-2.726-1.256-5.367-2.203-7.922c0.73,0.307-1.176-5.609,0.949-1.691
+				c-2.27-8.352-9.715-16.156-16.564-19.818c0.838,0.767,1.896,1.73,1.516,1.881c-3.406-2.028-2.807-2.186-3.295-3.043
+				c-2.775-1.129-2.957,0.091-4.795,0.002c-5.23-2.774-6.238-2.479-11.051-4.217l0.219,1.023c-3.465-1.154-4.037,0.438-7.782,0.004
+				c-0.228-0.178,1.2-0.644,2.375-0.815c-3.35,0.442-3.193-0.66-6.471,0.122c0.808-0.567,1.662-0.942,2.524-1.424
+				c-2.732,0.166-6.522,1.59-5.352,0.295c-4.456,1.988-12.37,4.779-16.811,8.943l-0.14-0.933c-2.035,2.443-8.874,7.296-9.419,10.46
+				l-0.544,0.127c-1.059,1.793-1.744,3.825-2.584,5.67c-1.385,2.36-2.03,0.908-1.833,1.278c-2.724,5.523-4.077,10.164-5.246,13.97
+				c0.833,1.245,0.02,7.495,0.335,12.497c-1.368,24.704,17.338,48.69,37.785,54.228c2.997,1.072,7.454,1.031,11.245,1.141
+				c-4.473-1.279-5.051-0.678-9.408-2.197c-3.143-1.48-3.832-3.17-6.058-5.102l0.881,1.557c-4.366-1.545-2.539-1.912-6.091-3.037
+				l0.941-1.229c-1.415-0.107-3.748-2.385-4.386-3.646l-1.548,0.061c-1.86-2.295-2.851-3.949-2.779-5.23l-0.5,0.891
+				c-0.567-0.973-6.843-8.607-3.587-6.83c-0.605-0.553-1.409-0.9-2.281-2.484l0.663-0.758c-1.567-2.016-2.884-4.6-2.784-5.461
+				c0.836,1.129,1.416,1.34,1.99,1.533c-3.957-9.818-4.179-0.541-7.176-9.994l0.634-0.051c-0.486-0.732-0.781-1.527-1.172-2.307
+				l0.276-2.75C4.667,58.121,6.719,47.409,7.13,41.534c0.285-2.389,2.378-4.932,3.97-8.92l-0.97-0.167
+				c1.854-3.234,10.586-12.988,14.63-12.486c1.959-2.461-0.389-0.009-0.772-0.629c4.303-4.453,5.656-3.146,8.56-3.947
+				c3.132-1.859-2.688,0.725-1.203-0.709c5.414-1.383,3.837-3.144,10.9-3.846c0.745,0.424-1.729,0.655-2.35,1.205
+				c4.511-2.207,14.275-1.705,20.617,1.225c7.359,3.439,15.627,13.605,15.953,23.17l0.371,0.1
+				c-0.188,3.802,0.582,8.199-0.752,12.238L76.992,46.856"/>
+			<path i:knockout="Off" fill="#D70751" d="M32.372,59.764l-0.252,1.26c1.181,1.604,2.118,3.342,3.626,4.596
+				C34.661,63.502,33.855,62.627,32.372,59.764"/>
+			<path i:knockout="Off" fill="#D70751" d="M35.164,59.654c-0.625-0.691-0.995-1.523-1.409-2.352
+				c0.396,1.457,1.207,2.709,1.962,3.982L35.164,59.654"/>
+			<path i:knockout="Off" fill="#D70751" d="M84.568,48.916l-0.264,0.662c-0.484,3.438-1.529,6.84-3.131,9.994
+				C82.943,56.244,84.088,52.604,84.568,48.916"/>
+			<path i:knockout="Off" fill="#D70751" d="M45.527,0.537C46.742,0.092,48.514,0.293,49.803,0c-1.68,0.141-3.352,0.225-5.003,0.438
+				L45.527,0.537"/>
+			<path i:knockout="Off" fill="#D70751" d="M2.872,23.219c0.28,2.592-1.95,3.598,0.494,1.889
+				C4.676,22.157,2.854,24.293,2.872,23.219"/>
+			<path i:knockout="Off" fill="#D70751" d="M0,35.215c0.563-1.728,0.665-2.766,0.88-3.766C-0.676,33.438,0.164,33.862,0,35.215"/>
+		</g>
+	</g>
+</svg>
diff --git a/data/icons/fedora1.svg b/data/icons/fedora1.svg
new file mode 100644
index 0000000..e4a0411
--- /dev/null
+++ b/data/icons/fedora1.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg"; version="1.0" 
+     x="0.0000000" y="0.0000000" width="252.32" height="252.32" 
+     viewBox="0 0 252.32 252.32" xml:space="preserve"
+     id="translucent-fedora-logo-with-radial-gradient">
+     <g id="main-group">
+         <g id="radial-gradient-group">
+
+             <radialGradient cx="115.89890" cy="133.10451" r="154.62019" fx="115.89890" fy="133.10451" id="radial-gradient" gradientUnits="userSpaceOnUse">
+                 <stop style="stop-color: #000000; stop-opacity: 0.0;" offset="0.0" id="translucent-stop-color"/>
+                 <stop style="stop-color: #0068c9; stop-opacity: 1.0;" offset="1.0" id="opaque-blue-stop-color"/>
+             </radialGradient>
+
+             <path d="M 252.31700,126.16300 C 252.31700,56.485000 195.83500,0.0000000 126.16000,0.0000000 C 56.517000,0.0000000 0.051000000,56.437000 0.0030000000,126.07200 L 0.0000000,126.06600 L 0.0000000,223.69600 L 0.0030000000,223.70400 C 0.041000000,239.51400 12.864000,252.31000 28.688000,252.31000 C 28.733000,252.31000 28.776000,252.30400 28.821000,252.30400 L 28.830000,252.31000 L 126.21100,252.31000 L 126.21100,252.31000 C 195.86100,252.28100 252.31700,195.82000 252.31700,126.16300 z " style="fill:url(#radial-gradient)" id="speech-bubble"/>
+         </g>
+         <g id="f-script">
+             <path d="M 163.20200,29.904000 C 130.49800,29.904000 103.98900,56.414000 103.98900,89.116000 C 103.98900,89.127000 103.98900,89.142000 103.98900,89.157000 L 103.98900,120.49600 L 72.746000,120.49600 C 72.741000,120.49600 72.741000,120.49600 72.738000,120.49600 C 40.035000,120.49600 13.526000,146.87700 13.526000,179.57700 C 13.526000,212.28200 40.036000,238.79100 72.738000,238.79100 C 105.43700,238.79100 131.94700,212.28200 131.94700,179.57700 C 131.94700,179.56500 131.94700,179.55400 131.94700,179.53600 L 131.94700,148.06700 L 163.18900,148.06700 C 163.19600,148.06700 163.19900,148.06700 163.20200,148.06700 C 195.90100,148.06700 222.41100,121.81600 222.41100,89.116000 C 222.41100,56.414000 195.90100,29.904000 163.20200,29.904000 z M 103.98900,179.63300 C 103.96400,196.86400 89.979000,210.83300 72.738000,210.83300 C 55.479000,210.83300 41.358000,196.84100 41.358000,179.58200 C 41.358000,162.31700 55.479000,148.06600 72.738000,148.06600 C 72.752000,148.06600 72.76
 6000,148.06600 72.779000,148.06600 L 99.558000,148.06600 C 99.567000,148.06600 99.572000,148.06600 99.578000,148.06600 C 102.01600,148.06600 103.99300,150.03900 103.99300,152.47300 C 103.99300,152.47800 103.99000,152.47800 103.99000,152.48400 L 103.99000,179.63300 L 103.98900,179.63300 z M 163.19900,120.49600 C 163.18900,120.49600 163.17900,120.49600 163.17000,120.49600 L 136.37300,120.49600 C 136.36700,120.49600 136.36000,120.49600 136.35700,120.49600 C 133.91900,120.49600 131.94700,118.52400 131.94700,116.08400 L 131.94700,116.08300 L 131.94700,89.065000 C 131.97600,71.824000 145.95700,57.860000 163.19900,57.860000 C 180.45800,57.860000 194.58200,71.853000 194.58200,89.115000 C 194.58200,106.37500 180.45800,120.49600 163.19900,120.49600 z " style="fill:#0a57a4" id="f-script-path"/>
+         </g>
+         <path d="M 103.98900,120.49600 L 103.98900,89.156000 C 103.98900,89.142000 103.98900,89.127000 103.98900,89.115000 C 103.98900,56.413000 130.49800,29.903000 163.20200,29.903000 C 168.16300,29.903000 171.68800,30.462000 176.28000,31.664000 C 182.97700,33.420000 188.44600,38.906000 188.44900,45.292000 C 188.45200,53.012000 182.84800,58.624000 174.47300,58.624000 C 170.48300,58.624000 169.04100,57.860000 163.19900,57.860000 C 145.95700,57.860000 131.97600,71.824000 131.94700,89.065000 L 131.94700,116.08200 L 131.94700,116.08300 C 131.94700,118.52300 133.91900,120.49500 136.35700,120.49500 C 136.36000,120.49500 136.36700,120.49500 136.37300,120.49500 L 156.89500,120.49500 C 164.54300,120.49500 170.71900,126.61800 170.72500,134.28600 C 170.72500,141.95700 164.54000,148.06600 156.89500,148.06600 L 131.94700,148.06600 L 131.94700,179.53500 C 131.94700,179.55300 131.94700,179.56400 131.94700,179.58200 C 131.94700,212.28100 105.43700,238.79000 72.738000,238.79000 C 67.776000
 ,238.79000 64.251000,238.23100 59.659000,237.02800 C 52.962000,235.27300 47.491000,229.78400 47.488000,223.40000 C 47.488000,215.68200 53.088000,210.06800 61.467000,210.06800 C 65.453000,210.06800 66.899000,210.83300 72.738000,210.83300 C 89.980000,210.83300 103.96500,196.86800 103.99200,179.63300 C 103.99200,179.63300 103.99200,152.47900 103.99200,152.47400 C 103.99200,150.03900 102.01500,148.06700 99.577000,148.06700 C 99.574000,148.06700 99.571000,148.06700 99.566000,148.06700 L 79.045000,148.06700 C 71.395000,148.06700 65.214000,141.96400 65.214000,134.29100 C 65.212000,126.57500 71.459000,120.49700 79.190000,120.49700 L 103.98900,120.49700 L 103.98900,120.49600 z " style="fill:#ffffff" id="blue-inifity-connectors"/>
+     </g>
+ </svg>
diff --git a/data/icons/ubuntuhardy.svg b/data/icons/ubuntuhardy.svg
new file mode 100644
index 0000000..2d904e8
--- /dev/null
+++ b/data/icons/ubuntuhardy.svg
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"; [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/";>
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/";
+	 x="0px" y="0px" width="285px" height="285px" viewBox="-0.866 -0.866 285 285" enable-background="new -0.866 -0.866 285 285"
+	 xml:space="preserve">
+<defs>
+</defs>
+<path fill="#DD4814" d="M283.465,141.734c0,78.273-63.457,141.73-141.734,141.73S0,220.008,0,141.734C0,63.455,63.453,0,141.73,0
+	S283.465,63.455,283.465,141.734z"/>
+<path fill="#FFFFFF" d="M45.356,122.812c-10.453,0-18.923,8.47-18.923,18.923c0,10.449,8.47,18.92,18.923,18.92
+	c10.449,0,18.92-8.471,18.92-18.92C64.276,131.281,55.806,122.812,45.356,122.812z M180.463,208.814
+	c-9.051,5.225-12.149,16.793-6.926,25.84c5.226,9.051,16.793,12.151,25.844,6.926c9.048-5.224,12.148-16.792,6.923-25.842
+	C201.08,206.691,189.511,203.59,180.463,208.814z M86.458,141.732c0-18.701,9.293-35.219,23.504-45.221L96.128,73.338
+	c-16.56,11.064-28.878,27.978-33.995,47.788c5.977,4.872,9.796,12.291,9.796,20.608c0,8.315-3.819,15.734-9.797,20.605
+	c5.116,19.812,17.435,36.726,33.995,47.789l13.835-23.175C95.751,176.953,86.458,160.436,86.458,141.732z M141.733,86.457
+	c28.877,0,52.564,22.141,55.047,50.373l26.968-0.394c-1.327-20.844-10.432-39.562-24.425-53.319
+	c-7.194,2.718-15.505,2.306-22.688-1.842c-7.192-4.152-11.705-11.156-12.941-18.757c-6.992-1.935-14.351-2.99-21.96-2.99
+	c-13.086,0-25.449,3.072-36.431,8.512l13.146,23.56C125.526,88.307,133.412,86.457,141.733,86.457z M141.733,197.008
+	c-8.322,0-16.207-1.85-23.285-5.143L105.3,215.427c10.983,5.438,23.347,8.511,36.433,8.511c7.609,0,14.968-1.055,21.961-2.99
+	c1.236-7.601,5.75-14.605,12.943-18.76c7.183-4.146,15.494-4.558,22.688-1.839c13.992-13.758,23.097-32.476,24.422-53.32
+	l-26.968-0.394C194.298,174.871,170.61,197.008,141.733,197.008z M180.46,74.649c9.05,5.227,20.619,2.126,25.842-6.921
+	c5.226-9.051,2.128-20.619-6.923-25.845c-9.049-5.224-20.617-2.124-25.843,6.927C168.312,57.857,171.412,69.426,180.46,74.649z"/>
+</svg>
diff --git a/src/util.vala b/src/util.vala
index 5030094..d4495f8 100644
--- a/src/util.vala
+++ b/src/util.vala
@@ -270,6 +270,38 @@ namespace Boxes {
         return (devices.get_length () > 0) ? devices.get_nth (0) as Osinfo.Device : null;
     }
 
+    public Gtk.Image get_product_logo (Osinfo.Product? product, int size) {
+        var image = new Gtk.Image.from_icon_name ("media-optical", 0);
+        image.pixel_size = size;
+
+        if (product != null)
+            fetch_product_logo (image, product, size);
+
+        return image;
+    }
+
+    public void fetch_product_logo (Gtk.Image image, Osinfo.Product product, int size) {
+        var path = get_logo_path (product);
+
+        if (path != null) {
+            try {
+                var pixbuf = new Gdk.Pixbuf.from_file_at_size (path, size, -1);
+                image.set_from_pixbuf (pixbuf);
+            } catch (GLib.Error error) {
+                warning ("Error loading logo file '%s': %s", path, error.message);
+            }
+        } else {
+            var derived = product.get_related (Osinfo.ProductRelationship.DERIVES_FROM);
+            if (derived.get_length () == 0)
+                return;
+
+            // FIXME: Does Osinfo allows deriving from multiple products?
+            var parent = derived.get_nth (0) as Osinfo.Product;
+
+            fetch_product_logo (image, parent, size);
+        }
+    }
+
     public int get_enum_value (string value_nick, Type enum_type) {
         var enum_class = (EnumClass) enum_type.class_ref ();
         var val = enum_class.get_value_by_nick (value_nick);
@@ -324,4 +356,17 @@ namespace Boxes {
             return params.lookup (key);
         }
     }
+
+    private string? get_logo_path (Osinfo.Product product, string[] extensions = {".svg", ".png", ".jpg"}) {
+        if (extensions.length == 0)
+            return null;
+
+        var path = get_pixmap (product.short_id + extensions[0]);
+        var file = File.new_for_path (path);
+
+        if (file.query_exists ())
+            return path;
+        else
+            return get_logo_path (product, extensions[1:extensions.length]);
+    }
 }
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 86e1f41..1622f9f 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -155,8 +155,7 @@ private class Boxes.WizardSource: GLib.Object {
             url_entry.activate ();
         }, 15, 5, true, "installer-" + media.device_file + "-item");
 
-        var image = new Gtk.Image.from_icon_name ("media-optical", 0);
-        image.pixel_size = 64;
+        var image = get_product_logo (media.os, 64);
         hbox.pack_start (image, false, false);
 
         var vbox = new Gtk.VBox (true, 5);
@@ -175,6 +174,10 @@ private class Boxes.WizardSource: GLib.Object {
             label.get_style_context ().add_class ("boxes-step-label");
             label.xalign = 0.0f;
             vbox.pack_start (label, true, true);
+
+            if (media.os.vendor != null)
+                // Translator comment: %s is name of vendor here (e.g Canonical Ltd or Red Hat Inc)
+                label.label += _(" from %s").printf (media.os.vendor);
         }
 
         var separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL);
diff --git a/src/wizard.vala b/src/wizard.vala
index ce17edd..c057cc8 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -25,6 +25,7 @@ private class Boxes.Wizard: Boxes.UI {
     private Gtk.ProgressBar prep_progress;
     private Gtk.VBox setup_vbox;
     private Gtk.Label review_label;
+    private Gtk.Image installer_image;
 
     private MediaManager media_manager;
     private VMCreator vm_creator;
@@ -221,6 +222,7 @@ private class Boxes.Wizard: Boxes.UI {
 
         try {
             install_media = media_manager.create_installer_media_for_path.end (result);
+            fetch_product_logo (installer_image, install_media.os, 128);
             prep_progress.fraction = 1.0;
             page = page + 1;
         } catch (IOError.CANCELLED cancel_error) { // We did this, so no warning!
@@ -231,6 +233,8 @@ private class Boxes.Wizard: Boxes.UI {
     }
 
     private void prepare () throws GLib.Error {
+        installer_image.set_from_icon_name ("media-optical", 0); // Reset
+
         if (this.wizard_source.install_media != null) {
             install_media = this.wizard_source.install_media;
             prep_progress.fraction = 1.0;
@@ -385,6 +389,11 @@ private class Boxes.Wizard: Boxes.UI {
         vbox.pack_start (wizard_source.widget, false, false);
         wizard_source.widget.hexpand = true;
         wizard_source.widget.halign = Gtk.Align.CENTER;
+        label = new Gtk.Label (_("Any trademarks shown above are used merely for identification of software products you have already obtained and are the property of their respective owners."));
+        label.get_style_context ().add_class ("boxes-logo-notice-label");
+        label.wrap = true;
+        label.max_width_chars = 50;
+        vbox.pack_start (label, false, false);
         vbox.show_all ();
 
         /* Preparation */
@@ -404,9 +413,9 @@ private class Boxes.Wizard: Boxes.UI {
         hbox.halign = Gtk.Align.CENTER;
         vbox.pack_start (hbox, true, true);
 
-        var image = new Gtk.Image.from_icon_name ("media-optical", 0);
-        image.pixel_size = 128;
-        hbox.pack_start (image, false, false);
+        installer_image = new Gtk.Image.from_icon_name ("media-optical", 0);
+        installer_image.pixel_size = 128;
+        hbox.pack_start (installer_image, false, false);
         var prep_vbox = new Gtk.VBox (true, 10);
         prep_vbox.valign = Gtk.Align.CENTER;
         hbox.pack_start (prep_vbox, true, true);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]