mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: add bus type to columns
This commit is contained in:
@ -125,6 +125,25 @@ format_flags (gpointer data,
|
||||
return flags_to_string (G_TYPE_DBUS_MESSAGE_FLAGS, flags);
|
||||
}
|
||||
|
||||
static char *
|
||||
format_bus_type (gpointer data,
|
||||
guint bus_type)
|
||||
{
|
||||
if (bus_type == G_BUS_TYPE_SESSION)
|
||||
return g_strdup ("Session");
|
||||
else if (bus_type == G_BUS_TYPE_SYSTEM)
|
||||
return g_strdup ("System");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static guint
|
||||
cast_bus_type (gpointer data,
|
||||
guint bus_type)
|
||||
{
|
||||
return bus_type;
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_dbus_section_dispose (GObject *object)
|
||||
{
|
||||
@ -147,6 +166,8 @@ sysprof_dbus_section_class_init (SysprofDBusSectionClass *klass)
|
||||
gtk_widget_class_bind_template_child (widget_class, SysprofDBusSection, column_view);
|
||||
gtk_widget_class_bind_template_child (widget_class, SysprofDBusSection, scrubber);
|
||||
gtk_widget_class_bind_template_child (widget_class, SysprofDBusSection, time_column);
|
||||
gtk_widget_class_bind_template_callback (widget_class, cast_bus_type);
|
||||
gtk_widget_class_bind_template_callback (widget_class, format_bus_type);
|
||||
gtk_widget_class_bind_template_callback (widget_class, format_flags);
|
||||
gtk_widget_class_bind_template_callback (widget_class, format_serial);
|
||||
gtk_widget_class_bind_template_callback (widget_class, format_size);
|
||||
|
||||
@ -117,6 +117,45 @@
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Bus</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="sort-order">ascending</property>
|
||||
<property name="expression">
|
||||
<closure type="guint" function="cast_bus_type">
|
||||
<lookup name="bus-type" type="SysprofDocumentDBusMessage"/>
|
||||
</closure>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<binding name="label">
|
||||
<closure type="gchararray" function="format_bus_type">
|
||||
<lookup name="bus-type" type="SysprofDocumentDBusMessage">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</closure>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
|
||||
Reference in New Issue
Block a user