]> Shamusworld >> Repos - architektonas/blobdiff - src/widgets/actionhandler.cpp
In the middle of chasing down MDI not activating bug, renaming of Graphic to
[architektonas] / src / widgets / actionhandler.cpp
index f44ca7a5c4b59be626f97228fae448aaf05605ac..b5a28de9ae62ad3a02df289cb6be96106605bf3f 100644 (file)
 /**
  * Constructor
  */
-ActionHandler::ActionHandler(QG_MainWindowInterface * mw)
+ActionHandler::ActionHandler(QG_MainWindowInterface * mwi)
 {
        DEBUG->print("ActionHandler::ActionHandler");
-       mainWindow = mw;
+       mainWindowIntf = mwi;
 
        snapFree = NULL;
        snapGrid = NULL;
@@ -171,7 +171,7 @@ ActionHandler::~ActionHandler()
  */
 void ActionHandler::killSelectActions()
 {
-       GraphicView * gv = mainWindow->getGraphicView();
+       GraphicView * gv = mainWindowIntf->getGraphicView();
 
        if (gv)
                gv->killSelectActions();
@@ -182,7 +182,7 @@ void ActionHandler::killSelectActions()
  */
 ActionInterface * ActionHandler::getCurrentAction()
 {
-       GraphicView * gv = mainWindow->getGraphicView();
+       GraphicView * gv = mainWindowIntf->getGraphicView();
 
        if (gv)
                return gv->getCurrentAction();
@@ -194,8 +194,8 @@ ActionInterface * ActionHandler::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)
@@ -218,7 +218,7 @@ itself would create the gv & doc. So for the EditUndo, we'd have:
        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
 
 /**
@@ -230,15 +230,15 @@ ActionInterface * ActionHandler::setCurrentAction(RS2::ActionType id)
 {
        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;
        }
 
@@ -816,6 +816,7 @@ bool ActionHandler::keycode(const QString & code)
        //if (!e.isAccepted()) {
        // keycode for new action:
        RS2::ActionType type = COMMANDS->keycodeToAction(code);
+
        if (type != RS2::ActionNone)
        {
                // some actions require special handling (GUI update):
@@ -868,7 +869,6 @@ bool ActionHandler::keycode(const QString & code)
                }
                return true;
        }
-       //}
 
        return false;
 }
@@ -887,7 +887,7 @@ bool ActionHandler::command(const QString & cmd)
 
        if (c == "\n")
        {
-               GraphicView * gv = mainWindow->getGraphicView();
+               GraphicView * gv = mainWindowIntf->getGraphicView();
 
                if (gv)
                        gv->back();
@@ -899,7 +899,7 @@ bool ActionHandler::command(const QString & cmd)
        // pass command on to running action:
        CommandEvent e(cmd);
 
-       GraphicView * gv = mainWindow->getGraphicView();
+       GraphicView * gv = mainWindowIntf->getGraphicView();
 
        if (gv)
        {
@@ -1834,13 +1834,10 @@ void ActionHandler::slotCamReorder()
 #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)