1
--- xfce4-cpufreq-plugin-0.2/cpufreq.c 2006-06-16 02:21:54.000000000 +0200
2
+++ xfce4-cpufreq-plugin-0.2.patched/cpufreq.c 2008-04-05 01:24:44.914728734 +0200
5
gboolean invert_colors;
6
gboolean showed_warning;
16
+ if ((cur < 1000000) && !c->always_GHz)
17
snprintf(buf, 256, "<span size=\"x-small\">%d</span><span size=\"small\"> </span><span size=\"x-small\">MHz</span>", cur / 1000);
20
snprintf(buf, 256, "<span size=\"small\">%.1f GHz</span>", (gdouble)cur / 1000000);
22
if ((cur < c->max && !c->invert_colors) ||
26
c->invert_colors = FALSE;
27
+ c->always_GHz = FALSE;
34
c->invert_colors = FALSE;
35
+ c->always_GHz = FALSE;
40
c->invert_colors = xfce_rc_read_bool_entry(rc, "InvColors", FALSE);
41
+ c->always_GHz = xfce_rc_read_bool_entry(rc, "AlwaysGHz", FALSE);
46
snprintf(buf, 32, "%d", c->cpu);
47
xfce_rc_write_entry(rc, "NumCPUs", buf);
48
xfce_rc_write_bool_entry(rc, "InvColors", c->invert_colors);
49
+ xfce_rc_write_bool_entry(rc, "AlwaysGHz", c->always_GHz);
57
+always_GHz_toggled (GtkToggleButton *button, gpointer data)
59
+ struct cpufreq_monitor *c = (struct cpufreq_monitor *)data;
60
+ c->always_GHz = gtk_toggle_button_get_active (button);
62
+ update_cpufreq_status (c);
66
combo_changed_cb (GtkComboBox *cb, gpointer data)
68
struct cpufreq_monitor *c = (struct cpufreq_monitor *)data;
70
GtkWidget *options_label = gtk_label_new (_("Options"));
71
gtk_widget_show (options_label);
72
gtk_frame_set_label_widget (GTK_FRAME (options), options_label);
75
+ GtkWidget *options_list = gtk_vbox_new(TRUE, 0);
76
+ gtk_widget_show(options_list);
78
GtkWidget *invert = gtk_check_button_new_with_mnemonic
80
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(invert), c->invert_colors);
81
gtk_widget_show(invert);
82
- gtk_container_add (GTK_CONTAINER (options), invert);
83
+ gtk_container_add (GTK_CONTAINER (options_list), invert);
85
g_signal_connect(invert, "toggled",
86
G_CALLBACK (invert_colors_toggled), c);
88
+ GtkWidget *alwaysGHz = gtk_check_button_new_with_mnemonic
89
+ (_("Always show Frequency as GHz"));
90
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(alwaysGHz), c->always_GHz);
91
+ gtk_widget_show(alwaysGHz);
92
+ gtk_container_add (GTK_CONTAINER (options_list), alwaysGHz);
94
+ g_signal_connect(alwaysGHz, "toggled",
95
+ G_CALLBACK (always_GHz_toggled), c);
97
+ gtk_container_add(GTK_CONTAINER (options), options_list);
99
gtk_box_pack_start(GTK_BOX(vbox), header, FALSE, TRUE, 0);
100
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
101
gtk_box_pack_start(GTK_BOX(vbox), cpucombo, FALSE, FALSE, 0);
103
c->nr_cpus = get_nr_cpus();
104
c->showed_warning = FALSE;
105
c->invert_colors = FALSE;
106
+ c->always_GHz = FALSE;
108
/* determine min/max */
109
cpufreq_get_hardware_limits(c->cpu, &c->min, &c->max);