[gnome-initial-setup/wip/pwithnall/misc-fixes: 40/70] live-chooser: swap USB/DVD assets as needed




commit 5ad0700fc9f07ea03af7cdfa07fb994e1afeb8fa
Author: Will Thompson <wjt endlessm com>
Date:   Wed Aug 23 12:31:33 2017 +0100

    live-chooser: swap USB/DVD assets as needed

 .../pages/live-chooser/gis-live-chooser-page.c     | 12 +++
 .../pages/live-chooser/gis-live-chooser-page.ui    | 37 ++++++++-
 .../pages/live-chooser/live-chooser.gresource.xml  |  1 +
 .../pages/live-chooser/try-endless-dvd.svg         | 96 ++++++++++++++++++++++
 4 files changed, 144 insertions(+), 2 deletions(-)
---
diff --git a/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.c 
b/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.c
index 240d4b99..0fa581d6 100644
--- a/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.c
+++ b/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.c
@@ -41,6 +41,9 @@
 struct _GisLiveChooserPagePrivate
 {
   GtkWidget *try_label;
+  GtkWidget *try_label_dvd;
+  GtkWidget *try_icon;
+  GtkWidget *try_icon_dvd;
   GtkWidget *reformat_label;
   GtkWidget *try_button;
   GtkWidget *reformat_button;
@@ -188,6 +191,7 @@ gis_live_chooser_page_constructed (GObject *object)
 {
   GisLiveChooserPage *page = GIS_LIVE_CHOOSER_PAGE (object);
   GisLiveChooserPagePrivate *priv = gis_live_chooser_page_get_instance_private (page);
+  GisDriver *driver = GIS_PAGE (page)->driver;
 
   G_OBJECT_CLASS (gis_live_chooser_page_parent_class)->constructed (object);
 
@@ -205,6 +209,10 @@ gis_live_chooser_page_constructed (GObject *object)
                             G_CALLBACK (reformat_button_clicked),
                             page);
 
+  g_object_bind_property (driver, "live-dvd", priv->try_label, "visible", G_BINDING_SYNC_CREATE | 
G_BINDING_INVERT_BOOLEAN);
+  g_object_bind_property (driver, "live-dvd", priv->try_icon, "visible", G_BINDING_SYNC_CREATE | 
G_BINDING_INVERT_BOOLEAN);
+  g_object_bind_property (driver, "live-dvd", priv->try_label_dvd, "visible", G_BINDING_SYNC_CREATE);
+  g_object_bind_property (driver, "live-dvd", priv->try_icon_dvd, "visible", G_BINDING_SYNC_CREATE);
 
   load_css_overrides (page);
 
@@ -217,6 +225,7 @@ gis_live_chooser_page_locale_changed (GisPage *page)
   GisLiveChooserPagePrivate *priv = gis_live_chooser_page_get_instance_private (GIS_LIVE_CHOOSER_PAGE 
(page));
 
   gtk_label_set_label (GTK_LABEL (priv->try_label), _("Try Endless OS by running it from the USB Stick."));
+  gtk_label_set_label (GTK_LABEL (priv->try_label_dvd), _("Try Endless OS by running it from the DVD."));
   gtk_label_set_label (GTK_LABEL (priv->reformat_label), _("Reformat this computer with Endless OS."));
   gtk_button_set_label (GTK_BUTTON (priv->try_button), _("Try It"));
   gtk_button_set_label (GTK_BUTTON (priv->reformat_button), _("Reformat"));
@@ -237,6 +246,9 @@ gis_live_chooser_page_class_init (GisLiveChooserPageClass *klass)
   gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), 
"/org/gnome/initial-setup/gis-live-chooser-page.ui");
 
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLiveChooserPage, try_label);
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLiveChooserPage, try_label_dvd);
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLiveChooserPage, try_icon);
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLiveChooserPage, try_icon_dvd);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLiveChooserPage, 
reformat_label);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLiveChooserPage, try_button);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLiveChooserPage, 
reformat_button);
diff --git a/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.ui 
b/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.ui
index e429166e..b6bcfa03 100644
--- a/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.ui
+++ b/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.ui
@@ -54,6 +54,25 @@
                         <property name="position">0</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkLabel" id="try_label_dvd">
+                        <property name="visible">False</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Try Endless OS by running it from the 
DVD.</property>
+                        <property name="justify">center</property>
+                        <property name="wrap">True</property>
+                        <property name="yalign">0</property>
+                        <property name="max_width_chars">30</property>
+                        <attributes>
+                          <attribute name="scale" value="1.4"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="GtkImage" id="try_icon">
                         <property name="visible">True</property>
