mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-ui: add callgraph loading dialog
This can lag a bit on big profiles, so add a loading page while we generate the callgraph in a thread.
This commit is contained in:
@ -60,6 +60,7 @@ typedef struct
|
||||
GQueue *history;
|
||||
|
||||
guint profile_size;
|
||||
guint loading;
|
||||
} SysprofCallgraphViewPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (SysprofCallgraphView, sysprof_callgraph_view, GTK_TYPE_BIN)
|
||||
@ -1203,3 +1204,22 @@ sysprof_callgraph_view_get_n_functions (SysprofCallgraphView *self)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
_sysprof_callgraph_view_set_loading (SysprofCallgraphView *self,
|
||||
gboolean loading)
|
||||
{
|
||||
SysprofCallgraphViewPrivate *priv = sysprof_callgraph_view_get_instance_private (self);
|
||||
|
||||
g_return_if_fail (SYSPROF_IS_CALLGRAPH_VIEW (self));
|
||||
|
||||
if (loading)
|
||||
priv->loading++;
|
||||
else
|
||||
priv->loading--;
|
||||
|
||||
if (priv->loading)
|
||||
gtk_stack_set_visible_child_name (priv->stack, "loading");
|
||||
else
|
||||
gtk_stack_set_visible_child_name (priv->stack, "callgraph");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user