Added french manual by Claude
authorinsilmaril
Mon Jan 14 16:26:59 2008 +0000 (2008-01-14)
changeset 6452abfdb7e85f4
parent 644 954221e01e4e
child 646 371945eb6d31
Added french manual by Claude
mainwindow.cpp
mapeditor.cpp
mapeditor.h
mapobj.cpp
mapobj.h
noteobj.cpp
texteditor.cpp
version.h
vym.pro
     1.1 --- a/mainwindow.cpp	Mon Jan 14 16:26:59 2008 +0000
     1.2 +++ b/mainwindow.cpp	Mon Jan 14 16:26:59 2008 +0000
     1.3 @@ -2343,7 +2343,7 @@
     1.4  	if (me)
     1.5  	{
     1.6  		ExportCSV ex;
     1.7 -		ex.setMapCenter(me->getMapCenter());
     1.8 +		ex.setModel (me->getModel());
     1.9  		ex.addFilter ("CSV (*.csv)");
    1.10  		ex.setDir(lastImageDir);
    1.11  		ex.setCaption(vymName+ " -" +tr("Export as CSV")+" "+tr("(still experimental)"));
    1.12 @@ -2362,7 +2362,7 @@
    1.13  	if (me)
    1.14  	{
    1.15  		ExportLaTeX ex;
    1.16 -		ex.setMapCenter(me->getMapCenter());
    1.17 +		ex.setModel (me->getModel());
    1.18  		ex.addFilter ("Tex (*.tex)");
    1.19  		ex.setDir(lastImageDir);
    1.20  		ex.setCaption(vymName+ " -" +tr("Export as LaTeX")+" "+tr("(still experimental)"));
    1.21 @@ -2381,7 +2381,7 @@
    1.22  	MapEditor *me=currentMapEditor();
    1.23  	if (me)
    1.24  	{
    1.25 -		ex.setMapCenter (me->getMapCenter() );
    1.26 +		ex.setModel (me->getModel());
    1.27  		ex.doExport();
    1.28  	}	
    1.29  }
    1.30 @@ -2392,7 +2392,7 @@
    1.31  	MapEditor *me=currentMapEditor();
    1.32  	if (me)
    1.33  	{
    1.34 -		ex.setMapCenter (me->getMapCenter() );
    1.35 +		ex.setModel (me->getModel());
    1.36  		ex.setCaption ( vymName+" - "+tr("Export to")+" Taskjuggler"+tr("(still experimental)"));
    1.37  		ex.setDir(lastImageDir);
    1.38  		ex.addFilter ("Taskjuggler (*.tjp)");
     2.1 --- a/mapeditor.cpp	Mon Jan 14 16:26:59 2008 +0000
     2.2 +++ b/mapeditor.cpp	Mon Jan 14 16:26:59 2008 +0000
     2.3 @@ -6,8 +6,6 @@
     2.4  #include <cstdlib>
     2.5  #include <typeinfo>
     2.6  
     2.7 -#include "version.h"
     2.8 -
     2.9  #include "parser.h"
    2.10  #include "editxlinkdialog.h"
    2.11  #include "exports.h"
    2.12 @@ -69,15 +67,11 @@
    2.13  	//mapScene= new QGraphicsScene(QRectF(0,0,width(),height()), parent);
    2.14  	mapScene->setBackgroundBrush (QBrush(Qt::white, Qt::SolidPattern));
    2.15  
    2.16 +	model=new VymModel();
    2.17 +	model->setScene (mapScene);
    2.18 +	model->setMapEditor (this);
    2.19  
    2.20      setScene (mapScene);
    2.21 -	
    2.22 -    mapCenter = new MapCenterObj(mapScene);
    2.23 -    mapCenter->setVisibility (true);
    2.24 -	mapCenter->setMapEditor (this);
    2.25 -	mapCenter->setHeading (tr("New Map","Heading of mapcenter in new map"));
    2.26 -	//mapCenter->move(mapScene->width()/2-mapCenter->width()/2,mapScene->height()/2-mapCenter->height()/2);
    2.27 -	mapCenter->move(0,0);
    2.28  
    2.29      printer=NULL;
    2.30  
    2.31 @@ -101,7 +95,7 @@
    2.32      editingBO=NULL;
    2.33      movingObj=NULL;
    2.34  
    2.35 -	xelection.setMapEditor (this);
    2.36 +	xelection.setModel (model);
    2.37  	xelection.unselect();
    2.38  
    2.39  	defXLinkWidth=1;
    2.40 @@ -141,7 +135,7 @@
    2.41  
    2.42  	setAcceptDrops (true);	
    2.43  
    2.44 -	mapCenter->reposition();	//	for positioning heading
    2.45 +	model->reposition();
    2.46  
    2.47  	// TODO animations
    2.48  	animObjList.clear();
    2.49 @@ -195,11 +189,12 @@
    2.50  	// tmpMapDir is in tmpVymDir, so it gets removed automagically when vym closes
    2.51  	
    2.52  	//removeDir(QDir(tmpMapDir));
    2.53 +	delete (model);
    2.54  }
    2.55  
    2.56 -MapCenterObj* MapEditor::getMapCenter()
    2.57 +VymModel* MapEditor::getModel()
    2.58  {
    2.59 -    return mapCenter;
    2.60 +    return model;
    2.61  }
    2.62  
    2.63  QGraphicsScene * MapEditor::getScene()
    2.64 @@ -299,10 +294,10 @@
    2.65  		colhint=attribut("linkColorHint","HeadingColor");
    2.66  
    2.67  	QString mapAttr=attribut("version",vymVersion);
    2.68 -	if (!saveSel || saveSel==mapCenter)
    2.69 -		mapAttr+= attribut("author",mapCenter->getAuthor()) +
    2.70 -				  attribut("comment",mapCenter->getComment()) +
    2.71 -			      attribut("date",mapCenter->getDate()) +
    2.72 +	if (!saveSel)
    2.73 +		mapAttr+= attribut("author",model->getAuthor()) +
    2.74 +				  attribut("comment",model->getComment()) +
    2.75 +			      attribut("date",model->getDate()) +
    2.76  		          attribut("backgroundColor", mapScene->backgroundBrush().color().name() ) +
    2.77  		          attribut("selectionColor", xelection.getColor().name() ) +
    2.78  		          attribut("linkStyle", ls ) +
    2.79 @@ -323,7 +318,7 @@
    2.80  	// Build xml recursivly
    2.81  	if (!saveSel || typeid (*saveSel) == typeid (MapCenterObj))
    2.82  		// Save complete map, if saveSel not set
    2.83 -		s+=mapCenter->saveToDir(tmpdir,prefix,writeflags,offset);
    2.84 +		s+=model->saveToDir(tmpdir,prefix,writeflags,offset);
    2.85  	else
    2.86  	{
    2.87  		if ( typeid(*saveSel) == typeid(BranchObj) )
    2.88 @@ -512,6 +507,17 @@
    2.89  		NULL);
    2.90  }
    2.91  
    2.92 +void MapEditor::saveState(const QString &uc, const QString &rc, const QString &comment) 
    2.93 +{
    2.94 +	// "Normal" savestate applied to model (no selection needed): 
    2.95 +	// save commands  and comment
    2.96 +	saveState (UndoCommand,
    2.97 +		NULL, uc,
    2.98 +		NULL, rc, 
    2.99 +		comment, 
   2.100 +		NULL);
   2.101 +}
   2.102 +
   2.103  		
   2.104  void MapEditor::parseAtom(const QString &atom)
   2.105  {
   2.106 @@ -803,7 +809,7 @@
   2.107  				// 1	num in parent (for branches)
   2.108  				// 2,3	x,y of mainbranch or mapcenter
   2.109  				s=parser.parString(ok,0);
   2.110 -				LinkableMapObj *dst=mapCenter->findObjBySelect (s);
   2.111 +				LinkableMapObj *dst=model->findObjBySelect (s);
   2.112  				if (dst)
   2.113  				{	
   2.114  					if (typeid(*dst) == typeid(BranchObj) ) 
   2.115 @@ -838,7 +844,7 @@
   2.116  			{
   2.117  				// 0	selectstring of parent
   2.118  				s=parser.parString(ok,0);
   2.119 -				LinkableMapObj *dst=mapCenter->findObjBySelect (s);
   2.120 +				LinkableMapObj *dst=model->findObjBySelect (s);
   2.121  				if (dst)
   2.122  				{	
   2.123  					if (typeid(*dst) == typeid(BranchObj) ||
   2.124 @@ -1431,7 +1437,7 @@
   2.125  	if (parser.errorLevel()==NoError)
   2.126  	{
   2.127  		// setChanged();  FIXME should not be called e.g. for export?!
   2.128 -		mapCenter->reposition();
   2.129 +		model->reposition();
   2.130  	}	
   2.131  	else	
   2.132  	{
   2.133 @@ -1550,8 +1556,8 @@
   2.134  	{
   2.135  		if (xelection.isEmpty() ) xelection.unselect();
   2.136  		xelection.clear();
   2.137 -		mapCenter->clear();
   2.138 -		mapCenter->setMapEditor(this);
   2.139 +		model->clear();
   2.140 +		model->setMapEditor(this);
   2.141  		// (map state is set later at end of load...)
   2.142  	} else
   2.143  	{
   2.144 @@ -1589,7 +1595,7 @@
   2.145  		QXmlSimpleReader reader;
   2.146  		reader.setContentHandler( handler );
   2.147  		reader.setErrorHandler( handler );
   2.148 -		handler->setMapEditor( this );
   2.149 +		handler->setModel ( model);
   2.150  
   2.151  
   2.152  		// We need to set the tmpDir in order  to load files with rel. path
   2.153 @@ -1603,7 +1609,7 @@
   2.154  		file.close();
   2.155  		if ( ok ) 
   2.156  		{
   2.157 -			mapCenter->reposition();
   2.158 +			model->reposition();
   2.159  			xelection.update();
   2.160  			if (lmode==NewMap)
   2.161  			{
   2.162 @@ -1685,7 +1691,7 @@
   2.163  		printer->setOutputFileName(settings.value("/mainwindow/printerFileName",printer->outputFileName()).toString());
   2.164  	}
   2.165  
   2.166 -	QRectF totalBBox=mapCenter->getTotalBBox();
   2.167 +	QRectF totalBBox=model->getTotalBBox();
   2.168  
   2.169  	// Try to set orientation automagically
   2.170  	// Note: Interpretation of generated postscript is amibiguous, if 
   2.171 @@ -1779,7 +1785,7 @@
   2.172  
   2.173  QPixmap MapEditor::getPixmap()
   2.174  {
   2.175 -	QRectF mapRect=mapCenter->getTotalBBox();
   2.176 +	QRectF mapRect=model->getTotalBBox();
   2.177  	QPixmap pix((int)mapRect.width()+2,(int)mapRect.height()+1);
   2.178  	QPainter pp (&pix);
   2.179  	
   2.180 @@ -1801,8 +1807,8 @@
   2.181  void MapEditor::setHideTmpMode (HideTmpMode mode)
   2.182  {
   2.183  	hidemode=mode;
   2.184 -	mapCenter->setHideTmp (hidemode);
   2.185 -	mapCenter->reposition();
   2.186 +	model->setHideTmp (hidemode);
   2.187 +	model->reposition();
   2.188  	scene()->update();
   2.189  }
   2.190  
   2.191 @@ -1824,7 +1830,7 @@
   2.192  void MapEditor::exportASCII(QString fname,bool askName)
   2.193  {
   2.194  	ExportASCII ex;
   2.195 -	ex.setMapCenter(mapCenter);
   2.196 +	ex.setModel (model);
   2.197  	if (fname=="") 
   2.198  		ex.setFile (mapName+".txt");	
   2.199  	else
   2.200 @@ -1879,7 +1885,7 @@
   2.201  {
   2.202  	ExportOO ex;
   2.203  	ex.setFile (fn);
   2.204 -	ex.setMapCenter(mapCenter);
   2.205 +	ex.setModel (model);
   2.206  	if (ex.setConfigFile(cf)) 
   2.207  	{
   2.208  		setExportMode (true);
   2.209 @@ -1946,7 +1952,7 @@
   2.210  	makeSubDirs (dir);
   2.211  
   2.212  	// write to directory
   2.213 -	QString saveFile=saveToDir (dir,mapName+"-",true,mapCenter->getTotalBBox().topLeft() ,NULL);
   2.214 +	QString saveFile=saveToDir (dir,mapName+"-",true,model->getTotalBBox().topLeft() ,NULL);
   2.215  	QFile file;
   2.216  
   2.217  	file.setName ( dir + "/"+mapName+".xml");
   2.218 @@ -1972,7 +1978,7 @@
   2.219  void MapEditor::clear()
   2.220  {
   2.221  	xelection.unselect();
   2.222 -	mapCenter->clear();
   2.223 +	model->clear();
   2.224  }
   2.225  
   2.226  void MapEditor::copy()
   2.227 @@ -2018,10 +2024,11 @@
   2.228  	QString comment=undoSet.readEntry (QString("/history/step-%1/comment").arg(curStep));
   2.229  	QString version=undoSet.readEntry ("/history/version");
   2.230  
   2.231 +	/* TODO Maybe check for version, if we save the history
   2.232  	if (!checkVersion(version))
   2.233  		QMessageBox::warning(0,tr("Warning"),
   2.234  			tr("Version %1 of saved undo/redo data\ndoes not match current vym version %2.").arg(version).arg(vymVersion));
   2.235 -
   2.236 +	*/ 
   2.237  
   2.238  	// Find out current undo directory
   2.239  	QString bakMapDir(QString(tmpMapDir+"/undo-%1").arg(curStep));
   2.240 @@ -2047,7 +2054,7 @@
   2.241  
   2.242  
   2.243  	parseAtom (redoCommand);
   2.244 -	mapCenter->reposition();
   2.245 +	model->reposition();
   2.246  
   2.247  	blockSaveState=blockSaveStateOrg;
   2.248  
   2.249 @@ -2095,9 +2102,11 @@
   2.250  	QString comment=undoSet.readEntry (QString("/history/step-%1/comment").arg(curStep));
   2.251  	QString version=undoSet.readEntry ("/history/version");
   2.252  
   2.253 +	/* TODO Maybe check for version, if we save the history
   2.254  	if (!checkVersion(version))
   2.255  		QMessageBox::warning(0,tr("Warning"),
   2.256  			tr("Version %1 of saved undo/redo data\ndoes not match current vym version %2.").arg(version).arg(vymVersion));
   2.257 +	*/
   2.258  
   2.259  	// Find out current undo directory
   2.260  	QString bakMapDir(QString(tmpMapDir+"/undo-%1").arg(curStep));
   2.261 @@ -2121,7 +2130,7 @@
   2.262  		cout << "    ---------------------------"<<endl<<endl;
   2.263  	}	
   2.264  	parseAtom (undoCommand);
   2.265 -	mapCenter->reposition();
   2.266 +	model->reposition();
   2.267  
   2.268  	undosAvail--;
   2.269  	curStep--; 
   2.270 @@ -2196,12 +2205,12 @@
   2.271  		QXmlSimpleReader reader;
   2.272  		reader.setContentHandler( &handler );
   2.273  		reader.setErrorHandler( &handler );
   2.274 -		handler.setMapEditor( this );
   2.275 +		handler.setModel ( model);
   2.276  		handler.setTmpDir ( pathDir );	// needed to load files with rel. path
   2.277  		if (undoSel.isEmpty())
   2.278  		{
   2.279  			unselect();
   2.280 -			mapCenter->clear();
   2.281 +			model->clear();
   2.282  			handler.setLoadMode (NewMap);
   2.283  		} else	
   2.284  		{
   2.285 @@ -2238,7 +2247,7 @@
   2.286  			QXmlSimpleReader reader;
   2.287  			reader.setContentHandler( &handler );
   2.288  			reader.setErrorHandler( &handler );
   2.289 -			handler.setMapEditor( this );
   2.290 +			handler.setModel (model);
   2.291  			handler.setTmpDir ( pathDir );	// needed to load files with rel. path
   2.292  			handler.setLoadMode (ImportAdd);
   2.293  			blockReposition=true;
   2.294 @@ -2250,7 +2259,7 @@
   2.295  				QMessageBox::critical( 0, tr( "Critical Parse Error while reading %1").arg(path),
   2.296  										handler.errorProtocol());
   2.297  			}
   2.298 -			if (sel!=mapCenter)
   2.299 +			if (sel->getDepth()>0)
   2.300  				sel->getLastBranch()->linkTo (sel,pos);
   2.301  		} else	
   2.302  			QMessageBox::critical( 0, tr( "Critical Error" ), tr("Could not read %1").arg(path));
   2.303 @@ -2285,7 +2294,7 @@
   2.304  			QString("Paste to %1").arg( getName(sel))
   2.305  		);
   2.306  		pasteNoSave(0);
   2.307 -		mapCenter->reposition();
   2.308 +		model->reposition();
   2.309  	}
   2.310  }
   2.311  
   2.312 @@ -2306,7 +2315,7 @@
   2.313  	*/	
   2.314  		copy();
   2.315  		deleteSelection();
   2.316 -		mapCenter->reposition();
   2.317 +		model->reposition();
   2.318  	}
   2.319  }
   2.320  
   2.321 @@ -2326,7 +2335,7 @@
   2.322                  s, "move "+qpointfToString(to), 
   2.323                  QString("Move %1 to %2").arg(getName(sel)).arg(ps));
   2.324              sel->move(x,y);
   2.325 -            mapCenter->reposition();
   2.326 +            model->reposition();
   2.327              xelection.update();
   2.328          }
   2.329  	}
   2.330 @@ -2348,7 +2357,7 @@
   2.331                  s, "moveRel "+qpointfToString(to), 
   2.332                  QString("Move %1 to relative position %2").arg(getName(sel)).arg(ps));
   2.333              ((OrnamentedObj*)sel)->move2RelPos (x,y);
   2.334 -            mapCenter->reposition();
   2.335 +            model->reposition();
   2.336              sel->updateLink();
   2.337              xelection.update();
   2.338          }
   2.339 @@ -2365,7 +2374,7 @@
   2.340  		par=(BranchObj*)(bo->getParObj());
   2.341  		BranchObj *obo=par->moveBranchUp (bo);	// bo will be the one below selection
   2.342  		saveState (bo->getSelectString(),"moveBranchDown ()",obo->getSelectString(),"moveBranchUp ()",QString("Move up %1").arg(getName(bo)));
   2.343 -		mapCenter->reposition();
   2.344 +		model->reposition();
   2.345  		scene()->update();
   2.346  		xelection.update();
   2.347  		ensureSelectionVisible();
   2.348 @@ -2382,7 +2391,7 @@
   2.349  		par=(BranchObj*)(bo->getParObj());
   2.350  		BranchObj *obo=par->moveBranchDown(bo);	// bo will be the one above selection
   2.351  		saveState(bo->getSelectString(),"moveBranchUp ()",obo->getSelectString(),"moveBranchDown ()",QString("Move down %1").arg(getName(bo)));
   2.352 -		mapCenter->reposition();
   2.353 +		model->reposition();
   2.354  		scene()->update();
   2.355  		xelection.update();
   2.356  		ensureSelectionVisible();
   2.357 @@ -2398,7 +2407,7 @@
   2.358  		{
   2.359  			saveStateChangingPart(bo,bo, "sortChildren ()",QString("Sort children of %1").arg(getName(bo)));
   2.360  			bo->sortChildren();
   2.361 -			mapCenter->reposition();
   2.362 +			model->reposition();
   2.363  			ensureSelectionVisible();
   2.364  		}
   2.365  	}
   2.366 @@ -2409,7 +2418,7 @@
   2.367  	FloatImageObj *fio=xelection.getFloatImage();
   2.368  	if (fio)
   2.369  	{
   2.370 -		BranchObj *dst=(BranchObj*)(mapCenter->findObjBySelect(dstString));
   2.371 +		BranchObj *dst=(BranchObj*)(model->findObjBySelect(dstString));
   2.372  		if (dst && (typeid(*dst)==typeid (BranchObj) || 
   2.373  					typeid(*dst)==typeid (MapCenterObj)))
   2.374  		{			
   2.375 @@ -2459,7 +2468,7 @@
   2.376  			"setHeading (\""+s+"\")", 
   2.377  			QString("Set heading of %1 to \"%2\"").arg(getName(sel)).arg(s) );
   2.378  		sel->setHeading(s );
   2.379 -		mapCenter->reposition();
   2.380 +		model->reposition();
   2.381  		xelection.update();
   2.382  		ensureSelectionVisible();
   2.383  	}
   2.384 @@ -2471,7 +2480,7 @@
   2.385  	if (bo)
   2.386  	{
   2.387  		bo->setHeading(s);
   2.388 -		mapCenter->reposition();
   2.389 +		model->reposition();
   2.390  		xelection.update();
   2.391  		ensureSelectionVisible();
   2.392  	}
   2.393 @@ -2484,7 +2493,7 @@
   2.394  	if (bo)
   2.395  	{
   2.396  		bo->setVymLink(s);
   2.397 -		mapCenter->reposition();
   2.398 +		model->reposition();
   2.399  		updateActions();
   2.400  		xelection.update();
   2.401  		ensureSelectionVisible();
   2.402 @@ -2548,7 +2557,7 @@
   2.403  				QString ("addBranch (%1)").arg(pos),
   2.404  				QString ("Add new branch to %1").arg(getName(bo)));	
   2.405  
   2.406 -			mapCenter->reposition();
   2.407 +			model->reposition();
   2.408  			xelection.update();
   2.409  			latestSelection=newbo->getSelectString();
   2.410  			// In Network mode, the client needs to know where the new branch is,
   2.411 @@ -2588,7 +2597,7 @@
   2.412  			saveState (newbo, "deleteKeepChilds ()", newbo, "addBranchBefore ()", 
   2.413  				QString ("Add branch before %1").arg(getName(bo)));
   2.414  
   2.415 -			mapCenter->reposition();
   2.416 +			model->reposition();
   2.417  			xelection.update();
   2.418  		}
   2.419  	}	
   2.420 @@ -2599,6 +2608,23 @@
   2.421  void MapEditor::deleteSelection()
   2.422  {
   2.423  	BranchObj *bo = xelection.getBranch();
   2.424 +	if (bo && xelection.type()==Selection::MapCenter)
   2.425 +	{
   2.426 +	//	BranchObj* par=(BranchObj*)(bo->getParObj());
   2.427 +		xelection.unselect();
   2.428 +	/* FIXME Note:  does saveStateRemovingPart work for MCO? (No parent!)
   2.429 +		saveStateRemovingPart (bo, QString ("Delete %1").arg(getName(bo)));
   2.430 +		*/
   2.431 +		bo=model->removeMapCenter ((MapCenterObj*)bo);
   2.432 +		if (bo) 
   2.433 +		{
   2.434 +			xelection.select (bo);
   2.435 +			ensureSelectionVisible();
   2.436 +			xelection.update();
   2.437 +		}	
   2.438 +		model->reposition();
   2.439 +		return;
   2.440 +	}
   2.441  	if (bo && xelection.type()==Selection::Branch)
   2.442  	{
   2.443  		BranchObj* par=(BranchObj*)(bo->getParObj());
   2.444 @@ -2607,7 +2633,7 @@
   2.445  		par->removeBranch(bo);
   2.446  		xelection.select (par);
   2.447  		ensureSelectionVisible();
   2.448 -		mapCenter->reposition();
   2.449 +		model->reposition();
   2.450  		xelection.update();
   2.451  		xelection.update();
   2.452  		return;
   2.453 @@ -2625,7 +2651,7 @@
   2.454  		xelection.unselect();
   2.455  		par->removeFloatImage(fio);
   2.456  		xelection.select (par);
   2.457 -		mapCenter->reposition();
   2.458 +		model->reposition();
   2.459  		xelection.update();
   2.460  		ensureSelectionVisible();
   2.461  		return;
   2.462 @@ -2659,7 +2685,7 @@
   2.463  
   2.464  bool MapEditor::select (const QString &s)
   2.465  {
   2.466 -	LinkableMapObj *lmo=mapCenter->findObjBySelect(s);
   2.467 +	LinkableMapObj *lmo=model->findObjBySelect(s);
   2.468  
   2.469  	// Finally select the found object
   2.470  	if (lmo)
   2.471 @@ -3085,9 +3111,7 @@
   2.472  {
   2.473  	QColor oldcol=mapScene->backgroundBrush().color();
   2.474  	saveState(
   2.475 -		mapCenter,
   2.476  		QString ("setMapBackgroundColor (\"%1\")").arg(oldcol.name()),
   2.477 -		mapCenter,
   2.478  		QString ("setMapBackgroundColor (\"%1\")").arg(col.name()),
   2.479  		QString("Set background color of map to %1").arg(col.name()));
   2.480  	mapScene->setBackgroundBrush(col);
   2.481 @@ -3177,7 +3201,7 @@
   2.482  		if (EOFind)
   2.483  			// nothing found, start again
   2.484  			EOFind=false;
   2.485 -		itFind=mapCenter->first();
   2.486 +		itFind=model->first();
   2.487  	}	
   2.488  	bool searching=true;
   2.489  	bool foundNote=false;
   2.490 @@ -3209,7 +3233,7 @@
   2.491  		}	
   2.492  		if (!foundNote)
   2.493  		{
   2.494 -			itFind=itFind->next();
   2.495 +			itFind=model->next(itFind);
   2.496  			if (!itFind) EOFind=true;
   2.497  		}
   2.498  	}	
   2.499 @@ -3239,7 +3263,7 @@
   2.500  			QString ("set URL of %1 to %2").arg(getName(bo)).arg(url)
   2.501  		);
   2.502  		updateActions();
   2.503 -		mapCenter->reposition();
   2.504 +		model->reposition();
   2.505  		xelection.update();
   2.506  		ensureSelectionVisible();
   2.507  	}
   2.508 @@ -3393,7 +3417,7 @@
   2.509  		);	
   2.510  		bo->setVymLink ("" );
   2.511  		updateActions();
   2.512 -		mapCenter->reposition();
   2.513 +		model->reposition();
   2.514  		scene()->update();
   2.515  	}
   2.516  }
   2.517 @@ -3415,7 +3439,7 @@
   2.518  			QString ("Set HideExport flag of %1 to %2").arg(getName(bo)).arg (r)
   2.519  		);	
   2.520  		updateActions();
   2.521 -		mapCenter->reposition();
   2.522 +		model->reposition();
   2.523  		xelection.update();
   2.524  		scene()->update();
   2.525  	}
   2.526 @@ -3473,10 +3497,10 @@
   2.527  		QString sel=bo->getSelectString();
   2.528  		unselect();
   2.529  		par->removeBranchHere(bo);
   2.530 -		mapCenter->reposition();
   2.531 +		model->reposition();
   2.532  		select (sel);
   2.533  		xelection.getBranch()->move2RelPos (p);
   2.534 -		mapCenter->reposition();
   2.535 +		model->reposition();
   2.536  	}	
   2.537  }
   2.538  
   2.539 @@ -3492,7 +3516,7 @@
   2.540  			QString( "Remove childs of branch %1").arg(getName(bo))
   2.541  		);
   2.542  		bo->removeChilds();
   2.543 -		mapCenter->reposition();
   2.544 +		model->reposition();
   2.545  	}	
   2.546  }
   2.547  
   2.548 @@ -3500,8 +3524,8 @@
   2.549  {
   2.550  	ExtraInfoDialog dia;
   2.551  	dia.setMapName (getFileName() );
   2.552 -	dia.setAuthor (mapCenter->getAuthor() );
   2.553 -	dia.setComment(mapCenter->getComment() );
   2.554 +	dia.setAuthor (model->getAuthor() );
   2.555 +	dia.setComment(model->getComment() );
   2.556  
   2.557  	// Calc some stats
   2.558  	QString stats;
   2.559 @@ -3512,14 +3536,14 @@
   2.560  	uint n=0;
   2.561  	uint xl=0;
   2.562  	BranchObj *bo;
   2.563 -	bo=mapCenter->first();
   2.564 +	bo=model->first();
   2.565  	while (bo) 
   2.566  	{
   2.567  		if (!bo->getNote().isEmpty() ) n++;
   2.568  		f+= bo->countFloatImages();
   2.569  		b++;
   2.570  		xl+=bo->countXLinks();
   2.571 -		bo=bo->next();
   2.572 +		bo=model->next(bo);
   2.573  	}
   2.574      stats+=QString ("%1 branches\n").arg (b-1,6);
   2.575      stats+=QString ("%1 xLinks \n").arg (xl,6);
   2.576 @@ -3569,33 +3593,38 @@
   2.577  void MapEditor::setMapAuthor (const QString &s)
   2.578  {
   2.579  	saveState (
   2.580 -		mapCenter,
   2.581 -		QString ("setMapAuthor (\"%1\")").arg(mapCenter->getAuthor()),
   2.582 -		mapCenter,
   2.583 +		QString ("setMapAuthor (\"%1\")").arg(model->getAuthor()),
   2.584  		QString ("setMapAuthor (\"%1\")").arg(s),
   2.585  		QString ("Set author of map to \"%1\"").arg(s)
   2.586  	);
   2.587 -	mapCenter->setAuthor (s);
   2.588 +	model->setAuthor (s);
   2.589  }
   2.590  
   2.591  void MapEditor::setMapComment (const QString &s)
   2.592  {
   2.593  	saveState (
   2.594 -		mapCenter,
   2.595 -		QString ("setMapComment (\"%1\")").arg(mapCenter->getComment()),
   2.596 -		mapCenter,
   2.597 +		QString ("setMapComment (\"%1\")").arg(model->getComment()),
   2.598  		QString ("setMapComment (\"%1\")").arg(s),
   2.599  		QString ("Set comment of map")
   2.600  	);
   2.601 -	mapCenter->setComment (s);
   2.602 +	model->setComment (s);
   2.603  }
   2.604  
   2.605  void MapEditor::setMapLinkStyle (const QString & s)
   2.606  {
   2.607 -	saveStateChangingPart (
   2.608 -		mapCenter,
   2.609 -		mapCenter,
   2.610 +	QString snow;
   2.611 +	if (linkstyle==LinkableMapObj::Line)
   2.612 +		snow="StyleLine";
   2.613 +	else if (linkstyle==LinkableMapObj::Parabel)
   2.614 +		snow="StyleParabel";
   2.615 +	else if (linkstyle==LinkableMapObj::PolyLine)
   2.616 +		snow="StylePolyLine";
   2.617 +	else if (linkstyle==LinkableMapObj::PolyParabel)
   2.618 +		snow="StyleParabel";
   2.619 +
   2.620 +	saveState (
   2.621  		QString("setMapLinkStyle (\"%1\")").arg(s),
   2.622 +		QString("setMapLinkStyle (\"%1\")").arg(snow),
   2.623  		QString("Set map link style (\"%1\")").arg(s)
   2.624  	);	
   2.625  
   2.626 @@ -3609,14 +3638,14 @@
   2.627  		linkstyle=LinkableMapObj::PolyParabel;
   2.628  
   2.629  	BranchObj *bo;
   2.630 -	bo=mapCenter->first();
   2.631 -	bo=bo->next();
   2.632 +	bo=model->first();
   2.633 +	bo=model->next(bo);
   2.634  	while (bo) 
   2.635  	{
   2.636  		bo->setLinkStyle(bo->getDefLinkStyle());
   2.637 -		bo=bo->next();
   2.638 +		bo=model->next(bo);
   2.639  	}
   2.640 -	mapCenter->reposition();
   2.641 +	model->reposition();
   2.642  }
   2.643  
   2.644  LinkableMapObj::Style MapEditor::getMapLinkStyle ()
   2.645 @@ -3628,11 +3657,11 @@
   2.646  {
   2.647  	defLinkColor=c;
   2.648  	BranchObj *bo;
   2.649 -	bo=mapCenter->first();
   2.650 +	bo=model->first();
   2.651  	while (bo) 
   2.652  	{
   2.653  		bo->setLinkColor();
   2.654 -		bo=bo->next();
   2.655 +		bo=model->next(bo);
   2.656  	}
   2.657  	updateActions();
   2.658  }
   2.659 @@ -3641,11 +3670,11 @@
   2.660  {
   2.661  	// called from setMapLinkColorHint(lch) or at end of parse
   2.662  	BranchObj *bo;
   2.663 -	bo=mapCenter->first();
   2.664 +	bo=model->first();
   2.665  	while (bo) 
   2.666  	{
   2.667  		bo->setLinkColor();
   2.668 -		bo=bo->next();
   2.669 +		bo=model->next(bo);
   2.670  	}
   2.671  }
   2.672  
   2.673 @@ -3662,11 +3691,11 @@
   2.674  	else	
   2.675  		linkcolorhint=LinkableMapObj::HeadingColor;
   2.676  	BranchObj *bo;
   2.677 -	bo=mapCenter->first();
   2.678 +	bo=model->first();
   2.679  	while (bo) 
   2.680  	{
   2.681  		bo->setLinkColor();
   2.682 -		bo=bo->next();
   2.683 +		bo=model->next(bo);
   2.684  	}
   2.685  }
   2.686  
   2.687 @@ -3705,9 +3734,7 @@
   2.688  	QColor col = QColorDialog::getColor( defLinkColor, this );
   2.689  	if ( !col.isValid() ) return;
   2.690  	saveState (
   2.691 -		mapCenter,
   2.692  		QString("setMapDefLinkColor (\"%1\")").arg(getMapDefLinkColor().name()),
   2.693 -		mapCenter,
   2.694  		QString("setMapDefLinkColor (\"%1\")").arg(col.name()),
   2.695  		QString("Set map link color to %1").arg(col.name())
   2.696  	);
   2.697 @@ -3730,9 +3757,7 @@
   2.698  {
   2.699  	if ( !col.isValid() ) return;
   2.700  	saveState (
   2.701 -		mapCenter,
   2.702  		QString("setSelectionColor (%1)").arg(xelection.getColor().name()),
   2.703 -		mapCenter,
   2.704  		QString("setSelectionColor (%1)").arg(col.name()),
   2.705  		QString("Set color of selection box to %1").arg(col.name())
   2.706  	);
   2.707 @@ -3829,7 +3854,7 @@
   2.708  		bo->addFloatImage();
   2.709  		fio=bo->getLastFloatImage();
   2.710  		fio->load(fn);
   2.711 -		mapCenter->reposition();
   2.712 +		model->reposition();
   2.713  		scene()->update();
   2.714  		return fio;
   2.715  	}
   2.716 @@ -3942,7 +3967,7 @@
   2.717  		bo->setFrameType (t);
   2.718  		saveState (bo, QString("setFrameType (\"%1\")").arg(s),
   2.719  			bo, QString ("setFrameType (\"%1\")").arg(bo->getFrameTypeName()),QString ("set type of frame to %1").arg(s));
   2.720 -		mapCenter->reposition();
   2.721 +		model->reposition();
   2.722  		bo->updateLink();
   2.723  	}
   2.724  }
   2.725 @@ -3955,7 +3980,7 @@
   2.726  		saveState (bo, QString("setFrameType (\"%1\")").arg(bo->getFrameTypeName()),
   2.727  			bo, QString ("setFrameType (\"%1\")").arg(s),QString ("set type of frame to %1").arg(s));
   2.728  		bo->setFrameType (s);
   2.729 -		mapCenter->reposition();
   2.730 +		model->reposition();
   2.731  		bo->updateLink();
   2.732  	}
   2.733  }
   2.734 @@ -3990,7 +4015,7 @@
   2.735  		saveState (bo, QString("setFramePadding (\"%1\")").arg(bo->getFramePadding() ),
   2.736  			bo, QString ("setFramePadding (\"%1\")").arg(i),QString ("set brush color of frame to %1").arg(i));
   2.737  		bo->setFramePadding (i);
   2.738 -		mapCenter->reposition();
   2.739 +		model->reposition();
   2.740  		bo->updateLink();
   2.741  	}	
   2.742  }
   2.743 @@ -4003,7 +4028,7 @@
   2.744  		saveState (bo, QString("setFrameBorderWidth (\"%1\")").arg(bo->getFrameBorderWidth() ),
   2.745  			bo, QString ("setFrameBorderWidth (\"%1\")").arg(i),QString ("set border width of frame to %1").arg(i));
   2.746  		bo->setFrameBorderWidth (i);
   2.747 -		mapCenter->reposition();
   2.748 +		model->reposition();
   2.749  		bo->updateLink();
   2.750  	}	
   2.751  }
   2.752 @@ -4024,7 +4049,7 @@
   2.753  			QString("Include images vertically in %1").arg(getName(bo))
   2.754  		);	
   2.755  		bo->setIncludeImagesVer(b);
   2.756 -		mapCenter->reposition();
   2.757 +		model->reposition();
   2.758  	}	
   2.759  }
   2.760  
   2.761 @@ -4044,7 +4069,7 @@
   2.762  			QString("Include images horizontally in %1").arg(getName(bo))
   2.763  		);	
   2.764  		bo->setIncludeImagesHor(b);
   2.765 -		mapCenter->reposition();
   2.766 +		model->reposition();
   2.767  	}	
   2.768  }
   2.769  
   2.770 @@ -4146,7 +4171,7 @@
   2.771  		if ( fd->exec() == QDialog::Accepted )
   2.772  		{
   2.773  			importDirInt (fd->selectedFile() );
   2.774 -			mapCenter->reposition();
   2.775 +			model->reposition();
   2.776  			scene()->update();
   2.777  		}
   2.778  	}	
   2.779 @@ -4232,8 +4257,9 @@
   2.780  	
   2.781  void MapEditor::testFunction2()
   2.782  {
   2.783 -	mapCenter->reposition();
   2.784 -	scene()->update();
   2.785 +
   2.786 +	cout << "Selection: "<<xelection.getSelectString().ascii()<<endl;
   2.787 +//	model->addMapCenter();
   2.788  
   2.789  /*
   2.790  	// Toggle hidemode
   2.791 @@ -4258,7 +4284,7 @@
   2.792  	// mouseEvent, we don't need to close here.
   2.793  
   2.794      QPointF p = mapToScene(e->pos());
   2.795 -    LinkableMapObj* lmo=mapCenter->findMapObj(p, NULL);
   2.796 +    LinkableMapObj* lmo=model->findMapObj(p, NULL);
   2.797  	
   2.798      if (lmo) 
   2.799  	{	// MapObj was found
   2.800 @@ -4336,7 +4362,7 @@
   2.801  	}
   2.802  
   2.803      QPointF p = mapToScene(e->pos());
   2.804 -    LinkableMapObj* lmo=mapCenter->findMapObj(p, NULL);
   2.805 +    LinkableMapObj* lmo=model->findMapObj(p, NULL);
   2.806  	
   2.807  	e->accept();
   2.808  
   2.809 @@ -4425,13 +4451,14 @@
   2.810  			if (mainWindow->getModMode()==Main::ModModeCopy &&
   2.811  				e->state() & Qt::ControlModifier)
   2.812  			{
   2.813 -				if (xelection.type()==Selection::Branch)
   2.814 +				BranchObj *bo=xelection.getBranch();
   2.815 +				if (bo)
   2.816  				{
   2.817  					copyingObj=true;
   2.818 -					mapCenter->addBranch ((BranchObj*)xelection.single());
   2.819 +					bo->addBranch ((BranchObj*)xelection.single());
   2.820  					unselect();
   2.821 -					xelection.select(mapCenter->getLastBranch());
   2.822 -					mapCenter->reposition();
   2.823 +					xelection.select(bo->getLastBranch());
   2.824 +					model->reposition();
   2.825  				}
   2.826  			} 
   2.827  
   2.828 @@ -4483,7 +4510,7 @@
   2.829  		// of selection back to absPos)
   2.830  		
   2.831  		// Check if we could link 
   2.832 -		LinkableMapObj* lmo=mapCenter->findMapObj(p, lmosel);
   2.833 +		LinkableMapObj* lmo=model->findMapObj(p, lmosel);
   2.834  		
   2.835  
   2.836  		FloatObj *fio=xelection.getFloatImage();
   2.837 @@ -4517,13 +4544,13 @@
   2.838  						"moveRel "+pnow,
   2.839  						QString("Move %1 to relative position %2").arg(getName(fio)).arg(pnow));
   2.840  					fio->getParObj()->requestReposition();
   2.841 -					mapCenter->reposition();
   2.842 +					model->reposition();
   2.843  
   2.844  					linkTo (lmo->getSelectString());
   2.845  					//movingObj=lmosel;
   2.846  					//movingObj_orgRelPos=lmosel->getRelPos();	
   2.847  
   2.848 -					mapCenter->reposition();
   2.849 +					model->reposition();
   2.850  				}	
   2.851  			}
   2.852  		} else	
   2.853 @@ -4532,10 +4559,10 @@
   2.854  			{
   2.855  				// Move MapCenter
   2.856  				if (e->buttons()== Qt::LeftButton && e->modifiers()==Qt::ShiftModifier) 
   2.857 -					mapCenter->moveAll(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
   2.858 +					((MapCenterObj*)lmosel)->moveAll(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
   2.859  				else	
   2.860 -					mapCenter->move   (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
   2.861 -				mapCenter->updateRelPositions();	
   2.862 +					lmosel->move   (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
   2.863 +				model->updateRelPositions();
   2.864  			} else
   2.865  			{	
   2.866  				if (lmosel->getDepth()==1)
   2.867 @@ -4614,7 +4641,7 @@
   2.868  		pickingColor=false;
   2.869  		setCursor (Qt::ArrowCursor);
   2.870  		// Check if we are over another branch
   2.871 -		dst=mapCenter->findMapObj(p, NULL);
   2.872 +		dst=model->findMapObj(p, NULL);
   2.873  		if (dst && lmosel) 
   2.874  		{	
   2.875  			if (e->state() & Qt::ShiftModifier)
   2.876 @@ -4630,7 +4657,7 @@
   2.877  	{
   2.878  		drawingLink=false;
   2.879  		// Check if we are over another branch
   2.880 -		dst=mapCenter->findMapObj(p, NULL);
   2.881 +		dst=model->findMapObj(p, NULL);
   2.882  		if (dst && lmosel) 
   2.883  		{	
   2.884  			tmpXLink->setEnd ( ((BranchObj*)(dst)) );
   2.885 @@ -4662,33 +4689,32 @@
   2.886  				QString("Move %1 to relative position %2").arg(getName(fo)).arg(pnow));
   2.887  
   2.888  			fo->getParObj()->requestReposition();
   2.889 -			mapCenter->reposition();
   2.890 +			model->reposition();
   2.891  		}	
   2.892  
   2.893  		// Check if we are over another branch, but ignore 
   2.894  		// any found LMOs, which are FloatObjs
   2.895 -		dst=mapCenter->findMapObj(mapToScene(e->pos() ), lmosel);
   2.896 +		dst=model->findMapObj(mapToScene(e->pos() ), lmosel);
   2.897  
   2.898  		if (dst && (typeid(*dst)!=typeid(BranchObj) && typeid(*dst)!=typeid(MapCenterObj))) 
   2.899  			dst=NULL;
   2.900  		
   2.901 -		if (xelection.type() == Selection::MapCenter )
   2.902 +		BranchObj *bo=xelection.getBranch();
   2.903 +		if (bo && bo->getDepth()==0)
   2.904  		{	
   2.905 -			// TODO: Check for problems if graphicsview is resized for 
   2.906 -			// undo/redo...
   2.907 -            if (movingObj_orgPos != mapCenter->getAbsPos())
   2.908 +            if (movingObj_orgPos != bo->getAbsPos())
   2.909              {
   2.910                  QString pold=qpointfToString(movingObj_orgPos);
   2.911 -                QString pnow=qpointfToString(mapCenter->getAbsPos());
   2.912 +                QString pnow=qpointfToString(bo->getAbsPos());
   2.913                  saveState(
   2.914                      fo,
   2.915                      "move "+pold,
   2.916                      fo,
   2.917                      "move "+pnow,
   2.918 -                    QString("Move mapcenter %1 to position %2").arg(getName(mapCenter)).arg(pnow));
   2.919 +                    QString("Move mapcenter %1 to position %2").arg(getName(bo)).arg(pnow));
   2.920              }
   2.921  		}
   2.922 -
   2.923 +	
   2.924  		if (xelection.type() == Selection::Branch )
   2.925  		{	// A branch was moved
   2.926  			
   2.927 @@ -4747,7 +4773,7 @@
   2.928  				{
   2.929  					// The select string might be different _after_ moving around.
   2.930  					// Therefor reposition and then use string of old selection, too
   2.931 -					mapCenter->reposition();
   2.932 +					model->reposition();
   2.933  
   2.934                      QPointF rp(lmosel->getRelPos());
   2.935                      if (rp != movingObj_orgRelPos)
   2.936 @@ -4760,7 +4786,7 @@
   2.937                      }
   2.938  				}
   2.939  			// Draw the original link, before selection was moved around
   2.940 -			mapCenter->reposition();
   2.941 +			model->reposition();
   2.942  		}
   2.943  		xelection.update();
   2.944  		// Finally resize scene, if needed
   2.945 @@ -4786,7 +4812,7 @@
   2.946  	if (e->button() == Qt::LeftButton )
   2.947  	{
   2.948  		QPointF p = mapToScene(e->pos());
   2.949 -		LinkableMapObj *lmo=mapCenter->findMapObj(p, NULL);
   2.950 +		LinkableMapObj *lmo=model->findMapObj(p, NULL);
   2.951  		if (lmo) {	// MapObj was found
   2.952  			// First select the MapObj than edit heading
   2.953  			xelection.select(lmo);
   2.954 @@ -4876,7 +4902,7 @@
   2.955  					}
   2.956  				}
   2.957  			}
   2.958 -			mapCenter->reposition();
   2.959 +			model->reposition();
   2.960  		}
   2.961  	}	
   2.962  	event->acceptProposedAction();
   2.963 @@ -4893,7 +4919,7 @@
   2.964  		animObjList.at(i)->animate();
   2.965  		((BranchObj*)animObjList.at(i))->move2RelPos (((BranchObj*)animObjList.at(i))->getRelPos() );
   2.966  	}
   2.967 -	mapCenter->reposition();
   2.968 +	model->reposition();
   2.969  }
   2.970  
   2.971  
   2.972 @@ -5011,19 +5037,19 @@
   2.973      case QAbstractSocket::RemoteHostClosedError:
   2.974          break;
   2.975      case QAbstractSocket::HostNotFoundError:
   2.976 -        QMessageBox::information(this, __VYM_NAME " Network client",
   2.977 +        QMessageBox::information(this, vymName +" Network client",
   2.978                                   "The host was not found. Please check the "
   2.979                                      "host name and port settings.");
   2.980          break;
   2.981      case QAbstractSocket::ConnectionRefusedError:
   2.982 -        QMessageBox::information(this, __VYM_NAME " Network client",
   2.983 +        QMessageBox::information(this, vymName + " Network client",
   2.984                                   "The connection was refused by the peer. "
   2.985                                      "Make sure the fortune server is running, "
   2.986                                      "and check that the host name and port "
   2.987                                      "settings are correct.");
   2.988          break;
   2.989      default:
   2.990 -        QMessageBox::information(this, __VYM_NAME " Network client",
   2.991 +        QMessageBox::information(this, vymName + " Network client",
   2.992                                   QString("The following error occurred: %1.")
   2.993                                   .arg(clientSocket->errorString()));
   2.994      }
   2.995 @@ -5115,7 +5141,7 @@
   2.996  	QString s=bo->getSelectString();
   2.997  	saveState (PartOfMap, s, "nop ()", s, "copy ()","Copy dropped image to clipboard",fio  );
   2.998  	saveState (fio,"delete ()", bo,QString("paste(%1)").arg(curStep),"Pasting dropped image");
   2.999 -    mapCenter->reposition();
  2.1000 +    model->reposition();
  2.1001      scene()->update();
  2.1002    }
  2.1003  }
     3.1 --- a/mapeditor.h	Mon Jan 14 16:26:59 2008 +0000
     3.2 +++ b/mapeditor.h	Mon Jan 14 16:26:59 2008 +0000
     3.3 @@ -6,13 +6,15 @@
     3.4  
     3.5  #include "attribute.h"
     3.6  #include "file.h"
     3.7 -#include "mapcenterobj.h"
     3.8  #include "misc.h"
     3.9  #include "parser.h"
    3.10  #include "ornamentedobj.h"
    3.11  #include "selection.h"
    3.12  #include "settings.h"
    3.13 +#include "vymmodel.h"
    3.14  
    3.15 +class VymModel;
    3.16 +class Selection;
    3.17  
    3.18  /*! \brief Main widget in vym to display and edit a map */
    3.19  
    3.20 @@ -41,7 +43,7 @@
    3.21  	};
    3.22      MapEditor(QWidget* parent=0);
    3.23  	~MapEditor();
    3.24 -    MapCenterObj* getMapCenter();		//!< Return center of map
    3.25 +	VymModel* getModel();
    3.26  	QGraphicsScene * getScene();
    3.27  	State getState();					//!< Return State of MapEditor
    3.28  	void setStateEditHeading (bool);	//!< If set to true, State will change to EditHeading
    3.29 @@ -83,15 +85,42 @@
    3.30  		Additionally a comment is logged. 
    3.31  
    3.32  	*/	
    3.33 -    void saveState(const SaveMode& savemode, const QString &undoSelection, const QString &undoCommand, const QString &redoSelection, const QString &redoCommand, const QString &comment, LinkableMapObj *saveSelection);
    3.34 +    void saveState(
    3.35 +		const SaveMode& savemode, 
    3.36 +		const QString &undoSelection, 
    3.37 +		const QString &undoCommand, 
    3.38 +		const QString &redoSelection, 
    3.39 +		const QString &redoCommand, 
    3.40 +		const QString &comment, 
    3.41 +		LinkableMapObj *saveSelection);
    3.42  	/*! Overloaded for convenience */
    3.43 -    void saveStateChangingPart(LinkableMapObj *undoSelection, LinkableMapObj* redoSelection, const QString &redoCommand, const QString &comment);
    3.44 +    void saveStateChangingPart(
    3.45 +		LinkableMapObj *undoSelection, 
    3.46 +		LinkableMapObj* redoSelection, 
    3.47 +		const QString &redoCommand, 
    3.48 +		const QString &comment);
    3.49  	/*! Overloaded for convenience */
    3.50 -    void saveStateRemovingPart(LinkableMapObj *redoSelection, const QString &comment);
    3.51 +    void saveStateRemovingPart(
    3.52 +		LinkableMapObj *redoSelection, 
    3.53 +		const QString &comment);
    3.54  	/*! Overloaded for convenience */
    3.55 -    void saveState(LinkableMapObj *undoSelection, const QString &undoCommand, LinkableMapObj *redoSelection, const QString &redoCommand, const QString &comment); 
    3.56 +    void saveState(
    3.57 +		LinkableMapObj *undoSelection, 
    3.58 +		const QString &undoCommand, 
    3.59 +		LinkableMapObj *redoSelection, 
    3.60 +		const QString &redoCommand, 
    3.61 +		const QString &comment); 
    3.62  	/*! Overloaded for convenience */
    3.63 -    void saveState(const QString &undoSelection, const QString &undoCommand, const QString &redoSelection, const QString &redoCommand, const QString &comment) ;
    3.64 +    void saveState(
    3.65 +		const QString &undoSelection, 
    3.66 +		const QString &undoCommand, 
    3.67 +		const QString &redoSelection, 
    3.68 +		const QString &redoCommand, 
    3.69 +		const QString &comment) ;
    3.70 +    void saveState(
    3.71 +		const QString &undoCommand, 
    3.72 +		const QString &redoCommand, 
    3.73 +		const QString &comment) ;
    3.74  
    3.75  public:	
    3.76  
    3.77 @@ -361,7 +390,7 @@
    3.78  private:
    3.79  	State state;				// State of MapEditor
    3.80  	QGraphicsScene *mapScene;
    3.81 -    MapCenterObj* mapCenter;
    3.82 +	VymModel *model;					// Vym Map, includding several mapCenters
    3.83  	QTimer *autosaveTimer;
    3.84  
    3.85  	bool adjustCanvasRequested;	// collect requests until end of user event
     4.1 --- a/mapobj.cpp	Mon Jan 14 16:26:59 2008 +0000
     4.2 +++ b/mapobj.cpp	Mon Jan 14 16:26:59 2008 +0000
     4.3 @@ -102,49 +102,16 @@
     4.4  	clickBox.moveTo (clickBox.x()+x,clickBox.y()+y);
     4.5  }
     4.6  
     4.7 -bool MapObj::inBox(const QPointF &p)
     4.8 -{
     4.9 -    if (p.x() >= clickBox.left() && p.x() <= clickBox.right()  
    4.10 -	&& p.y() <= clickBox.bottom() && p.y() >= clickBox.top() )
    4.11 -		return true;
    4.12 -    return false;	
    4.13 -}
    4.14 -
    4.15  QRectF MapObj::getBBox()
    4.16  {
    4.17      return bbox;
    4.18  }
    4.19  
    4.20 -QRectF MapObj::addBBox(QRectF r1, QRectF r2)
    4.21 -{	
    4.22 -	// Find smallest QRectF containing given rectangles
    4.23 +QRectF MapObj::getClickBox()
    4.24 +{
    4.25 +    return clickBox;
    4.26 +}
    4.27  
    4.28 -	QRectF n;
    4.29 -	// Set left border
    4.30 -	if (r1.left() <= r2.left() )
    4.31 -		n.setLeft(r1.left() );
    4.32 -	else
    4.33 -		n.setLeft(r2.left() );
    4.34 -		
    4.35 -	// Set top border		
    4.36 -	if (r1.top() <= r2.top() )
    4.37 -		n.setTop(r1.top() );
    4.38 -	else
    4.39 -		n.setTop(r2.top() );
    4.40 -		
    4.41 -	// Set right border
    4.42 -	if (r1.right() <= r2.right() )
    4.43 -		n.setRight(r2.right() );
    4.44 -	else
    4.45 -		n.setRight(r1.right() );
    4.46 -		
    4.47 -	// Set bottom 
    4.48 -	if (r1.bottom() <= r2.bottom() )
    4.49 -		n.setBottom(r2.bottom() );
    4.50 -	else
    4.51 -		n.setBottom(r1.bottom() );
    4.52 -	return n;
    4.53 -}
    4.54  
    4.55  QSizeF MapObj::getSize()
    4.56  {
     5.1 --- a/mapobj.h	Mon Jan 14 16:26:59 2008 +0000
     5.2 +++ b/mapobj.h	Mon Jan 14 16:26:59 2008 +0000
     5.3 @@ -3,12 +3,9 @@
     5.4  
     5.5  #include <QGraphicsScene>
     5.6  #include <QGraphicsItem>
     5.7 -#include <iostream>
     5.8  
     5.9  #include "xmlobj.h"
    5.10  
    5.11 -using namespace std;
    5.12 -
    5.13  #define Z_BBOX      0
    5.14  #define Z_XLINK    10
    5.15  #define Z_LINK     20
    5.16 @@ -39,9 +36,8 @@
    5.17      virtual void move (double x,double y);      // move to absolute Position
    5.18      virtual void move (QPointF p);
    5.19      virtual void moveBy (double x,double y);    // move to relative Position
    5.20 -    virtual bool inBox(const QPointF&);			// Check if Point is within clickbox
    5.21      virtual QRectF getBBox();					// returns bounding box
    5.22 -    virtual QRectF addBBox(QRectF,QRectF);			// returns bbox which includes both boxes
    5.23 +    virtual QRectF getClickBox();				// returns box to click
    5.24      virtual QSizeF getSize();					// returns size of bounding box
    5.25      virtual bool isVisibleObj();
    5.26      virtual void setVisibility(bool);
     6.1 --- a/noteobj.cpp	Mon Jan 14 16:26:59 2008 +0000
     6.2 +++ b/noteobj.cpp	Mon Jan 14 16:26:59 2008 +0000
     6.3 @@ -84,10 +84,9 @@
     6.4  	rx.setPattern ("&quot;");
     6.5  	r.replace (rx,"\"");
     6.6  
     6.7 -/* FIXME
     6.8 +/* FIXME	wrap text at width
     6.9  	if (fonthint !="fixed")
    6.10  	{
    6.11 -		// wrap text at width
    6.12  	}
    6.13  */	
    6.14  	return r;
     7.1 --- a/texteditor.cpp	Mon Jan 14 16:26:59 2008 +0000
     7.2 +++ b/texteditor.cpp	Mon Jan 14 16:26:59 2008 +0000
     7.3 @@ -6,7 +6,6 @@
     7.4  
     7.5  #include "noteobj.h"
     7.6  #include "settings.h"
     7.7 -#include "version.h"
     7.8  
     7.9  extern int statusbarTime;
    7.10  extern Settings settings;
     8.1 --- a/version.h	Mon Jan 14 16:26:59 2008 +0000
     8.2 +++ b/version.h	Mon Jan 14 16:26:59 2008 +0000
     8.3 @@ -4,10 +4,10 @@
     8.4  #include <QString>
     8.5  
     8.6  #define __VYM_NAME "VYM"
     8.7 -#define __VYM_VERSION "1.11.4"
     8.8 +#define __VYM_VERSION "1.11.5"
     8.9  //#define __VYM_CODENAME "Codename: 1.10.0-RC-3"
    8.10  #define __VYM_CODENAME "Codename: development version"
    8.11 -#define __VYM_BUILD_DATE "2008-01-02"
    8.12 +#define __VYM_BUILD_DATE "2008-01-14"
    8.13  
    8.14  
    8.15  bool checkVersion(const QString &);
     9.1 --- a/vym.pro	Mon Jan 14 16:26:59 2008 +0000
     9.2 +++ b/vym.pro	Mon Jan 14 16:26:59 2008 +0000
     9.3 @@ -35,6 +35,7 @@
     9.4  	floatimageobj.h \
     9.5  	floatobj.h \
     9.6  	frameobj.h \
     9.7 +	geometry.h \
     9.8  	headingobj.h \
     9.9  	highlighter.h \
    9.10  	historywindow.h \
    9.11 @@ -56,6 +57,7 @@
    9.12  	simplescripteditor.h\
    9.13  	texteditor.h \
    9.14  	version.h \
    9.15 +	vymmodel.h \
    9.16  	xlinkobj.h \
    9.17  	xml-base.h \
    9.18  	xml-vym.h \
    9.19 @@ -85,6 +87,7 @@
    9.20  	floatimageobj.cpp \
    9.21  	floatobj.cpp \
    9.22  	frameobj.cpp \
    9.23 +	geometry.cpp \
    9.24  	headingobj.cpp \
    9.25  	highlighter.cpp \
    9.26  	historywindow.cpp \
    9.27 @@ -107,6 +110,7 @@
    9.28  	simplescripteditor.cpp \
    9.29  	texteditor.cpp \
    9.30  	version.cpp \
    9.31 +	vymmodel.cpp \
    9.32  	xlinkobj.cpp \
    9.33  	xml-base.cpp \
    9.34  	xml-vym.cpp \