[gnome-software] details-page: Show the channel for snaps
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] details-page: Show the channel for snaps
- Date: Wed, 2 Oct 2019 14:10:14 +0000 (UTC)
commit fc45a8778bee1b4fd7dde46e0ae24f7763decbf2
Author: Robert Ancell <robert ancell canonical com>
Date: Thu Aug 29 08:15:15 2019 +0300
details-page: Show the channel for snaps
src/gs-details-page.c | 14 ++++++++++
src/gs-details-page.ui | 76 +++++++++++++++++++++++++++++++++++++-------------
2 files changed, 70 insertions(+), 20 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 62c28bca..4d88fe88 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -98,6 +98,8 @@ struct _GsDetailsPage
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;
GtkWidget *label_details_origin_value;
GtkWidget *label_details_size_installed_title;
@@ -1160,6 +1162,16 @@ gs_details_page_refresh_all (GsDetailsPage *self)
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));
+ gtk_widget_set_visible (self->label_details_channel_title, TRUE);
+ gtk_widget_set_visible (self->label_details_channel_value, TRUE);
+ } else {
+ gtk_widget_set_visible (self->label_details_channel_title, FALSE);
+ gtk_widget_set_visible (self->label_details_channel_value, FALSE);
+ }
+
/* set version */
tmp = gs_app_get_version (self->app);
if (tmp != NULL){
@@ -2697,6 +2709,8 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
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);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_origin_value);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_size_download_title);
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index b104bf8e..ebd19bbd 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -590,6 +590,42 @@
<property name="column_spacing">24</property>
<property name="hexpand">True</property>
<property name="valign">start</property>
+ <child>
+ <object class="GtkLabel" id="label_details_channel_title">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Channel</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">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_details_channel_value">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="label">stable</property>
+ <property name="selectable">True</property>
+ <property name="ellipsize">end</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <accessibility>
+ <relation type="labelled-by" target="label_details_channel_title"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+
<child>
<object class="GtkLabel" id="label_details_version_title">
<property name="visible">True</property>
@@ -603,7 +639,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
@@ -622,7 +658,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
@@ -639,7 +675,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">8</property>
+ <property name="top_attach">9</property>
</packing>
</child>
<child>
@@ -660,7 +696,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">8</property>
+ <property name="top_attach">9</property>
</packing>
</child>
@@ -677,7 +713,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">9</property>
+ <property name="top_attach">10</property>
</packing>
</child>
<child>
@@ -698,7 +734,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">9</property>
+ <property name="top_attach">10</property>
</packing>
</child>
@@ -715,7 +751,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
@@ -733,7 +769,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
@@ -749,7 +785,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
@@ -769,7 +805,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">3</property>
</packing>
</child>
@@ -786,7 +822,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">6</property>
+ <property name="top_attach">7</property>
</packing>
</child>
<child>
@@ -800,7 +836,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">6</property>
+ <property name="top_attach">7</property>
</packing>
</child>
@@ -817,7 +853,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="top_attach">8</property>
</packing>
</child>
<child>
@@ -831,7 +867,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">7</property>
+ <property name="top_attach">8</property>
</packing>
</child>
@@ -848,7 +884,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">6</property>
</packing>
</child>
<child>
@@ -863,7 +899,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">6</property>
</packing>
</child>
<child>
@@ -879,7 +915,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
@@ -909,7 +945,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
@@ -925,7 +961,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
@@ -971,7 +1007,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
</packing>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]