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 // DispatchResult.h is needed by the windows compiler because lyx::dispatch
16 // returns a DispatchResult const reference. Gcc does not complain. Weird...
17 #include "DispatchResult.h"
18 #include "FuncRequest.h"
19 #include "FuncStatus.h"
22 #include "qt_helpers.h"
24 #include "support/debug.h"
25 #include "support/lstrings.h"
31 Action::Action(QIcon const & icon,
32 QString const & text, FuncRequest const & func,
33 QString const & tooltip, QObject * parent)
34 : QAction(parent), func_(func)
36 // only Qt/Mac handles that
41 setStatusTip(tooltip);
42 connect(this, SIGNAL(triggered()), this, SLOT(action()));
49 FuncStatus const status = getStatus(func_);
51 if (status.onOff(true)) {
54 } else if (status.onOff(false)) {
61 setEnabled(status.enabled());
67 //LYXERR(Debug::ACTION, "calling lyx::dispatch: func_: ");
73 } // namespace frontend
76 #include "moc_Action.cpp"