@@ -63,7 +82,19 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">1</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkImage" id="try_icon_dvd">
+                        <property name="visible">False</property>
+                        <property name="can_focus">False</property>
+                        <property name="resource">/org/gnome/initial-setup/try-endless-dvd.svg</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">3</property>
                       </packing>
                     </child>
                     <child>
@@ -79,7 +110,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">2</property>
+                        <property name="position">4</property>
                       </packing>
                     </child>
                   </object>
@@ -183,6 +214,7 @@
     <widgets>
       <widget name="reformat_label"/>
       <widget name="try_label"/>
+      <widget name="try_label_dvd"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup">
@@ -190,6 +222,7 @@
     <widgets>
       <widget name="reformat_icon"/>
       <widget name="try_icon"/>
+      <widget name="try_icon_dvd"/>
     </widgets>
   </object>
 </interface>
diff --git a/gnome-initial-setup/pages/live-chooser/live-chooser.gresource.xml 
b/gnome-initial-setup/pages/live-chooser/live-chooser.gresource.xml
index 9e309981..c9dcfc48 100644
--- a/gnome-initial-setup/pages/live-chooser/live-chooser.gresource.xml
+++ b/gnome-initial-setup/pages/live-chooser/live-chooser.gresource.xml
@@ -5,5 +5,6 @@
     <file preprocess="xml-stripblanks" alias="gis-live-chooser-page.ui">gis-live-chooser-page.ui</file>
     <file>install-endless.png</file>
     <file>try-endless.png</file>
+    <file>try-endless-dvd.svg</file>
   </gresource>
 </gresources>
