marks: add end time to mark details

This commit is contained in:
Christian Hergert
2020-01-22 12:01:26 -08:00
parent 812b0d60a0
commit 7dad1f2ab4
2 changed files with 36 additions and 4 deletions

View File

@ -47,6 +47,7 @@ typedef struct
GtkLabel *group;
GtkLabel *mark;
GtkLabel *time;
GtkLabel *end;
GtkLabel *duration;
GtkTextView *message;
} SysprofMarksPagePrivate;
@ -147,12 +148,14 @@ sysprof_marks_page_selection_changed_cb (SysprofMarksPage *self,
g_autofree gchar *name = NULL;
g_autofree gchar *duration_str = NULL;
g_autofree gchar *time_str = NULL;
g_autofree gchar *end_str = NULL;
g_autofree gchar *text = NULL;
GtkAdjustment *adj;
gdouble x;
gint64 begin_time;
gint64 end_time;
gint64 duration;
gint64 etime;
gint64 otime;
gdouble lower;
gdouble upper;
@ -174,10 +177,14 @@ sysprof_marks_page_selection_changed_cb (SysprofMarksPage *self,
otime = begin_time - priv->capture_begin_time;
time_str = _sysprof_format_duration (otime);
etime = end_time - priv->capture_begin_time;
end_str = _sysprof_format_duration (etime);
gtk_label_set_label (priv->group, group);
gtk_label_set_label (priv->mark, name);
gtk_label_set_label (priv->duration, duration_str);
gtk_label_set_label (priv->time, time_str);
gtk_label_set_label (priv->end, end_str);
gtk_text_buffer_set_text (gtk_text_view_get_buffer (priv->message), text, -1);
@ -462,6 +469,7 @@ sysprof_marks_page_class_init (SysprofMarksPageClass *klass)
page_class->set_size_group = sysprof_marks_page_set_size_group;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/ui/sysprof-marks-page.ui");
gtk_widget_class_bind_template_child_private (widget_class, SysprofMarksPage, end);
gtk_widget_class_bind_template_child_private (widget_class, SysprofMarksPage, details_box);
gtk_widget_class_bind_template_child_private (widget_class, SysprofMarksPage, duration_cell);
gtk_widget_class_bind_template_child_private (widget_class, SysprofMarksPage, duration_column);

View File

@ -78,7 +78,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Duration</property>
<property name="label" translatable="yes">End</property>
<property name="visible">true</property>
<property name="xalign">1</property>
<style>
@ -90,6 +90,20 @@
<property name="left-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Duration</property>
<property name="visible">true</property>
<property name="xalign">1</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="top-attach">4</property>
<property name="left-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Message</property>
@ -101,7 +115,7 @@
</style>
</object>
<packing>
<property name="top-attach">4</property>
<property name="top-attach">5</property>
<property name="left-attach">0</property>
</packing>
</child>
@ -139,7 +153,7 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="duration">
<object class="GtkLabel" id="end">
<property name="visible">true</property>
<property name="xalign">0</property>
</object>
@ -148,6 +162,16 @@
<property name="left-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="duration">
<property name="visible">true</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="top-attach">4</property>
<property name="left-attach">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="hexpand">true</property>
@ -161,7 +185,7 @@
</child>
</object>
<packing>
<property name="top-attach">4</property>
<property name="top-attach">5</property>
<property name="left-attach">1</property>
</packing>
</child>