#include "qt_helpers.h"
#include "MenuBackend.h"
-#include "frontends/lyx_gui.h"
#include "support/lstrings.h"
#include "debug.h"
#ifdef Q_WS_MACX
#include "kbmap.h"
#include "QLyXKeySym.h"
-extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
#endif
using std::make_pair;
if (name_.empty())
return;
+ // Here, We make sure that theLyXFunc points to the correct LyXView.
+ theLyXFunc().setLyXView(owner_->view());
+
Menu const & fromLyxMenu = owner_->backend().getMenu(name_);
- owner_->backend().expand(fromLyxMenu, topLevelMenu_, owner_->view());
+ owner_->backend().expand(fromLyxMenu, topLevelMenu_, owner_->view()->buffer());
if (!owner_->backend().hasMenu(topLevelMenu_.name())) {
lyxerr[Debug::GUI] << "\tWARNING: menu seems empty" << lyx::to_utf8(topLevelMenu_.name()) << endl;
addBinding(label, *m);
Action * action = new Action(*(owner_->view()),
- lyx::to_utf8(label), m->func());
+ label, m->func());
qMenu->addAction(action);
}
}