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 #pragma implementation
17 #include "Menubar_pimpl.h"
18 #include "MenuBackend.h"
19 #include "LyXAction.h"
23 #include "FloatList.h"
24 #include "support/lstrings.h"
25 #include "support/LAssert.h"
26 #include "qt_helpers.h"
30 #include "QLPopupMenu.h"
45 Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mbe)
46 : owner_(static_cast<QtView*>(view)), menubackend_(mbe)
48 Menu::const_iterator m = mbe.getMenubar().begin();
49 Menu::const_iterator end = mbe.getMenubar().end();
50 for (; m != end; ++m) {
51 pair<int, QLPopupMenu *> menu =
52 createMenu(owner_->menuBar(), &(*m), this, true);
53 name_map_[m->submenuname()] = menu.second;
58 void Menubar::Pimpl::openByName(string const & name)
60 NameMap::const_iterator const cit = name_map_.find(name);
61 if (cit == name_map_.end())
64 // this will have to do I'm afraid.
65 cit->second->exec(QCursor::pos());