#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "GuiView.h"
#include "LyX.h"
#include "qt_helpers.h"
namespace frontend {
-Action::Action(GuiView * lyxView, QIcon const & icon,
+Action::Action(QIcon const & icon,
QString const & text, FuncRequest const & func,
QString const & tooltip, QObject * parent)
- : QAction(parent), func_(func), lyxView_(lyxView)
+ : QAction(parent), func_(func)
{
// only Qt/Mac handles that
setMenuRole(NoRole);
if (!bindings.empty())
text += " [" + toqstr(bindings.begin()->print(KeySequence::ForGui)) + "]";
- Action * act = new Action(&owner_, getIcon(item.func_, false),
- text, item.func_, text, this);
+ Action * act = new Action(getIcon(item.func_, false),
+ text, item.func_, text, this);
actions_.append(act);
return act;
}
subMenu->setEnabled(m->status().enabled());
} else {
// we have a MenuItem::Command
- qMenu.addAction(new Action(view, QIcon(), label(*m),
+ qMenu.addAction(new Action(QIcon(), label(*m),
m->func(), m->tooltip(), &qMenu));
}
}
BufferView const *) const;
/// Initialize specific MACOS X menubar
- void macxMenuBarInit(GuiView * view, QMenuBar * qmb);
+ void macxMenuBarInit(QMenuBar * qmb);
/// Mac special menu.
/** This defines a menu whose entries list the FuncRequests
that this menubar will be used also when one of LyX' dialogs has
focus. (JMarc)
*/
-void Menus::Impl::macxMenuBarInit(GuiView * view, QMenuBar * qmb)
+void Menus::Impl::macxMenuBarInit(QMenuBar * qmb)
{
/* Since Qt 4.2, the qt/mac menu code has special code for
specifying the role of a menu entry. However, it does not
for (size_t i = 0 ; cit != end ; ++cit, ++i) {
#if defined(QT_MAC_USE_COCOA) && (QT_MAC_USE_COCOA > 0)
if (first_call || entries[i].role != QAction::ApplicationSpecificRole) {
- Action * action = new Action(view, QIcon(), cit->label(),
+ Action * action = new Action(QIcon(), cit->label(),
cit->func(), QString(), qMenu);
action->setMenuRole(entries[i].role);
qMenu->addAction(action);
}
#else
- Action * action = new Action(view, QIcon(), cit->label(),
+ Action * action = new Action(QIcon(), cit->label(),
cit->func(), QString(), qMenu);
action->setMenuRole(entries[i].role);
qMenu->addAction(action);
// create duplicate items in the application menu. It seems
// that Qt does not remove them when the QMenubar is cleared.
LYXERR(Debug::GUI, "Creating Mac OS X special menu bar");
- d->macxMenuBarInit(view, qmb);
+ d->macxMenuBarInit(qmb);
#endif
} else {
// Clear all menubar contents before filling it.