[gnome-software] Show a loading spinner if the local package takes some time to read



commit 8d276d2192c7b8b0f12fcd5d3fb41f287b7c8835
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jan 29 13:21:18 2014 +0000

    Show a loading spinner if the local package takes some time to read
    
    This can happen if the package is very large.

 src/gnome-software.ui  |  837 ++++++++++++++++++++++++++----------------------
 src/gs-shell-details.c |   48 +++
 2 files changed, 495 insertions(+), 390 deletions(-)
---
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index 4a1ff7b..8455fe0 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -1089,95 +1089,152 @@
                 <property name="name">updates</property>
               </packing>
             </child>
+
+
             <child>
-              <object class="GtkScrolledWindow" id="scrolledwindow_details">
+              <object class="GtkStack" id="stack_details">
                 <property name="visible">True</property>
-                <property name="shadow_type">none</property>
-                <property name="can_focus">True</property>
-                <property name="hscrollbar_policy">never</property>
-                <property name="vscrollbar_policy">automatic</property>
+                <child internal-child="accessible">
+                  <object class="AtkObject" id="details-accessible">
+                    <property name="accessible-name">Details page</property>
+                  </object>
+                </child>
                 <child>
-                  <object class="GtkViewport" id="viewport1">
+                  <object class="GtkBox" id="details_spinner_box">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">12</property>
+                    <property name="halign">center</property>
+                    <property name="valign">center</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <style>
+                      <class name="dim-label"/>
+                    </style>
                     <child>
-                      <object class="GtkBox" id="box_details">
-                        <property name="width_request">752</property>
-                        <property name="orientation">vertical</property>
+                      <object class="GtkSpinner" id="spinner_details">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="width_request">128</property>
+                        <property name="height_request">128</property>
                         <property name="halign">center</property>
-                        <property name="margin_top">28</property>
-                        <property name="margin_bottom">28</property>
-                        <property name="margin_start">64</property>
-                        <property name="margin_end">64</property>
-                        <property name="hexpand">False</property>
+                        <property name="valign">center</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label_details_spinner">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Getting software details…</property>
+                        <property name="justify">center</property>
+                        <attributes>
+                          <attribute name="scale" value="1.4"/>
+                        </attributes>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="name">spinner</property>
+                  </packing>
+                </child>
+
+                <child>
+                  <object class="GtkScrolledWindow" id="scrolledwindow_details">
+                    <property name="visible">True</property>
+                    <property name="shadow_type">none</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">never</property>
+                    <property name="vscrollbar_policy">automatic</property>
+                    <child>
+                      <object class="GtkViewport" id="viewport1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <child>
-                          <object class="GtkBox" id="box_details_header">
-                            <property name="orientation">horizontal</property>
+                          <object class="GtkBox" id="box_details">
+                            <property name="width_request">752</property>
+                            <property name="orientation">vertical</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="halign">center</property>
+                            <property name="margin_top">28</property>
+                            <property name="margin_bottom">28</property>
+                            <property name="margin_start">64</property>
+                            <property name="margin_end">64</property>
+                            <property name="hexpand">False</property>
                             <child>
-                              <object class="GtkImage" id="application_details_icon">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="halign">start</property>
-                                <property name="valign">start</property>
-                                <property name="pixel_size">96</property>
-                                <property name="margin_bottom">28</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkBox" id="box_details_header2">
-                                <property name="orientation">vertical</property>
+                              <object class="GtkBox" id="box_details_header">
+                                <property name="orientation">horizontal</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="halign">start</property>
-                                <property name="valign">start</property>
                                 <child>
-                                  <object class="GtkLabel" id="application_details_title">
+                                  <object class="GtkImage" id="application_details_icon">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
                                     <property name="halign">start</property>
                                     <property name="valign">start</property>
