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"
18 #include "FuncRequest.h"
19 #include "FuncStatus.h"
22 #include "qt_helpers.h"
24 #include "support/lstrings.h"
30 Action::Action(GuiView & lyxView, QIcon const & icon,
31 QString const & text, FuncRequest const & func,
32 QString const & tooltip)
33 : QAction(&lyxView), func_(func), lyxView_(lyxView)
35 #if QT_VERSION >= 0x040200
36 // only Qt/Mac handles that
42 setStatusTip(tooltip);
43 connect(this, SIGNAL(triggered()), this, SLOT(action()));
50 FuncStatus const status = getStatus(func_);
52 if (status.onoff(true)) {
55 } else if (status.onoff(false)) {
62 setEnabled(status.enabled());
68 // LYXERR(Debug::ACTION) << "calling LyXFunc::dispatch: func_: "
70 lyxView_.dispatch(func_);
74 } // namespace frontend
77 #include "Action_moc.cpp"