From: Søren Sandmann Date: Sun, 5 Feb 2006 04:54:04 +0000 (+0000) Subject: Remove ancestors pane in favor of radiobuttons in the right pane. X-Git-Tag: 1.1.2~231 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58a1cf37efb3eb6a833e6269243750340027be31;p=platform%2Fupstream%2Fsysprof.git Remove ancestors pane in favor of radiobuttons in the right pane. Sat Feb 4 23:53:05 2006 Søren Sandmann * sysprof.glade: Remove ancestors pane in favor of radiobuttons in the right pane. * sysprof.c: Corresponding changes. * TODO: Updates --- diff --git a/ChangeLog b/ChangeLog index 6077577..c442614 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat Feb 4 23:53:05 2006 Søren Sandmann + + * sysprof.glade: Remove ancestors pane in favor of radiobuttons in + the right pane. + + * sysprof.c: Corresponding changes. + + * TODO: Updates + Wed Jan 25 11:24:04 2006 Søren Sandmann * TODO: Updates diff --git a/TODO b/TODO index c8d14fb..f7a8172 100644 --- a/TODO +++ b/TODO @@ -232,18 +232,25 @@ http://www.linuxbase.org/spec/booksets/LSB-Embedded/LSB-Embedded/ehframe.html list leaves for each leaf add trace to tree (leaf, interesting) + - Consider adding KDE-style nested callgraph view - probably need a dependency on gtk+ 2.8 (cairo) for this. - Matthias has code for something like this. + - Add support for line numbers within functions - Possibly a special "view details" mode, assuming that the details of a function are not that interesting together with a tree. (Could add radio buttons somewhere in in the right pane). + - CVS head now has two radio buttons in the right pane, and + caller pane is gone. + - rethink caller list, not terribly useful at the moment. Federico suggested listing all ancestors. Done: implemented this idea in CVS HEAD. If we keep it that way, should do a globale s/callers/ancestors on the code. + - not sure it's an improvement. Often it is more interesting to + find the immediate callers. - Have kernel module report the file the address was found in Should avoid a lot of potential broken/raciness with dlopen etc. diff --git a/sysprof.c b/sysprof.c index 8af671a..495c790 100644 --- a/sysprof.c +++ b/sysprof.c @@ -55,6 +55,10 @@ struct Application GtkTreeView * object_view; GtkTreeView * callers_view; GtkTreeView * descendants_view; + + GtkWidget * ancestors_radiobutton; + GtkWidget * descendants_radiobutton; + GtkWidget * view_notebook; GtkWidget * start_button; GtkWidget * profile_button; @@ -233,6 +237,9 @@ update_sensitivity (Application *app) gtk_widget_set_sensitive (GTK_WIDGET (app->callers_view), sensitive_tree_views); gtk_widget_set_sensitive (GTK_WIDGET (app->descendants_view), sensitive_tree_views); gtk_widget_set_sensitive (GTK_WIDGET (app->samples_label), sensitive_samples_label); + + gtk_widget_set_sensitive (GTK_WIDGET (app->descendants_radiobutton), sensitive_tree_views); + gtk_widget_set_sensitive (GTK_WIDGET (app->ancestors_radiobutton), sensitive_tree_views); if (app->screenshot_window_visible) gtk_widget_show (app->screenshot_window); @@ -303,6 +310,10 @@ delete_data (Application *app) gtk_tree_view_set_model (GTK_TREE_VIEW (app->callers_view), NULL); gtk_tree_view_set_model (GTK_TREE_VIEW (app->descendants_view), NULL); } + + /* Show descendants by default for new profiles */ + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (app->descendants_radiobutton), TRUE); collector_reset (app->collector); @@ -1283,10 +1294,24 @@ on_screenshot_close_button_clicked (GtkWidget *widget, } static void +switch_views (GtkWidget *widget, + Application *app) +{ + if (gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON (app->ancestors_radiobutton))) + { + gtk_notebook_set_current_page (GTK_NOTEBOOK (app->view_notebook), 1); + } + else + { + gtk_notebook_set_current_page (GTK_NOTEBOOK (app->view_notebook), 0); + } +} + +static void set_sizes (GtkWindow *window, GtkWindow *screenshot_window, - GtkWidget *hpaned, - GtkWidget *vpaned) + GtkWidget *hpaned) { GdkScreen *screen; int monitor_num; @@ -1304,7 +1329,6 @@ set_sizes (GtkWindow *window, gtk_window_resize (window, width, height); - gtk_paned_set_position (GTK_PANED (vpaned), height / 2); gtk_paned_set_position (GTK_PANED (hpaned), width * 3 / 8); width = monitor.width * 5 / 8; @@ -1465,6 +1489,14 @@ build_gui (Application *app) g_signal_connect (app->descendants_view, "row_collapsed", G_CALLBACK (on_descendants_row_expanded_or_collapsed), app); gtk_tree_view_column_set_expand (col, TRUE); + + /* view notebook */ + app->view_notebook = glade_xml_get_widget (xml, "view_notebook"); + app->ancestors_radiobutton = glade_xml_get_widget (xml, "ancestors_radiobutton"); + app->descendants_radiobutton = glade_xml_get_widget (xml, "descendants_radiobutton"); + + g_signal_connect (app->ancestors_radiobutton, "toggled", G_CALLBACK (switch_views), app); + g_signal_connect (app->descendants_radiobutton, "toggled", G_CALLBACK (switch_views), app); /* screenshot window */ app->screenshot_window = glade_xml_get_widget (xml, "screenshot_window"); @@ -1480,8 +1512,7 @@ build_gui (Application *app) /* set sizes */ set_sizes (GTK_WINDOW (app->main_window), GTK_WINDOW (app->screenshot_window), - glade_xml_get_widget (xml, "hpaned"), - glade_xml_get_widget (xml, "vpaned")); + glade_xml_get_widget (xml, "hpaned")); /* hide/show widgets */ gtk_widget_show_all (app->main_window); diff --git a/sysprof.glade b/sysprof.glade index f9210e7..1190f71 100644 --- a/sysprof.glade +++ b/sysprof.glade @@ -463,101 +463,220 @@ 3 True True + 0 - + True True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT - + True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT + True + True + False + True + False + False + False + + + + + True + False + + + + + + True + False + 0 + + + + True + False + False + GTK_POS_TOP + False + False - + True True - True - True - False - True - False - False - False + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + True + False + True + False + False + False + + + + + False + True + + + + + + True + Descendants + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + True + False + True + False + False + False + + + + + False + True + + + + + + True + Ancestors + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + tab + - True - False + 0 + True + True - + True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT + False + 12 - + True True - True - True - False - True - False - False - False + _Descendants + True + GTK_RELIEF_NORMAL + True + False + False + True + + 0 + False + False + GTK_PACK_END + + + + + + True + True + _Ancestors + True + GTK_RELIEF_NORMAL + True + False + False + True + descendants_radiobutton + + + 0 + False + False + GTK_PACK_END + - True - True + 0 + False + False + GTK_PACK_END True - False - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - True - False - True - False - False - False - - - - - True True