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.
16 #include "FuncRequest.h"
17 #include "FuncStatus.h"
20 #include "qt_helpers.h"
22 #include "support/lstrings.h"
28 Action::Action(GuiView & lyxView, QIcon const & icon,
29 QString const & text, FuncRequest const & func,
30 QString const & tooltip)
31 : QAction(&lyxView), func_(func), lyxView_(lyxView)
33 #if QT_VERSION >= 0x040200
34 // only Qt/Mac handles that
40 setStatusTip(tooltip);
41 connect(this, SIGNAL(triggered()), this, SLOT(action()));
48 FuncStatus const status = getStatus(func_);
50 if (status.onoff(true)) {
53 } else if (status.onoff(false)) {
60 setEnabled(status.enabled());
66 // LYXERR(Debug::ACTION) << "calling LyXFunc::dispatch: func_: "
68 lyxView_.dispatch(func_);
72 } // namespace frontend
75 #include "Action_moc.cpp"