-void RS_ActionDimLinear::commandEvent(RS_CommandEvent* e) {
- QString c = e->getCommand().toLower();
-
- if (checkCommand("help", c)) {
- if (RS_DIALOGFACTORY!=NULL) {
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
- + getAvailableCommands().join(", "));
- }
- return;
- }
-
- switch (getStatus()) {
- case SetText:
- setText(c);
- if (RS_DIALOGFACTORY!=NULL) {
- RS_DIALOGFACTORY->requestOptions(this, true, true);
- }
- graphicView->enableCoordinateInput();
- setStatus(lastStatus);
- break;
-
- case SetAngle: {
- bool ok;
- double a = RS_Math::eval(c, &ok);
- if (ok==true) {
- setAngle(RS_Math::deg2rad(a));
- } else {
- if (RS_DIALOGFACTORY!=NULL) {
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- }
- }
- if (RS_DIALOGFACTORY!=NULL) {
- RS_DIALOGFACTORY->requestOptions(this, true, true);
- }
- setStatus(lastStatus);
- }
- break;
-
- default:
- lastStatus = (Status)getStatus();
- deleteSnapper();
- deletePreview();
- clearPreview();
- if (checkCommand("text", c)) {
- graphicView->disableCoordinateInput();
- setStatus(SetText);
- return;
- } else if (!fixedAngle && (checkCommand("angle", c))) {
- setStatus(SetAngle);
- }
- break;
- }
+ default:
+ lastStatus = (Status)getStatus();
+ deleteSnapper();
+ deletePreview();
+ clearPreview();
+
+ if (checkCommand("text", c))
+ {
+ graphicView->disableCoordinateInput();
+ setStatus(SetText);
+ return;
+ }
+ else if (!fixedAngle && (checkCommand("angle", c)))
+ setStatus(SetAngle);
+ break;
+ }