Merge lp:~sense/indicator-application/runtime-themepath-change into lp:~c10ud/indicator-application/runtime-themepath-change
- runtime-themepath-change
- Merge into runtime-themepath-change
Proposed by
Sense Egbert Hofstede
Status: | Merged |
---|---|
Merged at revision: | 147 |
Proposed branch: | lp:~sense/indicator-application/runtime-themepath-change |
Merge into: | lp:~c10ud/indicator-application/runtime-themepath-change |
Diff against target: |
742 lines (+145/-107) 9 files modified
bindings/mono/libappindicator-api.metadata (+5/-1) bindings/python/appindicator.defs (+10/-4) src/app-indicator.c (+43/-28) src/app-indicator.h (+9/-7) src/application-service-appstore.c (+33/-37) src/application-service-appstore.h (+1/-1) src/application-service.xml (+2/-2) src/indicator-application.c (+40/-27) src/notification-item.xml (+2/-0) |
To merge this branch: | bzr merge lp:~sense/indicator-application/runtime-themepath-change |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Riccardo 'c10ud' | Pending | ||
Review via email: mp+30676@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bindings/mono/libappindicator-api.metadata' |
2 | --- bindings/mono/libappindicator-api.metadata 2010-05-23 10:44:53 +0000 |
3 | +++ bindings/mono/libappindicator-api.metadata 2010-07-22 15:44:49 +0000 |
4 | @@ -9,6 +9,8 @@ |
5 | <attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='connection_changed']" name="cname">connection-changed</attr> |
6 | <attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_icon']" name="name">NewIcon</attr> |
7 | <attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_icon']" name="cname">new-icon</attr> |
8 | + <attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_icon_theme_path']" name="name">NewIconThemePath</attr> |
9 | + <attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_icon_theme_path']" name="cname">new-icon-theme-path</attr> |
10 | <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_ID_S']" name="name">ID</attr> |
11 | <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_CATEGORY_S']" name="hidden">true</attr> |
12 | <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_STATUS_S']" name="hidden">true</attr> |
13 | @@ -26,16 +28,18 @@ |
14 | <attr path="/api/namespace/object[@cname='AppIndicator']/constructor[@cname='app_indicator_new_with_path']/*/*[@name='id']" name="property_name">id</attr> |
15 | <attr path="/api/namespace/object[@cname='AppIndicator']/constructor[@cname='app_indicator_new_with_path']/*/*[@name='icon_name']" name="property_name">icon-name</attr> |
16 | <attr path="/api/namespace/object[@cname='AppIndicator']/constructor[@cname='app_indicator_new_with_path']/*/*[@name='category']" name="property_name">category</attr> |
17 | - <attr path="/api/namespace/object[@cname='AppIndicator']/constructor[@cname='app_indicator_new_with_path']/*/*[@name='icon_path']" name="property_name">icon-theme-path</attr> |
18 | + <attr path="/api/namespace/object[@cname='AppIndicator']/constructor[@cname='app_indicator_new_with_path']/*/*[@name='icon_theme_path']" name="property_name">icon-theme-path</attr> |
19 | |
20 | <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_id']" /> |
21 | <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_status']" /> |
22 | <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_icon']" /> |
23 | + <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_icon_theme_path']" /> |
24 | <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_category']" /> |
25 | <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_attention_icon']" /> |
26 | |
27 | <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_id']" /> |
28 | <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_status']" /> |
29 | <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_icon']" /> |
30 | + <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_icon_theme_path']" /> |
31 | <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_attention_icon']" /> |
32 | </metadata> |
33 | |
34 | === modified file 'bindings/python/appindicator.defs' |
35 | --- bindings/python/appindicator.defs 2010-07-22 13:04:52 +0000 |
36 | +++ bindings/python/appindicator.defs 2010-07-22 15:44:49 +0000 |
37 | @@ -49,7 +49,7 @@ |
38 | '("const-gchar*" "id") |
39 | '("const-gchar*" "icon_name") |
40 | '("AppIndicatorCategory" "category") |
41 | - '("const-gchar*" "icon_path" (null-ok) (default "NULL")) |
42 | + '("const-gchar*" "icon_theme_path" (null-ok) (default "NULL")) |
43 | ) |
44 | ) |
45 | |
46 | @@ -89,12 +89,12 @@ |
47 | ) |
48 | ) |
49 | |
50 | -(define-method set_icon_path |
51 | +(define-method set_icon_theme_path |
52 | (of-object "AppIndicator") |
53 | - (c-name "app_indicator_set_icon_path") |
54 | + (c-name "app_indicator_set_icon_theme_path") |
55 | (return-type "none") |
56 | (parameters |
57 | - '("const-gchar*" "icon_path") |
58 | + '("const-gchar*" "icon_theme_path" (null-ok)) |
59 | ) |
60 | ) |
61 | |
62 | @@ -122,6 +122,12 @@ |
63 | (return-type "const-gchar*") |
64 | ) |
65 | |
66 | +(define-method get_icon_theme_path |
67 | + (of-object "AppIndicator") |
68 | + (c-name "app_indicator_get_icon_theme_path") |
69 | + (return-type "const-gchar*") |
70 | +) |
71 | + |
72 | (define-method get_attention_icon |
73 | (of-object "AppIndicator") |
74 | (c-name "app_indicator_get_attention_icon") |
75 | |
76 | === modified file 'src/app-indicator.c' |
77 | --- src/app-indicator.c 2010-07-22 13:04:52 +0000 |
78 | +++ src/app-indicator.c 2010-07-22 15:44:49 +0000 |
79 | @@ -69,7 +69,7 @@ |
80 | AppIndicatorStatus status; |
81 | gchar *icon_name; |
82 | gchar *attention_icon_name; |
83 | - gchar * icon_path; |
84 | + gchar *icon_theme_path; |
85 | DbusmenuServer *menuservice; |
86 | GtkWidget *menu; |
87 | |
88 | @@ -88,7 +88,7 @@ |
89 | NEW_ATTENTION_ICON, |
90 | NEW_STATUS, |
91 | CONNECTION_CHANGED, |
92 | - NEW_PATH, |
93 | + NEW_ICON_THEME_PATH, |
94 | LAST_SIGNAL |
95 | }; |
96 | |
97 | @@ -230,7 +230,7 @@ |
98 | "An icon for the indicator", |
99 | "The default icon that is shown for the indicator.", |
100 | NULL, |
101 | - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
102 | + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT)); |
103 | |
104 | /** |
105 | AppIndicator:attention-icon-name: |
106 | @@ -257,7 +257,7 @@ |
107 | "An additional path for custom icons.", |
108 | "An additional place to look for icon names that may be installed by the application.", |
109 | NULL, |
110 | - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); |
111 | + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT)); |
112 | |
113 | /** |
114 | AppIndicator:menu: |
115 | @@ -349,16 +349,16 @@ |
116 | G_TYPE_NONE, 1, G_TYPE_BOOLEAN, G_TYPE_NONE); |
117 | |
118 | /** |
119 | - AppIndicator::new-icon: |
120 | + AppIndicator::new-icon-theme-path: |
121 | @arg0: The #AppIndicator object |
122 | |
123 | Signaled when there is a new icon set for the |
124 | object. |
125 | */ |
126 | - signals[NEW_PATH] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_PATH, |
127 | + signals[NEW_ICON_THEME_PATH] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH, |
128 | G_TYPE_FROM_CLASS(klass), |
129 | G_SIGNAL_RUN_LAST, |
130 | - G_STRUCT_OFFSET (AppIndicatorClass, new_path), |
131 | + G_STRUCT_OFFSET (AppIndicatorClass, new_icon_theme_path), |
132 | NULL, NULL, |
133 | g_cclosure_marshal_VOID__VOID, |
134 | G_TYPE_NONE, 0, G_TYPE_NONE); |
135 | @@ -381,7 +381,7 @@ |
136 | priv->status = APP_INDICATOR_STATUS_PASSIVE; |
137 | priv->icon_name = NULL; |
138 | priv->attention_icon_name = NULL; |
139 | - priv->icon_path = NULL; |
140 | + priv->icon_theme_path = NULL; |
141 | priv->menu = NULL; |
142 | priv->menuservice = NULL; |
143 | |
144 | @@ -503,9 +503,9 @@ |
145 | priv->attention_icon_name = NULL; |
146 | } |
147 | |
148 | - if (priv->icon_path != NULL) { |
149 | - g_free(priv->icon_path); |
150 | - priv->icon_path = NULL; |
151 | + if (priv->icon_theme_path != NULL) { |
152 | + g_free(priv->icon_theme_path); |
153 | + priv->icon_theme_path = NULL; |
154 | } |
155 | |
156 | G_OBJECT_CLASS (app_indicator_parent_class)->finalize (object); |
157 | @@ -573,7 +573,7 @@ |
158 | break; |
159 | |
160 | case PROP_ICON_THEME_PATH: |
161 | - app_indicator_set_icon_path (APP_INDICATOR (object), |
162 | + app_indicator_set_icon_theme_path (APP_INDICATOR (object), |
163 | g_value_get_string (value)); |
164 | check_connect (self); |
165 | break; |
166 | @@ -618,7 +618,7 @@ |
167 | break; |
168 | |
169 | case PROP_ICON_THEME_PATH: |
170 | - g_value_set_string (value, priv->icon_path); |
171 | + g_value_set_string (value, priv->icon_theme_path); |
172 | break; |
173 | |
174 | case PROP_MENU: |
175 | @@ -1040,12 +1040,12 @@ |
176 | @id: The unique id of the indicator to create. |
177 | @icon_name: The icon name for this indicator |
178 | @category: The category of indicator. |
179 | - @icon_path: A custom path for finding icons. |
180 | + @icon_theme_path: A custom path for finding icons. |
181 | |
182 | Creates a new #AppIndicator setting the properties: |
183 | #AppIndicator:id with @id, #AppIndicator:category |
184 | with @category, #AppIndicator:icon-name with |
185 | - @icon_name and #AppIndicator:icon-theme-path with @icon_path. |
186 | + @icon_name and #AppIndicator:icon-theme-path with @icon_theme_path. |
187 | |
188 | Return value: A pointer to a new #AppIndicator object. |
189 | */ |
190 | @@ -1053,13 +1053,13 @@ |
191 | app_indicator_new_with_path (const gchar *id, |
192 | const gchar *icon_name, |
193 | AppIndicatorCategory category, |
194 | - const gchar *icon_path) |
195 | + const gchar *icon_theme_path) |
196 | { |
197 | AppIndicator *indicator = g_object_new (APP_INDICATOR_TYPE, |
198 | PROP_ID_S, id, |
199 | PROP_CATEGORY_S, category_from_enum (category), |
200 | PROP_ICON_NAME_S, icon_name, |
201 | - PROP_ICON_THEME_PATH_S, icon_path, |
202 | + PROP_ICON_THEME_PATH_S, icon_theme_path, |
203 | NULL); |
204 | |
205 | return indicator; |
206 | @@ -1150,26 +1150,25 @@ |
207 | } |
208 | |
209 | /** |
210 | - app_indicator_set_icon_theme: |
211 | + app_indicator_set_icon_theme_path: |
212 | @self: The #AppIndicator object to use |
213 | - @icon_path: The icon theme path to set. |
214 | + @icon_theme_path: The icon theme path to set. |
215 | |
216 | Sets the path to use when searching for icons. |
217 | **/ |
218 | void |
219 | -app_indicator_set_icon_path (AppIndicator *self, const gchar *icon_path) |
220 | +app_indicator_set_icon_theme_path (AppIndicator *self, const gchar *icon_theme_path) |
221 | { |
222 | g_return_if_fail (IS_APP_INDICATOR (self)); |
223 | - g_return_if_fail (icon_path != NULL); |
224 | |
225 | - if (g_strcmp0 (self->priv->icon_path, icon_path) != 0) |
226 | + if (g_strcmp0 (self->priv->icon_theme_path, icon_theme_path) != 0) |
227 | { |
228 | - if (self->priv->icon_path != NULL) |
229 | - g_free(self->priv->icon_path); |
230 | - |
231 | - self->priv->icon_path = g_strdup(icon_path); |
232 | - |
233 | - g_signal_emit (self, signals[NEW_PATH], 0, TRUE); |
234 | + if (self->priv->icon_theme_path != NULL) |
235 | + g_free(self->priv->icon_theme_path); |
236 | + |
237 | + self->priv->icon_theme_path = g_strdup(icon_theme_path); |
238 | + |
239 | + g_signal_emit (self, signals[NEW_ICON_THEME_PATH], 0, TRUE); |
240 | } |
241 | |
242 | return; |
243 | @@ -1667,6 +1666,22 @@ |
244 | } |
245 | |
246 | /** |
247 | + app_indicator_get_icon_theme_path: |
248 | + @self: The #AppIndicator object to use |
249 | + |
250 | + Wrapper function for property #AppIndicator:icon-theme-path. |
251 | + |
252 | + Return value: The current icon theme path. |
253 | +*/ |
254 | +const gchar * |
255 | +app_indicator_get_icon_theme_path (AppIndicator *self) |
256 | +{ |
257 | + g_return_val_if_fail (IS_APP_INDICATOR (self), NULL); |
258 | + |
259 | + return self->priv->icon_theme_path; |
260 | +} |
261 | + |
262 | +/** |
263 | app_indicator_get_attention_icon: |
264 | @self: The #AppIndicator object to use |
265 | |
266 | |
267 | === modified file 'src/app-indicator.h' |
268 | --- src/app-indicator.h 2010-07-22 13:04:52 +0000 |
269 | +++ src/app-indicator.h 2010-07-22 15:44:49 +0000 |
270 | @@ -98,15 +98,15 @@ |
271 | String identifier for the #AppIndicator::connection-changed signal. |
272 | */ |
273 | /** |
274 | - APP_INDICATOR_SIGNAL_NEW_PATH: |
275 | + APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH: |
276 | |
277 | - String identifier for the #AppIndicator::new-path signal. |
278 | + String identifier for the #AppIndicator::new-icon-theme-path signal. |
279 | */ |
280 | #define APP_INDICATOR_SIGNAL_NEW_ICON "new-icon" |
281 | #define APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON "new-attention-icon" |
282 | #define APP_INDICATOR_SIGNAL_NEW_STATUS "new-status" |
283 | #define APP_INDICATOR_SIGNAL_CONNECTION_CHANGED "connection-changed" |
284 | -#define APP_INDICATOR_SIGNAL_NEW_PATH "new-path" |
285 | +#define APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH "new-icon-theme-path" |
286 | |
287 | /** |
288 | AppIndicatorCategory: |
289 | @@ -154,6 +154,7 @@ |
290 | @new_icon: Slot for #AppIndicator::new-icon. |
291 | @new_attention_icon: Slot for #AppIndicator::new-attention-icon. |
292 | @new_status: Slot for #AppIndicator::new-status. |
293 | + @new_icon_theme_path: Slot for #AppIndicator::new-icon-theme-path |
294 | @connection_changed: Slot for #AppIndicator::connection-changed. |
295 | @fallback: Function that gets called to make a #GtkStatusIcon when |
296 | there is no Application Indicator area available. |
297 | @@ -177,7 +178,7 @@ |
298 | void (* new_status) (AppIndicator *indicator, |
299 | const gchar *status, |
300 | gpointer user_data); |
301 | - void (* new_path) (AppIndicator *indicator, |
302 | + void (* new_icon_theme_path) (AppIndicator *indicator, |
303 | gpointer user_data); |
304 | |
305 | /* Local Signals */ |
306 | @@ -224,7 +225,7 @@ |
307 | AppIndicator *app_indicator_new_with_path (const gchar *id, |
308 | const gchar *icon_name, |
309 | AppIndicatorCategory category, |
310 | - const gchar *icon_path); |
311 | + const gchar *icon_theme_path); |
312 | |
313 | /* Set properties */ |
314 | void app_indicator_set_status (AppIndicator *self, |
315 | @@ -235,14 +236,15 @@ |
316 | GtkMenu *menu); |
317 | void app_indicator_set_icon (AppIndicator *self, |
318 | const gchar *icon_name); |
319 | -void app_indicator_set_icon_path (AppIndicator *self, |
320 | - const gchar *icon_path); |
321 | +void app_indicator_set_icon_theme_path(AppIndicator *self, |
322 | + const gchar *icon_theme_path); |
323 | |
324 | /* Get properties */ |
325 | const gchar * app_indicator_get_id (AppIndicator *self); |
326 | AppIndicatorCategory app_indicator_get_category (AppIndicator *self); |
327 | AppIndicatorStatus app_indicator_get_status (AppIndicator *self); |
328 | const gchar * app_indicator_get_icon (AppIndicator *self); |
329 | +const gchar * app_indicator_get_icon_theme_path(AppIndicator *self); |
330 | const gchar * app_indicator_get_attention_icon (AppIndicator *self); |
331 | GtkMenu * app_indicator_get_menu (AppIndicator *self); |
332 | |
333 | |
334 | === modified file 'src/application-service-appstore.c' |
335 | --- src/application-service-appstore.c 2010-07-22 12:57:14 +0000 |
336 | +++ src/application-service-appstore.c 2010-07-22 15:44:49 +0000 |
337 | @@ -43,13 +43,13 @@ |
338 | #define NOTIFICATION_ITEM_PROP_STATUS "Status" |
339 | #define NOTIFICATION_ITEM_PROP_ICON_NAME "IconName" |
340 | #define NOTIFICATION_ITEM_PROP_AICON_NAME "AttentionIconName" |
341 | -#define NOTIFICATION_ITEM_PROP_ICON_PATH "IconThemePath" |
342 | +#define NOTIFICATION_ITEM_PROP_ICON_THEME_PATH "IconThemePath" |
343 | #define NOTIFICATION_ITEM_PROP_MENU "Menu" |
344 | |
345 | #define NOTIFICATION_ITEM_SIG_NEW_ICON "NewIcon" |
346 | #define NOTIFICATION_ITEM_SIG_NEW_AICON "NewAttentionIcon" |
347 | #define NOTIFICATION_ITEM_SIG_NEW_STATUS "NewStatus" |
348 | -#define NOTIFICATION_ITEM_SIG_NEW_ICON_PATH "NewIconPath" |
349 | +#define NOTIFICATION_ITEM_SIG_NEW_ICON_THEME_PATH "NewIconThemePath" |
350 | |
351 | /* Private Stuff */ |
352 | struct _ApplicationServiceAppstorePrivate { |
353 | @@ -78,7 +78,7 @@ |
354 | gchar * icon; |
355 | gchar * aicon; |
356 | gchar * menu; |
357 | - gchar * icon_path; |
358 | + gchar * icon_theme_path; |
359 | gboolean currently_free; |
360 | }; |
361 | |
362 | @@ -90,7 +90,7 @@ |
363 | APPLICATION_ADDED, |
364 | APPLICATION_REMOVED, |
365 | APPLICATION_ICON_CHANGED, |
366 | - APPLICATION_ICON_PATH_CHANGED, |
367 | + APPLICATION_ICON_THEME_PATH_CHANGED, |
368 | LAST_SIGNAL |
369 | }; |
370 | |
371 | @@ -140,10 +140,10 @@ |
372 | NULL, NULL, |
373 | _application_service_marshal_VOID__INT_STRING, |
374 | G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING, G_TYPE_NONE); |
375 | - signals[APPLICATION_ICON_PATH_CHANGED] = g_signal_new ("application-icon-path-changed", |
376 | + signals[APPLICATION_ICON_THEME_PATH_CHANGED] = g_signal_new ("application-icon-theme-path-changed", |
377 | G_TYPE_FROM_CLASS(klass), |
378 | G_SIGNAL_RUN_LAST, |
379 | - G_STRUCT_OFFSET (ApplicationServiceAppstoreClass, application_icon_path_changed), |
380 | + G_STRUCT_OFFSET (ApplicationServiceAppstoreClass, application_icon_theme_path_changed), |
381 | NULL, NULL, |
382 | _application_service_marshal_VOID__INT_STRING, |
383 | G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING, G_TYPE_NONE); |
384 | @@ -255,11 +255,11 @@ |
385 | app->aicon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME)); |
386 | } |
387 | |
388 | - gpointer icon_path_data = g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_PATH); |
389 | - if (icon_path_data != NULL) { |
390 | - app->icon_path = g_value_dup_string((GValue *)icon_path_data); |
391 | + gpointer icon_theme_path_data = g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_THEME_PATH); |
392 | + if (icon_theme_path_data != NULL) { |
393 | + app->icon_theme_path = g_value_dup_string((GValue *)icon_theme_path_data); |
394 | } else { |
395 | - app->icon_path = g_strdup(""); |
396 | + app->icon_theme_path = g_strdup(""); |
397 | } |
398 | |
399 | /* TODO: Calling approvers, but we're ignoring the results. So, eh. */ |
400 | @@ -355,8 +355,8 @@ |
401 | if (app->menu != NULL) { |
402 | g_free(app->menu); |
403 | } |
404 | - if (app->icon_path != NULL) { |
405 | - g_free(app->icon_path); |
406 | + if (app->icon_theme_path != NULL) { |
407 | + g_free(app->icon_theme_path); |
408 | } |
409 | |
410 | g_free(app); |
411 | @@ -454,7 +454,7 @@ |
412 | g_list_index(priv->applications, app), /* Position */ |
413 | app->dbus_name, |
414 | app->menu, |
415 | - app->icon_path, |
416 | + app->icon_theme_path, |
417 | TRUE); |
418 | } |
419 | } else { |
420 | @@ -549,38 +549,34 @@ |
421 | return; |
422 | } |
423 | |
424 | -/* Gets the data back on an updated icon signal. Hopefully |
425 | - a new fun icon. */ |
426 | +/* Gets the data back on an updated icon theme path. |
427 | + Maybe a new icon */ |
428 | static void |
429 | -new_path_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdata) |
430 | +new_icon_theme_path_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdata) |
431 | { |
432 | /* Check for errors */ |
433 | if (error != NULL) { |
434 | - g_warning("Unable to get updated icon name: %s", error->message); |
435 | + g_warning("Unable to get updated icon theme path: %s", error->message); |
436 | return; |
437 | } |
438 | |
439 | /* Grab the icon and make sure we have one */ |
440 | - const gchar * newpath = g_value_get_string(&value); |
441 | - if (newpath == NULL) { |
442 | - g_warning("Bad new path :("); |
443 | - return; |
444 | - } |
445 | + const gchar * new_icon_theme_path = g_value_get_string(&value); |
446 | |
447 | Application * app = (Application *) userdata; |
448 | |
449 | - if (g_strcmp0(newpath, app->icon_path)) { |
450 | - /* If the new path is actually a new path */ |
451 | - if (app->icon_path != NULL) g_free(app->icon_path); |
452 | - app->icon_path = g_strdup(newpath); |
453 | + if (g_strcmp0(new_icon_theme_path, app->icon_theme_path)) { |
454 | + /* If the new icon theme path is actually a new icon theme path */ |
455 | + if (app->icon_theme_path != NULL) g_free(app->icon_theme_path); |
456 | + app->icon_theme_path = g_strdup(new_icon_theme_path); |
457 | |
458 | if (app->status == APP_INDICATOR_STATUS_ACTIVE) { |
459 | gint position = get_position(app); |
460 | if (position == -1) return; |
461 | |
462 | g_signal_emit(G_OBJECT(app->appstore), |
463 | - signals[APPLICATION_ICON_PATH_CHANGED], 0, |
464 | - position, newpath, TRUE); |
465 | + signals[APPLICATION_ICON_THEME_PATH_CHANGED], 0, |
466 | + position, new_icon_theme_path, TRUE); |
467 | } |
468 | } |
469 | |
470 | @@ -634,17 +630,17 @@ |
471 | } |
472 | |
473 | /* Called when the Notification Item signals that it |
474 | - has a new icon. */ |
475 | + has a new icon theme path. */ |
476 | static void |
477 | -new_path (DBusGProxy * proxy, gpointer data) |
478 | +new_icon_theme_path (DBusGProxy * proxy, gpointer data) |
479 | { |
480 | Application * app = (Application *)data; |
481 | if (!app->validated) return; |
482 | |
483 | org_freedesktop_DBus_Properties_get_async(app->prop_proxy, |
484 | NOTIFICATION_ITEM_DBUS_IFACE, |
485 | - NOTIFICATION_ITEM_PROP_ICON_PATH, |
486 | - new_path_cb, |
487 | + NOTIFICATION_ITEM_PROP_ICON_THEME_PATH, |
488 | + new_icon_theme_path_cb, |
489 | app); |
490 | return; |
491 | } |
492 | @@ -675,7 +671,7 @@ |
493 | app->icon = NULL; |
494 | app->aicon = NULL; |
495 | app->menu = NULL; |
496 | - app->icon_path = NULL; |
497 | + app->icon_theme_path = NULL; |
498 | app->currently_free = FALSE; |
499 | |
500 | /* Get the DBus proxy for the NotificationItem interface */ |
501 | @@ -723,7 +719,7 @@ |
502 | G_TYPE_STRING, |
503 | G_TYPE_INVALID); |
504 | dbus_g_proxy_add_signal(app->dbus_proxy, |
505 | - NOTIFICATION_ITEM_SIG_NEW_ICON_PATH, |
506 | + NOTIFICATION_ITEM_SIG_NEW_ICON_THEME_PATH, |
507 | G_TYPE_INVALID); |
508 | |
509 | dbus_g_proxy_connect_signal(app->dbus_proxy, |
510 | @@ -742,8 +738,8 @@ |
511 | app, |
512 | NULL); |
513 | dbus_g_proxy_connect_signal(app->dbus_proxy, |
514 | - NOTIFICATION_ITEM_SIG_NEW_ICON_PATH, |
515 | - G_CALLBACK(new_path), |
516 | + NOTIFICATION_ITEM_SIG_NEW_ICON_THEME_PATH, |
517 | + G_CALLBACK(new_icon_theme_path), |
518 | app, |
519 | NULL); |
520 | |
521 | @@ -835,7 +831,7 @@ |
522 | |
523 | /* Icon path */ |
524 | g_value_init(&value, G_TYPE_STRING); |
525 | - g_value_set_string(&value, ((Application *)listpntr->data)->icon_path); |
526 | + g_value_set_string(&value, ((Application *)listpntr->data)->icon_theme_path); |
527 | g_value_array_append(values, &value); |
528 | g_value_unset(&value); |
529 | |
530 | |
531 | === modified file 'src/application-service-appstore.h' |
532 | --- src/application-service-appstore.h 2010-07-22 12:57:14 +0000 |
533 | +++ src/application-service-appstore.h 2010-07-22 15:44:49 +0000 |
534 | @@ -46,7 +46,7 @@ |
535 | void (*application_added) (ApplicationServiceAppstore * appstore, gchar *, gint, gchar *, gchar *, gpointer); |
536 | void (*application_removed) (ApplicationServiceAppstore * appstore, gint, gpointer); |
537 | void (*application_icon_changed)(ApplicationServiceAppstore * appstore, gint, const gchar *, gpointer); |
538 | - void (*application_icon_path_changed)(ApplicationServiceAppstore * appstore, gint, const gchar *, gpointer); |
539 | + void (*application_icon_theme_path_changed)(ApplicationServiceAppstore * appstore, gint, const gchar *, gpointer); |
540 | }; |
541 | |
542 | struct _ApplicationServiceAppstore { |
543 | |
544 | === modified file 'src/application-service.xml' |
545 | --- src/application-service.xml 2010-07-22 12:57:14 +0000 |
546 | +++ src/application-service.xml 2010-07-22 15:44:49 +0000 |
547 | @@ -44,9 +44,9 @@ |
548 | <arg type="i" name="position" direction="out" /> |
549 | <arg type="s" name="icon_name" direction="out" /> |
550 | </signal> |
551 | - <signal name="ApplicationIconPathChanged"> |
552 | + <signal name="ApplicationIconThemePathChanged"> |
553 | <arg type="i" name="position" direction="out" /> |
554 | - <arg type="s" name="icon_path" direction="out" /> |
555 | + <arg type="s" name="icon_theme_path" direction="out" /> |
556 | </signal> |
557 | |
558 | </interface> |
559 | |
560 | === modified file 'src/indicator-application.c' |
561 | --- src/indicator-application.c 2010-07-22 12:57:14 +0000 |
562 | +++ src/indicator-application.c 2010-07-22 15:44:49 +0000 |
563 | @@ -84,7 +84,8 @@ |
564 | typedef struct _ApplicationEntry ApplicationEntry; |
565 | struct _ApplicationEntry { |
566 | IndicatorObjectEntry entry; |
567 | - gchar * icon_path; |
568 | + gchar * icon_theme_path; |
569 | + gchar * icon_name; |
570 | gboolean old_service; |
571 | gchar * dbusobject; |
572 | gchar * dbusaddress; |
573 | @@ -105,10 +106,10 @@ |
574 | static void disconnected_helper (gpointer data, gpointer user_data); |
575 | static gboolean disconnected_kill (gpointer user_data); |
576 | static void disconnected_kill_helper (gpointer data, gpointer user_data); |
577 | -static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, IndicatorApplication * application); |
578 | +static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_theme_path, IndicatorApplication * application); |
579 | static void application_removed (DBusGProxy * proxy, gint position , IndicatorApplication * application); |
580 | static void application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconname, IndicatorApplication * application); |
581 | -static void application_icon_path_changed (DBusGProxy * proxy, gint position, const gchar * iconpath, IndicatorApplication * application); |
582 | +static void application_icon_theme_path_changed (DBusGProxy * proxy, gint position, const gchar * icon_theme_path, IndicatorApplication * application); |
583 | static void get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, gpointer userdata); |
584 | static void get_applications_helper (gpointer data, gpointer user_data); |
585 | static void theme_dir_unref(IndicatorApplication * ia, const gchar * dir); |
586 | @@ -282,7 +283,7 @@ |
587 | G_TYPE_STRING, |
588 | G_TYPE_INVALID); |
589 | dbus_g_proxy_add_signal(priv->service_proxy, |
590 | - "ApplicationIconPathChanged", |
591 | + "ApplicationIconThemePathChanged", |
592 | G_TYPE_INT, |
593 | G_TYPE_STRING, |
594 | G_TYPE_INVALID); |
595 | @@ -305,8 +306,8 @@ |
596 | application, |
597 | NULL /* Disconnection Signal */); |
598 | dbus_g_proxy_connect_signal(priv->service_proxy, |
599 | - "ApplicationIconPathChanged", |
600 | - G_CALLBACK(application_icon_path_changed), |
601 | + "ApplicationIconThemePathChanged", |
602 | + G_CALLBACK(application_icon_theme_path_changed), |
603 | application, |
604 | NULL /* Disconnection Signal */); |
605 | } |
606 | @@ -424,7 +425,7 @@ |
607 | ApplicationEntry and signaling the indicator host that |
608 | we've got a new indicator. */ |
609 | static void |
610 | -application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, IndicatorApplication * application) |
611 | +application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_theme_path, IndicatorApplication * application) |
612 | { |
613 | g_return_if_fail(IS_INDICATOR_APPLICATION(application)); |
614 | g_debug("Building new application entry: %s with icon: %s", dbusaddress, iconname); |
615 | @@ -446,15 +447,16 @@ |
616 | ApplicationEntry * app = g_new(ApplicationEntry, 1); |
617 | |
618 | app->old_service = FALSE; |
619 | - app->icon_path = NULL; |
620 | - if (icon_path != NULL && icon_path[0] != '\0') { |
621 | - app->icon_path = g_strdup(icon_path); |
622 | - theme_dir_ref(application, icon_path); |
623 | + app->icon_theme_path = NULL; |
624 | + if (icon_theme_path != NULL && icon_theme_path[0] != '\0') { |
625 | + app->icon_theme_path = g_strdup(icon_theme_path); |
626 | + theme_dir_ref(application, icon_theme_path); |
627 | } |
628 | |
629 | app->dbusaddress = g_strdup(dbusaddress); |
630 | app->dbusobject = g_strdup(dbusobject); |
631 | |
632 | + app->icon_name = g_strdup(iconname); |
633 | /* We make a long name using the suffix, and if that |
634 | icon is available we want to use it. Otherwise we'll |
635 | just use the name we were given. */ |
636 | @@ -500,9 +502,9 @@ |
637 | priv->applications = g_list_remove(priv->applications, app); |
638 | g_signal_emit(G_OBJECT(application), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED_ID, 0, &(app->entry), TRUE); |
639 | |
640 | - if (app->icon_path != NULL) { |
641 | - theme_dir_unref(application, app->icon_path); |
642 | - g_free(app->icon_path); |
643 | + if (app->icon_theme_path != NULL) { |
644 | + theme_dir_unref(application, app->icon_theme_path); |
645 | + g_free(app->icon_theme_path); |
646 | } |
647 | if (app->dbusaddress != NULL) { |
648 | g_free(app->dbusaddress); |
649 | @@ -510,6 +512,9 @@ |
650 | if (app->dbusobject != NULL) { |
651 | g_free(app->dbusobject); |
652 | } |
653 | + if (app->icon_name != NULL) { |
654 | + g_free(app->icon_name); |
655 | + } |
656 | if (app->entry.image != NULL) { |
657 | g_object_unref(G_OBJECT(app->entry.image)); |
658 | } |
659 | @@ -544,14 +549,16 @@ |
660 | gchar * longname = g_strdup_printf("%s-%s", iconname, PANEL_ICON_SUFFIX); |
661 | indicator_image_helper_update(app->entry.image, longname); |
662 | g_free(longname); |
663 | + |
664 | + app->icon_name = g_strdup(iconname); |
665 | |
666 | return; |
667 | } |
668 | |
669 | -/* The callback for the signal that the icon path for an application |
670 | +/* The callback for the signal that the icon theme path for an application |
671 | has changed. */ |
672 | static void |
673 | -application_icon_path_changed (DBusGProxy * proxy, gint position, const gchar * iconpath, IndicatorApplication * application) |
674 | +application_icon_theme_path_changed (DBusGProxy * proxy, gint position, const gchar * icon_theme_path, IndicatorApplication * application) |
675 | { |
676 | IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); |
677 | ApplicationEntry * app = (ApplicationEntry *)g_list_nth_data(priv->applications, position); |
678 | @@ -561,11 +568,17 @@ |
679 | return; |
680 | } |
681 | |
682 | - g_free(app->icon_path); |
683 | - app->icon_path = NULL; |
684 | - if (iconpath != NULL && iconpath[0] != '\0') { |
685 | - app->icon_path = g_strdup(iconpath); |
686 | - theme_dir_ref(application, iconpath); |
687 | + if (g_strcmp0(icon_theme_path, app->icon_theme_path) != 0) { |
688 | + if(app->icon_theme_path != NULL) { |
689 | + theme_dir_unref(application, app->icon_theme_path); |
690 | + g_free(app->icon_theme_path); |
691 | + app->icon_theme_path = NULL; |
692 | + } |
693 | + if (icon_theme_path != NULL && icon_theme_path[0] != '\0') { |
694 | + app->icon_theme_path = g_strdup(icon_theme_path); |
695 | + theme_dir_ref(application, app->icon_theme_path); |
696 | + } |
697 | + indicator_image_helper_update(app->entry.image, app->icon_name); |
698 | } |
699 | |
700 | return; |
701 | @@ -598,13 +611,13 @@ |
702 | gint position = g_value_get_int(g_value_array_get_nth(array, 1)); |
703 | const gchar * dbus_address = g_value_get_string(g_value_array_get_nth(array, 2)); |
704 | const gchar * dbus_object = g_value_get_boxed(g_value_array_get_nth(array, 3)); |
705 | - const gchar * icon_path = g_value_get_string(g_value_array_get_nth(array, 4)); |
706 | + const gchar * icon_theme_path = g_value_get_string(g_value_array_get_nth(array, 4)); |
707 | |
708 | - return application_added(NULL, icon_name, position, dbus_address, dbus_object, icon_path, user_data); |
709 | + return application_added(NULL, icon_name, position, dbus_address, dbus_object, icon_theme_path, user_data); |
710 | } |
711 | |
712 | -/* Refs a theme directory, and it may add it to the search |
713 | - path */ |
714 | +/* Unrefs a theme directory. This may involve removing it from |
715 | + the search path. */ |
716 | static void |
717 | theme_dir_unref(IndicatorApplication * ia, const gchar * dir) |
718 | { |
719 | @@ -663,8 +676,8 @@ |
720 | return; |
721 | } |
722 | |
723 | -/* Unrefs a theme directory. This may involve removing it from |
724 | - the search path. */ |
725 | +/* Refs a theme directory, and it may add it to the search |
726 | + path */ |
727 | static void |
728 | theme_dir_ref(IndicatorApplication * ia, const gchar * dir) |
729 | { |
730 | |
731 | === modified file 'src/notification-item.xml' |
732 | --- src/notification-item.xml 2010-03-15 17:10:43 +0000 |
733 | +++ src/notification-item.xml 2010-07-22 15:44:49 +0000 |
734 | @@ -19,6 +19,8 @@ |
735 | <!-- Signals --> |
736 | <signal name="NewIcon"> |
737 | </signal> |
738 | + <signal name="NewIconThemePath"> |
739 | + </signal> |
740 | <signal name="NewAttentionIcon"> |
741 | </signal> |
742 | <signal name="NewStatus"> |