-                                    <property name="hexpand">True</property>
-                                    <property name="margin_start">24</property>
-                                    <property name="margin_end">24</property>
-                                    <property name="margin_bottom">12</property>
-                                    <property name="xalign">0</property>
-                                    <property name="selectable">True</property>
-                                    <style>
-                                      <class name="application-details-title"/>
-                                    </style>
+                                    <property name="pixel_size">96</property>
+                                    <property name="margin_bottom">28</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
-                                    <property name="fill">True</property>
+                                    <property name="fill">False</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="application_details_summary">
+                                  <object class="GtkBox" id="box_details_header2">
+                                    <property name="orientation">vertical</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
                                     <property name="halign">start</property>
                                     <property name="valign">start</property>
-                                    <property name="hexpand">True</property>
-                                    <property name="margin_start">24</property>
-                                    <property name="margin_end">24</property>
-                                    <property name="margin_bottom">28</property>
-                                    <property name="xalign">0</property>
-                                    <property name="selectable">True</property>
-                                    <property name="wrap">True</property>
-                                    <property name="max-width-chars">60</property>
-                                    <style>
-                                      <class name="application-details-summary"/>
-                                    </style>
+                                    <child>
+                                      <object class="GtkLabel" id="application_details_title">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="valign">start</property>
+                                        <property name="hexpand">True</property>
+                                        <property name="margin_start">24</property>
+                                        <property name="margin_end">24</property>
+                                        <property name="margin_bottom">12</property>
+                                        <property name="xalign">0</property>
+                                        <property name="selectable">True</property>
+                                        <style>
+                                          <class name="application-details-title"/>
+                                        </style>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="application_details_summary">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="valign">start</property>
+                                        <property name="hexpand">True</property>
+                                        <property name="margin_start">24</property>
+                                        <property name="margin_end">24</property>
+                                        <property name="margin_bottom">28</property>
+                                        <property name="xalign">0</property>
+                                        <property name="selectable">True</property>
+                                        <property name="wrap">True</property>
+                                        <property name="max-width-chars">60</property>
+                                        <style>
+                                          <class name="application-details-summary"/>
+                                        </style>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -1188,398 +1245,398 @@
                               </object>
                               <packing>
                                 <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkBox" id="box_details_screenshot">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">9</property>
                             <child>
-                              <object class="GtkBox" id="box_details_screenshot_main">
+                              <object class="GtkBox" id="box_details_screenshot">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="orientation">vertical</property>
-                                <property name="spacing">6</property>
+                                <property name="spacing">9</property>
                                 <child>
-                                  <placeholder/>
+                                  <object class="GtkBox" id="box_details_screenshot_main">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="orientation">vertical</property>
+                                    <property name="spacing">6</property>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkBox" id="box_details_screenshot_thumbnails">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="orientation">vertical</property>
+                                    <property name="spacing">7</property>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
                                 </child>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="fill">True</property>
-                                <property name="position">0</property>
+                                <property name="position">1</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkBox" id="box_details_screenshot_thumbnails">
+                              <object class="GtkBox" id="box_details_description">
+                                <property name="margin_top">64</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="orientation">vertical</property>
-                                <property name="spacing">7</property>
+                                <property name="spacing">16</property>
                                 <child>
                                   <placeholder/>
                                 </child>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkBox" id="box_details_description">
-                            <property name="margin_top">64</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="orientation">vertical</property>
-                            <property name="spacing">16</property>
-                            <child>
-                              <placeholder/>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkBox" id="box_details_support">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">12</property>
-                            <property name="margin_top">28</property>
-                            <child>
-                              <object class="GtkButton" id="button_details_website">
-                                <property name="label" translatable="yes">_Website</property>
-                                <property name="width_request">150</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="use_underline">True</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkButton" id="button_history">
-                                <property name="label" translatable="yes">_History</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="use_underline">True</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkButton" id="button_details_launch">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="use_underline">True</property>
-                                <property name="label" translatable="yes" comments="Translators: A label for 
a button to execute the selected application.">_Launch</property>
-                                <style>
-                                  <class name="suggested-action"/>
-                                </style>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
                                 <property name="fill">False</property>
                                 <property name="position">2</property>
                               </packing>
                             </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">3</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="application_details_details_title">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="margin_top">28</property>
