Menu menu;
menubackend_.expand(menubackend_.getMenubar(), menu, owner_->buffer());
Menu menu;
menubackend_.expand(menubackend_.getMenubar(), menu, owner_->buffer());
- GuiPopupMenu * qMenu = new GuiPopupMenu(this, *m, true);
+ GuiPopupMenu * qMenu = new GuiPopupMenu(owner_, *m, true);
owner_->menuBar()->addMenu(qMenu);
name_map_[toqstr(name)] = qMenu;
owner_->menuBar()->addMenu(qMenu);
name_map_[toqstr(name)] = qMenu;
#include "Action.h"
#include "GuiPopupMenu.h"
#include "Action.h"
#include "GuiPopupMenu.h"
#include "qt_helpers.h"
#include "LyXFunc.h"
#include "MenuBackend.h"
#include "qt_helpers.h"
#include "LyXFunc.h"
#include "MenuBackend.h"
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
-GuiPopupMenu::GuiPopupMenu(GuiMenubar * owner, MenuItem const & mi,
+GuiPopupMenu::GuiPopupMenu(GuiView * owner, MenuItem const & mi,
- : QMenu(owner->menuBar()), owner_(owner)
+ : QMenu(owner), owner_(owner)
{
name_ = mi.submenuname();
{
name_ = mi.submenuname();
return;
// Here, We make sure that theLyXFunc points to the correct LyXView.
return;
// Here, We make sure that theLyXFunc points to the correct LyXView.
- theLyXFunc().setLyXView(owner_->view());
+ theLyXFunc().setLyXView(owner_);
- Menu const & fromLyxMenu = owner_->backend().getMenu(name_);
- owner_->backend().expand(fromLyxMenu, topLevelMenu_, owner_->view()->buffer());
+ Menu const & fromLyxMenu = menubackend.getMenu(name_);
+ menubackend.expand(fromLyxMenu, topLevelMenu_, owner_->buffer());
- if (!owner_->backend().hasMenu(topLevelMenu_.name())) {
+ if (!menubackend.hasMenu(topLevelMenu_.name())) {
LYXERR(Debug::GUI, "\tWARNING: menu seems empty"
<< to_utf8(topLevelMenu_.name()));
}
LYXERR(Debug::GUI, "\tWARNING: menu seems empty"
<< to_utf8(topLevelMenu_.name()));
}
docstring label = getLabel(*m);
addBinding(label, *m);
docstring label = getLabel(*m);
addBinding(label, *m);
- Action * action = new Action(*(owner_->view()),
+ Action * action = new Action(*(owner_),
QIcon(), toqstr(label), m->func(), QString());
qMenu->addAction(action);
}
QIcon(), toqstr(label), m->func(), QString());
qMenu->addAction(action);
}
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
/// a submenu
class GuiPopupMenu : public QMenu
/// a submenu
class GuiPopupMenu : public QMenu
- GuiPopupMenu(GuiMenubar * owner, MenuItem const & mi,
+ GuiPopupMenu(GuiView * owner, MenuItem const & mi,
bool topLevelMenu = false);
/// populates the menu or one of its submenu
bool topLevelMenu = false);
/// populates the menu or one of its submenu
/// add binding keys a the menu item label.
void addBinding(docstring & label, MenuItem const & mi);
/// add binding keys a the menu item label.
void addBinding(docstring & label, MenuItem const & mi);
- /// our owning menubar
- GuiMenubar * owner_;
+ /// our owning view
+ GuiView * owner_;
/// the name of this menu
docstring name_;
/// Top Level Menu
/// the name of this menu
docstring name_;
/// Top Level Menu