236
236
indicator_ng_update_entry (IndicatorNg *self)
239
const gchar *label = NULL;
240
const gchar *iconstr = NULL;
241
const gchar *accessible_desc = NULL;
242
gboolean visible = TRUE;
240
244
g_return_if_fail (self->menu != NULL);
241
245
g_return_if_fail (self->actions != NULL);
250
254
state = g_action_group_get_action_state (self->actions, self->header_action);
251
255
if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("(sssb)")))
254
const gchar *iconstr;
255
const gchar *accessible_desc;
258
257
g_variant_get (state, "(&s&s&sb)", &label, &iconstr, &accessible_desc, &visible);
259
else if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("a{sv}")))
261
g_variant_lookup (state, "label", "&s", &label);
262
g_variant_lookup (state, "icon", "&s", &iconstr);
263
g_variant_lookup (state, "accessible-desc", "&s", &accessible_desc);
264
g_variant_lookup (state, "visible", "b", &visible);
267
g_warning ("the action of the indicator menu item must have state with type (sssb) or a{sv}");
260
indicator_ng_set_label (self, label);
270
indicator_ng_set_label (self, label);
261
272
indicator_ng_set_icon_from_string (self, iconstr);
262
indicator_ng_set_accessible_desc (self, accessible_desc);
263
indicator_object_set_visible (INDICATOR_OBJECT (self), visible);
266
g_warning ("the action of the indicator menu item must have state with type (sssb)");
274
indicator_ng_set_accessible_desc (self, accessible_desc);
275
indicator_object_set_visible (INDICATOR_OBJECT (self), visible);
269
278
g_variant_unref (state);