| 1644 | } |
| 1645 | |
| 1646 | void |
| 1647 | AbstractMenu::insert_separator (const std::string &p, const std::string &name) |
| 1648 | { |
| 1649 | typedef std::vector<std::pair<AbstractMenuItem *, std::list<AbstractMenuItem>::iterator > > path_type; |
| 1650 | tl::Extractor extr (p.c_str ()); |
| 1651 | path_type path = find_item (extr); |
| 1652 | if (! path.empty ()) { |
| 1653 | |
| 1654 | AbstractMenuItem *parent = path.back ().first; |
| 1655 | std::list<AbstractMenuItem>::iterator iter = path.back ().second; |
| 1656 | |
| 1657 | parent->children.insert (iter, AbstractMenuItem (mp_dispatcher)); |
| 1658 | --iter; |
| 1659 | Action *action = new Action (); |
| 1660 | action->set_separator (true); |
| 1661 | iter->setup_item (parent->name (), name, action, true); |
| 1662 | |
| 1663 | } |
| 1664 | |
| 1665 | emit_changed (); |
| 1666 | } |
| 1667 | |
| 1668 | void |
| 1669 | AbstractMenu::insert_menu (const std::string &p, const std::string &name, Action *action) |