[totem] screenshot: Hide menu items when unavailable
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] screenshot: Hide menu items when unavailable
- Date: Tue, 14 Jan 2014 19:20:21 +0000 (UTC)
commit bd01c10587912f6a7abbb38f4ee18aafca507d15
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jan 8 17:03:09 2014 +0100
screenshot: Hide menu items when unavailable
https://bugzilla.gnome.org/show_bug.cgi?id=721797
src/plugins/screenshot/totem-screenshot-plugin.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/screenshot/totem-screenshot-plugin.c
b/src/plugins/screenshot/totem-screenshot-plugin.c
index 657e0b7..a862d7b 100644
--- a/src/plugins/screenshot/totem-screenshot-plugin.c
+++ b/src/plugins/screenshot/totem-screenshot-plugin.c
@@ -338,8 +338,15 @@ impl_activate (PeasActivatable *plugin)
menu = totem_object_get_menu_section (priv->totem, "screenshot-placeholder");
item = g_menu_item_new (_("Take _Screenshot"), "app.take-screenshot");
g_menu_item_set_attribute (item, "accel", "s", "<Primary><Alt>s");
+ g_menu_item_set_attribute_value (item, "hidden-when",
+ g_variant_new_string ("action-disabled"));
g_menu_append_item (G_MENU (menu), item);
- g_menu_append (G_MENU (menu), _("Create Screenshot _Gallery..."), "app.take-gallery");
+ g_object_unref (item);
+ item = g_menu_item_new (_("Create Screenshot _Gallery..."), "app.take-gallery");
+ g_menu_item_set_attribute_value (item, "hidden-when",
+ g_variant_new_string ("action-disabled"));
+ g_menu_append_item (G_MENU (menu), item);
+ g_object_unref (item);
/* Set up a GSettings watch for lockdown keys */
priv->settings = g_settings_new ("org.gnome.desktop.lockdown");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]