[gnome-software: 1/4] gs-details-page: Don’t list all OARS sections if app has ‘none’ rating




commit 9ae5daa648fda47b49bddaf2a229a2bd16b641c7
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Oct 28 18:23:58 2020 +0000

    gs-details-page: Don’t list all OARS sections if app has ‘none’ rating
    
    If an app has all its OARS metadata set to ‘none’ (i.e. no violence, no
    inappropriate language, no unrestricted communications, etc.), show a
    special message in the OARS popover, rather than an exhaustive list of
    every OARS section.
    
    This is only an issue with some content ratings schemes. Those, such as
    PEGI, which have no age rating band which includes age 0 are not
    affected. So this has to be tested with a system like INCAA or ESRB.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Fixes: #1008, #993

 src/gs-details-page.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 210724ce..736c978f 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -2393,6 +2393,23 @@ gs_details_page_content_rating_button_cb (GtkWidget *widget, GsDetailsPage *self
                        value_bad = value;
        }
 
+       /* if the worst thing is nothing, great! show a more specific message
+        * than a big listing of all the groups */
+       if (value_bad == AS_CONTENT_RATING_VALUE_NONE) {
+               /* set the labels */
+               gtk_label_set_label (GTK_LABEL (self->label_content_rating_message),
+                                    _("The application contains no age-inappropriate content."));
+               gtk_widget_set_visible (self->label_content_rating_title, FALSE);
+               gtk_widget_set_visible (self->label_content_rating_message, TRUE);
+               gtk_widget_set_visible (self->label_content_rating_none, FALSE);
+
+               /* show popover */
+               gtk_popover_set_relative_to (GTK_POPOVER (self->popover_content_rating), widget);
+               gtk_widget_show (self->popover_content_rating);
+
+               return;
+       }
+
        /* get the content rating description for the worst things about the app;
         * handle the groups separately*/
        for (gsize i = 0; ids[i] != NULL; i++) {


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