[gnome-software/wip/ubuntu-3-20] Display a warning for non-sandboxed snaps.
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/ubuntu-3-20] Display a warning for non-sandboxed snaps.
- Date: Wed, 13 Dec 2017 22:45:54 +0000 (UTC)
commit 913f76ff1946df8f0bd119343e4d778f805054ba
Author: James Henstridge <james jamesh id au>
Date: Fri Jun 23 11:22:36 2017 +0800
Display a warning for non-sandboxed snaps.
src/gs-shell-details.c | 10 ++++++++++
src/gs-shell-details.ui | 43 ++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 52 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 28f792e..78575d7 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -114,6 +114,7 @@ struct _GsShellDetails
GtkWidget *label_details_kudo_integration;
GtkWidget *label_details_kudo_translated;
GtkWidget *label_details_kudo_updated;
+ GtkWidget *box_not_sandboxed_warning;
};
G_DEFINE_TYPE (GsShellDetails, gs_shell_details, GS_TYPE_PAGE)
@@ -828,6 +829,14 @@ gs_shell_details_refresh_all (GsShellDetails *self)
history->len == 0)
gtk_widget_set_visible (self->button_history, FALSE);
+ /* Display a warning about non-sandboxed apps that may come
+ * from third party sources. Currently only checking snaps. */
+ ret = FALSE;
+ if (g_strcmp0 (gs_app_get_management_plugin (self->app), "snap") == 0) {
+ ret |= (kudos & GS_APP_KUDO_SANDBOXED) == 0;
+ }
+ gtk_widget_set_visible (self->box_not_sandboxed_warning, ret);
+
/* are we trying to replace something in the baseos */
gtk_widget_set_visible (self->infobar_details_package_baseos,
gs_app_has_quirk (self->app, AS_APP_QUIRK_COMPULSORY) &&
@@ -1719,6 +1728,7 @@ gs_shell_details_class_init (GsShellDetailsClass *klass)
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_kudo_integration);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_kudo_translated);
gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_kudo_updated);
+ gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_not_sandboxed_warning);
}
/**
diff --git a/src/gs-shell-details.ui b/src/gs-shell-details.ui
index 1c16097..48a30d0 100644
--- a/src/gs-shell-details.ui
+++ b/src/gs-shell-details.ui
@@ -611,6 +611,47 @@
</packing>
</child>
<child>
+ <object class="GtkBox" id="box_not_sandboxed_warning">
+ <property name="visible">False</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">30</property>
+ <property name="margin_bottom">12</property>
+ <child>
+ <object class="GtkImage" id="image_not_sandboxed_image_icon">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">16</property>
+ <property name="icon_name">dialog-warning</property>
+ <property name="icon_size">6</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_not_sandboxed_warning">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">This third party package is not
sandboxed. It will have access to your documents.</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</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">True</property>
+ <property name="fill">True</property>
+ <property name="position">10</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkBox" id="box_details_details">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -990,7 +1031,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">10</property>
+ <property name="position">11</property>
</packing>
</child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]