Merge lp:~larsu/indicator-session/lp1048348 into lp:indicator-session/12.10

Proposed by Lars Karlitski
Status: Merged
Approved by: Charles Kerr
Approved revision: 358
Merged at revision: 358
Proposed branch: lp:~larsu/indicator-session/lp1048348
Merge into: lp:indicator-session/12.10
Diff against target: 56 lines (+18/-0)
1 file modified
src/indicator-session.c (+18/-0)
To merge this branch: bzr merge lp:~larsu/indicator-session/lp1048348
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
jenkins (community) continuous-integration Approve
Review via email: mp+124112@code.launchpad.net

Commit message

If the system menu's icon is missing in the current theme, fall back to gtk-missing-icon instead of showing no icon at all.

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

"gtk-missing-image" makes more sense as a fallback than "system-shutdown", but otherwise looks good.

review: Needs Fixing
358. By Lars Karlitski

Change fallback icon to "gtk-missing-image"

Revision history for this message
Lars Karlitski (larsu) wrote :

Thought about it some more and agree with you. Changed it with r358.

Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/indicator-session.c'
--- src/indicator-session.c 2012-08-31 16:36:06 +0000
+++ src/indicator-session.c 2012-09-13 13:37:39 +0000
@@ -64,6 +64,7 @@
64 GDBusProxy * service_proxy;64 GDBusProxy * service_proxy;
65 GSettings * settings;65 GSettings * settings;
66 DbusmenuClient * menu_client;66 DbusmenuClient * menu_client;
67 GtkIconTheme * icon_theme;
67};68};
6869
69static gboolean greeter_mode;70static gboolean greeter_mode;
@@ -84,6 +85,7 @@
84 DbusmenuClient * client,85 DbusmenuClient * client,
85 gpointer user_data);86 gpointer user_data);
86static void on_menu_layout_updated (DbusmenuClient * client, IndicatorSession * session);87static void on_menu_layout_updated (DbusmenuClient * client, IndicatorSession * session);
88static void indicator_session_update_icon_callback (GtkWidget * widget, gpointer callback_data);
87static void indicator_session_update_icon_and_a11y (IndicatorSession * self);89static void indicator_session_update_icon_and_a11y (IndicatorSession * self);
88static void indicator_session_update_users_label (IndicatorSession* self,90static void indicator_session_update_users_label (IndicatorSession* self,
89 const gchar* name);91 const gchar* name);
@@ -135,6 +137,13 @@
135 self->entry.image = GTK_IMAGE (gtk_image_new());137 self->entry.image = GTK_IMAGE (gtk_image_new());
136 self->entry.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME,138 self->entry.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME,
137 INDICATOR_SESSION_DBUS_OBJECT));139 INDICATOR_SESSION_DBUS_OBJECT));
140 /* We need to check if the current icon theme has the hard coded icons.
141 * If not, we'll fall back to a standard icon */
142 self->icon_theme = gtk_icon_theme_get_default();
143 g_signal_connect(G_OBJECT(self->icon_theme),
144 "changed",
145 G_CALLBACK(indicator_session_update_icon_callback), self);
146
138 indicator_session_update_icon_and_a11y (self);147 indicator_session_update_icon_and_a11y (self);
139 g_settings_bind (self->settings, "show-real-name-on-panel",148 g_settings_bind (self->settings, "show-real-name-on-panel",
140 self->entry.label, "visible",149 self->entry.label, "visible",
@@ -478,6 +487,9 @@
478 icon = ICON_ALERT;487 icon = ICON_ALERT;
479 }488 }
480489
490 if (gtk_icon_theme_has_icon (indicator->icon_theme, icon) == FALSE)
491 icon = "gtk-missing-image";
492
481 g_debug (G_STRLOC" setting icon to \"%s\"", icon);493 g_debug (G_STRLOC" setting icon to \"%s\"", icon);
482 gtk_image_set_from_icon_name (GTK_IMAGE(indicator->entry.image),494 gtk_image_set_from_icon_name (GTK_IMAGE(indicator->entry.image),
483 icon,495 icon,
@@ -515,6 +527,12 @@
515}527}
516528
517static void529static void
530indicator_session_update_icon_callback (GtkWidget * widget, gpointer callback_data)
531{
532 indicator_session_update_icon_and_a11y ((IndicatorSession *)callback_data);
533}
534
535static void
518indicator_session_update_icon_and_a11y (IndicatorSession * indicator)536indicator_session_update_icon_and_a11y (IndicatorSession * indicator)
519{537{
520 const int disposition = calculate_disposition (indicator);538 const int disposition = calculate_disposition (indicator);

Subscribers

People subscribed via source and target branches