-                            <property name="margin_bottom">24</property>
-                            <property name="halign">start</property>
-                            <property name="valign">start</property>
-                            <property name="hexpand">True</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Details</property>
-                            <style>
-                              <class name="application-details-title"/>
-                            </style>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">4</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkGrid" id="grid_details_details">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="halign">center</property>
-                            <property name="row_spacing">6</property>
-                            <property name="column_spacing">12</property>
-                            <property name="row-homogeneous">True</property>
-                            <child>
-                              <object class="GtkLabel" id="label_details_version_title">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="xalign">1</property>
-                                <property name="label" translatable="yes">Version</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                </style>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="top_attach">0</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label_details_version_value">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label">0.12.3</property>
-                                <property name="selectable">True</property>
-                                <accessibility>
-                                  <relation target="label_details_version_title" type="labelled-by"/>
-                                </accessibility>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="top_attach">0</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label_details_updated_title">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="xalign">1</property>
-                                <property name="label" translatable="yes">Updated</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                </style>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="top_attach">1</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
                             <child>
-                              <object class="GtkLabel" id="label_details_updated_value">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label">May 12, 2012</property>
-                                <property name="selectable">True</property>
-                                <accessibility>
-                                  <relation target="label_details_updated_title" type="labelled-by"/>
-                                </accessibility>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="top_attach">1</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label_details_category_title">
+                              <object class="GtkBox" id="box_details_support">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="xalign">1</property>
-                                <property name="label" translatable="yes">Category</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                </style>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="top_attach">2</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label_details_category_value">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label">Photos &amp; Video</property>
-                                <property name="ellipsize">end</property>
-                                <property name="selectable">True</property>
-                                <accessibility>
-                                  <relation target="label_details_category_title" type="labelled-by"/>
-                                </accessibility>
+                                <property name="spacing">12</property>
+                                <property name="margin_top">28</property>
+                                <child>
+                                  <object class="GtkButton" id="button_details_website">
+                                    <property name="label" translatable="yes">_Website</property>
+                                    <property name="width_request">150</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_underline">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="button_history">
+                                    <property name="label" translatable="yes">_History</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_underline">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="button_details_launch">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="label" translatable="yes" comments="Translators: A label 
for a button to execute the selected application.">_Launch</property>
+                                    <style>
+                                      <class name="suggested-action"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
                               </object>
                               <packing>
-                                <property name="left_attach">1</property>
-                                <property name="top_attach">2</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">3</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkLabel" id="label_details_licence_title">
+                              <object class="GtkLabel" id="application_details_details_title">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="xalign">1</property>
-                                <property name="label" translatable="yes">Licence</property>
-                                <property name="margin_start">42</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                </style>
-                              </object>
-                              <packing>
-                                <property name="left_attach">2</property>
-                                <property name="top_attach">0</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label_details_licence_value">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
+                                <property name="margin_top">28</property>
+                                <property name="margin_bottom">24</property>
+                                <property name="halign">start</property>
+                                <property name="valign">start</property>
+                                <property name="hexpand">True</property>
                                 <property name="xalign">0</property>
-                                <property name="label">GPL</property>
-                                <property name="ellipsize">end</property>
-                                <property name="selectable">True</property>
-                                <accessibility>
-                                  <relation target="label_details_licence_title" type="labelled-by"/>
-                                </accessibility>
-                              </object>
-                              <packing>
-                                <property name="left_attach">3</property>
-                                <property name="top_attach">0</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label_details_size_title">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="xalign">1</property>
-                                <property name="label" translatable="yes">Size</property>
-                                <property name="margin_start">42</property>
+                                <property name="label" translatable="yes">Details</property>
                                 <style>
