diff options
author | Sebastien Braun | 2010-10-07 22:54:10 +0200 |
---|---|---|
committer | Sebastien Braun | 2010-10-07 22:54:10 +0200 |
commit | e61097b8881bc7e72a5499816cb1199ea274a3ca (patch) | |
tree | bcfa9f3fe3f43af02845bc21367de395b248600c /src/gui | |
parent | Make behaviour on lookup failures configurable (diff) | |
download | pvs-e61097b8881bc7e72a5499816cb1199ea274a3ca.tar.gz pvs-e61097b8881bc7e72a5499816cb1199ea274a3ca.tar.xz pvs-e61097b8881bc7e72a5499816cb1199ea274a3ca.zip |
Rework template meta-magic
- No more implicit dependency on Boost.MPL
- Better documentation for template magic
- Move input handler policies to handler definitions where they belong
- Separate out event descriptions from handlers
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/frame.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/frame.cpp b/src/gui/frame.cpp index 1b80c3d..12ce6b5 100644 --- a/src/gui/frame.cpp +++ b/src/gui/frame.cpp @@ -19,7 +19,6 @@ */ #include <src/input/inputEvent.h> -#include <src/input/inputHandlerChain.h> #include "frame.h" #include <src/gui/mainWindow.h> #include <iostream> @@ -434,19 +433,18 @@ void Frame::sendInputEvent(InputEvent const& evt) { QString str; eventToString(evt, str); - std::string evtStr = evt.toString(); PVSMsg msg(PVSCOMMAND, "INPUTEVENT", str); if(_remoteControlEnabled) { if(_remoteControlToAll) { - ConsoleLog writeLine(QString("sendInputEvent(%1) to one").arg(evtStr.c_str())); + ConsoleLog writeLine(QString("sendInputEvent(%1) to one").arg(evt.toString())); PVSConnectionManager::getManager()->getServer()->sendToAll(msg); } else { - ConsoleLog writeLine(QString("sendInputEvent(%1) to all").arg(evtStr.c_str())); + ConsoleLog writeLine(QString("sendInputEvent(%1) to all").arg(evt.toString())); _cFrame->getConnection()->sendMessage(msg); } } @@ -592,14 +590,14 @@ void Frame::showSpecialEventMenu() { qDebug("Trying to show menu..."); QMenu* menu = new QMenu(this); - QList<SpecialInputEventDescription> specialEvents = privileged_handler_chain::describe(); - QList<SpecialInputEventDescription>::iterator iter; + QList<SpecialInputEventDescription> specialEvents = SpecialInputEventDescription::describeSpecialEvents(); + QListIterator<SpecialInputEventDescription> iter(specialEvents); int i; - for(i = 0, iter = specialEvents.begin(); - iter != specialEvents.end(); - iter++, i++) + for(i = 0; + iter.hasNext(); + i++) { - QAction* act = menu->addAction((*iter).descriptionString); + QAction* act = menu->addAction(iter.next().description); act->setData(i); } QAction* selected = menu->exec(QCursor::pos()); |