info-overview: Hide software_updates_row when allow-updates is false.
This commit is contained in:
parent
8318d94e2f
commit
df9c4d726f
1 changed files with 23 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue