/**
* Constructor
*/
-ActionHandler::ActionHandler(QG_MainWindowInterface * mw)
+ActionHandler::ActionHandler(QG_MainWindowInterface * mwi)
{
DEBUG->print("ActionHandler::ActionHandler");
- mainWindow = mw;
+ mainWindowIntf = mwi;
snapFree = NULL;
snapGrid = NULL;
*/
void ActionHandler::killSelectActions()
{
- GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindowIntf->getGraphicView();
if (gv)
gv->killSelectActions();
*/
ActionInterface * ActionHandler::getCurrentAction()
{
- GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindowIntf->getGraphicView();
if (gv)
return gv->getCurrentAction();
Instead of the following giant switch statement, you could something like the following:
ActionInterface * ActionHandler::setCurrentAction(ActionInterface * action)
{
- GraphicView * gv = mainWindow->getGraphicView();
- Document * doc = mainWindow->getDocument();
+ GraphicView * gv = mainWindowIntf->getGraphicView();
+ Document * doc = mainWindowIntf->getDocument();
// only global options are allowed without a document:
if (gv == NULL || doc == NULL)
FunctionCreateAction(bool);
FunctionCreateAction(void);
-Well... The problem is the action, they're all different...
+Well... The problem is the actions, they're all different...
#endif
/**
{
DEBUG->print("ActionHandler::setCurrentAction()");
- GraphicView * gv = mainWindow->getGraphicView();
- Document * doc = mainWindow->getDocument();
+ GraphicView * gv = mainWindowIntf->getGraphicView();
+ Document * doc = mainWindowIntf->getDocument();
ActionInterface * a = NULL;
// only global options are allowed without a document:
if (gv == NULL || doc == NULL)
{
DEBUG->print(Debug::D_WARNING,
- "ActionHandler::setCurrentAction: graphic view or document is NULL");
+ "ActionHandler::setCurrentAction: graphic view=%08X or document=%08X", gv, doc);
return NULL;
}
//if (!e.isAccepted()) {
// keycode for new action:
RS2::ActionType type = COMMANDS->keycodeToAction(code);
+
if (type != RS2::ActionNone)
{
// some actions require special handling (GUI update):
}
return true;
}
- //}
return false;
}
if (c == "\n")
{
- GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindowIntf->getGraphicView();
if (gv)
gv->back();
// pass command on to running action:
CommandEvent e(cmd);
- GraphicView * gv = mainWindow->getGraphicView();
+ GraphicView * gv = mainWindowIntf->getGraphicView();
if (gv)
{
#endif
}
+// ??? WHAT THE FUCK IS THIS SHIT ???
void ActionHandler::slotFocusNormal()
{
- //QG_GraphicView* gv = mainWindow->getGraphicView();
- //if (gv) {
- //gv->setFocus();
- mainWindow->setFocus2();
- //}
+ mainWindowIntf->setFocus2();
}
void ActionHandler::setActionSnapFree(QAction * a)