-void RS_ActionDrawEllipseAxis::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 SetMinor: {
- bool ok;
- double m = RS_Math::eval(c, &ok);
- if (ok==true) {
- ratio = m / major.magnitude();
- if (!isArc) {
- trigger();
- } else {
- setStatus(SetAngle1);
- }
- } else {
- if (RS_DIALOGFACTORY!=NULL) {
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- }
- }
- }
- break;
-
- case SetAngle1: {
- bool ok;
- double a = RS_Math::eval(c, &ok);
- if (ok==true) {
- angle1 = RS_Math::deg2rad(a);
- setStatus(SetAngle2);
- } else {
- if (RS_DIALOGFACTORY!=NULL) {
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- }
- }
- }
- break;
-
- case SetAngle2: {
- bool ok;
- double a = RS_Math::eval(c, &ok);
- if (ok==true) {
- angle2 = RS_Math::deg2rad(a);
- trigger();
- } else {
- if (RS_DIALOGFACTORY!=NULL) {
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- }
- }
- }
- break;
-
- default:
- break;
- }
-}
+ switch (getStatus())
+ {
+ case SetMinor: {
+ bool ok;
+ double m = RS_Math::eval(c, &ok);
+
+ if (ok == true)
+ {
+ ratio = m / major.magnitude();
+
+ if (!isArc)
+ trigger();
+ else
+ setStatus(SetAngle1);
+ }
+ else if (RS_DIALOGFACTORY != NULL)
+ RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));