diff -r 462d39502273 -r 11f9124c1cca mapeditor.cpp --- a/mapeditor.cpp Wed Jul 16 11:56:44 2008 +0000 +++ b/mapeditor.cpp Mon Aug 04 10:43:06 2008 +0000 @@ -42,7 +42,6 @@ model=vm; model->setScene (mapScene); - model->setMapEditor (this); model->registerEditor(this); model->addMapCenter(); // FIXME create this in MapEditor until BO and MCO are independent of scene model->makeDefault(); @@ -71,7 +70,7 @@ setAcceptDrops (true); - model->reposition(); //FIXME really still needed? + //model->reposition(); //FIXME really still needed? // Action to embed LineEdit for heading in Scene @@ -287,10 +286,30 @@ void MapEditor::testFunction1() { - BranchObj *bo=model->getSelectedBranch(); + //BranchObj *bo=model->getSelectedBranch(); //if (bo) model->moveAway (bo); - if (bo) bo->setLinkStyle (LinkableMapObj::Line); + //if (bo) bo->setLinkStyle (LinkableMapObj::Line); + + // Displacement and animation of all non-mainbranches + QPointF p; + QPointF q; + BranchObj *bo; + bo=model->first(); + while (bo) + { + if (bo->getDepth() >0 && !bo->hasScrolledParent(bo) ) + { + p=QPointF (qrand() %600-300, qrand () %600-300); + bo->setRelPos(); + q=bo->getRelPos(); + model->startAnimation (bo,p, q); + } + bo=model->next(bo); + } + + + /* TODO Hide hidden stuff temporary, maybe add this as regular function somewhere if (hidemode==HideNone) { @@ -400,8 +419,11 @@ { // No MapObj found, we are on the Canvas itself // Context Menu on scene model->updateActions(); - contextMenuPos=p; - canvasContextMenu->popup(e->globalPos() ); + + // Open context menu synchronously to position new mapcenter + model->setContextPos (p); + canvasContextMenu->exec(e->globalPos() ); + model->unsetContextPos (); } e->accept(); } @@ -796,9 +818,9 @@ QString pold=qpointfToString(movingObj_orgPos); QString pnow=qpointfToString(bo->getAbsPos()); model->saveState( - fo, + bo, "move "+pold, - fo, + bo, "move "+pnow, QString("Move mapcenter %1 to position %2").arg(getName(bo)).arg(pnow)); } @@ -890,6 +912,7 @@ // if (lmosel->getOrientation()==LinkableMapObj::LeftOfCenter) dst.setX (dst.x()+lmosel->width() ); model->startAnimation( + (BranchObj*)lmosel, lmosel->getRelPos(), movingObj_orgRelPos // QPointF (movingObj_orgPos.x() - dst.x(), movingObj_orgPos.y() - dst.y() )