[gnome-control-center] info-overview: Hide software_updates_row when allow-updates is false.
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] info-overview: Hide software_updates_row when allow-updates is false.
- Date: Fri, 7 May 2021 03:59:39 +0000 (UTC)
commit df9c4d726f9b8d6b2063ca6337b733b529db360a
Author: Jan Kot <janymalino gmail com>
Date: Thu Jan 21 13:15:03 2021 +0100
info-overview: Hide software_updates_row when allow-updates is false.
panels/info-overview/cc-info-overview-panel.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
---
diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c
index f5c5ad7ea..7e1aefcad 100644
--- a/panels/info-overview/cc-info-overview-panel.c
+++ b/panels/info-overview/cc-info-overview-panel.c
@@ -770,6 +770,28 @@ info_overview_panel_setup_overview (CcInfoOverviewPanel *self)
cc_list_row_set_secondary_markup (self->graphics_row, graphics_hardware_string);
}
+static gboolean
+does_gnome_software_allow_updates (void)
+{
+ const gchar *schema_id = "org.gnome.software";
+ GSettingsSchemaSource *source;
+ g_autoptr(GSettingsSchema) schema;
+ g_autoptr(GSettings) settings;
+
+ source = g_settings_schema_source_get_default ();
+
+ if (source == NULL)
+ return FALSE;
+
+ schema = g_settings_schema_source_lookup (source, schema_id, FALSE);
+
+ if (schema == NULL)
+ return FALSE;
+
+ settings = g_settings_new (schema_id);
+ return g_settings_get_boolean (settings, "allow-updates");
+}
+
static gboolean
does_gnome_software_exist (void)
{
@@ -918,7 +940,7 @@ cc_info_overview_panel_init (CcInfoOverviewPanel *self)
g_resources_register (cc_info_overview_get_resource ());
- if (!does_gnome_software_exist () && !does_gpk_update_viewer_exist ())
+ if ((!does_gnome_software_exist () || !does_gnome_software_allow_updates ()) &&
!does_gpk_update_viewer_exist ())
gtk_widget_hide (GTK_WIDGET (self->software_updates_row));
info_overview_panel_setup_overview (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]