Right justify numbers

Thu Mar 31 21:18:13 2005  Søren Sandmann  <sandmann@redhat.com>

        * treeviewutils.c (add_double_format_column): Right justify numbers

        * sysprof.c (build_gui): Add a space after the numbers

        * sysprof.c (on_callers_row_activated): Focus object view

        * sysprof.c (on_descendants_row_activated): Focus new descendants
        tree.
This commit is contained in:
Søren Sandmann
2005-04-01 02:28:50 +00:00
committed by Søren Sandmann Pedersen
parent 39162c394a
commit 5f280920c5
4 changed files with 31 additions and 12 deletions

View File

@ -1,3 +1,14 @@
Thu Mar 31 21:18:13 2005 Søren Sandmann <sandmann@redhat.com>
* treeviewutils.c (add_double_format_column): Right justify numbers
* sysprof.c (build_gui): Add a space after the numbers
* sysprof.c (on_callers_row_activated): Focus object view
* sysprof.c (on_descendants_row_activated): Focus new descendants
tree.
Thu Mar 31 19:51:51 2005 Søren Sandmann <sandmann@redhat.com>
* sysprof-module.c (do_generate): Walk all threads, not just all

1
TODO
View File

@ -20,6 +20,7 @@ Before 1.0:
- give profiles on the command line
- autoconfuscate?
- .desktop file
- Consider expanding a few more levels of a new descendants tree
Before 1.2:

View File

@ -944,8 +944,6 @@ really_goto_object (Application *app, ProfileObject *object)
gtk_tree_view_set_cursor (app->object_view, path, 0, FALSE);
}
gtk_widget_grab_focus (GTK_WIDGET (app->object_view));
}
static void
@ -976,7 +974,11 @@ on_descendants_row_activated (GtkTreeView *tree_view,
GtkTreeViewColumn *column,
gpointer data)
{
goto_object (data, tree_view, path, DESCENDANTS_OBJECT);
Application *app = data;
goto_object (app, tree_view, path, DESCENDANTS_OBJECT);
gtk_widget_grab_focus (GTK_WIDGET (app->descendants_view));
}
static void
@ -985,7 +987,11 @@ on_callers_row_activated (GtkTreeView *tree_view,
GtkTreeViewColumn *column,
gpointer data)
{
goto_object (data, tree_view, path, CALLERS_OBJECT);
Application *app = data;
goto_object (app, tree_view, path, CALLERS_OBJECT);
gtk_widget_grab_focus (GTK_WIDGET (app->object_view));
}
static void
@ -1108,9 +1114,9 @@ build_gui (Application *app)
/* object view */
app->object_view = (GtkTreeView *)glade_xml_get_widget (xml, "object_view");
col = add_plain_text_column (app->object_view, _("Functions"), OBJECT_NAME);
add_double_format_column (app->object_view, _("Self"), OBJECT_SELF, "%.2f");
add_double_format_column (app->object_view, _("Total"), OBJECT_TOTAL, "%.2f");
% col = add_plain_text_column (app->object_view, _("Functions"), OBJECT_NAME);
add_double_format_column (app->object_view, _("Self"), OBJECT_SELF, "%.2f ");
add_double_format_column (app->object_view, _("Total"), OBJECT_TOTAL, "%.2f ");
selection = gtk_tree_view_get_selection (app->object_view);
g_signal_connect (selection, "changed", G_CALLBACK (on_object_selection_changed), app);
@ -1119,8 +1125,8 @@ build_gui (Application *app)
/* callers view */
app->callers_view = (GtkTreeView *)glade_xml_get_widget (xml, "callers_view");
col = add_plain_text_column (app->callers_view, _("Callers"), CALLERS_NAME);
add_double_format_column (app->callers_view, _("Self"), CALLERS_SELF, "%.2f");
add_double_format_column (app->callers_view, _("Total"), CALLERS_TOTAL, "%.2f");
add_double_format_column (app->callers_view, _("Self"), CALLERS_SELF, "%.2f ");
add_double_format_column (app->callers_view, _("Total"), CALLERS_TOTAL, "%.2f ");
g_signal_connect (app->callers_view, "row-activated",
G_CALLBACK (on_callers_row_activated), app);
@ -1129,8 +1135,8 @@ build_gui (Application *app)
/* descendants view */
app->descendants_view = (GtkTreeView *)glade_xml_get_widget (xml, "descendants_view");
col = add_plain_text_column (app->descendants_view, _("Descendants"), DESCENDANTS_NAME);
add_double_format_column (app->descendants_view, _("Self"), DESCENDANTS_SELF, "%.2f");
add_double_format_column (app->descendants_view, _("Cumulative"), DESCENDANTS_NON_RECURSE, "%.2f");
add_double_format_column (app->descendants_view, _("Self"), DESCENDANTS_SELF, "%.2f ");
add_double_format_column (app->descendants_view, _("Cumulative"), DESCENDANTS_NON_RECURSE, "%.2f ");
g_signal_connect (app->descendants_view, "row-activated",
G_CALLBACK (on_descendants_row_activated), app);

View File

@ -145,11 +145,12 @@ add_double_format_column (GtkTreeView *view, const gchar *title, gint model_colu
ColumnInfo *column_info = g_new (ColumnInfo, 1);
renderer = gtk_cell_renderer_text_new ();
g_object_set (renderer, "xalign", 1.0, NULL);
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, title);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_resizable (column, TRUE);
gtk_tree_view_column_set_resizable (column, FALSE);
column_info->column = model_column;
column_info->format = g_strdup (format);