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

Proposed by Lars Karlitski on 2012-09-28
Status: Merged
Approved by: Lars Karlitski on 2012-10-02
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) 2012-09-28 Approve on 2012-10-02
jenkins (community) continuous-integration Needs Fixing on 2012-09-28
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.
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)
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
1=== modified file 'src/indicator-messages.c'
2--- src/indicator-messages.c 2012-09-25 07:47:00 +0000
3+++ src/indicator-messages.c 2012-09-28 15:12:23 +0000
4@@ -340,11 +340,20 @@
5 indicator_messages_update_icon (IndicatorMessages *self,
6 GVariant *state)
7 {
8+ GIcon *icon;
9+ GError *error = NULL;
10+
11 g_return_if_fail (g_variant_is_of_type (state, G_VARIANT_TYPE_STRING));
12
13- gtk_image_set_from_icon_name (GTK_IMAGE (self->image),
14- g_variant_get_string (state, NULL),
15- GTK_ICON_SIZE_LARGE_TOOLBAR);
16+ icon = g_icon_new_for_string (g_variant_get_string (state, NULL), &error);
17+ if (icon == NULL) {
18+ g_warning ("unable to load icon: %s", error->message);
19+ g_error_free (error);
20+ }
21+ else {
22+ gtk_image_set_from_gicon (GTK_IMAGE (self->image), icon, GTK_ICON_SIZE_LARGE_TOOLBAR);
23+ g_object_unref (icon);
24+ }
25 }
26
27 static void
28
29=== modified file 'src/messages-service.c'
30--- src/messages-service.c 2012-09-19 06:28:17 +0000
31+++ src/messages-service.c 2012-09-28 15:12:23 +0000
32@@ -70,6 +70,10 @@
33 g_string_append (name, "-new");
34
35 icon = g_themed_icon_new (name->str);
36+ g_themed_icon_append_name (G_THEMED_ICON (icon),
37+ draws_attention ? "indicator-messages-new"
38+ : "indicator-messages");
39+
40 iconstr = g_icon_to_string (icon);
41
42 g_object_unref (icon);

Subscribers

People subscribed via source and target branches