28 #define LAST_INDEX "last_index" 29 #define CHANGED_ID "changed_id" 47 gint column, index, id;
50 model = gtk_combo_box_get_model(GTK_COMBO_BOX(cbwe));
51 if (!gtk_tree_model_get_iter_first(model, &iter))
54 gtk_combo_box_set_active(GTK_COMBO_BOX(cbwe), -1);
58 column = gtk_combo_box_get_entry_text_column(cbwe);
61 gtk_tree_model_get(model, &iter, column, &tree_string, -1);
62 match = g_utf8_collate(text, tree_string) == 0;
68 id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cbwe), CHANGED_ID));
69 g_signal_handler_block(cbwe,
id);
70 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(cbwe), &iter);
71 g_signal_handler_unblock(cbwe,
id);
73 index = gtk_combo_box_get_active(GTK_COMBO_BOX(cbwe));
74 g_object_set_data(G_OBJECT(cbwe), LAST_INDEX, GINT_TO_POINTER(index));
77 while (gtk_tree_model_iter_next(model, &iter));
89 gnc_cbwe_changed_cb (GtkComboBox *widget,
94 index = gtk_combo_box_get_active(widget);
97 g_object_set_data(G_OBJECT(cbwe), LAST_INDEX, GINT_TO_POINTER(index));
118 gnc_cbwe_match_selected_cb (GtkEntryCompletion *completion,
119 GtkTreeModel *comp_model,
120 GtkTreeIter *comp_iter,
126 column = gtk_combo_box_get_entry_text_column(cbwe);
127 gtk_tree_model_get(comp_model, comp_iter, column, &text, -1);
147 gnc_cbwe_focus_out_cb (GtkEntry *entry,
148 GdkEventFocus *event,
155 text = gtk_entry_get_text(entry);
159 index = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cbwe), LAST_INDEX));
160 gtk_combo_box_set_active(GTK_COMBO_BOX(cbwe), index);
165 gnc_cbwe_add_completion (GtkComboBox *cbwe)
168 GtkEntryCompletion *completion;
171 entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(cbwe)));
172 completion = gtk_entry_get_completion(entry);
177 completion = gtk_entry_completion_new();
178 model = gtk_combo_box_get_model(GTK_COMBO_BOX(cbwe));
179 gtk_entry_completion_set_model(completion, model);
180 gtk_entry_completion_set_text_column(completion, 0);
181 gtk_entry_set_completion(entry, completion);
182 g_object_unref(completion);
186 gnc_cbwe_require_list_item (GtkComboBox *cbwe)
189 GtkEntryCompletion *completion;
195 gnc_cbwe_add_completion(cbwe);
200 entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(cbwe)));
201 completion = gtk_entry_get_completion(entry);
202 index = gtk_combo_box_get_active(GTK_COMBO_BOX(cbwe));
205 model = gtk_entry_completion_get_model(completion);
206 if (gtk_tree_model_get_iter_first(model, &iter))
208 gtk_combo_box_set_active(GTK_COMBO_BOX(cbwe), 0);
212 g_object_set_data(G_OBJECT(cbwe), LAST_INDEX, GINT_TO_POINTER(index));
216 id = g_signal_connect(cbwe,
"changed",
217 G_CALLBACK(gnc_cbwe_changed_cb), cbwe);
218 g_signal_connect(completion,
"match_selected",
219 G_CALLBACK(gnc_cbwe_match_selected_cb), cbwe);
220 g_signal_connect(entry,
"focus-out-event",
221 G_CALLBACK(gnc_cbwe_focus_out_cb), cbwe);
223 g_object_set_data(G_OBJECT(cbwe), CHANGED_ID, GINT_TO_POINTER(
id));
238 gboolean is_dark = FALSE;
241 double lightness = (0.299 * fg_color->red + 0.587 * fg_color->green + 0.114 * fg_color->blue);
264 g_return_if_fail (color != NULL);
265 g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
267 gtk_style_context_get (context,
269 GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &c,
290 g_return_if_fail (color != NULL);
291 g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
293 gtk_style_context_get (context,
295 GTK_STYLE_PROPERTY_BORDER_COLOR, &c,
302 find_widget_func (GtkWidget *widget,
const gchar *
id)
304 const gchar *name = gtk_buildable_get_name (GTK_BUILDABLE(widget));
305 GtkWidget *ret = NULL;
307 if (g_strcmp0 (name,
id) == 0)
310 if (GTK_IS_CONTAINER(widget))
312 GList *container_list = gtk_container_get_children (GTK_CONTAINER(widget));
313 for (GList *n = container_list; !ret && n; n = n->next)
314 ret = find_widget_func (n->data,
id);
315 g_list_free (container_list);
332 GtkWidget *content_area = gtk_dialog_get_content_area (dialog);
333 return find_widget_func (content_area,
id);
347 g_return_if_fail (action_group != NULL);
349 actions = g_action_group_list_actions (G_ACTION_GROUP(action_group));
350 num_actions = g_strv_length (actions);
353 for (gint i = 0; i < num_actions; i++)
355 GAction *action = g_action_map_lookup_action (G_ACTION_MAP(action_group),
357 g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
359 g_strfreev (actions);
364 accel_map_foreach_func (gpointer user_data,
const gchar* accel_path, guint accel_key,
365 GdkModifierType accel_mods, gboolean changed)
367 GMenuModel *menu_model = user_data;
368 gchar **accel_path_parts = NULL;
369 guint accel_size = 0;
370 gchar *target = NULL;
371 gchar *accel_name_tmp = gtk_accelerator_name (accel_key, accel_mods);
372 gchar *accel_name = g_strescape (accel_name_tmp, NULL);
374 accel_path_parts = g_strsplit (accel_path,
"/", -1);
375 accel_size = g_strv_length (accel_path_parts);
378 target = g_strdup (accel_path_parts[3]);
382 target, NULL, accel_name, NULL);
384 g_strfreev (accel_path_parts);
386 g_free (accel_name_tmp);
391 add_accel_for_menu_lookup (GtkWidget *widget, gpointer user_data)
393 if (GTK_IS_MENU_ITEM(widget))
395 GtkMenuItem* menuItem = GTK_MENU_ITEM(widget);
396 GtkWidget* subMenu = gtk_menu_item_get_submenu (menuItem);
397 GtkWidget *accel_label = gtk_bin_get_child (GTK_BIN(widget));
401 gboolean added = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(menuItem),
404 GdkModifierType mods;
406 gtk_accel_label_get_accel (GTK_ACCEL_LABEL(accel_label), &key, &mods);
408 if (key > 0 && !added)
410 g_object_set_data (G_OBJECT(menuItem),
"accel-added", GINT_TO_POINTER(1));
411 gtk_widget_add_accelerator (GTK_WIDGET(widget),
"activate",
412 GTK_ACCEL_GROUP(user_data),
413 key, mods, GTK_ACCEL_VISIBLE);
416 if (GTK_IS_CONTAINER(subMenu))
417 gtk_container_foreach (GTK_CONTAINER(subMenu),
418 add_accel_for_menu_lookup, user_data);
433 g_return_if_fail (GTK_IS_WIDGET(menu));
434 g_return_if_fail (model != NULL);
435 g_return_if_fail (accel_group != NULL);
438 gtk_accel_map_foreach (model, (GtkAccelMapForeach)accel_map_foreach_func);
440 gtk_container_foreach (GTK_CONTAINER(menu), add_accel_for_menu_lookup, accel_group);
445 find_menu_item_func (GtkWidget *widget,
const gchar *action_name,
const gchar *action_label)
447 GtkWidget *ret = NULL;
449 if (GTK_IS_MENU_ITEM(widget))
455 if (GTK_IS_ACTIONABLE(widget))
457 const gchar *a_name = gtk_actionable_get_action_name (GTK_ACTIONABLE(widget));
459 if (g_strcmp0 (a_name, action_name) == 0)
466 GtkWidget *accel_label = gtk_bin_get_child (GTK_BIN(widget));
471 const gchar *al_name = gtk_label_get_label (GTK_LABEL(accel_label));
473 if (g_strcmp0 (al_name, action_label) == 0)
478 subMenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(widget));
480 if (GTK_IS_CONTAINER(subMenu))
482 GList *container_list = gtk_container_get_children (GTK_CONTAINER(subMenu));
483 for (GList *n = container_list; !ret && n; n = n->next)
484 ret = find_menu_item_func (n->data, action_name, action_label);
485 g_list_free (container_list);
502 GtkWidget *ret = NULL;
503 const gchar *action_label = NULL;
505 g_return_val_if_fail (GTK_IS_WIDGET(menu), NULL);
506 g_return_val_if_fail (action_name != NULL, NULL);
508 if (GTK_IS_CONTAINER(menu))
510 GList *container_list = gtk_container_get_children (GTK_CONTAINER(menu));
511 for (GList *n = container_list; !ret && n; n = n->next)
512 ret = find_menu_item_func (n->data, action_name, action_label);
513 g_list_free (container_list);
530 GtkWidget *ret = NULL;
531 const gchar *action_name = NULL;
533 g_return_val_if_fail (GTK_IS_WIDGET(menu), NULL);
534 g_return_val_if_fail (action_label != NULL, NULL);
536 if (GTK_IS_CONTAINER(menu))
538 GList *container_list = gtk_container_get_children (GTK_CONTAINER(menu));
539 for (GList *n = container_list; !ret && n; n = n->next)
540 ret = find_menu_item_func (n->data, action_name, action_label);
541 g_list_free (container_list);
548 menu_item_list (GtkWidget *widget, gpointer user_data)
550 GList **list = user_data;
552 if (GTK_IS_MENU_ITEM(widget))
554 GtkWidget* subMenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(widget));
556 *list = g_list_prepend (*list, widget);
558 if (GTK_IS_CONTAINER(subMenu))
559 gtk_container_foreach (GTK_CONTAINER(subMenu),
560 menu_item_list, user_data);
575 g_return_val_if_fail (GTK_IS_WIDGET(menu), NULL);
577 gtk_container_foreach (GTK_CONTAINER(menu), menu_item_list, &list);
585 GtkWidget *found_tool_item;
586 const gchar *action_name;
590 find_tool_action (GtkWidget *widget, gpointer user_data)
594 if (GTK_IS_ACTIONABLE(widget))
597 const gchar *item_action_name = gtk_actionable_get_action_name (GTK_ACTIONABLE(widget));
599 if (g_str_has_suffix (item_action_name, ftis->action_name))
600 ftis->found_tool_item = GTK_WIDGET(widget);
617 g_return_val_if_fail (GTK_IS_TOOLBAR(toolbar), NULL);
618 g_return_val_if_fail (action_name != NULL, NULL);
620 ftis.action_name = action_name;
621 ftis.found_tool_item = NULL;
623 gtk_container_foreach (GTK_CONTAINER(toolbar), find_tool_action, &ftis);
625 return ftis.found_tool_item;
630 extract_items_from_model (GMenuModel *model,
634 GMenuAttributeIter *iter;
637 GncMenuModelSearch *gsm = user_data;
638 const gchar *action = NULL;
639 const gchar *label = NULL;
640 const gchar *tooltip = NULL;
641 const gchar *target_char = NULL;
642 gint target_int = -1;
644 iter = g_menu_model_iterate_item_attributes (model, item);
645 while (g_menu_attribute_iter_get_next (iter, &key, &value))
647 if (g_str_equal (key, GNC_MENU_ATTRIBUTE_TOOLTIP) &&
648 g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
649 tooltip = g_variant_get_string (value, NULL);
650 else if (g_str_equal (key, G_MENU_ATTRIBUTE_LABEL) &&
651 g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
652 label = g_variant_get_string (value, NULL);
653 else if (g_str_equal (key, G_MENU_ATTRIBUTE_ACTION) &&
654 g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
655 action = g_variant_get_string (value, NULL);
656 else if (g_str_equal (key, G_MENU_ATTRIBUTE_TARGET) &&
657 g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
658 target_char = g_variant_get_string (value, NULL);
659 else if (g_str_equal (key, G_MENU_ATTRIBUTE_TARGET) &&
660 g_variant_is_of_type (value, G_VARIANT_TYPE_INT32))
661 target_int = g_variant_get_int32 (value);
662 g_variant_unref (value);
665 if (gsm->search_action_target)
667 gboolean target_test = FALSE;
669 if (target_int != -1 && target_int == atoi (gsm->search_action_target))
672 if (target_char && g_strcmp0 (target_char, gsm->search_action_target) == 0)
677 g_object_unref (iter);
682 if (action && gsm->search_action_name)
684 if (g_str_has_suffix (action, gsm->search_action_name))
688 gsm->tooltip = tooltip;
689 gsm->search_action_label = label;
692 if (label && gsm->search_action_label)
694 if (g_strcmp0 (label, gsm->search_action_label) == 0)
698 gsm->tooltip = tooltip;
699 gsm->search_action_name = action;
702 g_object_unref (iter);
706 items_from_model (GMenuModel *model,
709 GncMenuModelSearch *gsm = user_data;
711 for (gint i = 0; i < g_menu_model_get_n_items (model); i++)
714 GMenuModel *sub_model;
719 extract_items_from_model (model, i, user_data);
721 iter = g_menu_model_iterate_item_links (model, i);
722 while (g_menu_link_iter_get_next (iter, NULL, &sub_model))
724 items_from_model (sub_model, user_data);
725 g_object_unref (sub_model);
727 g_object_unref (iter);
748 g_return_val_if_fail (menu_model != NULL, FALSE);
749 g_return_val_if_fail (gsm != NULL, FALSE);
753 items_from_model (menu_model, gsm);
780 GncMenuModelSearch *gsm;
781 GtkWidget *menu_item = NULL;
783 g_return_val_if_fail (menu_model != NULL, NULL);
784 g_return_val_if_fail (menu != NULL, NULL);
785 g_return_val_if_fail (action_name != NULL, NULL);
787 gsm = g_new0 (GncMenuModelSearch, 1);
789 gsm->search_action_label = NULL;
790 gsm->search_action_name = action_name;
791 gsm->search_action_target = NULL;
820 const gchar *target,
const gchar *label,
821 const gchar *accel_name,
const gchar *tooltip)
823 GncMenuModelSearch *gsm;
824 gboolean found = FALSE;
826 g_return_val_if_fail (menu_model != NULL, FALSE);
827 g_return_val_if_fail (action_name != NULL, FALSE);
829 gsm = g_new0 (GncMenuModelSearch, 1);
831 gsm->search_action_label = NULL;
832 gsm->search_action_name = action_name;
833 gsm->search_action_target = target;
837 GMenuAttributeIter *iter;
840 GVariant *old_target = NULL;
841 const gchar *old_action = NULL;
842 const gchar *old_temp = NULL;
843 const gchar *old_accel = NULL;
844 const gchar *old_tooltip = NULL;
846 iter = g_menu_model_iterate_item_attributes (gsm->model, gsm->index);
847 while (g_menu_attribute_iter_get_next (iter, &key, &value))
849 if (g_str_equal (key, GNC_MENU_ATTRIBUTE_TEMPORARY) &&
850 g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
851 old_temp = g_variant_get_string (value, NULL);
852 else if (g_str_equal (key, G_MENU_ATTRIBUTE_ACTION) &&
853 g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
854 old_action = g_variant_get_string (value, NULL);
855 else if (g_str_equal (key, GNC_MENU_ATTRIBUTE_ACCELERATOR) &&
856 g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
857 old_accel = g_variant_get_string (value, NULL);
858 else if (g_str_equal (key, GNC_MENU_ATTRIBUTE_TOOLTIP) &&
859 g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
860 old_tooltip = g_variant_get_string (value, NULL);
861 else if (g_str_equal (key, G_MENU_ATTRIBUTE_TARGET))
862 old_target = g_variant_ref (value);
864 g_variant_unref (value);
866 g_object_unref (iter);
868 if (!label && !gsm->search_action_label)
871 g_variant_unref (old_target);
877 if ((accel_name && g_strcmp0 (old_accel, accel_name) != 0) ||
878 (tooltip && g_strcmp0 (old_tooltip, tooltip) != 0) ||
879 (label && g_strcmp0 (gsm->search_action_label, label) != 0))
881 GMenuItem *item = NULL;
884 item = g_menu_item_new (label, old_action);
886 item = g_menu_item_new (gsm->search_action_label, old_action);
889 g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_TOOLTIP,
"s", tooltip);
893 g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_TOOLTIP,
"s", old_tooltip);
896 g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_ACCELERATOR,
"s", accel_name);
900 g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_ACCELERATOR,
"s", old_accel);
903 g_menu_item_set_attribute (item, GNC_MENU_ATTRIBUTE_TEMPORARY,
"s", old_temp);
906 g_menu_item_set_attribute_value (item, G_MENU_ATTRIBUTE_TARGET, old_target);
908 g_menu_remove (G_MENU(gsm->model), gsm->index);
909 g_menu_insert_item (G_MENU(gsm->model), gsm->index, item);
910 g_object_unref (item);
914 g_variant_unref (old_target);
928 item_to_remove_from_model (GMenuModel *model,
933 GVariant *value = g_menu_model_get_item_attribute_value (model, item,
936 if (value && g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
943 *remove_list = g_list_append (*remove_list, tr);
944 g_variant_unref (value);
949 remove_items_from_model (GMenuModel *model,
954 for (gint i = g_menu_model_get_n_items (model) -1; i >= 0; i--)
957 GMenuModel *sub_model;
959 item_to_remove_from_model (model, i, remove_list, attrib);
961 iter = g_menu_model_iterate_item_links (model, i);
962 while (g_menu_link_iter_get_next (iter, NULL, &sub_model))
964 remove_items_from_model (sub_model, remove_list, attrib);
965 g_object_unref (sub_model);
967 g_object_unref (iter);
972 remove_items (gpointer data, gpointer user_data)
975 g_menu_remove (G_MENU(tr->model), tr->index);
989 GList *remove_list = NULL;
991 g_return_if_fail (menu_model != NULL);
992 g_return_if_fail (attrib != NULL);
994 remove_items_from_model (menu_model, &remove_list, attrib);
996 g_list_foreach (remove_list, (GFunc)remove_items, NULL);
997 g_list_free (remove_list);
1002 statusbar_push (GtkWidget *statusbar,
const gchar *text)
1004 gtk_statusbar_push (GTK_STATUSBAR(statusbar), 0,
1009 statusbar_pop (GtkWidget *statusbar)
1011 gtk_statusbar_pop (GTK_STATUSBAR(statusbar), 0);
1015 menu_item_select_cb (GtkWidget *menu_item, GtkWidget *statusbar)
1017 GtkWidget *accel_label = gtk_bin_get_child (GTK_BIN(menu_item));
1018 GMenuModel *menubar_model = g_object_get_data (G_OBJECT(statusbar),
"menu-model");
1025 GncMenuModelSearch *gsm = g_new0 (GncMenuModelSearch, 1);
1027 gsm->search_action_label = gtk_label_get_label (GTK_LABEL(accel_label));
1028 gsm->search_action_name = NULL;
1033 statusbar_push (statusbar, gsm->tooltip);
1040 menu_item_deselect_cb (GtkWidget *menu_item, GtkWidget *statusbar)
1042 statusbar_pop (statusbar);
1054 GtkWidget *statusbar)
1056 g_return_if_fail (menu_item != NULL);
1057 g_return_if_fail (statusbar != NULL);
1059 if (GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menu_item),
"added-callbacks")))
1062 g_signal_connect (menu_item,
"select",
1063 G_CALLBACK(menu_item_select_cb),
1065 g_signal_connect (menu_item,
"deselect",
1066 G_CALLBACK(menu_item_deselect_cb),
1068 g_object_set (G_OBJECT(menu_item),
"has-tooltip", FALSE, NULL);
1070 g_object_set_data (G_OBJECT(menu_item),
"added-callbacks", GINT_TO_POINTER(1));
1075 tool_item_enter_event (GtkWidget *button, GdkEvent *event,
1078 GtkWidget *tool_item = gtk_widget_get_parent (button);
1079 gchar *tooltip = gtk_widget_get_tooltip_text (tool_item);
1080 statusbar_push (user_data, tooltip);
1086 tool_item_leave_event (GtkWidget *button, GdkEvent *event,
1089 statusbar_pop (user_data);
1102 GtkWidget *statusbar)
1106 g_return_if_fail (tool_item != NULL);
1107 g_return_if_fail (statusbar != NULL);
1109 child = gtk_bin_get_child (GTK_BIN(tool_item));
1111 gtk_widget_add_events (GTK_WIDGET(child),
1112 GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
1113 | GDK_FOCUS_CHANGE_MASK);
1115 g_signal_connect (child,
"enter-notify-event",
1116 G_CALLBACK (tool_item_enter_event),
1119 g_signal_connect (child,
"leave-notify-event",
1120 G_CALLBACK (tool_item_leave_event),
1123 g_object_set (G_OBJECT(tool_item),
"has-tooltip", FALSE, NULL);
void gnc_cbwe_set_by_string(GtkComboBox *cbwe, const gchar *text)
Find an entry in the GtkComboBox by its text value, and set the widget to that value.
void gnc_menubar_model_remove_items_with_attrib(GMenuModel *menu_model, const gchar *attrib)
Remove GMenuModel entries based on having an attribute value equal to attrib, it does not matter what...
void gnc_tool_item_setup_tooltip_to_statusbar_callback(GtkWidget *tool_item, GtkWidget *statusbar)
Setup the callbacks for tool bar items so the tooltip can be displayed in the status bar...
gboolean gnc_menubar_model_find_item(GMenuModel *menu_model, GncMenuModelSearch *gsm)
Find a GtkMenu item from the action name.
gboolean gnc_is_dark_theme(GdkRGBA *fg_color)
Return whether the current gtk theme is a dark one.
void gnc_style_context_get_border_color(GtkStyleContext *context, GtkStateFlags state, GdkRGBA *color)
Wrapper to get the border color of a widget for a given state.
void gnc_style_context_get_background_color(GtkStyleContext *context, GtkStateFlags state, GdkRGBA *color)
Wrapper to get the background color of a widget for a given state.
GtkWidget * gnc_get_dialog_widget_from_id(GtkDialog *dialog, const gchar *id)
Find the Widget defined by 'id' in the dialog.
GList * gnc_menu_get_items(GtkWidget *menu)
Return a list of GtkMenuItems.
GtkWidget * gnc_menubar_model_find_menu_item(GMenuModel *menu_model, GtkWidget *menu, const gchar *action_name)
Find a GtkMenu item from the action name.
GtkWidget * gnc_find_toolbar_item(GtkWidget *toolbar, const gchar *action_name)
Search the toolbar for the tool item based on the action name.
GtkWidget * gnc_find_menu_item_by_action_name(GtkWidget *menu, const gchar *action_name)
Search the menu for the menu item based on action name.
void gnc_add_accelerator_keys_for_menu(GtkWidget *menu, GMenuModel *model, GtkAccelGroup *accel_group)
Add accelerator keys for menu item widgets.
GtkWidget * gnc_find_menu_item_by_action_label(GtkWidget *menu, const gchar *action_label)
Search the menu for the menu item based on the action label.
void gnc_disable_all_actions_in_group(GSimpleActionGroup *action_group)
Disable all the actions in a simple action group.
gboolean gnc_menubar_model_update_item(GMenuModel *menu_model, const gchar *action_name, const gchar *target, const gchar *label, const gchar *accel_name, const gchar *tooltip)
Update the GMenuModel item based on the action name by copying existing item, removing it and inserti...
void gnc_menu_item_setup_tooltip_to_statusbar_callback(GtkWidget *menu_item, GtkWidget *statusbar)
Setup the callbacks for menu bar items so the tooltip can be displayed in the status bar...