diff -r fb97757e06c0 -r 0796c5592f00 mapeditor.cpp --- a/mapeditor.cpp Sat Mar 31 09:28:30 2007 +0000 +++ b/mapeditor.cpp Mon Apr 09 15:42:21 2007 +0000 @@ -523,6 +523,7 @@ } } else if (com=="colorSubtree") { + cout << "atom="<< atom.ascii()<updateFlagsToolbar(); } } + } else if (com=="setFrameType") + { + if (xelection.isEmpty() ) + { + parser.setError (Aborted,"Nothing selected"); + } else if (! selb ) + { + parser.setError (Aborted,"Type of selection is not a branch"); + } else if (parser.checkParamCount(1)) + { + s=parser.parString(ok,0); + if (ok) + setFrameType (s); + } } else if (com=="unscroll") { if (xelection.isEmpty() ) @@ -991,23 +1006,10 @@ void MapEditor::runScript (QString script) { - // TODO "atomize" script, currently each line holds one atom - - QStringList list=script.split("\n"); - QString l; - int pos; - for (int i=0; i=0) l.truncate (pos); - - // Try to ignore empty lines - if (l.contains (QRegExp ("\\w"))) - parseAtom (l); - } + // FIXME "atomize" script, currently each line holds one atom + + parser.setScript (script); + parser.runScript(); } @@ -2513,9 +2515,9 @@ QColor oldcol=mapScene->backgroundBrush().color(); saveState( mapCenter, - QString ("setMapBackgroundColor (%1)").arg(oldcol.name()), + QString ("setMapBackgroundColor (\"%1\")").arg(oldcol.name()), mapCenter, - QString ("setMapBackgroundColor (%1)").arg(col.name()), + QString ("setMapBackgroundColor (\"%1\")").arg(col.name()), QString("Set background color of map to %1").arg(col.name())); mapScene->setBackgroundBrush(col); } @@ -2541,9 +2543,9 @@ { saveState( bo, - QString ("colorBranch (%1)").arg(bo->getColor().name()), + QString ("colorBranch (\"%1\")").arg(bo->getColor().name()), bo, - QString ("colorBranch (%1)").arg(c.name()), + QString ("colorBranch (\"%1\")").arg(c.name()), QString("Set color of %1 to %2").arg(getName(bo)).arg(c.name()) ); bo->setColor(c); // color branch @@ -2558,7 +2560,7 @@ saveStateChangingPart( bo, bo, - QString ("colorSubtree (%1)").arg(c.name()), + QString ("colorSubtree (\"%1\")").arg(c.name()), QString ("Set color of %1 and childs to %2").arg(getName(bo)).arg(c.name()) ); bo->setColorSubtree (c); // color links, color childs @@ -3336,6 +3338,17 @@ } } +void MapEditor::setFrameType(const QString &s) // FIXME missing saveState +{ + BranchObj *bo=xelection.getBranch(); + if (bo) + { + bo->setFrameType (s); + mapCenter->reposition(); + bo->updateLink(); + } +} + void MapEditor::setFramePenColor(const QColor &c) // FIXME missing saveState { BranchObj *bo=xelection.getBranch();