3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Abdelrazak Younes
8 * Full author contact details are available in file CREDITS.
15 #include "frontends/LyXView.h"
19 #include "FuncRequest.h"
20 #include "FuncStatus.h"
23 #include "qt_helpers.h"
25 #include "support/lstrings.h"
31 Action::Action(GuiViewBase & lyxView, QString const & icon,
32 QString const & text, FuncRequest const & func,
33 QString const & tooltip)
34 : QAction(&lyxView), func_(func), lyxView_(lyxView)
36 #if QT_VERSION >= 0x040200
37 // only Qt/Mac handles that
40 setIcon(QPixmap(icon));
43 setStatusTip(tooltip);
44 connect(this, SIGNAL(triggered()), this, SLOT(action()));
51 FuncStatus const status = getStatus(func_);
53 if (status.onoff(true)) {
56 } else if (status.onoff(false)) {
63 setEnabled(status.enabled());
69 // LYXERR(Debug::ACTION) << "calling LyXFunc::dispatch: func_: "
71 lyxView_.dispatch(func_);
75 } // namespace frontend
78 #include "Action_moc.cpp"