Remove ancestors pane in favor of radiobuttons in the right pane.
authorSøren Sandmann <sandmann@redhat.com>
Sun, 5 Feb 2006 04:54:04 +0000 (04:54 +0000)
committerSøren Sandmann Pedersen <ssp@src.gnome.org>
Sun, 5 Feb 2006 04:54:04 +0000 (04:54 +0000)
Sat Feb  4 23:53:05 2006  Søren Sandmann  <sandmann@redhat.com>

* sysprof.glade: Remove ancestors pane in favor of radiobuttons in
the right pane.

* sysprof.c: Corresponding changes.

* TODO: Updates

ChangeLog
TODO
sysprof.c
sysprof.glade

index 6077577..c442614 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Sat Feb  4 23:53:05 2006  Søren Sandmann  <sandmann@redhat.com>
+
+       * 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  <sandmann@redhat.com>
 
        * TODO: Updates
diff --git a/TODO b/TODO
index c8d14fb..f7a8172 100644 (file)
--- 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.
index 8af671a..495c790 100644 (file)
--- 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);
index f9210e7..1190f71 100644 (file)
              <property name="border_width">3</property>
              <property name="visible">True</property>
              <property name="can_focus">True</property>
+             <property name="position">0</property>
 
              <child>
-               <widget class="GtkVPaned" id="vpaned">
+               <widget class="GtkScrolledWindow" id="scrolledwindow7">
                  <property name="visible">True</property>
                  <property name="can_focus">True</property>
+                 <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                 <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                 <property name="shadow_type">GTK_SHADOW_IN</property>
+                 <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
                  <child>
-                   <widget class="GtkScrolledWindow" id="scrolledwindow1">
+                   <widget class="GtkTreeView" id="object_view">
                      <property name="visible">True</property>
                      <property name="can_focus">True</property>
-                     <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                     <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                     <property name="shadow_type">GTK_SHADOW_IN</property>
-                     <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+                     <property name="headers_visible">True</property>
+                     <property name="rules_hint">True</property>
+                     <property name="reorderable">False</property>
+                     <property name="enable_search">True</property>
+                     <property name="fixed_height_mode">False</property>
+                     <property name="hover_selection">False</property>
+                     <property name="hover_expand">False</property>
+                   </widget>
+                 </child>
+               </widget>
+               <packing>
+                 <property name="shrink">True</property>
+                 <property name="resize">False</property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkVBox" id="vbox5">
+                 <property name="visible">True</property>
+                 <property name="homogeneous">False</property>
+                 <property name="spacing">0</property>
+
+                 <child>
+                   <widget class="GtkNotebook" id="view_notebook">
+                     <property name="visible">True</property>
+                     <property name="show_tabs">False</property>
+                     <property name="show_border">False</property>
+                     <property name="tab_pos">GTK_POS_TOP</property>
+                     <property name="scrollable">False</property>
+                     <property name="enable_popup">False</property>
 
                      <child>
-                       <widget class="GtkTreeView" id="object_view">
+                       <widget class="GtkScrolledWindow" id="scrolledwindow6">
                          <property name="visible">True</property>
                          <property name="can_focus">True</property>
-                         <property name="headers_visible">True</property>
-                         <property name="rules_hint">True</property>
-                         <property name="reorderable">False</property>
-                         <property name="enable_search">True</property>
-                         <property name="fixed_height_mode">False</property>
-                         <property name="hover_selection">False</property>
-                         <property name="hover_expand">False</property>
+                         <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                         <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                         <property name="shadow_type">GTK_SHADOW_IN</property>
+                         <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+                         <child>
+                           <widget class="GtkTreeView" id="descendants_view">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="headers_visible">True</property>
+                             <property name="rules_hint">True</property>
+                             <property name="reorderable">False</property>
+                             <property name="enable_search">True</property>
+                             <property name="fixed_height_mode">False</property>
+                             <property name="hover_selection">False</property>
+                             <property name="hover_expand">False</property>
+                           </widget>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="tab_expand">False</property>
+                         <property name="tab_fill">True</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label2">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Descendants</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                         <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                         <property name="width_chars">-1</property>
+                         <property name="single_line_mode">False</property>
+                         <property name="angle">0</property>
+                       </widget>
+                       <packing>
+                         <property name="type">tab</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkScrolledWindow" id="scrolledwindow5">
+                         <property name="visible">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                         <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                         <property name="shadow_type">GTK_SHADOW_IN</property>
+                         <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+                         <child>
+                           <widget class="GtkTreeView" id="callers_view">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="headers_visible">True</property>
+                             <property name="rules_hint">True</property>
+                             <property name="reorderable">False</property>
+                             <property name="enable_search">True</property>
+                             <property name="fixed_height_mode">False</property>
+                             <property name="hover_selection">False</property>
+                             <property name="hover_expand">False</property>
+                           </widget>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="tab_expand">False</property>
+                         <property name="tab_fill">True</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label3">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Ancestors</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                         <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                         <property name="width_chars">-1</property>
+                         <property name="single_line_mode">False</property>
+                         <property name="angle">0</property>
                        </widget>
