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.
17 #include "FuncStatus.h"
20 #include "frontends/LyXView.h"
22 #include "qt_helpers.h"
24 #include "support/lstrings.h"
26 #include <boost/bind.hpp>
38 int const statusbar_timer_value = 3000;
42 Action::Action(LyXView & lyxView, string const & text,
43 FuncRequest const & func, string const & tooltip)
44 : QAction(this), func_(func), lyxView_(lyxView)
46 setText(toqstr(text));
47 setToolTip(toqstr(tooltip));
48 setStatusTip(toqstr(tooltip));
49 connect(this, SIGNAL(triggered()), this, SLOT(action()));
53 Action::Action(LyXView & lyxView, string const & icon, string const & text,
54 FuncRequest const & func, string const & tooltip)
55 : QAction(this), func_(func), lyxView_(lyxView)
57 setIcon(QPixmap(icon.c_str()));
58 setText(toqstr(text));
59 setToolTip(toqstr(tooltip));
60 setStatusTip(toqstr(tooltip));
61 connect(this, SIGNAL(triggered()), this, SLOT(action()));
66 void Action::setAction(FuncRequest const & func)
74 FuncStatus const status = lyxView_.getLyXFunc().getStatus(func_);
76 if (status.onoff(true)) {
79 } else if (status.onoff(false)) {
86 setEnabled(status.enabled());
92 // lyxerr[Debug::ACTION] << "calling LyXFunc::dispatch: func_: " << func_ << endl;
94 lyxView_.getLyXFunc().dispatch(func_);
97 } // namespace frontend
100 #include "Action_moc.cpp"