#include "actiondrawlinetangent1.h"
#include "actiondrawlinetangent2.h"
#include "actiondrawpoint.h"
+#include "actiondrawpolyline.h"
#include "actiondrawspline.h"
#include "actiondrawtext.h"
#include "actioneditcopy.h"
#include "actionmodifytrim.h"
#include "actionmodifytrimamount.h"
#include "actionoptionsdrawing.h"
+#include "actionpolylineadd.h"
+#include "actionpolylineappend.h"
+#include "actionpolylinedel.h"
+#include "actionpolylinedelbetween.h"
+#include "actionpolylinetrim.h"
#include "actionselect.h"
#include "actionselectall.h"
#include "actionselectcontour.h"
#include "actionzoomredraw.h"
#include "actionzoomwindow.h"
-#warning "!!! Need to add polyline functionality !!!"
-#if 0
-#include "actiondrawpolyline.h"
-#include "actionpolylineadd.h"
-#include "actionpolylineappend.h"
-#include "actionpolylinedel.h"
-#include "actionpolylinedelbetween.h"
-#include "actionpolylinetrim.h"
-#endif
-
#ifdef RS_CAM
#include "actioncamexportauto.h"
#include "actioncamreorder.h"
/**
* 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;
}
a = new ActionSelectLayer(*doc, *gv);
break;
- // Tool actions:
- //
-//no
-// case RS2::ActionToolRegenerateDimensions:
-// a = new ActionToolRegenerateDimensions(*doc, *gv);
-// break;
-
// Zooming actions:
//
case RS2::ActionZoomIn:
case RS2::ActionDrawLineRelAngle:
a = new ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, false);
break;
-#warning "!!! Need to add polyline functionality !!!"
-#ifdef RS_PROF
case RS2::ActionDrawPolyline:
a = new ActionDrawPolyline(*doc, *gv);
break;
case RS2::ActionPolylineTrim:
a = new ActionPolylineTrim(*doc, *gv);
break;
-#endif
case RS2::ActionDrawLinePolygon:
a = new ActionDrawLinePolygon(*doc, *gv);
break;
//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)