-
- node = node->xmlChildrenNode;
-
- while (node) {
- if (!xmlStrcasecmp(node->name, (const xmlChar*) "menu")) {
- if (parse_attr_string("plugin", node, &plugin)) {
- PluginMenuCreateData data;
- data.doc = doc;
- data.node = node;
- data.parent = menu;
- parent = plugin_create(plugin, &data);
- g_free(plugin);
- } else {
- parent = menu;
- parse_menu(doc, node, &parent);
- menu_add_entry(menu, menu_entry_new_submenu(parent->label,
- parent));
- }
-
- }
- else if (!xmlStrcasecmp(node->name, (const xmlChar*) "item")) {
- if (parse_attr_string("label", node, &label)) {
- if ((nact = parse_find_node("action", node->xmlChildrenNode)))
- act = action_parse(doc, nact);
- else
- act = NULL;
- if (act)
- menu_add_entry(menu, menu_entry_new(label, act));
- else
- menu_add_entry(menu, menu_entry_new_separator(label));
- g_free(label);
- }
- }
- node = node->next;
+ if (!loaded) {
+ if (parse_load_menu("menu.xml", &doc, &node)) {
+ parse_tree(menu_parse_inst, doc, node->children);
+ xmlFreeDoc(doc);
+ } else
+ g_message(_("Unable to find a valid menu file '%s'"),
+ "menu.xml");