X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fwidgets%2Fqg_actionhandler.cpp;h=d0d6210f0244af98adce32e4e94a25d21eb0ef2a;hb=be33e866f2121c48db93e06d743c5ae3826c1948;hp=11d4b3f3440cc8799327ce12f631c406483a033e;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/widgets/qg_actionhandler.cpp b/src/widgets/qg_actionhandler.cpp index 11d4b3f..d0d6210 100644 --- a/src/widgets/qg_actionhandler.cpp +++ b/src/widgets/qg_actionhandler.cpp @@ -14,6 +14,7 @@ #include "qg_actionhandler.h" +#include "rs_commandevent.h" #include "commands.h" #include "rs_actionblocksadd.h" #include "rs_actionblocksattributes.h" @@ -67,6 +68,7 @@ #include "rs_actioninfodist2.h" #include "rs_actioninfoinside.h" #include "rs_actioninfototallength.h" +#include "rs_actioninterface.h" #include "rs_actionlayersadd.h" #include "rs_actionlayersedit.h" #include "rs_actionlayersfreezeall.h" @@ -172,7 +174,7 @@ QG_ActionHandler::~QG_ActionHandler() */ void QG_ActionHandler::killSelectActions() { - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); if (gv != NULL) gv->killSelectActions(); @@ -183,19 +185,19 @@ void QG_ActionHandler::killSelectActions() */ RS_ActionInterface * QG_ActionHandler::getCurrentAction() { - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); - if (gv != NULL) + if (gv) return gv->getCurrentAction(); - else - return NULL; + + return NULL; } #if 0 Instead of the following giant switch statement, you could something like the following: RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS_ActionInterface * action) { - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); RS_Document * doc = mainWindow->getDocument(); // only global options are allowed without a document: @@ -214,6 +216,12 @@ Then you'd call it with: Hmmm.... We need gv & doc *before* we call this... +What you'd do then is have the form of the thing worked ahead of time and the function +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... #endif /** @@ -225,7 +233,7 @@ RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS2::ActionType id) { RS_DEBUG->print("QG_ActionHandler::setCurrentAction()"); - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); RS_Document * doc = mainWindow->getDocument(); RS_ActionInterface * a = NULL; @@ -810,7 +818,7 @@ bool QG_ActionHandler::keycode(const QString & code) // pass keycode on to running action: //RS_keycodeEvent e(cmd); - //RS_GraphicView* gv = mainWindow->getGraphicView(); + //GraphicView* gv = mainWindow->getGraphicView(); //if (gv!=NULL) { // gv->keycodeEvent(&e); //} @@ -891,7 +899,7 @@ bool QG_ActionHandler::command(const QString & cmd) if (c == "\n") { - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); if (gv != NULL) gv->back(); @@ -903,7 +911,7 @@ bool QG_ActionHandler::command(const QString & cmd) // pass command on to running action: RS_CommandEvent e(cmd); - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); if (gv != NULL) {