From e6d1389f8345153a57c7ea32a6fc4319b4adb379 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sat, 8 Jul 2023 13:09:13 -0700 Subject: [PATCH] sysprof: add size column (and use columnview) for files --- src/sysprof/sysprof-files-dialog.c | 8 ++++++ src/sysprof/sysprof-files-dialog.ui | 41 +++++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/sysprof/sysprof-files-dialog.c b/src/sysprof/sysprof-files-dialog.c index 4232af8c..dff6cccf 100644 --- a/src/sysprof/sysprof-files-dialog.c +++ b/src/sysprof/sysprof-files-dialog.c @@ -104,6 +104,13 @@ sysprof_files_dialog_activate_cb (SysprofFilesDialog *self, gtk_window_present (window); } +static char * +format_size (gpointer unused, + guint64 size) +{ + return g_format_size (size); +} + static void sysprof_files_dialog_dispose (GObject *object) { @@ -173,6 +180,7 @@ sysprof_files_dialog_class_init (SysprofFilesDialogClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-files-dialog.ui"); gtk_widget_class_bind_template_callback (widget_class, sysprof_files_dialog_activate_cb); + gtk_widget_class_bind_template_callback (widget_class, format_size); gtk_widget_class_bind_template_child (widget_class, SysprofFilesDialog, column_view); gtk_widget_class_bind_template_child (widget_class, SysprofFilesDialog, path_column); } diff --git a/src/sysprof/sysprof-files-dialog.ui b/src/sysprof/sysprof-files-dialog.ui index 93ee4d96..8b5a8d66 100644 --- a/src/sysprof/sysprof-files-dialog.ui +++ b/src/sysprof/sysprof-files-dialog.ui @@ -20,7 +20,6 @@ - true true @@ -58,10 +57,6 @@ 0 - 3 - 3 - 6 - 6 GtkListItem @@ -71,6 +66,42 @@ +]]> + + + + + + + + Size + + + + + + + + + + + + + ]]>