| 415 | } |
| 416 | |
| 417 | void |
| 418 | LayoutViewBase::init_menu () |
| 419 | { |
| 420 | make_menu (); |
| 421 | |
| 422 | // make the plugins create their menu items |
| 423 | for (tl::Registrar<lay::PluginDeclaration>::iterator cls = tl::Registrar<lay::PluginDeclaration>::begin (); cls != tl::Registrar<lay::PluginDeclaration>::end (); ++cls) { |
| 424 | // TODO: get rid of the const_cast hack |
| 425 | const_cast <lay::PluginDeclaration *> (&*cls)->init_menu (dispatcher ()); |
| 426 | } |
| 427 | |
| 428 | // if not in editable mode, hide all entries from "edit_mode" group and show all from the "view_mode" group and vice versa |
| 429 | std::vector<std::string> edit_mode_grp = menu ()->group ("edit_mode"); |
| 430 | for (std::vector<std::string>::const_iterator g = edit_mode_grp.begin (); g != edit_mode_grp.end (); ++g) { |
| 431 | menu ()->action (*g)->set_visible (is_editable ()); |
| 432 | } |
| 433 | std::vector<std::string> view_mode_grp = menu ()->group ("view_mode"); |
| 434 | for (std::vector<std::string>::const_iterator g = view_mode_grp.begin (); g != view_mode_grp.end (); ++g) { |
| 435 | menu ()->action (*g)->set_visible (! is_editable ()); |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | void |
| 440 | LayoutViewBase::shutdown () |
nothing calls this directly
no test coverage detected