diff --git a/ChangeLog b/ChangeLog index 2316d32f..6af1a4d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Mar 2 22:54:37 2006 Soeren Sandmann + + * treeviewutils.c (tree_view_foreach_visible): Handle NULL models. + + * sysprof.glade, sysprof.c: Revert back to three pane layout. + 2006-02-17 Bastien Nocera * configure.ac: diff --git a/TODO b/TODO index 1646e36d..7f5210f5 100644 --- a/TODO +++ b/TODO @@ -244,8 +244,6 @@ http://www.linuxbase.org/spec/booksets/LSB-Embedded/LSB-Embedded/ehframe.html 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. @@ -468,6 +466,10 @@ Later: DONE: +- CVS head now has two radio buttons in the right pane, and + caller pane is gone. (This turned out to be a bad idea, because it + is often useful to click on ancestors to move up the tree). + * Don't build the GUI if gtk+ is not installed * Find out why we sometimes get reports of time spent by [pid 0]. diff --git a/sysprof.c b/sysprof.c index 2d1bfc91..a6e3bda9 100644 --- a/sysprof.c +++ b/sysprof.c @@ -55,10 +55,6 @@ 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; @@ -239,9 +235,6 @@ 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); @@ -312,10 +305,6 @@ 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); @@ -1297,25 +1286,11 @@ on_screenshot_close_button_clicked (GtkWidget *widget, update_sensitivity (app); } -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 *hpaned, + GtkWidget *vpaned) { GdkScreen *screen; int monitor_num; @@ -1333,6 +1308,7 @@ 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; @@ -1493,14 +1469,6 @@ 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"); @@ -1516,7 +1484,8 @@ 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, "hpaned"), + glade_xml_get_widget (xml, "vpaned")); /* hide/show widgets */ gtk_widget_show_all (app->main_window); diff --git a/sysprof.glade b/sysprof.glade index 1190f710..f9210e70 100644 --- a/sysprof.glade +++ b/sysprof.glade @@ -463,10 +463,78 @@ 3 True True - 0 - + + True + True + + + + 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 + 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 + + + + + True + False + + + + + True True GTK_POLICY_AUTOMATIC @@ -475,7 +543,7 @@ GTK_CORNER_TOP_LEFT - + True True True @@ -488,193 +556,6 @@ - - True - False - - - - - - True - False - 0 - - - - True - False - False - GTK_POS_TOP - False - 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 - - - - - 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 - - - - - 0 - True - True - - - - - - True - False - 12 - - - - True - True - _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 - - - - - 0 - False - False - GTK_PACK_END - - - True True diff --git a/treeviewutils.c b/treeviewutils.c index 8f8f2c8f..65f9b73d 100644 --- a/treeviewutils.c +++ b/treeviewutils.c @@ -265,6 +265,6 @@ tree_view_foreach_visible (GtkTreeView *view, GtkTreeModel *model = gtk_tree_view_get_model (view); GtkTreeIter iter; - if (gtk_tree_model_get_iter_first (model, &iter)) + if (model && gtk_tree_model_get_iter_first (model, &iter)) process_iter (view, &iter, callback, data); }