From d7014ac4e8a2eaae5444f3113be4d7d94880e059 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 10 May 2019 19:49:29 -0700 Subject: [PATCH] libsysprof-ui: reload process model when not in whole-system --- .../sysprof-profiler-menu-button.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/libsysprof-ui/sysprof-profiler-menu-button.c b/src/libsysprof-ui/sysprof-profiler-menu-button.c index 48d01725..0482163e 100644 --- a/src/libsysprof-ui/sysprof-profiler-menu-button.c +++ b/src/libsysprof-ui/sysprof-profiler-menu-button.c @@ -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),