]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Action.cpp
shuffle some code around
[lyx.git] / src / frontends / qt4 / Action.cpp
index 26d9bd6ec301e7b9228a10f8327195ff473a8428..63a05c68eb702517f847f96d900b6e9334efce32 100644 (file)
 
 #include "Action.h"
 
-#include "GuiView.h"
-#include "qt_helpers.h"
+#include "frontends/LyXView.h"
 
-#include "callback.h"
-#include "LyXFunc.h"
-#include "FuncStatus.h"
 #include "debug.h"
+#include "FuncRequest.h"
+#include "FuncStatus.h"
+#include "GuiView.h"
+#include "LyXFunc.h"
+#include "qt_helpers.h"
 
 #include "support/lstrings.h"
 
-#include <boost/bind.hpp>
-
-using std::string;
-using std::endl;
-
 namespace lyx {
 namespace frontend {
 
 
-Action::Action(GuiViewBase & lyxView, docstring const & text,
-               FuncRequest const & func, docstring const & tooltip)
+Action::Action(GuiViewBase & lyxView, QString const & icon,
+         QString const & text, FuncRequest const & func,
+         QString const & tooltip)
        : QAction(&lyxView), func_(func), lyxView_(lyxView)
 {
 #if QT_VERSION >= 0x040200
        // only Qt/Mac handles that
        setMenuRole(NoRole);
 #endif
-       setText(toqstr(text));
-       setToolTip(toqstr(tooltip));
-       setStatusTip(toqstr(tooltip));
+       setIcon(QPixmap(icon));
+       setText(text);
+       setToolTip(tooltip);
+       setStatusTip(tooltip);
        connect(this, SIGNAL(triggered()), this, SLOT(action()));
        update();
 }
 
-Action::Action(GuiViewBase & lyxView, string const & icon, docstring const & text,
-               FuncRequest const & func, docstring const & tooltip)
-               : QAction(&lyxView), func_(func), lyxView_(lyxView)
-{
-       setIcon(QPixmap(icon.c_str()));
-       setText(toqstr(text));
-       setToolTip(toqstr(tooltip));
-       setStatusTip(toqstr(tooltip));
-       connect(this, SIGNAL(triggered()), this, SLOT(action()));
-       update();
-}
-
-/*
-void Action::setAction(FuncRequest const & func)
-{
-       func_=func;
-}
-*/
 
 void Action::update()
 {
@@ -85,8 +65,8 @@ void Action::update()
 
 void Action::action()
 {
-//     LYXERR(Debug::ACTION) << "calling LyXFunc::dispatch: func_: " << func_ << endl;
-
+       //      LYXERR(Debug::ACTION) << "calling LyXFunc::dispatch: func_: "
+       //      "\n";
        lyxView_.dispatch(func_);
        triggered(this);
 }