diff --git a/src/libsysprof-ui/sysprof-aid-icon.c b/src/libsysprof-ui/sysprof-aid-icon.c index 6ee91a7e..5dc43fbc 100644 --- a/src/libsysprof-ui/sysprof-aid-icon.c +++ b/src/libsysprof-ui/sysprof-aid-icon.c @@ -63,6 +63,14 @@ sysprof_aid_icon_new (SysprofAid *aid) NULL); } +gboolean +sysprof_aid_icon_is_selected (SysprofAidIcon *self) +{ + g_return_val_if_fail (SYSPROF_IS_AID_ICON (self), FALSE); + + return gtk_widget_get_visible (GTK_WIDGET (self->check)); +} + /** * sysprof_aid_icon_get_aid: * diff --git a/src/libsysprof-ui/sysprof-aid-icon.h b/src/libsysprof-ui/sysprof-aid-icon.h index b49726b1..20f53f68 100644 --- a/src/libsysprof-ui/sysprof-aid-icon.h +++ b/src/libsysprof-ui/sysprof-aid-icon.h @@ -31,8 +31,9 @@ G_BEGIN_DECLS G_DECLARE_FINAL_TYPE (SysprofAidIcon, sysprof_aid_icon, SYSPROF, AID_ICON, GtkFlowBoxChild) -GtkWidget *sysprof_aid_icon_new (SysprofAid *aid); -SysprofAid *sysprof_aid_icon_get_aid (SysprofAidIcon *self); -void sysprof_aid_icon_toggle (SysprofAidIcon *self); +GtkWidget *sysprof_aid_icon_new (SysprofAid *aid); +SysprofAid *sysprof_aid_icon_get_aid (SysprofAidIcon *self); +void sysprof_aid_icon_toggle (SysprofAidIcon *self); +gboolean sysprof_aid_icon_is_selected (SysprofAidIcon *self); G_END_DECLS diff --git a/src/libsysprof-ui/sysprof-profiler-assistant.c b/src/libsysprof-ui/sysprof-profiler-assistant.c index 5a96acec..ef22031c 100644 --- a/src/libsysprof-ui/sysprof-profiler-assistant.c +++ b/src/libsysprof-ui/sysprof-profiler-assistant.c @@ -169,9 +169,12 @@ sysprof_profiler_assistant_foreach_cb (GtkWidget *widget, } else if (SYSPROF_IS_AID_ICON (widget)) { - SysprofAid *aid = sysprof_aid_icon_get_aid (SYSPROF_AID_ICON (widget)); + if (sysprof_aid_icon_is_selected (SYSPROF_AID_ICON (widget))) + { + SysprofAid *aid = sysprof_aid_icon_get_aid (SYSPROF_AID_ICON (widget)); - sysprof_aid_prepare (aid, profiler); + sysprof_aid_prepare (aid, profiler); + } } }