diff -r 82ebfc46233b -r 31de6677aa96 mapeditor.cpp --- a/mapeditor.cpp Tue Dec 01 11:06:15 2009 +0000 +++ b/mapeditor.cpp Thu Dec 03 22:32:24 2009 +0000 @@ -1045,14 +1045,46 @@ mainWindow->editOpenVymLink(); // tabWidget may change, better return now // before segfaulting... - } else if (foname=="note") + } else if (foname=="system-note") mainWindow->windowToggleNoteEditor(); else if (foname=="hideInExport") model->toggleHideExport(); // FIXME-3 needed? xelection.update(); return; - } + } else + { + // Take care of xLink + if (ti->xlinkCount()>0 && lmo->getBBox().width()>30) + { + if ((lmo->getOrientation()==LinkableMapObj::RightOfCenter && p.x() > lmo->getBBox().right()-20) || + (lmo->getOrientation()==LinkableMapObj::LeftOfCenter && p.x() < lmo->getBBox().left()+20) ) + { + if (ti->xlinkCount()>1) + { + QMenu menu; + QList alist; + for (int i=0;ixlinkCount();i++) + alist.append (new QAction(ti->getXLinkNum(i)->getOtherBranch(ti)->getHeading(),&menu)); + menu.addActions (alist); + QAction *ra=menu.exec (e->globalPos() ); + if (ra) + model->select (ti->getXLinkNum(alist.indexOf(ra))->getOtherBranch (ti)); + while (!alist.isEmpty()) + { + QAction *a=alist.takeFirst(); + delete a; + } + return; + } else + { + model->select (ti->getXLinkNum(0)->getOtherBranch (ti)); + return; + } + } + } + } } + // No system flag clicked, take care of modmodes (CTRL-Click) if (e->state() & Qt::ControlModifier) { @@ -1216,9 +1248,11 @@ { // selection != a FloatObj if (seli->depth()==0) { + // Move mapcenter lmosel->move (p-movingObj_start); if (e->buttons()== Qt::LeftButton && e->modifiers()==Qt::ShiftModifier) { + // Move only mapcenter, leave its children where they are QPointF v; v=lmosel->getAbsPos(); for (int i=0; ibranchCount(); ++i) @@ -1232,7 +1266,8 @@ if (seli->depth()==1) { // Move mainbranch - lmosel->move(p-movingObj_start); + if (!lmosel->hasParObjTmp()) + lmosel->move(p-movingObj_start); lmosel->setRelPos(); } else { @@ -1254,8 +1289,7 @@ { // Special case: CTRL to link below dst lmosel->setParObjTmp (dst,p,+1); - } - else if (e->modifiers()==Qt::ShiftModifier) + } else if (e->modifiers()==Qt::ShiftModifier) lmosel->setParObjTmp (dst,p,-1); else lmosel->setParObjTmp (dst,p,0); @@ -1451,7 +1485,7 @@ } } else { - // No destination, undo temporary move + // No destination, undo temporary move // FIXME-1 animation missing now? if (seli->depth()==1) {