anjuta r3562 - in trunk: . plugins/patch plugins/profiler



Author: jhs
Date: Fri Feb  1 11:01:49 2008
New Revision: 3562
URL: http://svn.gnome.org/viewvc/anjuta?rev=3562&view=rev

Log:
2008-02-01  Johannes Schmid <jhs gnome org>

	* plugins/patch/patch-plugin.glade:
	* plugins/patch/plugin.c: (patch_plugin_activate):
	Another UI issue with the patch plugin and silenced a compiler
	warning
	
	Patch from James Liggett:
	* plugins/profiler/gprof-call-graph-view.c:
	(gprof_call_graph_view_create_columns):
	* plugins/profiler/gprof-flat-profile-view.c:
	(gprof_flat_profile_view_create_columns):
	* plugins/profiler/gprof-view.c: (gprof_view_format_float):
	* plugins/profiler/gprof-view.h:
	
	Use two decimal places for float values in profiler views (#507831)

Modified:
   trunk/ChangeLog
   trunk/plugins/patch/patch-plugin.glade
   trunk/plugins/patch/plugin.c
   trunk/plugins/profiler/gprof-call-graph-view.c
   trunk/plugins/profiler/gprof-flat-profile-view.c
   trunk/plugins/profiler/gprof-view.c
   trunk/plugins/profiler/gprof-view.h

Modified: trunk/plugins/patch/patch-plugin.glade
==============================================================================
--- trunk/plugins/patch/patch-plugin.glade	(original)
+++ trunk/plugins/patch/patch-plugin.glade	Fri Feb  1 11:01:49 2008
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.0 on Thu Jan 31 19:51:34 2008 
+<!--Generated with glade3 3.4.0 on Fri Feb  1 11:57:23 2008 
 	Version: 2.91.3
 	Date: Sat Jul 29 21:16:15 2006
 	User: jhs
@@ -26,29 +26,36 @@
               <placeholder/>
             </child>
             <child>
-              <widget class="GtkHScale" id="patch_level_scale">
-                <property name="adjustment">0 0 0 0 10 0</property>
-                <property name="digits">0</property>
+              <widget class="GtkCheckButton" id="dryrun">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Dry run</property>
+                <property name="response_id">0</property>
+                <property name="draw_indicator">True</property>
               </widget>
               <packing>
-                <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkLabel" id="label3">
+              <widget class="GtkLabel" id="output">
+                <property name="visible">True</property>
+              </widget>
+              <packing>
+                <property name="right_attach">2</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label1">
                 <property name="xalign">0</property>
                 <property name="yalign">0</property>
                 <property name="xpad">5</property>
                 <property name="ypad">5</property>
-                <property name="label">Patch level:</property>
+                <property name="label">File/Directory to patch:</property>
               </widget>
-              <packing>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-              </packing>
             </child>
             <child>
               <widget class="GtkLabel" id="label2">
@@ -64,35 +71,28 @@
               </packing>
             </child>
             <child>
-              <widget class="GtkLabel" id="label1">
+              <widget class="GtkLabel" id="label3">
                 <property name="xalign">0</property>
                 <property name="yalign">0</property>
                 <property name="xpad">5</property>
                 <property name="ypad">5</property>
-                <property name="label">File/Directory to patch:</property>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkLabel" id="output">
-                <property name="visible">True</property>
+                <property name="label">Patch level:</property>
               </widget>
               <packing>
-                <property name="right_attach">2</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkCheckButton" id="dryrun">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">Dry run</property>
-                <property name="response_id">0</property>
-                <property name="draw_indicator">True</property>
+              <widget class="GtkHScale" id="patch_level_scale">
+                <property name="adjustment">0 0 10 0 10 0</property>
+                <property name="digits">0</property>
               </widget>
               <packing>
+                <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
           </widget>

Modified: trunk/plugins/patch/plugin.c
==============================================================================
--- trunk/plugins/patch/plugin.c	(original)
+++ trunk/plugins/patch/plugin.c	Fri Feb  1 11:01:49 2008
@@ -25,7 +25,7 @@
 #include "patch-plugin.h"
 
 #define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-patch.ui"
-#define ICON_FILE "anjuta-patch-plugin-48.png"
+#define ICON_FILE_48 "anjuta-patch-plugin-48.png"
 
 static gpointer parent_class;
 
@@ -85,7 +85,7 @@
 	
 	/* Register icon */
 	BEGIN_REGISTER_ICON (plugin);
-	REGISTER_ICON (ICON_FILE, "patch-plugin-icon");
+	REGISTER_ICON (ICON_FILE_48, "patch-plugin-icon");
 	END_REGISTER_ICON;
 
 

Modified: trunk/plugins/profiler/gprof-call-graph-view.c
==============================================================================
--- trunk/plugins/profiler/gprof-call-graph-view.c	(original)
+++ trunk/plugins/profiler/gprof-call-graph-view.c	Fri Feb  1 11:01:49 2008
@@ -346,8 +346,10 @@
 	
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", 
-										FUNCTIONS_COL_TIME);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (FUNCTIONS_COL_TIME),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 										
@@ -360,8 +362,10 @@
 	gtk_tree_view_append_column (GTK_TREE_VIEW (functions_list_view), col);
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", 
-										FUNCTIONS_COL_SELF);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (FUNCTIONS_COL_SELF),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 	
@@ -372,8 +376,10 @@
 	gtk_tree_view_append_column (GTK_TREE_VIEW (called_list_view), col);
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", 
-										CALLED_COL_SELF);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (CALLED_COL_SELF),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 	
@@ -384,8 +390,10 @@
 	gtk_tree_view_append_column (GTK_TREE_VIEW (called_by_list_view), col);
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", 
-										CALLED_COL_SELF);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (CALLED_COL_SELF),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 										
@@ -395,8 +403,10 @@
 	gtk_tree_view_append_column (GTK_TREE_VIEW (functions_list_view), col);
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", 
-										FUNCTIONS_COL_CHILDREN);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (FUNCTIONS_COL_CHILDREN),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 	
@@ -405,8 +415,10 @@
 	gtk_tree_view_append_column (GTK_TREE_VIEW (called_list_view), col);
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", 
-										CALLED_COL_CHILDREN);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (CALLED_COL_CHILDREN),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 	
@@ -415,8 +427,10 @@
 	gtk_tree_view_append_column (GTK_TREE_VIEW (called_by_list_view), col);
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", 
-										CALLED_COL_CHILDREN);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (CALLED_COL_CHILDREN),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 										

