summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/window/glomenu.cxx
diff options
context:
space:
mode:
authorAntonio Fernandez <antonio.fernandez@aentos.es>2012-08-26 23:53:56 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-11-14 13:52:44 +0100
commit1475c67cc5552e9fa9a8e613eb7a034e489cf0d3 (patch)
tree5114eb7e08f81a68d03df2b48688ba94f03a572e /vcl/unx/gtk/window/glomenu.cxx
parent3411a8a23a1cda4fecaaf3dd2b3e83082b6419d0 (diff)
Added code for accelerators and special items.
Change-Id: Ibd62c4655d671e2920dea5140df8f481c2892fbb
Diffstat (limited to 'vcl/unx/gtk/window/glomenu.cxx')
-rw-r--r--vcl/unx/gtk/window/glomenu.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/vcl/unx/gtk/window/glomenu.cxx b/vcl/unx/gtk/window/glomenu.cxx
index e4122d5a4d49..77be47139cc7 100644
--- a/vcl/unx/gtk/window/glomenu.cxx
+++ b/vcl/unx/gtk/window/glomenu.cxx
@@ -299,6 +299,32 @@ g_lo_menu_set_action_and_target_value_to_item_in_section (GLOMenu *menu,
}
void
+g_lo_menu_set_accelerator_to_item_in_section (GLOMenu *menu,
+ gint section,
+ gint position,
+ const gchar *accelerator)
+{
+ g_return_if_fail (G_IS_LO_MENU (menu));
+
+ GMenuModel *model = G_MENU_MODEL_CLASS (g_lo_menu_parent_class)
+ ->get_item_link (G_MENU_MODEL (menu), section, G_MENU_LINK_SECTION);
+
+ g_return_if_fail (model != NULL);
+
+ GVariant *value;
+
+ if (accelerator != NULL)
+ value = g_variant_new_string (accelerator);
+ else
+ value = NULL;
+
+ g_lo_menu_set_attribute_value (G_LO_MENU (model), position, "accel", value);
+
+ // Notify the update.
+ g_menu_model_items_changed (model, position, 1, 1);
+}
+
+void
g_lo_menu_set_link (GLOMenu *menu,
gint position,
const gchar *link,