mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: Implement markchartrow.filter-by-mark action
This finally allows setting a session-wide mark filter.
This commit is contained in:
@ -50,6 +50,27 @@ G_DEFINE_FINAL_TYPE (SysprofMarkChartRow, sysprof_mark_chart_row, GTK_TYPE_WIDGE
|
|||||||
|
|
||||||
static GParamSpec *properties [N_PROPS];
|
static GParamSpec *properties [N_PROPS];
|
||||||
|
|
||||||
|
static void
|
||||||
|
filter_by_mark_action (GtkWidget *widget,
|
||||||
|
const char *action_name,
|
||||||
|
GVariant *parameter)
|
||||||
|
{
|
||||||
|
SysprofMarkChartRow *self = (SysprofMarkChartRow *)widget;
|
||||||
|
SysprofMarkCatalog *catalog;
|
||||||
|
SysprofSession *session;
|
||||||
|
|
||||||
|
g_assert (SYSPROF_IS_MARK_CHART_ROW (self));
|
||||||
|
|
||||||
|
if (self->item == NULL ||
|
||||||
|
!(session = sysprof_mark_chart_item_get_session (self->item)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
catalog = sysprof_mark_chart_item_get_catalog (self->item);
|
||||||
|
g_assert (SYSPROF_IS_MARK_CATALOG (catalog));
|
||||||
|
|
||||||
|
sysprof_session_filter_by_mark (session, catalog);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
sysprof_mark_chart_row_activate_layer_item_cb (SysprofMarkChartRow *self,
|
sysprof_mark_chart_row_activate_layer_item_cb (SysprofMarkChartRow *self,
|
||||||
SysprofChartLayer *layer,
|
SysprofChartLayer *layer,
|
||||||
@ -205,6 +226,8 @@ sysprof_mark_chart_row_class_init (SysprofMarkChartRowClass *klass)
|
|||||||
gtk_widget_class_bind_template_callback (widget_class, sysprof_mark_chart_row_activate_layer_item_cb);
|
gtk_widget_class_bind_template_callback (widget_class, sysprof_mark_chart_row_activate_layer_item_cb);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, sysprof_mark_chart_row_button_pressed_cb);
|
gtk_widget_class_bind_template_callback (widget_class, sysprof_mark_chart_row_button_pressed_cb);
|
||||||
|
|
||||||
|
gtk_widget_class_install_action (widget_class, "markchartrow.filter-by-mark", NULL, filter_by_mark_action);
|
||||||
|
|
||||||
g_type_ensure (SYSPROF_TYPE_CHART);
|
g_type_ensure (SYSPROF_TYPE_CHART);
|
||||||
g_type_ensure (SYSPROF_TYPE_TIME_SERIES_ITEM);
|
g_type_ensure (SYSPROF_TYPE_TIME_SERIES_ITEM);
|
||||||
g_type_ensure (SYSPROF_TYPE_TIME_SPAN_LAYER);
|
g_type_ensure (SYSPROF_TYPE_TIME_SPAN_LAYER);
|
||||||
|
|||||||
Reference in New Issue
Block a user