Modified: trunk/plugins/profiler/gprof-flat-profile-view.c
==============================================================================
--- trunk/plugins/profiler/gprof-flat-profile-view.c	(original)
+++ trunk/plugins/profiler/gprof-flat-profile-view.c	Fri Feb  1 11:01:49 2008
@@ -70,7 +70,10 @@
 	
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", COL_TIME_PERC);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (COL_TIME_PERC),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);	
 	
@@ -81,7 +84,10 @@
 	
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", COL_CUM_SEC);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (COL_CUM_SEC),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);	
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 	
@@ -95,7 +101,10 @@
 	
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", COL_SELF_SEC);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (COL_SELF_SEC),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 	
@@ -120,7 +129,10 @@
 	
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", COL_AVG_MS);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (COL_AVG_MS),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 	
@@ -133,7 +145,10 @@
 	
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_column_pack_start (col, renderer, TRUE);
-	gtk_tree_view_column_add_attribute (col, renderer, "text", COL_TOTAL_MS);
+	gtk_tree_view_column_set_cell_data_func (col, renderer, 
+											 gprof_view_format_float,
+											 GINT_TO_POINTER (COL_TOTAL_MS),
+											 NULL);
 	gtk_tree_view_column_set_resizable (col, TRUE);
 	gtk_tree_view_column_set_reorderable (col, TRUE);
 	

Modified: trunk/plugins/profiler/gprof-view.c
==============================================================================
--- trunk/plugins/profiler/gprof-view.c	(original)
+++ trunk/plugins/profiler/gprof-view.c	Fri Feb  1 11:01:49 2008
@@ -158,3 +158,21 @@
 {
 	return GPROF_VIEW_GET_CLASS (self)->get_widget (self);
 }
+
+void 
+gprof_view_format_float (GtkTreeViewColumn *col,  GtkCellRenderer *renderer,
+						 GtkTreeModel *model, GtkTreeIter *iter,
+					     gpointer column_number)
+{
+	gfloat number;
+	gchar *formatted_number;
+	
+	gtk_tree_model_get (model, iter, GPOINTER_TO_INT (column_number), &number,
+						-1);
+	
+	formatted_number = g_strdup_printf ("%0.2f", number);
+	g_object_set (renderer, "text", formatted_number, NULL);
+	
+	g_free (formatted_number);
+}
+

Modified: trunk/plugins/profiler/gprof-view.h
==============================================================================
--- trunk/plugins/profiler/gprof-view.h	(original)
+++ trunk/plugins/profiler/gprof-view.h	Fri Feb  1 11:01:49 2008
@@ -74,6 +74,13 @@
 void gprof_view_refresh (GProfView *self);
 GtkWidget *gprof_view_get_widget (GProfView *self);
 
+/* Static methods */
+void gprof_view_format_float (GtkTreeViewColumn *col, 
+							  GtkCellRenderer *renderer,
+							  GtkTreeModel *model,
+							  GtkTreeIter *iter,
+							  gpointer column_number);
+
 G_END_DECLS
 
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]