libsysprof-ui: reload process model when not in whole-system

This commit is contained in:
Christian Hergert
2019-05-10 19:49:29 -07:00
parent a10b7759af
commit d7014ac4e8

View File

@ -847,6 +847,21 @@ sysprof_profiler_menu_button_validate_spawn (SysprofProfilerMenuButton *self,
}
}
static void
sysprof_profiler_menu_button_notify_whole_system (SysprofProfilerMenuButton *self,
GParamSpec *pspec,
GtkSwitch *whole_system)
{
SysprofProfilerMenuButtonPrivate *priv = sysprof_profiler_menu_button_get_instance_private (self);
g_assert (SYSPROF_IS_PROFILER_MENU_BUTTON (self));
g_assert (GTK_IS_SWITCH (whole_system));
/* Reload when process view is shown */
if (!gtk_switch_get_active (whole_system))
sysprof_process_model_queue_reload (priv->process_model);
}
static void
sysprof_profiler_menu_button_init (SysprofProfilerMenuButton *self)
{
@ -878,6 +893,12 @@ sysprof_profiler_menu_button_init (SysprofProfilerMenuButton *self)
self,
G_CONNECT_SWAPPED);
g_signal_connect_object (priv->whole_system_switch,
"notify::active",
G_CALLBACK (sysprof_profiler_menu_button_notify_whole_system),
self,
G_CONNECT_SWAPPED);
g_signal_connect_object (priv->process_list_box,
"row-activated",
G_CALLBACK (sysprof_profiler_menu_button_row_activated),