Merge lp:~larsu/indicator-messages/lp1056595 into lp:indicator-messages/12.10

Proposed by Lars Karlitski
Status: Merged
Approved by: Lars Karlitski
Approved revision: 318
Merge reported by: Lars Karlitski
Merged at revision: not available
Proposed branch: lp:~larsu/indicator-messages/lp1056595
Merge into: lp:indicator-messages/12.10
Diff against target: 42 lines (+16/-3)
2 files modified
src/indicator-messages.c (+12/-3)
src/messages-service.c (+4/-0)
To merge this branch: bzr merge lp:~larsu/indicator-messages/lp1056595
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
jenkins (community) continuous-integration Needs Fixing
Review via email: mp+126992@code.launchpad.net

Commit message

Include fallback icon names

And use g_icon_new_from_string in the indicator to make it load fallbacks.

Description of the change

Fall back to indicator-messages{,-new} for icon themes that don't have the icons with status emblems yet.

Also fixes a small bug in messages-service: It used the icon string directly, which breaks down when fallbacks are specified.

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/indicator-messages.c'
--- src/indicator-messages.c 2012-09-25 07:47:00 +0000
+++ src/indicator-messages.c 2012-09-28 15:12:23 +0000
@@ -340,11 +340,20 @@
340indicator_messages_update_icon (IndicatorMessages *self,340indicator_messages_update_icon (IndicatorMessages *self,
341 GVariant *state)341 GVariant *state)
342{342{
343 GIcon *icon;
344 GError *error = NULL;
345
343 g_return_if_fail (g_variant_is_of_type (state, G_VARIANT_TYPE_STRING));346 g_return_if_fail (g_variant_is_of_type (state, G_VARIANT_TYPE_STRING));
344347
345 gtk_image_set_from_icon_name (GTK_IMAGE (self->image),348 icon = g_icon_new_for_string (g_variant_get_string (state, NULL), &error);
346 g_variant_get_string (state, NULL),349 if (icon == NULL) {
347 GTK_ICON_SIZE_LARGE_TOOLBAR);350 g_warning ("unable to load icon: %s", error->message);
351 g_error_free (error);
352 }
353 else {
354 gtk_image_set_from_gicon (GTK_IMAGE (self->image), icon, GTK_ICON_SIZE_LARGE_TOOLBAR);
355 g_object_unref (icon);
356 }
348}357}
349358
350static void359static void
351360
=== modified file 'src/messages-service.c'
--- src/messages-service.c 2012-09-19 06:28:17 +0000
+++ src/messages-service.c 2012-09-28 15:12:23 +0000
@@ -70,6 +70,10 @@
70 g_string_append (name, "-new");70 g_string_append (name, "-new");
7171
72 icon = g_themed_icon_new (name->str);72 icon = g_themed_icon_new (name->str);
73 g_themed_icon_append_name (G_THEMED_ICON (icon),
74 draws_attention ? "indicator-messages-new"
75 : "indicator-messages");
76
73 iconstr = g_icon_to_string (icon);77 iconstr = g_icon_to_string (icon);
7478
75 g_object_unref (icon);79 g_object_unref (icon);

Subscribers

People subscribed via source and target branches