speedprof 'Record' button ...



Hi there,

	When I use speedprof - which (it seems) is perhaps the nicest profiling
tool I've seen for quick & easy profiling of OO.o - having got what I
need, I run the profile & then get increasingly paranoid while thousands
of samples stack up while I analyse the results ;-)

	This (very) simple patch adds a 'Record' button that well - just
stops / starts the event logging process (and hence blocks the remote
app) on the toolbar. It also fixes a crash with the tree view selection
API (changed behavior in the GtkTreeView apprently).

	What's happened to memprof ? is there any real development ongoing, we
have a number of outstanding fixes to make stuff work, pwrt. threading
etc. Is this maintained ? and/or can one tag
'last-hope-before-meeks-mangles-it' and commit stuff ? :-)

	Thanks,

		Michael. 

-- 
 michael meeks novell com  <><, Pseudo Engineer, itinerant idiot
Index: main.c
===================================================================
RCS file: /cvs/gnome/memprof/main.c,v
retrieving revision 1.36
diff -u -p -u -r1.36 main.c
--- main.c	11 Sep 2004 00:35:19 -0000	1.36
+++ main.c	29 Apr 2006 19:43:50 -0000
@@ -410,7 +410,8 @@ profile_selection_changed (GtkTreeSelect
 	GtkSortType old_sort_type;
 	gboolean was_sorted;
 
-	gtk_tree_selection_get_selected (selection, (GtkTreeModel **)&store, &selected);
+	if (!gtk_tree_selection_get_selected (selection, (GtkTreeModel **)&store, &selected))
+		return;
 
 	gtk_tree_model_get (GTK_TREE_MODEL (store), &selected,
 			    PROFILE_FUNC_FUNC, &func,
@@ -1226,6 +1230,18 @@ reset_profile_cb (GtkWidget *widget)
 		process_clear_input (pwin->process);
 }
 
+void
+record_button_toggled_cb (GtkWidget *widget)
+{
+	ProcessWindow *pwin = pwin_from_widget (widget);
+
+	if (gtk_toggle_tool_button_get_active
+			(GTK_TOGGLE_TOOL_BUTTON (widget)))
+		process_start_input (pwin->process);
+	else
+		process_stop_input (pwin->process);
+}
+
 static void
 string_view_init (GtkTreeView *tree_view)
 {
Index: memprof.glade
===================================================================
RCS file: /cvs/gnome/memprof/memprof.glade,v
retrieving revision 1.21
diff -u -p -u -r1.21 memprof.glade
--- memprof.glade	20 Sep 2003 20:33:44 -0000	1.21
+++ memprof.glade	29 Apr 2006 19:43:50 -0000
@@ -326,68 +335,120 @@
		  <property name="stock_pixmap">gtk-clear</property>
 		  <signal name="clicked" handler="reset_profile_cb" last_modification_time="Sat, 21 Jun 2003 20:02:39 GMT"/>
 		</widget>
+	      </child>
+
+	      <child>
+		<widget class="GtkToggleToolButton" id="record-button">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Record</property>
+		  <property name="use_underline">True</property>
+		  <property name="stock_id">gtk-media-record</property>
+		  <property name="visible_horizontal">True</property>
+		  <property name="visible_vertical">True</property>
+		  <property name="is_important">False</property>
+		  <property name="active">True</property>
+		  <signal name="toggled" handler="record_button_toggled_cb" last_modification_time="Sat, 29 Apr 2006 19:36:29 GMT"/>
+		</widget>
 	      </child>
 	    </widget>
 	  </child>


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