Ejemplo n.º 1
0
void menu_item_execute(const MenuInfo *menu_info, const MenuItem *menu_item, gboolean beep)
{
	guint state = debug_state() | menu_info->extra_state();

	if (!menu_item->state || menu_item_matches_state(menu_item, state))
		menu_item->callback(menu_item);
	else if (beep)
		plugin_beep();
}
Ejemplo n.º 2
0
static void toolbar_update_state(DebugState state)
{
	static DebugState last_state = 0;
	state |= debug_menu_extra_state();

	if (state != last_state)
	{
		ToolItem *item;

		for (item = toolbar_items; item->index != -1; item++)
		{
			gtk_widget_set_sensitive(item->widget,
				menu_item_matches_state(debug_menu_items + item->index, state));
		}
	}
}
Ejemplo n.º 3
0
static void update_active_menu(guint state)
{
	state |= active_menu->extra_state();

	if (state != active_menu->last_state)
	{
		const MenuItem *menu_item;

		for (menu_item = active_menu->items; menu_item->name; menu_item++)
		{
			if (menu_item->state)
			{
				gtk_widget_set_sensitive(menu_item->widget,
					menu_item_matches_state(menu_item, state));
			}
		}

		active_menu->last_state = state;
	}
}