From 008b9f4cc15a4391f18e58293ed646a5a14f8201 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sat, 8 Jul 2023 10:29:00 -0700 Subject: [PATCH] sysprof: add event count to recording pad and style like messagedialog --- src/sysprof/sysprof-recording-pad.c | 11 ++++++ src/sysprof/sysprof-recording-pad.ui | 50 +++++++++++++++++----------- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/sysprof/sysprof-recording-pad.c b/src/sysprof/sysprof-recording-pad.c index 7d78ff7e..35569a64 100644 --- a/src/sysprof/sysprof-recording-pad.c +++ b/src/sysprof/sysprof-recording-pad.c @@ -20,6 +20,8 @@ #include "config.h" +#include + #include "sysprof-application.h" #include "sysprof-recording-pad.h" @@ -42,6 +44,14 @@ G_DEFINE_FINAL_TYPE (SysprofRecordingPad, sysprof_recording_pad, ADW_TYPE_WINDOW static GParamSpec *properties[N_PROPS]; +static char * +format_event_count (GObject *unused, + gint64 event_count) +{ + /* translators: this expands to the number of events recorded by the profiler as an indicator of progress */ + return g_strdup_printf (_("%"G_GINT64_FORMAT" events"), event_count); +} + static char * format_time (GObject *unused, gint64 duration) @@ -139,6 +149,7 @@ sysprof_recording_pad_class_init (SysprofRecordingPadClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-recording-pad.ui"); gtk_widget_class_bind_template_child (widget_class, SysprofRecordingPad, stop_button); gtk_widget_class_bind_template_callback (widget_class, format_time); + gtk_widget_class_bind_template_callback (widget_class, format_event_count); } static void diff --git a/src/sysprof/sysprof-recording-pad.ui b/src/sysprof/sysprof-recording-pad.ui index 1f6871e0..830e9c8f 100644 --- a/src/sysprof/sysprof-recording-pad.ui +++ b/src/sysprof/sysprof-recording-pad.ui @@ -1,6 +1,9 @@