-                                  <class name="dim-label"/>
+                                  <class name="application-details-title"/>
                                 </style>
                               </object>
                               <packing>
-                                <property name="left_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label_details_size_value">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label">30 MB</property>
-                                <property name="selectable">True</property>
-                                <accessibility>
-                                  <relation target="label_details_size_title" type="labelled-by"/>
-                                </accessibility>
-                              </object>
-                              <packing>
-                                <property name="left_attach">3</property>
-                                <property name="top_attach">1</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">4</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkLabel" id="label_details_developer_title">
+                              <object class="GtkGrid" id="grid_details_details">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="xalign">1</property>
-                                <property name="label" translatable="yes">Developer</property>
-                                <property name="margin_start">42</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                </style>
-                              </object>
-                              <packing>
-                                <property name="left_attach">2</property>
-                                <property name="top_attach">2</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label_details_developer_value">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label">Yorba</property>
-                                <property name="ellipsize">end</property>
-                                <property name="selectable">True</property>
-                                <accessibility>
-                                  <relation target="label_details_developer_title" type="labelled-by"/>
-                                </accessibility>
+                                <property name="halign">center</property>
+                                <property name="row_spacing">6</property>
+                                <property name="column_spacing">12</property>
+                                <property name="row-homogeneous">True</property>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_version_title">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">1</property>
+                                    <property name="label" translatable="yes">Version</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">0</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_version_value">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label">0.12.3</property>
+                                    <property name="selectable">True</property>
+                                    <accessibility>
+                                      <relation target="label_details_version_title" type="labelled-by"/>
+                                    </accessibility>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_updated_title">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">1</property>
+                                    <property name="label" translatable="yes">Updated</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">0</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_updated_value">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label">May 12, 2012</property>
+                                    <property name="selectable">True</property>
+                                    <accessibility>
+                                      <relation target="label_details_updated_title" type="labelled-by"/>
+                                    </accessibility>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_category_title">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">1</property>
+                                    <property name="label" translatable="yes">Category</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">0</property>
+                                    <property name="top_attach">2</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_category_value">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label">Photos &amp; Video</property>
+                                    <property name="ellipsize">end</property>
+                                    <property name="selectable">True</property>
+                                    <accessibility>
+                                      <relation target="label_details_category_title" type="labelled-by"/>
+                                    </accessibility>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="top_attach">2</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_licence_title">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">1</property>
+                                    <property name="label" translatable="yes">Licence</property>
+                                    <property name="margin_start">42</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">2</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_licence_value">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label">GPL</property>
+                                    <property name="ellipsize">end</property>
+                                    <property name="selectable">True</property>
+                                    <accessibility>
+                                      <relation target="label_details_licence_title" type="labelled-by"/>
+                                    </accessibility>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">3</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_size_title">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">1</property>
+                                    <property name="label" translatable="yes">Size</property>
+                                    <property name="margin_start">42</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">2</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_size_value">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label">30 MB</property>
+                                    <property name="selectable">True</property>
+                                    <accessibility>
+                                      <relation target="label_details_size_title" type="labelled-by"/>
+                                    </accessibility>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">3</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_developer_title">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">1</property>
+                                    <property name="label" translatable="yes">Developer</property>
+                                    <property name="margin_start">42</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">2</property>
+                                    <property name="top_attach">2</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label_details_developer_value">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label">Yorba</property>
+                                    <property name="ellipsize">end</property>
+                                    <property name="selectable">True</property>
+                                    <accessibility>
+                                      <relation target="label_details_developer_title" type="labelled-by"/>
+                                    </accessibility>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">3</property>
+                                    <property name="top_attach">2</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
                               </object>
                               <packing>
-                                <property name="left_attach">3</property>
-                                <property name="top_attach">2</property>
-                                <property name="width">1</property>
-                                <property name="height">1</property>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">5</property>
                               </packing>
                             </child>
                           </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">5</property>
