[gnome-software/wip/rancell/permissions] Drop the permissions from the detail page



commit b9698504489eeccd4310cff701266cbefe1dd847
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Aug 14 16:29:43 2017 +1200

    Drop the permissions from the detail page

 src/gs-details-page.c  |   40 ------------------------------------
 src/gs-details-page.ui |   53 +++--------------------------------------------
 src/gtk-style-hc.css   |    5 ----
 src/gtk-style.css      |    5 ----
 4 files changed, 4 insertions(+), 99 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index c2c0910..b104485 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -77,7 +77,6 @@ struct _GsDetailsPage
        GtkWidget               *box_details_screenshot_main;
        GtkWidget               *box_details_screenshot_thumbnails;
        GtkWidget               *box_details_license_list;
-       GtkWidget               *box_permissions;
        GtkWidget               *button_details_launch;
        GtkWidget               *button_details_add_shortcut;
        GtkWidget               *button_details_remove_shortcut;
@@ -124,7 +123,6 @@ struct _GsDetailsPage
        GtkWidget               *spinner_remove;
        GtkWidget               *stack_details;
        GtkWidget               *grid_details_kudo;
-       GtkWidget               *grid_permissions;
        GtkWidget               *image_details_kudo_docs;
        GtkWidget               *image_details_kudo_sandboxed;
        GtkWidget               *image_details_kudo_integration;
@@ -539,40 +537,6 @@ gs_details_page_notify_state_changed_cb (GsApp *app,
 }
 
 static void
-gs_details_page_refresh_permissions (GsDetailsPage *self)
-{
-       GPtrArray *permissions;
-       guint i;
-
-       /* nothing to show */
-       if (self->app == NULL)
-               return;
-
-       /* show or hide the entire permissions section */
-       permissions = gs_app_get_permissions (self->app);
-       gtk_widget_set_visible (self->box_permissions, permissions->len > 0);
-
-       gtk_container_foreach (GTK_CONTAINER (self->grid_permissions),
-                              (GtkCallback) gtk_widget_destroy, NULL);
-       for (i = 0; i < permissions->len; i++) {
-               GsPermission *permission = g_ptr_array_index (permissions, i);
-               GtkWidget *sw, *label;
-
-               sw = gtk_switch_new ();
-               gtk_widget_set_visible (sw, TRUE);
-               gtk_switch_set_active (GTK_SWITCH (sw), gs_permission_get_enabled (permission));
-               gtk_grid_attach (GTK_GRID (self->grid_permissions), sw, 0, i, 1, 1);
-
-               label = gtk_label_new (gs_permission_get_label (permission));
-               g_object_set (label,
-                             "xalign", 0.0,
-                             NULL);
-               gtk_widget_set_visible (label, TRUE);
-               gtk_grid_attach (GTK_GRID (self->grid_permissions), label, 1, i, 1, 1);
-       }
-}
-
-static void
 gs_details_page_screenshot_selected_cb (GtkListBox *list,
                                         GtkListBoxRow *row,
                                         GsDetailsPage *self)
@@ -1511,7 +1475,6 @@ gs_details_page_app_refine_cb (GObject *source,
        app_dump = gs_app_to_string (self->app);
        g_debug ("%s", app_dump);
 
-       gs_details_page_refresh_permissions (self);
        gs_details_page_refresh_screenshots (self);
        gs_details_page_refresh_addons (self);
        gs_details_page_refresh_reviews (self);
@@ -1561,7 +1524,6 @@ set_app (GsDetailsPage *self, GsApp *app)
 
        /* change widgets */
        gs_page_switch_to (GS_PAGE (self), TRUE);
-       gs_details_page_refresh_permissions (self);
        gs_details_page_refresh_screenshots (self);
        gs_details_page_refresh_addons (self);
        gs_details_page_refresh_reviews (self);
@@ -2320,7 +2282,6 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_screenshot_main);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_screenshot_thumbnails);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_license_list);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_permissions);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_launch);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_add_shortcut);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_remove_shortcut);
@@ -2365,7 +2326,6 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, spinner_remove);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, stack_details);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, grid_details_kudo);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, grid_permissions);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_docs);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_sandboxed);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_integration);
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index 9a89f20..94a273d 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -598,51 +598,6 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkBox" id="box_permissions">
-                            <property name="visible">False</property>
-                            <property name="orientation">vertical</property>
-                            <property name="margin_bottom">26</property>
-                            <property name="spacing">30</property>
-                            <child>
-                              <object class="GtkLabel">
-                                <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="xalign">0</property>
-                                <property name="label" translatable="yes">Permissions</property>
-                                <style>
-                                  <class name="application-permissions-title"/>
-                                </style>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkGrid" id="grid_permissions">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="row_spacing">9</property>
-                                <property name="column_spacing">24</property>
-                              </object>
-                              <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">11</property>
-                          </packing>
-                        </child>
-                        <child>
                           <object class="GtkLabel" id="application_details_details_title">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
@@ -658,7 +613,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">12</property>
+                            <property name="position">11</property>
                           </packing>
                         </child>
                         <child>
@@ -1196,7 +1151,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">13</property>
+                            <property name="position">12</property>
                           </packing>
                         </child>
                         <child>
@@ -1259,7 +1214,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">14</property>
+                            <property name="position">13</property>
                           </packing>
                         </child>
                         <child>
@@ -1324,7 +1279,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">15</property>
+                            <property name="position">14</property>
                           </packing>
                         </child>
                       </object>
diff --git a/src/gtk-style-hc.css b/src/gtk-style-hc.css
index fb8cfdc..5dd475c 100644
--- a/src/gtk-style-hc.css
+++ b/src/gtk-style-hc.css
@@ -96,11 +96,6 @@
        text-shadow: none;
 }
 
-.application-permissions-title {
-       font-weight: bold;
-       font-size: 125%;
-}
-
 .application-details-title {
        font-weight: bold;
        font-size: 125%;
diff --git a/src/gtk-style.css b/src/gtk-style.css
index d36747f..cc3565d 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -247,11 +247,6 @@
        text-shadow: none;
 }
 
-.application-permissions-title {
-       font-weight: bold;
-       font-size: 125%;
-}
-
 .application-details-title {
        font-weight: bold;
        font-size: 125%;


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