+                       <packing>
+                         <property name="type">tab</property>
+                       </packing>
                      </child>
                    </widget>
                    <packing>
-                     <property name="shrink">True</property>
-                     <property name="resize">False</property>
+                     <property name="padding">0</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
                    </packing>
                  </child>
 
                  <child>
-                   <widget class="GtkScrolledWindow" id="scrolledwindow3">
+                   <widget class="GtkHBox" id="hbox2">
                      <property name="visible">True</property>
-                     <property name="can_focus">True</property>
-                     <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                     <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                     <property name="shadow_type">GTK_SHADOW_IN</property>
-                     <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+                     <property name="homogeneous">False</property>
+                     <property name="spacing">12</property>
 
                      <child>
-                       <widget class="GtkTreeView" id="callers_view">
+                       <widget class="GtkRadioButton" id="descendants_radiobutton">
                          <property name="visible">True</property>
                          <property name="can_focus">True</property>
-                         <property name="headers_visible">True</property>
-                         <property name="rules_hint">True</property>
-                         <property name="reorderable">False</property>
-                         <property name="enable_search">True</property>
-                         <property name="fixed_height_mode">False</property>
-                         <property name="hover_selection">False</property>
-                         <property name="hover_expand">False</property>
+                         <property name="label" translatable="yes">_Descendants</property>
+                         <property name="use_underline">True</property>
+                         <property name="relief">GTK_RELIEF_NORMAL</property>
+                         <property name="focus_on_click">True</property>
+                         <property name="active">False</property>
+                         <property name="inconsistent">False</property>
+                         <property name="draw_indicator">True</property>
                        </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">False</property>
+                         <property name="fill">False</property>
+                         <property name="pack_type">GTK_PACK_END</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkRadioButton" id="ancestors_radiobutton">
+                         <property name="visible">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="label" translatable="yes">_Ancestors</property>
+                         <property name="use_underline">True</property>
+                         <property name="relief">GTK_RELIEF_NORMAL</property>
+                         <property name="focus_on_click">True</property>
+                         <property name="active">False</property>
+                         <property name="inconsistent">False</property>
+                         <property name="draw_indicator">True</property>
+                         <property name="group">descendants_radiobutton</property>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">False</property>
+                         <property name="fill">False</property>
+                         <property name="pack_type">GTK_PACK_END</property>
+                       </packing>
                      </child>
                    </widget>
                    <packing>
-                     <property name="shrink">True</property>
-                     <property name="resize">True</property>
+                     <property name="padding">0</property>
+                     <property name="expand">False</property>
+                     <property name="fill">False</property>
+                     <property name="pack_type">GTK_PACK_END</property>
                    </packing>
                  </child>
                </widget>
                <packing>
                  <property name="shrink">True</property>
-                 <property name="resize">False</property>
-               </packing>
-             </child>
-
-             <child>
-               <widget class="GtkScrolledWindow" id="scrolledwindow2">
-                 <property name="visible">True</property>
-                 <property name="can_focus">True</property>
-                 <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                 <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                 <property name="shadow_type">GTK_SHADOW_IN</property>
-                 <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-                 <child>
-                   <widget class="GtkTreeView" id="descendants_view">
-                     <property name="visible">True</property>
-                     <property name="can_focus">True</property>
-                     <property name="headers_visible">True</property>
-                     <property name="rules_hint">True</property>
-                     <property name="reorderable">False</property>
-                     <property name="enable_search">True</property>
-                     <property name="fixed_height_mode">False</property>
-                     <property name="hover_selection">False</property>
-                     <property name="hover_expand">False</property>
-                   </widget>
-                 </child>
-               </widget>
-               <packing>
-                 <property name="shrink">True</property>
                  <property name="resize">True</property>
                </packing>
              </child>