[Pkg-xfce-commits] r1842 - in goodies/xfce4-cpufreq-plugin/debian: . patches

cockroach-guest at alioth.debian.org cockroach-guest at alioth.debian.org
Mon Apr 7 23:26:13 UTC 2008


Author: cockroach-guest
Date: 2008-04-07 23:26:12 +0000 (Mon, 07 Apr 2008)
New Revision: 1842

Added:
   goodies/xfce4-cpufreq-plugin/debian/patches/01_add_always_ghz_option.patch
Modified:
   goodies/xfce4-cpufreq-plugin/debian/changelog
Log:
Added patch to always show frequency in GHz


Modified: goodies/xfce4-cpufreq-plugin/debian/changelog
===================================================================
--- goodies/xfce4-cpufreq-plugin/debian/changelog	2008-04-07 11:14:38 UTC (rev 1841)
+++ goodies/xfce4-cpufreq-plugin/debian/changelog	2008-04-07 23:26:12 UTC (rev 1842)
@@ -6,6 +6,9 @@
   [ Simon Huggins ]
   * Add Vcs-* headers to debian/control
 
+  [ Stefan Ott]
+  * Add patch to always show frequency in GHz 			closes: 474330
+
  -- Simon Huggins <huggie at earth.li>  Tue, 27 Nov 2007 17:07:12 +0000
 
 xfce4-cpufreq-plugin (0.2-1) unstable; urgency=low

Added: goodies/xfce4-cpufreq-plugin/debian/patches/01_add_always_ghz_option.patch
===================================================================
--- goodies/xfce4-cpufreq-plugin/debian/patches/01_add_always_ghz_option.patch	                        (rev 0)
+++ goodies/xfce4-cpufreq-plugin/debian/patches/01_add_always_ghz_option.patch	2008-04-07 23:26:12 UTC (rev 1842)
@@ -0,0 +1,109 @@
+--- xfce4-cpufreq-plugin-0.2/cpufreq.c	2006-06-16 02:21:54.000000000 +0200
++++ xfce4-cpufreq-plugin-0.2.patched/cpufreq.c	2008-04-05 01:24:44.914728734 +0200
+@@ -64,6 +64,7 @@
+ 
+ 	gboolean invert_colors;
+ 	gboolean showed_warning;
++	gboolean always_GHz;
+ 
+ 	GdkColor colorLow;
+ 	GdkColor colorHi;
+@@ -178,9 +179,9 @@
+ 		}
+ 	}
+ 	
+-	if (cur < 1000000)
++	if ((cur < 1000000) && !c->always_GHz)
+ 		snprintf(buf, 256, "<span size=\"x-small\">%d</span><span size=\"small\"> </span><span size=\"x-small\">MHz</span>", cur / 1000);
+-	else
++	else 
+ 		snprintf(buf, 256, "<span size=\"small\">%.1f GHz</span>", (gdouble)cur / 1000000);
+ 
+ 	if ((cur < c->max && !c->invert_colors) || 
+@@ -291,6 +292,7 @@
+ 	{
+ 		c->cpu = 0;
+ 		c->invert_colors = FALSE;
++		c->always_GHz = FALSE;
+ 		return;
+ 	}
+ 	
+@@ -302,11 +304,13 @@
+ 	{
+ 		c->cpu = 0;
+ 		c->invert_colors = FALSE;
++		c->always_GHz = FALSE;
+ 		return;
+ 	}
+ 
+ 	c->cpu = atoi(str);
+ 	c->invert_colors = xfce_rc_read_bool_entry(rc, "InvColors", FALSE);
++	c->always_GHz = xfce_rc_read_bool_entry(rc, "AlwaysGHz", FALSE);
+ 	xfce_rc_close (rc);
+ }
+ 
+@@ -329,6 +333,7 @@
+ 	snprintf(buf, 32, "%d", c->cpu);
+ 	xfce_rc_write_entry(rc, "NumCPUs", buf);
+ 	xfce_rc_write_bool_entry(rc, "InvColors", c->invert_colors);
++	xfce_rc_write_bool_entry(rc, "AlwaysGHz", c->always_GHz);
+ 	xfce_rc_close (rc);
+ }
+ 
+@@ -351,6 +356,15 @@
+ }
+ 
+ static void
++always_GHz_toggled (GtkToggleButton *button, gpointer data)
++{
++	struct cpufreq_monitor *c = (struct cpufreq_monitor *)data;
++	c->always_GHz = gtk_toggle_button_get_active (button);
++
++	update_cpufreq_status (c);
++}
++
++static void
+ combo_changed_cb (GtkComboBox *cb, gpointer data)
+ {
+ 	struct cpufreq_monitor *c = (struct cpufreq_monitor *)data;
+@@ -410,16 +424,30 @@
+ 	GtkWidget *options_label = gtk_label_new (_("Options"));
+ 	gtk_widget_show (options_label);
+ 	gtk_frame_set_label_widget (GTK_FRAME (options), options_label);
+-
++	
++	GtkWidget *options_list = gtk_vbox_new(TRUE, 0);
++	gtk_widget_show(options_list);
++	
+ 	GtkWidget *invert = gtk_check_button_new_with_mnemonic
+ 							(_("Invert colors"));
+ 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(invert), c->invert_colors);
+ 	gtk_widget_show(invert);
+-	gtk_container_add (GTK_CONTAINER (options), invert);
++	gtk_container_add (GTK_CONTAINER (options_list), invert); 
+ 
+ 	g_signal_connect(invert, "toggled", 
+ 				G_CALLBACK (invert_colors_toggled), c);
+ 	
++	GtkWidget *alwaysGHz = gtk_check_button_new_with_mnemonic
++							(_("Always show Frequency as GHz"));
++	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(alwaysGHz), c->always_GHz);
++	gtk_widget_show(alwaysGHz);
++	gtk_container_add (GTK_CONTAINER (options_list), alwaysGHz); 
++
++	g_signal_connect(alwaysGHz, "toggled", 
++				G_CALLBACK (always_GHz_toggled), c);
++	
++	gtk_container_add(GTK_CONTAINER (options), options_list);
++	
+ 	gtk_box_pack_start(GTK_BOX(vbox), header, FALSE, TRUE, 0);
+ 	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
+ 	gtk_box_pack_start(GTK_BOX(vbox), cpucombo, FALSE, FALSE, 0);
+@@ -445,6 +473,7 @@
+ 	c->nr_cpus = get_nr_cpus();
+ 	c->showed_warning = FALSE;
+ 	c->invert_colors = FALSE;
++	c->always_GHz = FALSE;
+ 	
+ 	/* determine min/max */
+ 	cpufreq_get_hardware_limits(c->cpu, &c->min, &c->max);




More information about the Pkg-xfce-commits mailing list