[gnome-software] details: Show an infobar with explanatory text for webapps



commit ecb95b95e88429544b17f593fadf17a66925ccab
Author: Kalev Lember <kalevlember gmail com>
Date:   Fri Apr 11 18:42:41 2014 +0200

    details: Show an infobar with explanatory text for webapps
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725002

 src/gs-shell-details.c  |   12 +++++++
 src/gs-shell-details.ui |   75 +++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 84 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 345c93b..65c717b 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -68,6 +68,7 @@ struct GsShellDetailsPrivate
        GtkWidget               *infobar_details_app_repo;
        GtkWidget               *infobar_details_package_baseos;
        GtkWidget               *infobar_details_repo;
+       GtkWidget               *infobar_details_webapp;
        GtkWidget               *label_details_category_value;
        GtkWidget               *label_details_developer_title;
        GtkWidget               *label_details_developer_value;
@@ -768,6 +769,16 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
                gtk_widget_set_visible (priv->infobar_details_app_norepo, FALSE);
                break;
        }
+
+       /* installing a webapp */
+       switch (gs_app_get_id_kind (priv->app)) {
+       case GS_APP_ID_KIND_WEBAPP:
+               gtk_widget_set_visible (priv->infobar_details_webapp, TRUE);
+               break;
+       default:
+               gtk_widget_set_visible (priv->infobar_details_webapp, FALSE);
+               break;
+       }
 }
 
 /**
@@ -1254,6 +1265,7 @@ gs_shell_details_class_init (GsShellDetailsClass *klass)
        gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, infobar_details_app_repo);
        gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, 
infobar_details_package_baseos);
        gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, infobar_details_repo);
+       gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, infobar_details_webapp);
        gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, 
label_details_category_value);
        gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, 
label_details_developer_title);
        gtk_widget_class_bind_template_child_private (widget_class, GsShellDetails, 
label_details_developer_value);
diff --git a/src/gs-shell-details.ui b/src/gs-shell-details.ui
index fea8763..c7a070b 100644
--- a/src/gs-shell-details.ui
+++ b/src/gs-shell-details.ui
@@ -470,6 +470,75 @@
                       </packing>
                     </child>
                     <child>
+                      <object class="GtkInfoBar" id="infobar_details_webapp">
+                        <property name="visible">True</property>
+                        <property name="app_paintable">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="message_type">info</property>
+                        <property name="margin_top">20</property>
+                        <style>
+                          <class name="application-details-infobar"/>
+                        </style>
+                        <child internal-child="content_area">
+                          <object class="GtkBox" id="infobar-content_area5">
+                            <property name="can_focus">False</property>
+                            <property name="spacing">16</property>
+                            <property name="halign">center</property>
+                            <child>
+                              <object class="GtkGrid" id="grid_details_webapp">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <object class="GtkLabel" id="label_header_details_webapp">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">Internet Only 
Application</property>
+                                    <attributes>
+                                      <attribute name="weight" value="bold"/>
+                                    </attributes>
+                                  </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_webapp">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">This application can only be 
used when there is an active internet connection.</property>
+                                  </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>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</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>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">7</property>
+                      </packing>
+                    </child>
+                    <child>
                       <object class="GtkBox" id="box_details_support">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -525,7 +594,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">False</property>
-                        <property name="position">7</property>
+                        <property name="position">8</property>
                       </packing>
                     </child>
                     <child>
@@ -546,7 +615,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">8</property>
+                        <property name="position">9</property>
                       </packing>
                     </child>
                     <child>
@@ -816,7 +885,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">9</property>
+                        <property name="position">10</property>
                       </packing>
                     </child>
                   </object>


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