-                          </packing>
                         </child>
                       </object>
                     </child>
                   </object>
+                  <packing>
+                    <property name="name">ready</property>
+                  </packing>
                 </child>
               </object>
               <packing>
                 <property name="name">details</property>
               </packing>
             </child>
+
+
             <child>
               <object class="GsBox" id="box_category">
                 <property name="visible">True</property>
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index acf36fe..7cb650c 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -36,6 +36,11 @@ static void  gs_shell_details_finalize       (GObject        *object);
 
 #define GS_SHELL_DETAILS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GS_TYPE_SHELL_DETAILS, 
GsShellDetailsPrivate))
 
+typedef enum {
+       GS_SHELL_DETAILS_STATE_LOADING,
+       GS_SHELL_DETAILS_STATE_READY
+} GsShellDetailsState;
+
 struct GsShellDetailsPrivate
 {
        GsPluginLoader          *plugin_loader;
@@ -63,6 +68,45 @@ gs_shell_details_invalidate (GsShellDetails *shell_details)
 }
 
 /**
+ * gs_shell_details_set_state:
+ **/
+static void
+gs_shell_details_set_state (GsShellDetails *shell_details,
+                           GsShellDetailsState state)
+{
+       GsShellDetailsPrivate *priv = shell_details->priv;
+       GtkWidget *widget;
+
+       /* spinner */
+       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "spinner_details"));
+       switch (state) {
+       case GS_SHELL_DETAILS_STATE_LOADING:
+               gtk_spinner_start (GTK_SPINNER (widget));
+               gtk_widget_show (widget);
+               break;
+       case GS_SHELL_DETAILS_STATE_READY:
+               gtk_spinner_stop (GTK_SPINNER (widget));
+               gtk_widget_hide (widget);
+               break;
+       default:
+               g_assert_not_reached ();
+       }
+
+       /* stack */
+       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "stack_details"));
+       switch (state) {
+       case GS_SHELL_DETAILS_STATE_LOADING:
+               gtk_stack_set_visible_child_name (GTK_STACK (widget), "spinner");
+               break;
+       case GS_SHELL_DETAILS_STATE_READY:
+               gtk_stack_set_visible_child_name (GTK_STACK (widget), "ready");
+               break;
+       default:
+               g_assert_not_reached ();
+       }
+}
+
+/**
  * gs_shell_details_refresh:
  **/
 void
@@ -687,6 +731,7 @@ gs_shell_details_app_refine_cb (GObject *source,
                return;
        }
        gs_shell_details_refresh_all (shell_details);
+       gs_shell_details_set_state (shell_details, GS_SHELL_DETAILS_STATE_READY);
 }
 
 /**
@@ -733,6 +778,7 @@ gs_shell_details_filename_to_app_cb (GObject *source,
        /* change widgets */
        gs_shell_details_refresh (shell_details);
        gs_shell_details_refresh_all (shell_details);
+       gs_shell_details_set_state (shell_details, GS_SHELL_DETAILS_STATE_READY);
 }
 
 /**
@@ -742,6 +788,7 @@ void
 gs_shell_details_set_filename (GsShellDetails *shell_details, const gchar *filename)
 {
        GsShellDetailsPrivate *priv = shell_details->priv;
+       gs_shell_details_set_state (shell_details, GS_SHELL_DETAILS_STATE_LOADING);
        gs_plugin_loader_filename_to_app_async (priv->plugin_loader,
                                                filename,
                                                GS_PLUGIN_REFINE_FLAGS_DEFAULT |
@@ -766,6 +813,7 @@ gs_shell_details_set_app (GsShellDetails *shell_details, GsApp *app)
        g_free (app_dump);
 
        /* get extra details about the app */
+       gs_shell_details_set_state (shell_details, GS_SHELL_DETAILS_STATE_LOADING);
        gs_plugin_loader_app_refine_async (priv->plugin_loader, app,
                                           GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENCE |
                                           GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE |


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