2 * \file qt2/Menubar_pimpl.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS
14 #include "Menubar_pimpl.h"
15 #include "MenuBackend.h"
16 #include "LyXAction.h"
20 #include "FloatList.h"
21 #include "support/lstrings.h"
22 #include "support/LAssert.h"
23 #include "qt_helpers.h"
27 #include "QLPopupMenu.h"
42 Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mbe)
43 : owner_(static_cast<QtView*>(view)), menubackend_(mbe)
45 Menu::const_iterator m = mbe.getMenubar().begin();
46 Menu::const_iterator end = mbe.getMenubar().end();
47 for (; m != end; ++m) {
48 pair<int, QLPopupMenu *> menu =
49 createMenu(owner_->menuBar(), &(*m), this, true);
50 name_map_[m->submenuname()] = menu.second;
55 void Menubar::Pimpl::openByName(string const & name)
57 NameMap::const_iterator const cit = name_map_.find(name);
58 if (cit == name_map_.end())
61 // this will have to do I'm afraid.
62 cit->second->exec(QCursor::pos());