~ubuntu-branches/ubuntu/precise/xfce4-power-manager/precise

« back to all changes in this revision

Viewing changes to debian/patches/xubuntu-use-notification-icons.patch

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2009-10-02 20:15:41 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091002201541-ognqyxyov51epj84
Tags: 0.8.4-1ubuntu1
* New upstream bugfix release (LP: #438754), merge from Debian unstable,
  remaining Ubuntu changes:
  - debian/patches:
    + xubuntu-use-notification-icons.patch: use our notification-* icons for
      notification bubbles instead of the normal ones LP: #437374
    + 10_pc.patch: added patched files to POTFILES.skip
    + series: created, with these two patches
  - debian/rules: add --with quilt
  - debian/control: build-depends on quilt (>= 0.46-7).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=== modified file 'src/xfpm-battery.c'
 
2
--- a/src/xfpm-battery.c        2009-09-24 09:10:34 +0000
 
3
+++ b/src/xfpm-battery.c        2009-09-26 20:41:29 +0000
 
4
@@ -160,10 +160,12 @@
 
5
                           XfpmBatteryState state,
 
6
                           guint percentage)
 
7
 {
 
8
-    gchar *icon;
 
9
+    gchar *icon = NULL, *notify_icon = NULL;
 
10
 
 
11
     if ( state == BATTERY_NOT_PRESENT )
 
12
     {
 
13
+    //FIXME what icon is most appropriate for this case? When does it happen?
 
14
+    xfpm_tray_icon_set_notify_icon (battery->priv->icon, "notification-battery-100-plugged");
 
15
        xfpm_tray_icon_set_icon (battery->priv->icon, 
 
16
                                 battery->priv->type == HAL_DEVICE_TYPE_UPS ? 
 
17
                                 XFPM_UPS_ICON_PREFIX "missing" : 
 
18
@@ -175,10 +177,13 @@
 
19
     if ( state == BATTERY_FULLY_CHARGED )
 
20
     {
 
21
        if ( battery->priv->type == HAL_DEVICE_TYPE_PRIMARY)
 
22
+       {
 
23
+           xfpm_tray_icon_set_notify_icon (battery->priv->icon, battery->priv->adapter_present ? "notification-battery-100-plugged" : "notification-battery-100");   
 
24
            xfpm_tray_icon_set_icon (battery->priv->icon, 
 
25
                                     battery->priv->adapter_present ? 
 
26
                                     XFPM_PRIMARY_ICON_PREFIX "charged" : 
 
27
                                     XFPM_PRIMARY_ICON_PREFIX "100");
 
28
+       }
 
29
        else
 
30
        {
 
31
            icon = g_strdup_printf("%s%s", 
 
32
@@ -186,6 +191,11 @@
 
33
                                   xfpm_battery_get_icon_index (battery->priv->type, percentage));
 
34
            xfpm_tray_icon_set_icon (battery->priv->icon, icon);
 
35
            g_free(icon);
 
36
+
 
37
+           notify_icon = g_strdup_printf("%s%s", "notification-battery-", 
 
38
+                          xfpm_battery_get_icon_index (battery->priv->type, percentage));
 
39
+           xfpm_tray_icon_set_notify_icon (battery->priv->icon, notify_icon);
 
40
+           g_free(notify_icon);
 
41
        }
 
42
     }
 
43
     else if ( state == BATTERY_NOT_FULLY_CHARGED )
 
44
@@ -196,16 +206,26 @@
 
45
                              battery->priv->icon_prefix, 
 
46
                              xfpm_battery_get_icon_index (battery->priv->type, percentage),
 
47
                              "charging");
 
48
+           notify_icon = g_strdup_printf("%s%s-%s",
 
49
+                             "notification-battery-", 
 
50
+                             xfpm_battery_get_icon_index (battery->priv->type, percentage),
 
51
+                             "plugged");
 
52
        }
 
53
        else
 
54
        {
 
55
            icon = g_strdup_printf("%s%s",
 
56
                              battery->priv->icon_prefix, 
 
57
                              xfpm_battery_get_icon_index (battery->priv->type, percentage));
 
58
+           notify_icon = g_strdup_printf("%s%s",
 
59
+                             "notification-battery-", 
 
60
+                             xfpm_battery_get_icon_index (battery->priv->type, percentage));
 
61
        }
 
62
        xfpm_tray_icon_set_icon (battery->priv->icon, icon);
 
63
        g_free(icon);
 
64
        
 
65
+       xfpm_tray_icon_set_notify_icon (battery->priv->icon, notify_icon);
 
66
+       g_free(notify_icon);
 
67
+       
 
68
     }
 