diff --git a/gnome-initial-setup/pages/live-chooser/try-endless-dvd.svg 
b/gnome-initial-setup/pages/live-chooser/try-endless-dvd.svg
new file mode 100644
index 00000000..7bd82934
--- /dev/null
+++ b/gnome-initial-setup/pages/live-chooser/try-endless-dvd.svg
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   version="1.1"
+   id="Layer_1"
+   x="0px"
+   y="0px"
+   viewBox="0 0 255 81"
+   xml:space="preserve"
+   sodipodi:docname="try-endless-dvd.svg"
+   width="255"
+   height="81"
+   inkscape:version="0.92+devel unknown"><metadata
+     id="metadata41"><rdf:RDF><cc:Work
+         rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; 
/><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+     id="defs39" /><sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     inkscape:document-rotation="0"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1600"
+     inkscape:window-height="835"
+     id="namedview37"
+     showgrid="false"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:zoom="2.2229958"
+     inkscape:cx="117.22962"
+     inkscape:cy="19.000002"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="Layer_1" /><style
+     type="text/css"
+     id="style2">
+       .st0{fill:#EAEAEA;}
+       .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
+       .st2{fill-rule:evenodd;clip-rule:evenodd;fill:#999999;}
+       .st3{fill:#F15B24;}
+       .st4{fill:#CCCCCB;}
+       .st5{fill:#FFFFFF;}
+</style><g
+     id="g4308"
+     transform="matrix(1.6666667,0,0,1.6666667,-51.666668,-41.500001)"><path
+       class="st1"
+       d="m 127.3,28.4 h 54.3 v 36.8 h -54.3 z"
+       id="path6"
+       inkscape:connector-curvature="0" /><path
+       class="st2"
+       d="m 180.2,25.5 h -51.4 c -2.1,0 -3.8,1.8 -3.8,3.9 v 34 c 0,2.2 1.7,3.9 3.8,3.9 h 51.4 c 2.1,0 
3.8,-1.8 3.8,-3.9 v -34 c 0,-2.1 -1.7,-3.9 -3.8,-3.9 z m -0.3,37.6 c 0,0.1 -0.1,0.2 -0.2,0.2 h -50.3 c -0.1,0 
-0.2,-0.1 -0.2,-0.2 V 29.8 c 0,-0.1 0.1,-0.2 0.2,-0.2 h 50.3 c 0.1,0 0.2,0.1 0.2,0.2 z"
+       id="path10"
+       inkscape:connector-curvature="0" /><path
+       class="st2"
+       d="m 164.4,69.9 h -4.7 v -2.6 h -9.3 v 2.6 h -4.6 c -2.1,0 -3.8,1.5 -4,3.6 h 26.6 c -0.2,-2.1 
-1.9,-3.6 -4,-3.6 z"
+       id="path12"
+       inkscape:connector-curvature="0" /><path
+       class="st3"
+       d="m 162.9,45.6 c -1.5,-0.9 -4.3,0.2 -6.8,1.6 -0.6,-0.3 -1.3,-0.7 -1.9,-1 1.9,-1.1 3.4,-2.2 3.7,-2.5 
0.2,-0.2 0.3,-0.5 0.1,-0.8 -0.2,-0.3 -0.5,-0.3 -0.7,-0.1 -1.2,0.9 -2.8,2 -4.4,2.9 -3,-1.4 -5.6,-2.3 -6.9,-1.5 
-0.4,0.2 -0.9,0.8 -0.9,1.8 -0.1,1.6 0.5,2.3 1,2.6 1.5,0.9 4.3,-0.2 6.8,-1.6 0.6,0.3 1.3,0.7 1.9,1 -1.9,1.1 
-3.4,2.3 -3.7,2.5 -0.2,0.2 -0.3,0.5 -0.1,0.8 0.2,0.3 0.5,0.3 0.7,0.1 1.2,-0.9 2.8,-2 4.4,-2.9 3,1.4 5.6,2.3 
6.9,1.5 0.4,-0.2 0.9,-0.8 0.9,-1.8 0.1,-1.5 -0.5,-2.3 -1,-2.6 z m -16.3,2 c -0.1,-0.1 -0.6,-0.3 -0.5,-1.5 
0,-0.6 0.2,-0.8 0.4,-0.9 0.3,-0.2 0.8,-0.2 1.5,-0.1 1,0.2 2.3,0.7 3.7,1.3 -2.2,1.1 -4.2,1.8 -5.1,1.2 z m 
16.3,0.6 c 0,0.6 -0.2,0.8 -0.4,0.9 -0.3,0.2 -0.8,0.2 -1.5,0.1 -1,-0.2 -2.3,-0.7 -3.7,-1.3 2.2,-1.1 4.2,-1.8 
5.1,-1.3 0.1,0.1 0.5,0.4 0.5,1.6 z"
+       id="path16"
+       inkscape:connector-curvature="0" /><path
+       class="st4"
+       d="M 54.5,24.9 C 41.5,24.9 31,35.4 31,48.4 31,61.4 41.5,71.9 54.5,71.9 67.5,71.9 78,61.4 78,48.4 
78,35.4 67.4,24.9 54.5,24.9 Z m 0,31.1 c -4.2,0 -7.6,-3.4 -7.6,-7.6 0,-4.2 3.4,-7.6 7.6,-7.6 4.2,0 7.6,3.4 
7.6,7.6 0,4.2 -3.4,7.6 -7.6,7.6 z"
+       id="path20"
+       inkscape:connector-curvature="0" /><path
+       class="st5"
+       d="m 54.5,41.3 c -3.9,0 -7.1,3.2 -7.1,7.1 0,3.9 3.2,7.1 7.1,7.1 3.9,0 7.1,-3.2 7.1,-7.1 0,-4 
-3.2,-7.1 -7.1,-7.1 z m 2,7.3 c -0.2,1.2 -1.2,2 -2.4,1.8 -1.2,-0.2 -2,-1.2 -1.8,-2.4 0.2,-1.2 1.2,-2 2.4,-1.8 
1.2,0.2 2,1.3 1.8,2.4 z"
+       id="path24"
+       inkscape:connector-curvature="0" /><path
+       class="st4"
+       d="m 95.8,48.5 c 0,1.1 -0.9,2 -1.9,2 -1,0 -1.9,-0.9 -1.9,-2 0,-1.1 0.9,-2 1.9,-2 1,0 1.9,0.9 1.9,2 z"
+       id="path28"
+       inkscape:connector-curvature="0" /><path
+       class="st4"
+       d="m 103.4,48.5 c 0,1.1 -0.9,2 -1.9,2 -1,0 -1.9,-0.9 -1.9,-2 0,-1.1 0.9,-2 1.9,-2 1,0 1.9,0.9 1.9,2 z"
+       id="path30"
+       inkscape:connector-curvature="0" /><path
+       class="st4"
+       d="m 111,48.5 c 0,1.1 -0.9,2 -1.9,2 -1,0 -1.9,-0.9 -1.9,-2 0,-1.1 0.9,-2 1.9,-2 1,0 1.9,0.9 1.9,2 z"
+       id="path32"
+       inkscape:connector-curvature="0" /></g></svg>
\ No newline at end of file


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