~ubuntu-branches/ubuntu/maverick/xfce4-cpufreq-plugin/maverick

« back to all changes in this revision

Viewing changes to debian/patches/01_add_always_ghz_option.patch

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez, Yves-Alexis Perez, Simon Huggins, Stefan Ott
  • Date: 2008-04-14 22:13:14 UTC
  • Revision ID: james.westby@ubuntu.com-20080414221314-oenprao7jiqw8s0n
Tags: 0.2-2
[ Yves-Alexis Perez ]
* debian/control: 
  - updated standards version to 3.7.3.
  - updated my email address.
  - drop dpatch build-dep, useless.
  - add needed build-dep on intltool.
* debian/patches:
  - 02_ja.po added, add japanese translation.                 closes: #475914
* debian/copyright: updated dates and copyright holders.

[ Simon Huggins ]
* Add Vcs-* headers to debian/control

[ Stefan Ott]
* Add patch to always show frequency in GHz                      closes:#474330

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
3
@@ -64,6 +64,7 @@
 
4
 
 
5
        gboolean invert_colors;
 
6
        gboolean showed_warning;
 
7
+       gboolean always_GHz;
 
8
 
 
9
        GdkColor colorLow;
 
10
        GdkColor colorHi;
 
11
@@ -178,9 +179,9 @@
 
12
                }
 
13
        }
 
14
        
 
15
-       if (cur < 1000000)
 
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);
 
18
-       else
 
19
+       else 
 
20
                snprintf(buf, 256, "<span size=\"small\">%.1f GHz</span>", (gdouble)cur / 1000000);
 
21
 
 
22
        if ((cur < c->max && !c->invert_colors) || 
 
23
@@ -291,6 +292,7 @@
 
24
        {
 
25
                c->cpu = 0;
 
26
                c->invert_colors = FALSE;
 
27
+               c->always_GHz = FALSE;
 
28
                return;
 
29
        }
 
30
        
 
31
@@ -302,11 +304,13 @@
 
32
        {
 
33
                c->cpu = 0;
 
34
                c->invert_colors = FALSE;
 
35
+               c->always_GHz = FALSE;
 
36
                return;
 
37
        }
 
38
 
 
39
        c->cpu = atoi(str);
 
40
        c->invert_colors = xfce_rc_read_bool_entry(rc, "InvColors", FALSE);
 
41
+       c->always_GHz = xfce_rc_read_bool_entry(rc, "AlwaysGHz", FALSE);
 
42
        xfce_rc_close (rc);
 
43
 }
 
44
 
 
45
@@ -329,6 +333,7 @@
 
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);
 
50
        xfce_rc_close (rc);
 
51
 }
 
52
 
 
53
@@ -351,6 +356,15 @@
 
54
 }
 
55
 
 
56
 static void
 
57
+always_GHz_toggled (GtkToggleButton *button, gpointer data)
 
58
+{
 
59
+       struct cpufreq_monitor *c = (struct cpufreq_monitor *)data;
 
60
+       c->always_GHz = gtk_toggle_button_get_active (button);
 
61
+
 
62
+       update_cpufreq_status (c);
 
63
+}
 
64
+
 
65
+static void
 
66
 combo_changed_cb (GtkComboBox *cb, gpointer data)
 
67
 {
 
68
        struct cpufreq_monitor *c = (struct cpufreq_monitor *)data;
 
69
@@ -410,16 +424,30 @@
 
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);
 
73
-
 
74
+       
 
75
+       GtkWidget *options_list = gtk_vbox_new(TRUE, 0);
 
76
+       gtk_widget_show(options_list);
 
77
+       
 
78
        GtkWidget *invert = gtk_check_button_new_with_mnemonic
 
79
                                                        (_("Invert colors"));
 
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); 
 
84
 
 
85
        g_signal_connect(invert, "toggled", 
 
86
                                G_CALLBACK (invert_colors_toggled), c);
 
87
        
 
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); 
 
93
+
 
94
+       g_signal_connect(alwaysGHz, "toggled", 
 
95
+                               G_CALLBACK (always_GHz_toggled), c);
 
96
+       
 
97
+       gtk_container_add(GTK_CONTAINER (options), options_list);
 
98
+       
 
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);
 
102
@@ -445,6 +473,7 @@
 
103
        c->nr_cpus = get_nr_cpus();
 
104
        c->showed_warning = FALSE;
 
105
        c->invert_colors = FALSE;
 
106
+       c->always_GHz = FALSE;
 
107
        
 
108
        /* determine min/max */
 
109
        cpufreq_get_hardware_limits(c->cpu, &c->min, &c->max);