[gnome-software/wip/ubuntu-zesty: 126/134] Hide licence, updated and category fields if they aren't set
- From: Jeremy Bicha <jbicha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/ubuntu-zesty: 126/134] Hide licence, updated and category fields if they aren't set
- Date: Sat, 17 Dec 2016 05:16:25 +0000 (UTC)
commit 864af253c78029aa2381b5bf3bdf06a47efb8c88
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Mar 29 11:30:08 2016 +1300
Hide licence, updated and category fields if they aren't set
src/gs-shell-details.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index c843ec9..4aa04bf 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -94,6 +94,7 @@ struct _GsShellDetails
GtkWidget *label_details_category_value;
GtkWidget *label_details_developer_title;
GtkWidget *label_details_developer_value;
+ GtkWidget *label_details_license_title;
GtkWidget *button_details_license_free;
GtkWidget *button_details_license_nonfree;
GtkWidget *button_details_license_unknown;
@@ -103,6 +104,7 @@ struct _GsShellDetails
GtkWidget *label_details_size_installed_value;
GtkWidget *label_details_size_download_title;
GtkWidget *label_details_size_download_value;
+ GtkWidget *label_details_updated_title;
GtkWidget *label_details_updated_value;
GtkWidget *label_details_version_value;
GtkWidget *label_failed;
@@ -793,15 +795,18 @@ gs_shell_details_refresh_all (GsShellDetails *self)
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);
+ gtk_widget_set_visible (self->button_details_license_unknown, FALSE);
+ gtk_widget_set_visible (self->label_details_license_title, FALSE);
} 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);
+ gtk_widget_set_visible (self->label_details_license_title, TRUE);
} 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);
+ gtk_widget_set_visible (self->label_details_license_title, TRUE);
}
/* set version */
@@ -845,6 +850,8 @@ gs_shell_details_refresh_all (GsShellDetails *self)
updated == GS_APP_INSTALL_DATE_UNSET) {
/* TRANSLATORS: this is where the updated date is not known */
gtk_label_set_label (GTK_LABEL (self->label_details_updated_value), C_("updated", "Never"));
+ gtk_widget_set_visible (self->label_details_updated_title, FALSE);
+ gtk_widget_set_visible (self->label_details_updated_value, FALSE);
} else {
g_autoptr(GDateTime) dt = NULL;
g_autofree gchar *updated_str = NULL;
@@ -863,6 +870,8 @@ gs_shell_details_refresh_all (GsShellDetails *self)
gtk_label_set_markup (GTK_LABEL (self->label_details_updated_value), url->str);
g_string_free (url, TRUE);
}
+ gtk_widget_set_visible (self->label_details_updated_title, TRUE);
+ gtk_widget_set_visible (self->label_details_updated_value, TRUE);
}
/* set the category */
@@ -2002,6 +2011,7 @@ gs_shell_details_class_init (GsShellDetailsClass *klass)
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_category_value);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_developer_title);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_developer_value);
+ gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_license_title);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_license_free);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_license_nonfree);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_license_unknown);
@@ -2011,6 +2021,7 @@ gs_shell_details_class_init (GsShellDetailsClass *klass)
gtk_widget_class_bind_template_child (widget_class, GsShellDetails,
label_details_size_download_value);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails,
label_details_size_installed_title);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails,
label_details_size_installed_value);
+ gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_updated_title);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_updated_value);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_version_value);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_failed);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]