mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: connect view menu to callgraph properties
This commit is contained in:
@ -8,6 +8,16 @@
|
||||
<child>
|
||||
<object class="SysprofWeightedCallgraphView" id="callgraph_view">
|
||||
<property name="vexpand">true</property>
|
||||
<binding name="include-threads">
|
||||
<lookup name="include-threads" type="SysprofSession">
|
||||
<lookup name="session">SysprofSamplesSection</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
<binding name="hide-system-libraries">
|
||||
<lookup name="hide-system-libraries" type="SysprofSession">
|
||||
<lookup name="session">SysprofSamplesSection</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
<binding name="document">
|
||||
<lookup name="document" type="SysprofSession">
|
||||
<lookup name="session">SysprofSamplesSection</lookup>
|
||||
|
||||
@ -72,6 +72,11 @@ static void
|
||||
sysprof_window_set_document (SysprofWindow *self,
|
||||
SysprofDocument *document)
|
||||
{
|
||||
static const char *callgraph_actions[] = {
|
||||
"include-threads",
|
||||
"hide-system-libraries",
|
||||
};
|
||||
|
||||
g_assert (SYSPROF_IS_WINDOW (self));
|
||||
g_assert (SYSPROF_IS_DOCUMENT (document));
|
||||
g_assert (self->document == NULL);
|
||||
@ -82,6 +87,14 @@ sysprof_window_set_document (SysprofWindow *self,
|
||||
|
||||
self->session = sysprof_session_new (document);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SESSION]);
|
||||
|
||||
for (guint i = 0; i < G_N_ELEMENTS (callgraph_actions); i++)
|
||||
{
|
||||
g_autofree char *action_name = g_strdup_printf ("callgraph.%s", callgraph_actions[i]);
|
||||
g_autoptr(GPropertyAction) action = g_property_action_new (action_name, self->session, callgraph_actions[i]);
|
||||
|
||||
g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (action));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@ -81,6 +81,7 @@
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">document-properties-symbolic</property>
|
||||
<property name="menu-model">view_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@ -178,4 +179,17 @@
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="view_menu">
|
||||
<section>
|
||||
<attribute name="label" translatable="yes">Callgraph</attribute>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Hide System Libraries</attribute>
|
||||
<attribute name="action" translatable="yes">win.callgraph.hide-system-libraries</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Include Threads</attribute>
|
||||
<attribute name="action" translatable="yes">win.callgraph.include-threads</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
</interface>
|
||||
|
||||
Reference in New Issue
Block a user