69
     else if ( state == BATTERY_IS_CHARGING )
 
70
     {
 
71
@@ -213,9 +233,16 @@
 
72
                              battery->priv->icon_prefix, 
 
73
                              xfpm_battery_get_icon_index (battery->priv->type, percentage),
 
74
                              "charging");
 
75
+    notify_icon = g_strdup_printf("%s%s-%s",
 
76
+                             "notification-battery-", 
 
77
+                             xfpm_battery_get_icon_index (battery->priv->type, percentage),
 
78
+                             "plugged");
 
79
                                      
 
80
        xfpm_tray_icon_set_icon (battery->priv->icon, icon);
 
81
        g_free(icon);
 
82
+       
 
83
+       xfpm_tray_icon_set_notify_icon (battery->priv->icon, notify_icon);
 
84
+       g_free(notify_icon);
 
85
     }
 
86
     else if ( state == BATTERY_IS_DISCHARGING || state == BATTERY_CHARGE_CRITICAL ||
 
87
              state == BATTERY_CHARGE_LOW )
 
88
@@ -223,10 +250,15 @@
 
89
        icon = g_strdup_printf("%s%s",
 
90
                              battery->priv->icon_prefix, 
 
91
                              xfpm_battery_get_icon_index (battery->priv->type, percentage));
 
92
+       notify_icon = g_strdup_printf("%s%s",
 
93
+                             "notification-battery-", 
 
94
+                             xfpm_battery_get_icon_index (battery->priv->type, percentage));
 
95
                                      
 
96
        xfpm_tray_icon_set_icon (battery->priv->icon, icon);
 
97
        g_free(icon);
 
98
        
 
99
+       xfpm_tray_icon_set_notify_icon (battery->priv->icon, notify_icon);
 
100
+       g_free(notify_icon);
 
101
     }
 
102
 }
 
103
 
 
104
@@ -245,7 +277,7 @@
 
