#include <config.h>
-#include "BufferView.h"
+#include "Action.h"
+
#include "lyx_cb.h"
#include "lyxfunc.h"
#include "FuncStatus.h"
-
#include "debug.h"
-#include <boost/bind.hpp>
-
#include "frontends/LyXView.h"
-#include "qt_helpers.h"
-#include "Action.h"
+#include "qt_helpers.h"
#include "support/lstrings.h"
+#include <boost/bind.hpp>
+
+
using std::string;
using std::endl;
Action::Action(LyXView & lyxView, string const & text,
FuncRequest const & func, string const & tooltip)
- : QAction(this), lyxView_(lyxView), func_(func)
+ : QAction(this), func_(func), lyxView_(lyxView)
{
- setText(tr(toqstr(text)));
- setToolTip(tr(toqstr(tooltip)));
+ setText(toqstr(text));
+ setToolTip(toqstr(tooltip));
setStatusTip(toqstr(tooltip));
connect(this, SIGNAL(triggered()), this, SLOT(action()));
- this->setCheckable(true);
+ update();
}
Action::Action(LyXView & lyxView, string const & icon, string const & text,
FuncRequest const & func, string const & tooltip)
- : QAction(this), lyxView_(lyxView), func_(func)
+ : QAction(this), func_(func), lyxView_(lyxView)
{
setIcon(QPixmap(icon.c_str()));
- setText(tr(toqstr(text)));
- setToolTip(tr(toqstr(tooltip)));
+ setText(toqstr(text));
+ setToolTip(toqstr(tooltip));
setStatusTip(toqstr(tooltip));
connect(this, SIGNAL(triggered()), this, SLOT(action()));
- this->setCheckable(true);
+ update();
}
/*
{
FuncStatus const status = lyxView_.getLyXFunc().getStatus(func_);
- this->setChecked(status.onoff(true));
- this->setEnabled(status.enabled());
+ if (status.onoff(true)) {
+ setCheckable(true);
+ setChecked(true);
+ } else if (status.onoff(false)) {
+ setCheckable(true);
+ setChecked(false);
+ } else {
+ setCheckable(false);
+ }
+
+ setEnabled(status.enabled());
}