mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-03-23 05:31:28 +00:00
libsysprof-ui: add empty state for timing data
This commit is contained in:
@ -434,8 +434,6 @@ sysprof_capture_view_load_scan_cb (GObject *object,
|
||||
if (priv->features.has_counters || priv->features.has_marks)
|
||||
sysprof_visualizer_view_set_reader (priv->visualizer_view, state->reader);
|
||||
|
||||
if (priv->features.has_marks)
|
||||
{
|
||||
state->n_active++;
|
||||
sysprof_marks_view_load_async (priv->marks_view,
|
||||
state->reader,
|
||||
@ -443,7 +441,6 @@ sysprof_capture_view_load_scan_cb (GObject *object,
|
||||
g_task_get_cancellable (task),
|
||||
sysprof_capture_view_load_marks_cb,
|
||||
g_object_ref (task));
|
||||
}
|
||||
|
||||
sysprof_details_view_set_reader (priv->details_view, priv->reader);
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ typedef struct
|
||||
GtkTreeView *tree_view;
|
||||
GtkTreeViewColumn *duration_column;
|
||||
SysprofCellRendererDuration *duration_cell;
|
||||
GtkStack *stack;
|
||||
} SysprofMarksViewPrivate;
|
||||
|
||||
enum {
|
||||
@ -216,6 +217,7 @@ sysprof_marks_view_class_init (SysprofMarksViewClass *klass)
|
||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMarksView, tree_view);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMarksView, duration_cell);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMarksView, duration_column);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMarksView, stack);
|
||||
|
||||
properties [PROP_ZOOM_MANAGER] =
|
||||
g_param_spec_object ("zoom-manager", NULL, NULL,
|
||||
@ -291,6 +293,11 @@ sysprof_marks_view_load_cb (GObject *object,
|
||||
|
||||
gtk_tree_view_set_model (priv->tree_view, GTK_TREE_MODEL (model));
|
||||
|
||||
if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (model), NULL) == 0)
|
||||
gtk_stack_set_visible_child_name (priv->stack, "empty-state");
|
||||
else
|
||||
gtk_stack_set_visible_child_name (priv->stack, "marks");
|
||||
|
||||
g_task_return_boolean (task, TRUE);
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="SysprofMarksView" parent="GtkBin">
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scroller">
|
||||
<property name="visible">true</property>
|
||||
@ -80,6 +83,22 @@
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">marks</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="SysprofEmptyStateView">
|
||||
<property name="icon-name">computer-fail-symbolic</property>
|
||||
<property name="title" translatable="yes">No Timings Available</property>
|
||||
<property name="subtitle" translatable="yes">No timing data was collected.</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">empty-state</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
|
||||
Reference in New Issue
Block a user