[gnome-software: 14/18] gs-details-page: Drop the app licensing details
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 14/18] gs-details-page: Drop the app licensing details
- Date: Tue, 29 Jun 2021 14:17:07 +0000 (UTC)
commit 5169c178f9f6f377e606de2ff556583ea3c74c64
Author: Philip Withnall <pwithnall endlessos org>
Date: Fri May 28 15:03:26 2021 +0100
gs-details-page: Drop the app licensing details
These are now partially covered by the context tile bar, and will be
fully covered once the ‘Community Built’ box from
https://gitlab.gnome.org/Teams/Design/software-mockups/-/raw/master/adaptive/app-page-adaptive.png
is implemented.
For now, they don’t need to be listed separately in the details table.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
Helps: #1111
src/gs-details-page.c | 214 -------------------------------------------------
src/gs-details-page.ui | 195 --------------------------------------------
src/gtk-style.css | 67 ----------------
3 files changed, 476 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 41ac1a98c..884a407ff 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -92,7 +92,6 @@ struct _GsDetailsPage
GtkWidget *star;
GtkWidget *label_review_count;
GtkWidget *screenshot_carousel;
- GtkWidget *box_details_license_list;
GtkWidget *button_details_launch;
GtkWidget *button_details_add_shortcut;
GtkWidget *button_details_remove_shortcut;
@@ -117,11 +116,6 @@ struct _GsDetailsPage
GtkWidget *label_details_developer_value;
GtkWidget *box_details_developer;
GtkWidget *image_details_developer_verified;
- GtkWidget *button_details_license_free;
- GtkWidget *button_details_license_nonfree;
- GtkWidget *button_details_license_unknown;
- GtkWidget *label_details_license_title;
- GtkWidget *box_details_license_value;
GtkWidget *label_details_channel_title;
GtkWidget *label_details_channel_value;
GtkWidget *label_details_origin_title;
@@ -129,8 +123,6 @@ struct _GsDetailsPage
GtkWidget *label_details_updated_title;
GtkWidget *label_details_updated_value;
GtkWidget *label_failed;
- GtkWidget *label_license_nonfree_details;
- GtkWidget *label_licenses_intro;
GtkWidget *list_box_addons;
GtkWidget *list_box_version_history;
GtkWidget *row_latest_version;
@@ -156,9 +148,6 @@ struct _GsDetailsPage
GtkWidget *label_details_kudo_updated;
GtkWidget *progressbar_top;
guint progress_pulse_id;
- GtkWidget *popover_license_free;
- GtkWidget *popover_license_nonfree;
- GtkWidget *popover_license_unknown;
GtkWidget *star_eventbox;
GtkWidget *origin_popover;
GtkWidget *origin_popover_list_box;
@@ -1036,22 +1025,6 @@ gs_details_page_refresh_all (GsDetailsPage *self)
}
gtk_widget_set_visible (self->image_details_developer_verified, gs_app_has_quirk (self->app,
GS_APP_QUIRK_DEVELOPER_VERIFIED));
- /* set the license buttons */
- tmp = gs_app_get_license (self->app);
- if (tmp == NULL) {
- gtk_widget_set_visible (self->button_details_license_free, FALSE);
- gtk_widget_set_visible (self->button_details_license_nonfree, FALSE);
- gtk_widget_set_visible (self->button_details_license_unknown, TRUE);
- } else if (gs_app_get_license_is_free (self->app)) {
- gtk_widget_set_visible (self->button_details_license_free, TRUE);
- gtk_widget_set_visible (self->button_details_license_nonfree, FALSE);
- gtk_widget_set_visible (self->button_details_license_unknown, FALSE);
- } else {
- gtk_widget_set_visible (self->button_details_license_free, FALSE);
- gtk_widget_set_visible (self->button_details_license_nonfree, TRUE);
- gtk_widget_set_visible (self->button_details_license_unknown, FALSE);
- }
-
/* set channel for snaps */
if (gs_app_get_bundle_kind (self->app) == AS_BUNDLE_KIND_SNAP) {
gtk_label_set_label (GTK_LABEL (self->label_details_channel_value), gs_app_get_branch
(self->app));
@@ -1242,18 +1215,6 @@ gs_details_page_refresh_all (GsDetailsPage *self)
break;
}
- /* hide fields that don't make sense for sources */
- switch (gs_app_get_kind (self->app)) {
- case AS_COMPONENT_KIND_REPOSITORY:
- gtk_widget_set_visible (self->label_details_license_title, FALSE);
- gtk_widget_set_visible (self->box_details_license_value, FALSE);
- break;
- default:
- gtk_widget_set_visible (self->label_details_license_title, TRUE);
- gtk_widget_set_visible (self->box_details_license_value, TRUE);
- break;
- }
-
gs_details_page_update_shortcut_button (self);
/* update progress */
@@ -1582,9 +1543,6 @@ _set_app (GsDetailsPage *self, GsApp *app)
g_signal_connect_object (self->app, "notify::size",
G_CALLBACK (gs_details_page_notify_state_changed_cb),
self, 0);
- g_signal_connect_object (self->app, "notify::license",
- G_CALLBACK (gs_details_page_notify_state_changed_cb),
- self, 0);
g_signal_connect_object (self->app, "notify::quirk",
G_CALLBACK (gs_details_page_notify_state_changed_cb),
self, 0);
@@ -2112,155 +2070,6 @@ gs_details_page_more_reviews_button_cb (GtkWidget *widget, GsDetailsPage *self)
gtk_widget_set_visible (self->button_more_reviews, FALSE);
}
-static gboolean
-gs_details_page_activate_link_cb (GtkLabel *label,
- const gchar *uri,
- GsDetailsPage *self)
-{
- gs_shell_show_uri (self->shell, uri);
- return TRUE;
-}
-
-static GtkWidget *
-gs_details_page_label_widget (GsDetailsPage *self,
- const gchar *title,
- const gchar *url)
-{
- GtkWidget *w;
- g_autofree gchar *markup = NULL;
-
- markup = g_strdup_printf ("<a href=\"%s\">%s</a>", url, title);
- w = gtk_label_new (markup);
- g_signal_connect (w, "activate-link",
- G_CALLBACK (gs_details_page_activate_link_cb),
- self);
- gtk_label_set_use_markup (GTK_LABEL (w), TRUE);
- gtk_label_set_xalign (GTK_LABEL (w), 0.f);
- gtk_widget_set_visible (w, TRUE);
- return w;
-}
-
-static GtkWidget *
-gs_details_page_license_widget_for_token (GsDetailsPage *self, const gchar *token)
-{
- /* public domain */
- if (g_strcmp0 (token, "@LicenseRef-public-domain") == 0) {
- /* TRANSLATORS: see the wikipedia page */
- return gs_details_page_label_widget (self, _("Public domain"),
- /* TRANSLATORS: Replace the link with a version in your language,
- * e.g. https://de.wikipedia.org/wiki/Gemeinfreiheit */
- _("https://en.wikipedia.org/wiki/Public_domain"));
- }
-
- /* free software, license unspecified */
- if (g_str_has_prefix (token, "@LicenseRef-free")) {
- /* TRANSLATORS: Replace the link with a version in your language,
- * e.g. https://www.gnu.org/philosophy/free-sw.de */
- const gchar *url = _("https://www.gnu.org/philosophy/free-sw");
- gchar *tmp;
-
- /* we support putting a custom URL in the
- * token string, e.g. @LicenseRef-free=http://ubuntu.com */
- tmp = g_strstr_len (token, -1, "=");
- if (tmp != NULL)
- url = tmp + 1;
-
- /* TRANSLATORS: see GNU page */
- return gs_details_page_label_widget (self, _("Free Software"), url);
- }
-
- /* SPDX value */
- if (g_str_has_prefix (token, "@")) {
- g_autofree gchar *uri = NULL;
- uri = g_strdup_printf ("http://spdx.org/licenses/%s",
- token + 1);
- return gs_details_page_label_widget (self, token + 1, uri);
- }
-
- /* new SPDX value the extractor didn't know about */
- if (as_is_spdx_license_id (token)) {
- g_autofree gchar *uri = NULL;
- uri = g_strdup_printf ("http://spdx.org/licenses/%s",
- token);
- return gs_details_page_label_widget (self, token, uri);
- }
-
- /* nothing to show */
- return NULL;
-}
-
-static void
-gs_details_page_license_free_cb (GtkWidget *widget, GsDetailsPage *self)
-{
- guint cnt = 0;
- guint i;
- g_auto(GStrv) tokens = NULL;
-
- /* URLify any SPDX IDs */
- gs_container_remove_all (GTK_CONTAINER (self->box_details_license_list));
- tokens = as_spdx_license_tokenize (gs_app_get_license (self->app));
- for (i = 0; tokens[i] != NULL; i++) {
- GtkWidget *w = NULL;
-
- /* translated join */
- if (g_strcmp0 (tokens[i], "&") == 0)
- continue;
- if (g_strcmp0 (tokens[i], "|") == 0)
- continue;
- if (g_strcmp0 (tokens[i], "+") == 0)
- continue;
-
- /* add widget */
- w = gs_details_page_license_widget_for_token (self, tokens[i]);
- if (w == NULL)
- continue;
- gtk_container_add (GTK_CONTAINER (self->box_details_license_list), w);
-
- /* one more license */
- cnt++;
- }
-
- /* use the correct plural */
- gtk_label_set_label (GTK_LABEL (self->label_licenses_intro),
- /* TRANSLATORS: for the free software popover */
- ngettext ("Users are bound by the following license:",
- "Users are bound by the following licenses:",
- cnt));
- gtk_widget_set_visible (self->label_licenses_intro, cnt > 0);
-
- gtk_widget_show (self->popover_license_free);
-}
-
-static void
-gs_details_page_license_nonfree_cb (GtkWidget *widget, GsDetailsPage *self)
-{
- g_autofree gchar *str = NULL;
- g_autofree gchar *uri = NULL;
- g_auto(GStrv) tokens = NULL;
-
- /* license specified as a link */
- tokens = as_spdx_license_tokenize (gs_app_get_license (self->app));
- for (guint i = 0; tokens[i] != NULL; i++) {
- if (g_str_has_prefix (tokens[i], "@LicenseRef-proprietary=")) {
- uri = g_strdup (tokens[i] + 24);
- break;
- }
- }
- if (uri == NULL)
- uri = g_settings_get_string (self->settings, "nonfree-software-uri");
- str = g_strdup_printf ("<a href=\"%s\">%s</a>",
- uri,
- _("More information"));
- gtk_label_set_label (GTK_LABEL (self->label_license_nonfree_details), str);
- gtk_widget_show (self->popover_license_nonfree);
-}
-
-static void
-gs_details_page_license_unknown_cb (GtkWidget *widget, GsDetailsPage *self)
-{
- gtk_widget_show (self->popover_license_unknown);
-}
-
static void
gs_details_page_network_available_notify_cb (GsPluginLoader *plugin_loader,
GParamSpec *pspec,
@@ -2338,18 +2147,6 @@ gs_details_page_setup (GsPage *page,
g_signal_connect (self->button_donate, "clicked",
G_CALLBACK (gs_details_page_donate_cb),
self);
- g_signal_connect (self->button_details_license_free, "clicked",
- G_CALLBACK (gs_details_page_license_free_cb),
- self);
- g_signal_connect (self->button_details_license_nonfree, "clicked",
- G_CALLBACK (gs_details_page_license_nonfree_cb),
- self);
- g_signal_connect (self->button_details_license_unknown, "clicked",
- G_CALLBACK (gs_details_page_license_unknown_cb),
- self);
- g_signal_connect (self->label_license_nonfree_details, "activate-link",
- G_CALLBACK (gs_details_page_activate_link_cb),
- self);
gtk_list_box_set_sort_func (GTK_LIST_BOX (self->origin_popover_list_box),
origin_popover_list_sort_func,
@@ -2494,7 +2291,6 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, star);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_review_count);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, screenshot_carousel);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_license_list);
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);
@@ -2519,11 +2315,6 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_developer_value);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_developer);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_developer_verified);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_license_free);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_license_nonfree);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_license_unknown);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_license_title);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_license_value);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_channel_title);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_channel_value);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_origin_title);
@@ -2555,11 +2346,6 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_translated);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_updated);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, progressbar_top);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, popover_license_free);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, popover_license_nonfree);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, popover_license_unknown);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_license_nonfree_details);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_licenses_intro);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, star_eventbox);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, origin_popover);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, origin_popover_list_box);
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index 89c77224f..768f5ce73 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -930,68 +930,6 @@
<property name="top_attach">6</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="label_details_license_title">
- <property name="visible">True</property>
- <property name="label" translatable="yes">License</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="vexpand">True</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box_details_license_value">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkButton" id="button_details_license_free">
- <property name="label" translatable="yes" comments="This refers to
the license of the application">Free</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="halign">start</property>
- <style>
- <class name="details-license-free"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="button_details_license_nonfree">
- <property name="label" translatable="yes" comments="This refers to
the license of the application">Proprietary</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="halign">start</property>
- <style>
- <class name="details-license-nonfree"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="button_details_license_unknown">
- <property name="label" translatable="yes" comments="This refers to
the license of the application" context="Application license">Unknown</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="halign">start</property>
- <style>
- <class name="details-license-unknown"/>
- </style>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
</object>
</child>
</object>
@@ -1126,139 +1064,6 @@
<widget name="button_details_website"/>
</widgets>
</object>
- <object class="GtkSizeGroup" id="sizegroup_button_details_license">
- <widgets>
- <widget name="button_details_license_free"/>
- <widget name="button_details_license_nonfree"/>
- <widget name="button_details_license_unknown"/>
- </widgets>
- </object>
- <object class="GtkPopover" id="popover_license_free">
- <property name="visible">False</property>
- <property name="border_width">21</property>
- <property name="relative_to">button_details_license_free</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Free Software</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="max_width_chars">34</property>
- <property name="label" translatable="yes">This means that the software can be freely run,
copied, distributed, studied and modified.</property>
- <property name="wrap">True</property>
- <property name="xalign">0</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label_licenses_intro">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label">Users are bound by the following licenses:</property>
- <property name="wrap">True</property>
- <property name="xalign">0</property>
- </object>
- </child>
- <child>
- <object class="GtkBox" id="box_details_license_list">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkPopover" id="popover_license_nonfree">
- <property name="visible">False</property>
- <property name="border_width">21</property>
- <property name="relative_to">button_details_license_nonfree</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Proprietary Software</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="max_width_chars">34</property>
- <property name="label" translatable="yes">This means that the software is owned by an individual
or a company. There are often restrictions on its use and its source code cannot usually be
accessed.</property>
- <property name="wrap">True</property>
- <property name="xalign">0</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label_license_nonfree_details">
- <property name="visible">True</property>
- <property name="use-markup">True</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">More information</property>
- <property name="wrap">True</property>
- <property name="xalign">0</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkPopover" id="popover_license_unknown">
- <property name="visible">False</property>
- <property name="name">popover_license_unknown</property>
- <property name="border_width">21</property>
- <property name="relative_to">button_details_license_unknown</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Unknown Software License</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="max_width_chars">34</property>
- <property name="label" translatable="yes">The license terms of this software are
unknown.</property>
- <property name="wrap">True</property>
- <property name="xalign">0</property>
- </object>
- </child>
- </object>
- </child>
- </object>
<object class="GtkBox" id="origin_box">
<property name="visible">True</property>
diff --git a/src/gtk-style.css b/src/gtk-style.css
index e17c85cf2..bbf9ec2af 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -78,73 +78,6 @@ sidebar row.needs-attention:selected > box > label {
-gtk-outline-radius: 16px;
}
-.details-license-free,
-.details-license-nonfree,
-.details-license-unknown,
-.details-license-free:backdrop,
-.details-license-nonfree:backdrop,
-.details-license-unknown:backdrop {
- outline-offset: 0;
- background-image: none;
- border-image: none;
- border-radius: 4px;
- border-width: 0 0 2px 0;
- padding: 1px 9px;
- box-shadow: none;
- text-shadow: none;
- color: #ffffff;
-}
-
-.details-license-free label,
-.details-license-free:backdrop label,
-.details-license-free:hover label,
-.details-license-nonfree label,
-.details-license-nonfree:backdrop label,
-.details-license-nonfree:hover label {
- color: #fff;
-}
-
-.details-license-unknown label,
-.details-license-unknown:backdrop label,
-.details-license-unknown:hover label {
- color: #373d3f;
-}
-.details-license-free {
- background-color: #4e9a06;
- border-color: #3e7905;
-}
-.details-license-free:hover {
- background-color: #5db807;
- border-color: #4d9606;
-}
-.details-license-free:backdrop {
- border-color: #4e9a06;
-}
-
-.details-license-nonfree {
- background-color: #ee2222;
- border-color: #c20f0f;
-}
-.details-license-nonfree:hover {
- background-color: #f25959;
- border-color: #ed1b1b;
-}
-.details-license-nonfree:backdrop {
- border-color: #ee2222;
-}
-
-.details-license-unknown {
- background-color: #dbdbdb;
- border-color: #bbbbbb;
-}
-.details-license-unknown:hover {
- background-color: #eeeeee;
- border-color: #d5d5d5;
-}
-.details-license-unknown:backdrop {
- border-color: #dbdbdb;
-}
-
.kudo-pill {
color: @theme_selected_fg_color;
background-color: shade(@theme_selected_bg_color, 1.1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]