105
     xfpm_notify_show_notification (battery->priv->notify, 
 
106
                                    _("Xfce power manager"), 
 
107
                                    message, 
 
108
-                                   xfpm_tray_icon_get_icon_name (battery->priv->icon),
 
109
+                                   xfpm_tray_icon_get_notify_icon_name (battery->priv->icon),
 
110
                                    8000,
 
111
                                    battery->priv->type == HAL_DEVICE_TYPE_PRIMARY ? FALSE : TRUE,
 
112
                                    XFPM_NOTIFY_NORMAL,
 
113
 
 
114
=== modified file 'src/xfpm-tray-icon.c'
 
115
--- a/src/xfpm-tray-icon.c      2009-09-24 09:10:34 +0000
 
116
+++ b/src/xfpm-tray-icon.c      2009-09-26 20:52:17 +0000
 
117
@@ -61,6 +61,7 @@
 
118
     
 
119
     GtkStatusIcon   *icon;
 
120
     GQuark           icon_quark;
 
121
+    GQuark           notify_icon_quark;
 
122
     gboolean         info_menu;
 
123
     gboolean         inhibited;
 
124
     gboolean        data_available;
 
125
@@ -119,7 +120,7 @@
 
126
        xfpm_notify_show_notification (tray->priv->notify, 
 
127
                                      _("Xfce power manager"), 
 
128
                                       error->message, 
 
129
-                                      xfpm_tray_icon_get_icon_name (tray),
 
130
+                                      xfpm_tray_icon_get_notify_icon_name (tray),
 
131
                                       10000,
 
132
                                       FALSE,
 
133
                                       XFPM_NOTIFY_CRITICAL,
 
134
@@ -142,7 +143,7 @@
 
135
        xfpm_notify_show_notification (tray->priv->notify, 
 
136
                                      _("Xfce power manager"), 
 
137
                                       error->message, 
 
138
-                                      xfpm_tray_icon_get_icon_name (tray),
 
139
+                                      xfpm_tray_icon_get_notify_icon_name (tray),
 
140
                                       10000,
 
141
                                       FALSE,
 
142
                                       XFPM_NOTIFY_CRITICAL,
 
143
@@ -433,6 +434,7 @@
 
144
     
 
145
     tray->priv->info_menu = TRUE;
 
146
     tray->priv->icon_quark = 0;
 
147
+    tray->priv->notify_icon_quark = 0;
 
148
     
 
149
     g_signal_connect (tray->priv->icon, "size-changed",
 
150
                      G_CALLBACK (xfpm_tray_icon_size_changed_cb), tray);
 
151
@@ -507,6 +509,13 @@
 
152
                                    icon);
 
153
 }
 
154
 
 
155
+void xfpm_tray_icon_set_notify_icon (XfpmTrayIcon *icon, const gchar *icon_name)
 
156
+{
 
157
+    g_return_if_fail(XFPM_IS_TRAY_ICON(icon));
 
158
+    
 
159
+    icon->priv->notify_icon_quark = g_quark_from_string(icon_name);
 
160
+}
 
161
+
 
162
 void xfpm_tray_icon_set_tooltip (XfpmTrayIcon *icon, const gchar *tooltip)
 
163
 {
 
164
     g_return_if_fail (XFPM_IS_TRAY_ICON (icon));
 
165
@@ -551,3 +560,12 @@
 
166
     
 
167
     return  g_quark_to_string (icon->priv->icon_quark);
 
168
 }
 
169
+
 
170
+const gchar *xfpm_tray_icon_get_notify_icon_name   (XfpmTrayIcon *icon)
 
171
+{
 
172
+    g_return_val_if_fail(XFPM_IS_TRAY_ICON(icon), NULL);
 
173
+    
 
174
+    if ( icon->priv->notify_icon_quark == 0 ) return NULL;
 
175
+    
 
176
+    return  g_quark_to_string (icon->priv->notify_icon_quark);
 
177
+}
 
178
 
 
179
=== modified file 'src/xfpm-tray-icon.h'
 
180
--- a/src/xfpm-tray-icon.h      2009-09-24 09:10:34 +0000
 
181
+++ b/src/xfpm-tray-icon.h      2009-09-26 20:50:38 +0000
 
182
@@ -55,6 +55,9 @@
 
183
 
 
184
 void                xfpm_tray_icon_set_icon            (XfpmTrayIcon *icon,
 
185
                                                         const gchar *icon_name);
 
186
+
 
187
+void                xfpm_tray_icon_set_notify_icon     (XfpmTrayIcon *icon,
 
188
+                                                        const gchar *icon_name);
 
189
                                                    
 
190
 void                xfpm_tray_icon_set_tooltip         (XfpmTrayIcon *icon,
 
191
                                                         const gchar *tooltip);
 
192
@@ -68,6 +71,8 @@
 
193
 
 
194
 const gchar        *xfpm_tray_icon_get_icon_name       (XfpmTrayIcon *icon) G_GNUC_PURE;  
 
195
 
 
196
+const gchar        *xfpm_tray_icon_get_notify_icon_name (XfpmTrayIcon *icon) G_GNUC_PURE;  
 
197
+
 
198
 G_END_DECLS
 
199
 
 
200
 #endif /* __XFPM_TRAY_ICON_H */
 
201