1.8.57 - more changes in history window, Note Editor is QT4 now
authorinsilmaril
Thu, 14 Sep 2006 11:38:18 +0000
changeset 3883a58c9ef4a18
parent 387 a40af6315ac6
child 389 bb94eec7c8f3
1.8.57 - more changes in history window, Note Editor is QT4 now
demos/todo.vym
historywindow.cpp
historywindow.h
linkablemapobj.cpp
linkablemapobj.h
mainwindow.cpp
mapcenterobj.cpp
mapcenterobj.h
mapeditor.cpp
ornamentedobj.cpp
tex/vym.changelog
texteditor.cpp
texteditor.h
version.h
vym.pro
warningdialog.cpp
warningdialog.h
warningdialog.ui
warningdialog.ui.h
xml.cpp
     1.1 Binary file demos/todo.vym has changed
     2.1 --- a/historywindow.cpp	Thu Sep 14 11:38:17 2006 +0000
     2.2 +++ b/historywindow.cpp	Thu Sep 14 11:38:18 2006 +0000
     2.3 @@ -10,13 +10,13 @@
     2.4  	
     2.5  	QTableWidgetItem *item;
     2.6  
     2.7 -	item= new QTableWidgetItem(tr("Action"));
     2.8 +	item= new QTableWidgetItem(tr("Action","Table with actions"));
     2.9  	ui.historyTable->setHorizontalHeaderItem(0, item);
    2.10  	
    2.11 -	item= new QTableWidgetItem(tr("Comment"));
    2.12 +	item= new QTableWidgetItem(tr("Comment","Table with actions"));
    2.13  	ui.historyTable->setHorizontalHeaderItem(1, item);
    2.14  	
    2.15 -	item= new QTableWidgetItem(tr("Undo action"));
    2.16 +	item= new QTableWidgetItem(tr("Undo action","Table with actions"));
    2.17  	ui.historyTable->setHorizontalHeaderItem(2, item);
    2.18  
    2.19  	ui.historyTable->setSelectionBehavior (QAbstractItemView::SelectRows);
    2.20 @@ -27,6 +27,17 @@
    2.21  }
    2.22  
    2.23  
    2.24 +void HistoryWindow::clearRow(int row)
    2.25 +{
    2.26 +	QTableWidgetItem *it;
    2.27 +	it=ui.historyTable->item (row,0);
    2.28 +	if (it) it->setText ("");
    2.29 +	it=ui.historyTable->item (row,1);
    2.30 +	if (it) it->setText ("");
    2.31 +	it=ui.historyTable->item (row,2);
    2.32 +	if (it) it->setText ("");
    2.33 +}
    2.34 +
    2.35  void HistoryWindow::updateRow(int row, int step, SimpleSettings &set)
    2.36  {
    2.37  	QTableWidgetItem *item;
    2.38 @@ -63,7 +74,7 @@
    2.39  	else	
    2.40  		ui.redoButton->setEnabled (true);
    2.41  
    2.42 -	// Update table
    2.43 +	// Update undos in table
    2.44  	for (i=undosAvail; i>0; i--)
    2.45  	{
    2.46  		updateRow (r,s,set);
    2.47 @@ -83,20 +94,24 @@
    2.48  			ui.historyTable->setItem(undosAvail, i, item);
    2.49  		}
    2.50  	}
    2.51 -	item=new QTableWidgetItem(" - " +tr("Current state","current bar in history hwindow")+ " - ");
    2.52 +	item=new QTableWidgetItem(" - " +tr("Current state","Current bar in history hwindow")+ " - ");
    2.53  	item->setBackgroundColor (c);
    2.54  	ui.historyTable->setItem(undosAvail, 1, item);
    2.55  
    2.56  
    2.57 +	// Update Redos in table
    2.58  	s=curStep;
    2.59  	s++; if (s>stepsTotal) s=1;
    2.60 -
    2.61  	for (i=1;i<= redosAvail; i++)
    2.62  	{
    2.63  		updateRow (undosAvail+i,s,set);
    2.64  		s++; if (s>stepsTotal) s=1;
    2.65  	}
    2.66  
    2.67 +	// Delete the rest
    2.68 +	for (i=undosAvail+redosAvail+1;i<= stepsTotal; i++)
    2.69 +		clearRow (i);
    2.70 +
    2.71  	ui.historyTable->resizeColumnsToContents();
    2.72  }
    2.73  
     3.1 --- a/historywindow.h	Thu Sep 14 11:38:17 2006 +0000
     3.2 +++ b/historywindow.h	Thu Sep 14 11:38:18 2006 +0000
     3.3 @@ -1,7 +1,6 @@
     3.4  #ifndef HISTORYWINDOW_H
     3.5  #define HISTORYWINDOW_H
     3.6  
     3.7 -//#include "mapeditor.h"
     3.8  #include "settings.h"
     3.9  #include "ui_historywindow.h"
    3.10  
    3.11 @@ -25,6 +24,7 @@
    3.12  	void select();
    3.13  
    3.14  private:
    3.15 +	void clearRow (int);
    3.16  	void updateRow (int, int, SimpleSettings &);
    3.17  	Ui::HistoryWindow ui;
    3.18  	MapEditor *mapEditor;
     4.1 --- a/linkablemapobj.cpp	Thu Sep 14 11:38:17 2006 +0000
     4.2 +++ b/linkablemapobj.cpp	Thu Sep 14 11:38:18 2006 +0000
     4.3 @@ -154,10 +154,8 @@
     4.4  {
     4.5  	if (parObj)
     4.6  	{	
     4.7 -		relPos=getRelPos();
     4.8 -
     4.9 +		getRelPos();
    4.10  		parObj->calcBBoxSize();
    4.11 -		parObj->requestReposition();
    4.12  	}	
    4.13  }
    4.14  
    4.15 @@ -165,8 +163,9 @@
    4.16  {
    4.17  	relPos=p;
    4.18  	if (parObj)
    4.19 -	{	parObj->calcBBoxSize();
    4.20 -		parObj->requestReposition();
    4.21 +	{		
    4.22 +		parObj->calcBBoxSize();
    4.23 +		requestReposition();
    4.24  	}	
    4.25  }
    4.26  
    4.27 @@ -468,6 +467,31 @@
    4.28  	}	
    4.29  }
    4.30  
    4.31 +void LinkableMapObj::setOrientation()
    4.32 +{
    4.33 +	LinkOrient orientOld=orientation;
    4.34 +
    4.35 +	if (!parObj) 
    4.36 +	{
    4.37 +		orientation=OrientUndef;
    4.38 +		return;
    4.39 +	}
    4.40 +		
    4.41 +    // Set orientation, first look for orientation of parent
    4.42 +    if (parObj->getOrientation() != OrientUndef ) 
    4.43 +		// use the orientation of the parent:
    4.44 +		orientation=parObj->getOrientation();
    4.45 +    else
    4.46 +    {
    4.47 +		// calc orientation depending on position rel to parent
    4.48 +		if (absPos.x() < QPoint(parObj->getChildPos() ).x() )
    4.49 +			orientation=OrientLeftOfCenter; 
    4.50 +		else
    4.51 +			orientation=OrientRightOfCenter;
    4.52 +    }
    4.53 +	if (orientOld!=orientation) requestReposition();
    4.54 +}
    4.55 +
    4.56  void LinkableMapObj::updateLink()
    4.57  {
    4.58      // needs:
    4.59 @@ -511,21 +535,11 @@
    4.60  		p2y=QPoint( parObj->getParPos() ).y();
    4.61  	} 
    4.62  
    4.63 +
    4.64 +
    4.65 +	setDockPos(); // Call overloaded method
    4.66 +/* FIXME not needed?
    4.67  	LinkOrient orientOld=orientation;
    4.68 -
    4.69 -    // Set orientation, first look for orientation of parent
    4.70 -    if (parObj->getOrientation() != OrientUndef ) 
    4.71 -		// use the orientation of the parent:
    4.72 -		orientation=parObj->getOrientation();
    4.73 -    else
    4.74 -    {
    4.75 -		// calc orientation depending on position rel to mapCenter
    4.76 -		if (absPos.x() < QPoint(parObj->getChildPos() ).x() )
    4.77 -			orientation=OrientLeftOfCenter; 
    4.78 -		else
    4.79 -			orientation=OrientRightOfCenter;
    4.80 -    }
    4.81 -
    4.82  	if ((orientation!=orientOld) && (orientOld!= OrientUndef))
    4.83  	{
    4.84  		// Orientation just changed. Reorient this subbranch, because move is called
    4.85 @@ -534,10 +548,11 @@
    4.86  		//
    4.87  		// Also possible: called in BranchObj::init(), then orientOld==OrientUndef,
    4.88  		// no need to reposition now
    4.89 +		cout <<"Trying to reorientate...   orient="<<orientation<<endl;
    4.90  		reposition();
    4.91  	}
    4.92  	
    4.93 -	setDockPos();
    4.94 +*/
    4.95  
    4.96  	double p1x=parPos.x();	// Link is drawn from P1 to P2
    4.97  	double p1y=parPos.y();
    4.98 @@ -657,11 +672,6 @@
    4.99  	return lmo;
   4.100  }
   4.101  
   4.102 -void LinkableMapObj::setDockPos()
   4.103 -{
   4.104 -	cout <<"LMO::setDockPos()\n";
   4.105 -}
   4.106 -
   4.107  QPoint LinkableMapObj::getChildPos()
   4.108  {
   4.109      return childPos;
   4.110 @@ -709,14 +719,19 @@
   4.111                      (int)( + 150*sin (a)));
   4.112  }
   4.113  
   4.114 +/*
   4.115  void LinkableMapObj::alignRelativeTo (QPoint ref)
   4.116  {
   4.117 -	// FIXME testing, seems not to be used right now...
   4.118 -	cout << "LMO::alignRelTo   ref="<<ref<<endl;
   4.119 +	// Overloaded, only called for BO, FIO, ...
   4.120 +	// FIXME not needed?
   4.121  }
   4.122 +*/
   4.123  
   4.124  void LinkableMapObj::reposition()
   4.125  {
   4.126 +	// FIXME not needed? Is overloaded in BranchObj...
   4.127 +	/*
   4.128 +	cout << "LMO::reposition\n";
   4.129  	if (depth==0)
   4.130  	{
   4.131  		// only calculate the sizes once. If the deepest LMO changes its height,
   4.132 @@ -729,9 +744,11 @@
   4.133  	{
   4.134  		// This is only important for moving branches:
   4.135  		// For editing a branch it isn't called...
   4.136 +		cout << "  reposition to abs "<<absPos<<endl;
   4.137  	    alignRelativeTo ( QPoint (absPos.x(),
   4.138  							absPos.y()-(bboxTotal.height()-bbox.height())/2) );
   4.139  	}
   4.140 +	*/
   4.141  }
   4.142  
   4.143  void LinkableMapObj::requestReposition()
     5.1 --- a/linkablemapobj.h	Thu Sep 14 11:38:17 2006 +0000
     5.2 +++ b/linkablemapobj.h	Thu Sep 14 11:38:18 2006 +0000
     5.3 @@ -63,13 +63,14 @@
     5.4  	virtual void setFrameType (const FrameType &);
     5.5  	virtual void setFrameType (const QString &);
     5.6  	virtual void setVisibility (bool);
     5.7 +	virtual void setOrientation();
     5.8      virtual void updateLink();				// update parPos and childPos
     5.9  											// depending on pos
    5.10  											// redraw link with given style
    5.11      LinkableMapObj* getChildObj();			// returns pointer to fromObj
    5.12      LinkableMapObj* getParObj();			// returns pointer to toObj
    5.13      virtual LinkableMapObj* findObjBySelect(QString s);	// find obj by selectstring
    5.14 -	virtual void setDockPos();				// sets childPos and parPos
    5.15 +	virtual void setDockPos()=0;				// sets childPos and parPos
    5.16      QPoint getChildPos();					// returns pos where childs dock
    5.17      QPoint getParPos();						// returns pos where parents dock
    5.18      LinkOrient getOrientation();			// get orientation
    5.19 @@ -78,7 +79,7 @@
    5.20  	virtual MapEditor* getMapEditor();		// get MapEditor (usually from parent);
    5.21  	virtual QPoint getRandPos();			// make randomised position
    5.22  
    5.23 -    virtual void alignRelativeTo(const QPoint );
    5.24 +    //virtual void alignRelativeTo(const QPoint );
    5.25  	virtual void reposition();
    5.26  	virtual void requestReposition();		// do reposition after next user event
    5.27  	virtual void forceReposition();			// to force a reposition now (outside
     6.1 --- a/mainwindow.cpp	Thu Sep 14 11:38:17 2006 +0000
     6.2 +++ b/mainwindow.cpp	Thu Sep 14 11:38:18 2006 +0000
     6.3 @@ -3215,9 +3215,7 @@
     6.4  
     6.5  void Main::testFunction()
     6.6  {
     6.7 -	HistoryWindow hw;
     6.8 -	hw.exec();
     6.9 -	//currentMapEditor()->testFunction();
    6.10 +	currentMapEditor()->testFunction();
    6.11  }
    6.12  
    6.13  void Main::helpDoc()
     7.1 --- a/mapcenterobj.cpp	Thu Sep 14 11:38:17 2006 +0000
     7.2 +++ b/mapcenterobj.cpp	Thu Sep 14 11:38:18 2006 +0000
     7.3 @@ -65,8 +65,8 @@
     7.4  
     7.5  void MapCenterObj::moveAllBy (double dx, double dy)
     7.6  {
     7.7 -	// Move myself
     7.8 -	moveBy(dx,dy);
     7.9 +	// Move myself and childs
    7.10 +	BranchObj::moveBy(dx,dy);
    7.11  }
    7.12  
    7.13  void MapCenterObj::updateLink()
    7.14 @@ -80,6 +80,24 @@
    7.15  		b->updateLink();
    7.16  }
    7.17  
    7.18 +void MapCenterObj::updateRelPositions()
    7.19 +{
    7.20 +	if (repositionRequest) unsetAllRepositionRequests();
    7.21 +
    7.22 +	// update relative Positions of branches and floats
    7.23 +	BranchObj *b;
    7.24 +	for (b=branch.first(); b; b=branch.next() ) 
    7.25 +	{
    7.26 +		b->setRelPos();
    7.27 +		b->setOrientation();
    7.28 +	}
    7.29 +	
    7.30 +	FloatObj *fo;
    7.31 +	for (fo=floatimage.first(); fo; fo=floatimage.next() ) fo->setRelPos();
    7.32 +
    7.33 +	if (repositionRequest) reposition();
    7.34 +}
    7.35 +
    7.36  LinkableMapObj* MapCenterObj::findMapObj(QPoint p, LinkableMapObj *excludeLMO)
    7.37  	{
    7.38  	BranchObj *bo;
     8.1 --- a/mapcenterobj.h	Thu Sep 14 11:38:17 2006 +0000
     8.2 +++ b/mapcenterobj.h	Thu Sep 14 11:38:18 2006 +0000
     8.3 @@ -21,6 +21,7 @@
     8.4      virtual void moveAll   (double,double);
     8.5      virtual void moveAllBy (double,double);
     8.6      virtual void updateLink();
     8.7 +    virtual void updateRelPositions();
     8.8      LinkableMapObj* findMapObj(QPoint,LinkableMapObj*);	// find MapObj 
     8.9  	virtual QString saveToDir (const QString&,const QString&,int, const QPoint&);// Save data recursivly to tempdir
    8.10  	void setVersion(const  QString &);
     9.1 --- a/mapeditor.cpp	Thu Sep 14 11:38:17 2006 +0000
     9.2 +++ b/mapeditor.cpp	Thu Sep 14 11:38:18 2006 +0000
     9.3 @@ -209,7 +209,7 @@
     9.4  	fileName=tr("unnamed");
     9.5  	mapName="";
     9.6  
     9.7 -	stepsTotal=settings.readNumEntry("/mapeditor/stepsTotal",5);
     9.8 +	stepsTotal=settings.readNumEntry("/mapeditor/stepsTotal",50);
     9.9  	undoSet.setEntry ("/history/stepsTotal",QString::number(stepsTotal));
    9.10  	
    9.11  	// Initialize find routine
    9.12 @@ -546,7 +546,7 @@
    9.13  
    9.14  	/* TODO remove after testing
    9.15  	*/
    9.16 -	cout << "ME::saveState()  begin"<<endl;
    9.17 +	cout << "ME::saveState()  "<<endl;
    9.18  	
    9.19  	setChanged();
    9.20  
    9.21 @@ -559,7 +559,8 @@
    9.22  	if (curStep>stepsTotal) curStep=1;
    9.23  	
    9.24  	QString backupXML;
    9.25 -	QString bakMapDir=QDir::convertSeparators (QString(tmpMapDir+"/undo-%1").arg(curStep));
    9.26 +	QString bakMapName=QDir::convertSeparators (QString("history-%1").arg(curStep));
    9.27 +	QString bakMapDir=QDir::convertSeparators (tmpMapDir +"/"+bakMapName);
    9.28  	QString bakMapPath=QDir::convertSeparators(bakMapDir+"/map.xml");
    9.29  
    9.30  	// Create bakMapDir if not available
    9.31 @@ -589,7 +590,13 @@
    9.32  		// Write XML Data to disk
    9.33  		saveStringToDisk (QString(bakMapPath),backupXML);
    9.34  
    9.35 +	// We would have to save all actions in a tree, to keep track of 
    9.36 +	// possible redos after a action. Too complex, forget about redos.
    9.37 +	redosAvail=0;
    9.38 +
    9.39 +	// Write the current state to disk
    9.40  	undoSet.setEntry ("/history/undosAvail",QString::number(undosAvail));
    9.41 +	undoSet.setEntry ("/history/redosAvail",QString::number(redosAvail));
    9.42  	undoSet.setEntry ("/history/curStep",QString::number(curStep));
    9.43  	undoSet.setEntry (QString("/history/step-%1/undoCommand").arg(curStep),undoCommand);
    9.44  	undoSet.setEntry (QString("/history/step-%1/undoSelection").arg(curStep),undoSelection);
    9.45 @@ -771,6 +778,8 @@
    9.46  		{
    9.47  			s=api.parString (ok,0);	// undo selection
    9.48  			t=api.parString (ok,1);	// backup dir
    9.49 +			if (QDir::isRelativePath(t)) t=QDir::convertSeparators (tmpMapDir + "/"+t);
    9.50 +			cout <<t.ascii()<<endl;
    9.51  			undoXML(s,t);	
    9.52  		}
    9.53  	} else if (com=="select")
    9.54 @@ -1429,16 +1438,19 @@
    9.55  {
    9.56  	// Restore variables
    9.57  	int undosAvail=undoSet.readNumEntry (QString("/history/undosAvail"));
    9.58 +	int redosAvail=undoSet.readNumEntry (QString("/history/redosAvail"));
    9.59 +
    9.60 +	cout << "ME::goto "<<i<<endl;
    9.61  	
    9.62 -	if (i<0) return;
    9.63 -
    9.64 -	// Clicking above current steps let's us undo things
    9.65 +	if (i<0) i=undosAvail+redosAvail;
    9.66 +
    9.67 +	// Clicking above current step makes us undo things
    9.68  	if (i<undosAvail) 
    9.69  	{	
    9.70  		for (int j=0; j<undosAvail-i; j++) undo();
    9.71  		return;
    9.72  	}	
    9.73 -	// Clicking below current steps let's us rendo things
    9.74 +	// Clicking below current step makes us redo things
    9.75  	if (i>undosAvail) 
    9.76  		for (int j=undosAvail; j<i; j++) redo();
    9.77  
    9.78 @@ -1542,7 +1554,9 @@
    9.79  
    9.80  void MapEditor::moveRel (const int &x, const int &y)
    9.81  {
    9.82 -	if (selection)
    9.83 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
    9.84 +				      typeid(*selection) == typeid(MapCenterObj) ||
    9.85 +					  typeid(*selection) == typeid (FloatImageObj))) 
    9.86  	{
    9.87  		QString ps=qpointToString (selection->getRelPos());
    9.88  		QString s=selection->getSelectString();
    9.89 @@ -1550,7 +1564,7 @@
    9.90  			s, "moveRel "+ps, 
    9.91  			s, "moveRel "+qpointToString (QPoint (x,y)), 
    9.92  			QString("Move %1 to relativ position %2").arg(getName(selection)).arg(ps));
    9.93 -		selection->setRelPos (QPoint(x,y));
    9.94 +		((OrnamentedObj*)selection)->move2RelPos (x,y);
    9.95  		mapCenter->reposition();
    9.96  		adjustCanvasSize();
    9.97  	}
    9.98 @@ -3217,7 +3231,6 @@
    9.99  
   9.100  void MapEditor::editXLink(int i)
   9.101  {
   9.102 -	qDebug ("ko.");  //FIXME Huh?
   9.103  	if (selection && 
   9.104  		(typeid(*selection) == typeid(BranchObj)) || 
   9.105  		(typeid(*selection) == typeid(MapCenterObj))  )
   9.106 @@ -3247,42 +3260,18 @@
   9.107  {
   9.108  	cout << "MapEditor::testFunction() called\n";
   9.109  
   9.110 -/*
   9.111 -	bool ok;
   9.112 -	QString text = QInputDialog::getText(
   9.113 -		this, 
   9.114 -		tr("QInputDialog::getText()"),
   9.115 -		 tr("User name:"), QLineEdit::Normal,
   9.116 -		 QDir::home().dirName(), &ok, Qt::FramelessWindowHint);
   9.117 -*/
   9.118 -
   9.119 -	QDialog *d =new QDialog(NULL);
   9.120 -	QLineEdit *le=new QLineEdit (d);
   9.121 -//	d->setModal (true);
   9.122 -	d->setWindowFlags (Qt::FramelessWindowHint);
   9.123 -	le->setFocus();
   9.124 -	le->setText ("Foo");
   9.125 -	le->selectAll();
   9.126 -	connect (le, SIGNAL (returnPressed()), d, SLOT (accept()));
   9.127 -	d->exec();
   9.128 -	qWarning( le->text());
   9.129 -	return;
   9.130 -	
   9.131 -
   9.132 -
   9.133 -/*
   9.134  	WarningDialog dia;
   9.135 -	dia.setCancelButton (true);
   9.136 +	dia.showCancelButton (true);
   9.137  	dia.setText("This is a longer \nWarning");
   9.138 +	/*
   9.139  	dia.setCaption("Warning: Flux problem");
   9.140  	dia.setShowAgainName("/warnings/mapeditor");
   9.141 -	dia.setWindowFlags (Qt::FramelessWindowHint);
   9.142 +	*/
   9.143  	if (dia.exec()==QDialog::Accepted)
   9.144  		cout << "accepted!\n";
   9.145  	else	
   9.146  		cout << "canceled!\n";
   9.147  	return;
   9.148 -*/
   9.149  
   9.150  /* Hide hidden stuff temporary, maybe add this as regular function somewhere
   9.151  	if (hidemode==HideNone)
   9.152 @@ -3541,7 +3530,7 @@
   9.153  
   9.154  			// Relink float to new mapcenter or branch, if shift is pressed	
   9.155  			// Only relink, if selection really has a new parent
   9.156 -			if ( (e->state() & Qt::ShiftModifier) && lmo &&
   9.157 +			if ( (e->modifiers()==Qt::ShiftModifier) && lmo &&
   9.158  				( (typeid(*lmo)==typeid(BranchObj)) ||
   9.159  				  (typeid(*lmo)==typeid(MapCenterObj)) ) &&
   9.160  				( lmo != fo->getParObj())  
   9.161 @@ -3563,24 +3552,26 @@
   9.162  					movingObj=(MapObj*)(fio);
   9.163  				}	
   9.164  			}
   9.165 -		} else	// selection != a FloatObj
   9.166 -		{
   9.167 +		} else	
   9.168 +		{	// selection != a FloatObj
   9.169  			if (lmosel->getDepth()==0)
   9.170  			{
   9.171 -				if (e->state() == Qt::LeftButton && e->modifiers()==Qt::ShiftModifier) 
   9.172 -					// If mapCenter is moved, move all the rest by default, too.
   9.173 +				// Move MapCenter
   9.174 +				if (e->buttons()== Qt::LeftButton && e->modifiers()==Qt::ShiftModifier) 
   9.175  					mapCenter->moveAll(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
   9.176  				else	
   9.177  					mapCenter->move   (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
   9.178 +				mapCenter->updateRelPositions();	
   9.179  			} else
   9.180  			{	
   9.181  				if (lmosel->getDepth()==1)
   9.182  				{
   9.183 -					// depth==1, mainbranch
   9.184 +					// Move mainbranch
   9.185  					lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
   9.186 +					lmosel->setRelPos();
   9.187  				} else
   9.188  				{
   9.189 -					// depth>1
   9.190 +					// Move ordinary branch
   9.191  					if (lmosel->getOrientation() == OrientLeftOfCenter)
   9.192  						// Add width of bbox here, otherwise alignRelTo will cause jumping around
   9.193  						lmosel->move(p.x() -movingObj_start.x()+lmosel->getBBox().width(), 
   9.194 @@ -3590,19 +3581,18 @@
   9.195  				} 
   9.196  				// reposition subbranch
   9.197  				lmosel->reposition();	
   9.198 -				//ensureSelectionVisible();
   9.199  
   9.200  				if (lmo && (lmo!=selection) &&  
   9.201  					(typeid(*lmo) == typeid(BranchObj) ||
   9.202  					(typeid(*lmo) == typeid(MapCenterObj) )
   9.203  					) )
   9.204  				{
   9.205 -					if (e->state() & Qt::ControlModifier)
   9.206 +					if (e->modifiers()==Qt::ControlModifier)
   9.207  					{
   9.208  						// Special case: CTRL to link below lmo
   9.209  						lmosel->setParObjTmp (lmo,p,+1);
   9.210  					}
   9.211 -					else if (e->state() & Qt::ShiftModifier)
   9.212 +					else if (e->modifiers()==Qt::ShiftModifier)
   9.213  						lmosel->setParObjTmp (lmo,p,-1);
   9.214  					else
   9.215  						lmosel->setParObjTmp (lmo,p,0);
   9.216 @@ -3688,9 +3678,9 @@
   9.217      // Have we been moving something?
   9.218      if ( selection && movingObj ) 
   9.219      {	
   9.220 -		// Moved FloatObj? Maybe we need to reposition
   9.221  		if(typeid(*selection)==typeid (FloatImageObj))
   9.222  		{
   9.223 +			// Moved FloatObj. Maybe we need to reposition
   9.224  			FloatImageObj *fo=(FloatImageObj*)selection;
   9.225  		    QString pold=qpointToString(movingObj_orgRelPos);
   9.226  		    QString pnow=qpointToString(fo->getRelPos());
   9.227 @@ -3699,6 +3689,7 @@
   9.228  				"moveRel "+pnow,
   9.229  				QString("Move %1 to relativ position %2").arg(getName(selection)).arg(pnow));
   9.230  
   9.231 +			// FIXME Why calling parObj here?
   9.232  			selection->getParObj()->requestReposition();
   9.233  			mapCenter->reposition();
   9.234  		}	
   9.235 @@ -3711,9 +3702,14 @@
   9.236  		if (dst && (typeid(*dst)!=typeid(BranchObj) && typeid(*dst)!=typeid(MapCenterObj))) 
   9.237  			dst=NULL;
   9.238  		
   9.239 -		// Now check, if we have been moving a branch 
   9.240 +		if (typeid(*selection) == typeid(MapCenterObj)  )
   9.241 +		{	// The MapCenter was moved
   9.242 +			cout << "FIXME missing savestate...\n";	
   9.243 +		}
   9.244 +		
   9.245  		if (typeid(*selection) == typeid(BranchObj)  )
   9.246 -		{
   9.247 +		{	// A branch was moved
   9.248 +			
   9.249  			// save the position in case we link to mapcenter
   9.250  			QPoint savePos=QPoint (selection->x(),selection->y() );
   9.251  
    10.1 --- a/ornamentedobj.cpp	Thu Sep 14 11:38:17 2006 +0000
    10.2 +++ b/ornamentedobj.cpp	Thu Sep 14 11:38:18 2006 +0000
    10.3 @@ -160,6 +160,11 @@
    10.4  void OrnamentedObj::move2RelPos(double x, double y)
    10.5  {
    10.6  	setRelPos (QPoint((int)x,(int)y));
    10.7 +	if (parObj)
    10.8 +	{
    10.9 +		QPoint p=parObj->getChildPos();
   10.10 +		move (p.x()+x, p.y() +y);
   10.11 +	}
   10.12  }
   10.13  
   10.14  void OrnamentedObj::move2RelPos(QPoint p)
   10.15 @@ -355,14 +360,16 @@
   10.16  {
   10.17  	QString posAttr;
   10.18  
   10.19 -	if (useRelPos)
   10.20 -		posAttr=attribut("relPosX",QString().setNum(relPos.x(),10)) +
   10.21 -                attribut("relPosY",QString().setNum(relPos.y(),10)); 
   10.22 +	if (depth==0)
   10.23 +		posAttr=		
   10.24 +			attribut("absPosX",QString().setNum(absPos.x(),10)) +
   10.25 +			attribut("absPosY",QString().setNum(absPos.y(),10)); 
   10.26  	else
   10.27  	{
   10.28 -		if (depth==0 || depth==1) posAttr=
   10.29 -			attribut("absPosX",QString().setNum(absPos.x(),10)) +
   10.30 -			attribut("absPosY",QString().setNum(absPos.y(),10)); 
   10.31 +		if (depth==1)
   10.32 +			posAttr=
   10.33 +				attribut("relPosX",QString().setNum(relPos.x(),10)) +
   10.34 +				attribut("relPosY",QString().setNum(relPos.y(),10)); 
   10.35  		else
   10.36  			posAttr="";
   10.37  	}	
    11.1 --- a/tex/vym.changelog	Thu Sep 14 11:38:17 2006 +0000
    11.2 +++ b/tex/vym.changelog	Thu Sep 14 11:38:18 2006 +0000
    11.3 @@ -1,8 +1,17 @@
    11.4  -------------------------------------------------------------------
    11.5 -Wed Sep  8 14:43:09 CEST 2006 - uwedr
    11.6 +Thu Sep 14 12:01:28 CEST 2006 - uwedr
    11.7 +
    11.8 +- Version: 1.8.57
    11.9 +- Feature: Note Editor completly based on QT4 now.
   11.10 +
   11.11 +-------------------------------------------------------------------
   11.12 +Wed Sep  13 16:43:09 CEST 2006 - uwedr
   11.13  
   11.14  - Version: 1.8.56
   11.15 -- Feature: New History window, started to port designer stuff to QT4
   11.16 +- Feature: New History window, All designer elements ported to QT4
   11.17 +- Bugfix: No more hopping around of floats, when canvas is resized 
   11.18 +          (by using relative positions for mainbranches. This might 
   11.19 +		  confuse parsing 1.8.56 documents with vym <= 1.8.1
   11.20  
   11.21  -------------------------------------------------------------------
   11.22  Wed Sep  6 09:48:12 CEST 2006 - uwedr
    12.1 --- a/texteditor.cpp	Thu Sep 14 11:38:17 2006 +0000
    12.2 +++ b/texteditor.cpp	Thu Sep 14 11:38:18 2006 +0000
    12.3 @@ -41,9 +41,7 @@
    12.4      printer = new QPrinter( QPrinter::HighResolution );
    12.5  	printer->setPrinterName (settings.value("/mainwindow/printerName",printer->printerName()).toString());
    12.6  
    12.7 -	// Editor (use MyTextEdit to wrap verticalAlignmentChanged to 
    12.8 -	//         int argument. see header file)
    12.9 -    e = new MyTextEdit( this, "editor" );
   12.10 +    e = new QTextEdit( this);
   12.11      e->setFocus();
   12.12  	e->setTextFormat(Qt::RichText);		// default
   12.13  	e->setTabStopWidth (20);		// unit is pixel
   12.14 @@ -51,9 +49,15 @@
   12.15  	e->setAutoFillBackground (true);
   12.16  	connect (e, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) );
   12.17      setCentralWidget( e );
   12.18 -    statusBar()->message( "Ready", statusbarTime);
   12.19 +    statusBar()->message( tr("Ready","Statusbar message"), statusbarTime);
   12.20  	setCaption(__VYM " - " +tr ("Note Editor"));
   12.21  
   12.22 +
   12.23 +	connect(e, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)),
   12.24 +            this, SLOT(formatChanged(const QTextCharFormat &)));
   12.25 +
   12.26 +
   12.27 +
   12.28  	// Toolbars
   12.29  	setupFileActions();
   12.30  	setupEditActions();
   12.31 @@ -92,6 +96,9 @@
   12.32  	}	
   12.33  	filenameHint="";
   12.34  
   12.35 +	// Restore position of toolbars
   12.36 +	restoreState (settings.value("/noteeditor/state",0).toByteArray());
   12.37 +
   12.38  	// Save settings in vymrc
   12.39  	settings.setValue("/mainwindow/printerName",printer->printerName());
   12.40  }
   12.41 @@ -103,6 +110,7 @@
   12.42  	// Save Settings
   12.43  	settings.setValue( "/noteeditor/geometry/size", size() );
   12.44  	settings.setValue( "/noteeditor/geometry/pos", pos() );
   12.45 +	settings.setValue ("/noteeditor/state",saveState(0));
   12.46  	
   12.47  	settings.setValue( "/noteeditor/showWithMain",showWithMain());
   12.48  
   12.49 @@ -114,6 +122,8 @@
   12.50  	settings.setValue( "/noteeditor/fonts/fonthintDefault",s );
   12.51  	settings.setValue("/noteeditor/fonts/varFont", varFont.toString() );
   12.52  	settings.setValue("/noteeditor/fonts/fixedFont", fixedFont.toString() );
   12.53 +
   12.54 +
   12.55  }
   12.56  
   12.57  bool TextEditor::isEmpty()
   12.58 @@ -165,12 +175,12 @@
   12.59  		if (fn.isEmpty() )
   12.60  		{
   12.61  			filename="";
   12.62 -			statusBar()->message( "No filename available for this note.", statusbarTime );
   12.63 +			statusBar()->message( tr("No filename available for this note.","Statusbar message"), statusbarTime );
   12.64  		}	
   12.65  		else
   12.66  		{
   12.67  			filename=fn;
   12.68 -			statusBar()->message( QString( "Current filename is %1" ).arg( filename ), statusbarTime );
   12.69 +			statusBar()->message( tr(QString( "Current filename is %1" ).arg( filename ),"Statusbar message"), statusbarTime );
   12.70  		}	
   12.71  }
   12.72  
   12.73 @@ -304,23 +314,6 @@
   12.74  	tb->addAction (a);
   12.75  	actionEditDeleteAll=a;
   12.76  
   12.77 -	a = new QAction(QPixmap(), tr( "&Convert Paragraphs" ),this);
   12.78 -	/* TODO not needed any longer? remove also from docu...
   12.79 -	a->setStatusTip(tr( "Convert paragraphs to linebreaks" )); 
   12.80 -	a->setShortcut( Qt::ALT + Qt::Key_P );
   12.81 -    connect( a, SIGNAL( activated() ), this, SLOT( textConvertPar() ) );
   12.82 -	editMenu->addAction (a);
   12.83 -	*/
   12.84 -	actionEditConvertPar=a;
   12.85 -
   12.86 -	a = new QAction( QPixmap(), tr( "&Join lines" ), this);
   12.87 -	/* TODO not needed any longer? remove also from docu...
   12.88 -	a->setStatusTip(tr( "Join all lines of a paragraph" ) ); 
   12.89 -	a->setShortcut(Qt::ALT + Qt::Key_J );
   12.90 -    connect( a, SIGNAL( activated() ), this, SLOT( textJoinLines() ) );
   12.91 -	editMenu->addAction (a);
   12.92 -	*/
   12.93 -	actionEditJoinLines=a;
   12.94  }
   12.95  
   12.96  void TextEditor::setupFormatActions()
   12.97 @@ -339,7 +332,6 @@
   12.98  	tb->addAction (a);
   12.99  	actionFormatUseFixedFont=a;
  12.100  
  12.101 -//    comboFont = new QComboBox( true, tb );
  12.102      comboFont = new QComboBox;
  12.103  	tb->addWidget (comboFont);
  12.104      QFontDatabase fontDB;
  12.105 @@ -395,9 +387,28 @@
  12.106      actionTextUnderline=a;
  12.107      formatMenu->addSeparator();
  12.108  
  12.109 +    QActionGroup *grp2 = new QActionGroup( this );
  12.110 +    grp2->setExclusive(true);
  12.111 +    a = new QAction( QPixmap (iconPath+"text_sub.png"), tr( "Subs&cript" ),grp2 );
  12.112 +	a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_B );
  12.113 +    a->setToggleAction( true );
  12.114 +	tb->addAction (a);
  12.115 +	formatMenu->addAction (a);
  12.116 +    connect(a, SIGNAL(activated()), this, SLOT(textVAlign()));
  12.117 +    actionAlignSubScript=a;
  12.118 +
  12.119 +    a = new QAction( QPixmap (iconPath+"text_super.png"), tr( "Su&perscript" ),grp2  );
  12.120 +	a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_P );
  12.121 +    a->setToggleAction( true );
  12.122 +	tb->addAction (a);
  12.123 +	formatMenu->addAction (a);
  12.124 +    connect(a, SIGNAL(activated()), this, SLOT(textVAlign()));
  12.125 +    actionAlignSuperScript=a;
  12.126      QActionGroup *grp = new QActionGroup( this );
  12.127      connect( grp, SIGNAL( selected( QAction* ) ), this, SLOT( textAlign( QAction* ) ) );
  12.128  
  12.129 +    formatMenu->addSeparator();
  12.130 +
  12.131      a = new QAction( QPixmap (iconPath+"text_left.png"), tr( "&Left" ),grp );
  12.132  	a->setShortcut( Qt::CTRL+Qt::Key_L );
  12.133      a->setToggleAction( true );
  12.134 @@ -423,31 +434,13 @@
  12.135  	formatMenu->addAction (a);
  12.136      actionAlignJustify=a;
  12.137  
  12.138 -    QActionGroup *grp2 = new QActionGroup( this );
  12.139 -    grp2->setExclusive(true);
  12.140 -    a = new QAction( QPixmap (iconPath+"text_sub.png"), tr( "Subs&cript" ),grp2 );
  12.141 -	a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_B );
  12.142 -    a->setToggleAction( true );
  12.143 -	tb->addAction (a);
  12.144 -	formatMenu->addAction (a);
  12.145 -    connect(a, SIGNAL(activated()), this, SLOT(textVAlign()));
  12.146 -    actionAlignSubScript=a;
  12.147  
  12.148 -    a = new QAction( QPixmap (iconPath+"text_super.png"), tr( "Su&perscript" ),grp2  );
  12.149 -	a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_P );
  12.150 -    a->setToggleAction( true );
  12.151 -	tb->addAction (a);
  12.152 -	formatMenu->addAction (a);
  12.153 -    connect(a, SIGNAL(activated()), this, SLOT(textVAlign()));
  12.154 -    actionAlignSuperScript=a;
  12.155 -
  12.156 -    formatMenu->addSeparator();
  12.157      
  12.158 +		 /* FIXME
  12.159      connect( e, SIGNAL( currentFontChanged( const QFont & ) ),
  12.160  	     this, SLOT( fontChanged( const QFont & ) ) );
  12.161      connect( e, SIGNAL( currentColorChanged( const QColor & ) ),
  12.162  	     this, SLOT( colorChanged( const QColor & ) ) );
  12.163 -		 /*
  12.164      connect( e, SIGNAL( currentAlignmentChanged( int ) ),
  12.165  	     this, SLOT( alignmentChanged( int ) ) );
  12.166      connect( e, SIGNAL( currentVerticalAlignmentChanged(int)),
  12.167 @@ -648,84 +641,6 @@
  12.168      statusBar()->message( QString( "Note exported as %1" ).arg( filename ), statusbarTime );
  12.169  }
  12.170  
  12.171 -void TextEditor::textConvertPar()
  12.172 -{
  12.173 -	// In X11 a copy&paste generates paragraphs, 
  12.174 -	// which is not always wanted
  12.175 -	// This function replaces paragraphs by linebreaks.
  12.176 -
  12.177 -	QString t;
  12.178 -	t=e->text();
  12.179 -	QRegExp re("<p.*>");
  12.180 -	re.setMinimal(true);
  12.181 -	t.replace (re,"");
  12.182 -	t.replace ("</p>","<br />");
  12.183 -	e->setText(t);
  12.184 -
  12.185 -	/* TODO QT3 use seletion ()
  12.186 -	int parFrom, parTo, indFrom, indTo;
  12.187 -	e->getSelection (&parFrom,&indFrom,&parTo,&indTo);
  12.188 -	if (parFrom>-1)
  12.189 -		t=e->selectedText();
  12.190 -	else
  12.191 -		t=e->text();
  12.192 -
  12.193 -	QRegExp re("<p.*>");
  12.194 -	re.setMinimal(true);
  12.195 -	t.replace (re,"");
  12.196 -	t.replace ("</p>","<br />");
  12.197 -	if (parFrom>-1)
  12.198 -	{
  12.199 -		e->setCursorPosition (parFrom,indFrom);
  12.200 -		e->cut();
  12.201 -		// Tried to simply insert the changed text with
  12.202 -		// e->insert (t,(uint)(QTextEdit::RemoveSelected));
  12.203 -		// but then the html would be quoted. So I use the ugly
  12.204 -		// way: insert a marker, replace it in whole text of QTextEdit
  12.205 -		QString marker="R3PlAcEMeL4teR!";
  12.206 -		e->insert (marker);
  12.207 -		e->setText (e->text().replace(marker,t));
  12.208 -	} else
  12.209 -		e->setText(t);
  12.210 -	*/	
  12.211 -}
  12.212 -
  12.213 -void TextEditor::textJoinLines()
  12.214 -{
  12.215 -/* TODO  QT3
  12.216 -	int parFrom, parTo, indFrom, indTo;
  12.217 -	e->getSelection (&parFrom,&indFrom,&parTo,&indTo);
  12.218 -	QString t;
  12.219 -	if (parFrom>-1)
  12.220 -		t=e->selectedText();
  12.221 -	else
  12.222 -		t=e->text();
  12.223 -	// In addition to textConvertPar it is sometimes
  12.224 -	// useful to join all lines of a paragraph
  12.225 -	QRegExp re("</p>\n+<p>(?!</p>)");
  12.226 -	re.setMinimal(true);
  12.227 -	t.replace (re," ");
  12.228 -
  12.229 -	// Above we may have introduced new " " at beginning of a
  12.230 -	// paragraph - remove it.
  12.231 -	re.setPattern("<p> ");
  12.232 -	t.replace (re,"<p>");
  12.233 -	if (parFrom>-1)
  12.234 -	{
  12.235 -		e->setCursorPosition (parFrom,indFrom);
  12.236 -		e->cut();
  12.237 -		// Tried to simply insert the changed text with
  12.238 -		// e->insert (t,(uint)(QTextEdit::RemoveSelected));
  12.239 -		// but then the html would be quoted. So I use the ugly
  12.240 -		// way: insert a marker, replace it in whole text of QTextEdit
  12.241 -		QString marker="R3PlAcEMeL4teR!";
  12.242 -		e->insert (marker);
  12.243 -		e->setText (e->text().replace(marker,t));
  12.244 -	} else
  12.245 -		e->setText(t);
  12.246 -*/		
  12.247 -}
  12.248 -
  12.249  void TextEditor::textExportAsASCII()
  12.250  {
  12.251  	QString text = NoteObj (e->text()).getNoteASCII();
  12.252 @@ -857,8 +772,7 @@
  12.253  void TextEditor::textColor()
  12.254  {
  12.255      QColor col = QColorDialog::getColor( e->color(), this );
  12.256 -    if ( !col.isValid() )
  12.257 -	return;
  12.258 +    if ( !col.isValid() ) return;
  12.259      e->setColor( col );
  12.260      QPixmap pix( 16, 16 );
  12.261      pix.fill( Qt::black );
  12.262 @@ -868,35 +782,36 @@
  12.263  void TextEditor::textAlign( QAction *a )
  12.264  {
  12.265      if ( a == actionAlignLeft )
  12.266 -	e->setAlignment( Qt::AlignLeft );
  12.267 +		e->setAlignment( Qt::AlignLeft );
  12.268      else if ( a == actionAlignCenter )
  12.269 -	e->setAlignment( Qt::AlignHCenter );
  12.270 +		e->setAlignment( Qt::AlignHCenter );
  12.271      else if ( a == actionAlignRight )
  12.272 -	e->setAlignment( Qt::AlignRight );
  12.273 +		e->setAlignment( Qt::AlignRight );
  12.274      else if ( a == actionAlignJustify )
  12.275 -	e->setAlignment( Qt::AlignJustify );
  12.276 +		e->setAlignment( Qt::AlignJustify );
  12.277  }
  12.278  
  12.279  void TextEditor::textVAlign()
  12.280  {
  12.281 -/* FIXME QT3 alignment
  12.282 +	QTextCharFormat format;
  12.283 +
  12.284      if ( sender() == actionAlignSuperScript && actionAlignSuperScript->isOn()) {
  12.285 -	e->setVerticalAlignment( QTextEdit::AlignSuperScript);
  12.286 +		format.setVerticalAlignment(QTextCharFormat::AlignSuperScript);
  12.287      } else if (sender() == actionAlignSubScript && actionAlignSubScript->isOn()) {
  12.288 -	e->setVerticalAlignment( QTextEdit::AlignSubScript);
  12.289 +		format.setVerticalAlignment(QTextCharFormat::AlignSubScript);
  12.290      } else {
  12.291 -	e->setVerticalAlignment( QTextEdit::AlignNormal);
  12.292 +		format.setVerticalAlignment(QTextCharFormat::AlignNormal);
  12.293      }
  12.294 -*/	
  12.295 +	e->mergeCurrentCharFormat(format);
  12.296  }
  12.297  
  12.298  
  12.299  void TextEditor::fontChanged( const QFont &f )
  12.300  {
  12.301 -/*
  12.302 -    comboFont->lineEdit()->setText( f.family() );
  12.303 -    comboSize->lineEdit()->setText( QString::number( f.pointSize() ) );
  12.304 -*/	
  12.305 +	int i=comboFont->findText(f.family());
  12.306 +    if (i>=0) comboFont->setCurrentIndex (i);
  12.307 +	i=comboSize->findText(QString::number(f.pointSize()));
  12.308 +	if (i>=0) comboSize->setCurrentIndex(i);
  12.309      actionTextBold->setOn( f.bold() );
  12.310      actionTextItalic->setOn( f.italic() );
  12.311      actionTextUnderline->setOn( f.underline() );
  12.312 @@ -909,32 +824,40 @@
  12.313      actionTextColor->setIconSet( pix );
  12.314  }
  12.315  
  12.316 +void TextEditor::formatChanged( const QTextCharFormat &f )
  12.317 +{
  12.318 +	fontChanged(f.font());
  12.319 +    colorChanged(f.foreground().color());
  12.320 +    alignmentChanged(e->alignment());
  12.321 +	verticalAlignmentChanged (f.verticalAlignment());
  12.322 +}
  12.323 +
  12.324  void TextEditor::alignmentChanged( int a )
  12.325  {
  12.326      if ( ( a == Qt::AlignLeft ) || ( a & Qt::AlignLeft ))
  12.327 -	actionAlignLeft->setOn( true );
  12.328 +		actionAlignLeft->setOn( true );
  12.329      else if ( ( a & Qt::AlignHCenter ) )
  12.330 -	actionAlignCenter->setOn( true );
  12.331 +		actionAlignCenter->setOn( true );
  12.332      else if ( ( a & Qt::AlignRight ) )
  12.333 -	actionAlignRight->setOn( true );
  12.334 +		actionAlignRight->setOn( true );
  12.335      else if ( ( a & Qt::AlignJustify ) )
  12.336 -	actionAlignJustify->setOn( true );
  12.337 +		actionAlignJustify->setOn( true );
  12.338  }
  12.339  
  12.340 -void TextEditor::verticalAlignmentChanged(int a) 
  12.341 +void TextEditor::verticalAlignmentChanged(QTextCharFormat::VerticalAlignment a)
  12.342  {
  12.343 -	/* FIXME QT3 alignment
  12.344 -    if (a == QTextEdit::AlignSuperScript ) {
  12.345 -	actionAlignSuperScript->setOn(true);
  12.346 -	actionAlignSubScript->setOn(false);
  12.347 -    } else if (a == QTextEdit::AlignSubScript ) {
  12.348 -	actionAlignSuperScript->setOn(false);
  12.349 -	actionAlignSubScript->setOn(true);
  12.350 -    } else {
  12.351 -	actionAlignSuperScript->setOn(false);
  12.352 -	actionAlignSubScript->setOn(false);
  12.353 -    }
  12.354 -	*/
  12.355 +	actionAlignSubScript->setOn (false);
  12.356 +	actionAlignSuperScript->setOn (false);
  12.357 +	switch (a)
  12.358 +	{
  12.359 +		case QTextCharFormat::AlignSuperScript: 
  12.360 +			actionAlignSuperScript->setOn (true);
  12.361 +			break;
  12.362 +		case QTextCharFormat::AlignSubScript:
  12.363 +			actionAlignSubScript->setOn (true);
  12.364 +			break;
  12.365 +		default: ;	
  12.366 +	}
  12.367  }
  12.368  
  12.369  
  12.370 @@ -951,8 +874,6 @@
  12.371  	actionEditCut->setEnabled(true);
  12.372  	actionEditPaste->setEnabled(true);
  12.373  	actionEditDeleteAll->setEnabled(true);
  12.374 -	actionEditConvertPar->setEnabled(true);
  12.375 -	actionEditJoinLines->setEnabled(true);
  12.376  	actionFormatUseFixedFont->setEnabled(true);
  12.377  }
  12.378  
  12.379 @@ -968,8 +889,6 @@
  12.380  	actionEditCut->setEnabled(false);
  12.381  	actionEditPaste->setEnabled(false);
  12.382  	actionEditDeleteAll->setEnabled(false);
  12.383 -	actionEditConvertPar->setEnabled(false);
  12.384 -	actionEditJoinLines->setEnabled(false);
  12.385  	actionFormatUseFixedFont->setEnabled(false);
  12.386  }
  12.387  
    13.1 --- a/texteditor.h	Thu Sep 14 11:38:17 2006 +0000
    13.2 +++ b/texteditor.h	Thu Sep 14 11:38:18 2006 +0000
    13.3 @@ -56,8 +56,6 @@
    13.4      void textLoad();
    13.5      void textSaveAs();
    13.6      void textSave();
    13.7 -	void textConvertPar();
    13.8 -	void textJoinLines();
    13.9  	void textExportAsASCII();
   13.10      void textPrint();
   13.11  	void textEditUndo();
   13.12 @@ -74,15 +72,16 @@
   13.13  	void textVAlign();
   13.14      void fontChanged( const QFont &f );
   13.15      void colorChanged( const QColor &c );
   13.16 +	void formatChanged (const QTextCharFormat &f);
   13.17      void alignmentChanged( int a );
   13.18 -    void verticalAlignmentChanged(int a);
   13.19 +    void verticalAlignmentChanged(QTextCharFormat::VerticalAlignment);
   13.20  	void enableActions();
   13.21  	void disableActions();
   13.22  	void setState (EditorState);
   13.23  
   13.24  private:
   13.25      QPrinter *printer;
   13.26 -    MyTextEdit *e;
   13.27 +    QTextEdit *e;
   13.28  	QPoint lastPos;			// save last position of window
   13.29      QString filename;
   13.30      QString filenameHint;
   13.31 @@ -95,9 +94,7 @@
   13.32  
   13.33  	QFont varFont;
   13.34  	QFont fixedFont;
   13.35 -    QComboBox
   13.36 -	*comboFont,
   13.37 -	*comboSize;
   13.38 +    QComboBox *comboFont, *comboSize;
   13.39  	
   13.40  	QAction *actionFileLoad,
   13.41  	*actionFileSave,
   13.42 @@ -109,8 +106,6 @@
   13.43  	*actionEditCut,
   13.44  	*actionEditPaste,
   13.45  	*actionEditDeleteAll,
   13.46 -	*actionEditConvertPar,
   13.47 -	*actionEditJoinLines,
   13.48  	*actionFormatUseFixedFont,
   13.49  	*actionSettingsVarFont,
   13.50  	*actionSettingsFixedFont,
   13.51 @@ -119,47 +114,12 @@
   13.52  	*actionTextUnderline,
   13.53  	*actionTextItalic,
   13.54  	*actionTextColor,
   13.55 +	*actionAlignSubScript,
   13.56 +	*actionAlignSuperScript,
   13.57  	*actionAlignLeft,
   13.58  	*actionAlignCenter,
   13.59  	*actionAlignRight,
   13.60 -	*actionAlignJustify,
   13.61 -	*actionAlignSubScript,
   13.62 -	*actionAlignSuperScript;
   13.63 -};
   13.64 -
   13.65 -/* FIXME Wraps currentVerticalAlignmentChanged(VerticalAlignment)
   13.66 - * to currentVerticalAlignmentChanged(int) 
   13.67 - * this way the signal can be used without use of the internal 
   13.68 - * VerticalAlignment enum of QTextEdit 
   13.69 - * If VerticalAlignment has been a global like the normal alignment there
   13.70 - * have been no problems!
   13.71 - */
   13.72 - 
   13.73 -class MyTextEdit : public QTextEdit 
   13.74 -{
   13.75 -    Q_OBJECT;
   13.76 - public:
   13.77 -    MyTextEdit(QWidget *parent, const char *name) : QTextEdit(parent, name) 
   13.78 -	{
   13.79 -	/*
   13.80 -		connect(
   13.81 -			this, SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)), 
   13.82 -			this, SLOT(verticalAlignmentChanged(VerticalAlignment)));
   13.83 -	*/		
   13.84 -    }
   13.85 -//    int verticalAlignment() const { return m_verticalAlignment; } 
   13.86 - signals:
   13.87 -//    void currentVerticalAlignmentChanged(int a);
   13.88 - public slots:
   13.89 - /*
   13.90 -    void verticalAlignmentChanged(VerticalAlignment a) 
   13.91 -	{
   13.92 -		m_verticalAlignment = a;
   13.93 -		emit currentVerticalAlignmentChanged((int)a);
   13.94 -    }
   13.95 -*/	
   13.96 - private: 
   13.97 -//	 int m_verticalAlignment;
   13.98 +	*actionAlignJustify;
   13.99  };
  13.100  
  13.101  #endif
    14.1 --- a/version.h	Thu Sep 14 11:38:17 2006 +0000
    14.2 +++ b/version.h	Thu Sep 14 11:38:18 2006 +0000
    14.3 @@ -2,7 +2,7 @@
    14.4  #define VERSION_H
    14.5  
    14.6  #define __VYM "VYM"
    14.7 -#define __VYM_VERSION "1.8.55"
    14.8 -#define __BUILD_DATE "September 8, 2006"
    14.9 +#define __VYM_VERSION "1.8.57"
   14.10 +#define __BUILD_DATE "September 14, 2006"
   14.11  
   14.12  #endif
    15.1 --- a/vym.pro	Thu Sep 14 11:38:17 2006 +0000
    15.2 +++ b/vym.pro	Thu Sep 14 11:38:18 2006 +0000
    15.3 @@ -4,11 +4,15 @@
    15.4  CONFIG	+= qt warn_on release
    15.5  QT += qt3support
    15.6  
    15.7 -HEADERS	+= aboutdialog.h \
    15.8 +HEADERS	+= \	
    15.9 +	aboutdialog.h \
   15.10  	api.h \
   15.11  	branchobj.h \
   15.12 +	editxlinkdialog.h \
   15.13  	exportoofiledialog.h \
   15.14 +	exportxhtmldialog.h\
   15.15  	exports.h \
   15.16 +	extrainfodialog.h \
   15.17  	file.h \
   15.18  	findwindow.h \
   15.19  	flagobj.h \
   15.20 @@ -28,6 +32,7 @@
   15.21  	mapobj.h \
   15.22  	misc.h \
   15.23  	noteobj.h \
   15.24 +	options.h \
   15.25  	ornamentedobj.h \
   15.26  	process.h \
   15.27  	showtextdialog.h\
   15.28 @@ -37,13 +42,17 @@
   15.29  	xml.h \
   15.30  	xsltproc.h \
   15.31  	settings.h \
   15.32 -	options.h
   15.33 +	warningdialog.h
   15.34  
   15.35 -SOURCES	+= aboutdialog.cpp \
   15.36 +SOURCES	+= \
   15.37 +	aboutdialog.cpp \
   15.38  	api.cpp \
   15.39  	branchobj.cpp \
   15.40 +	editxlinkdialog.cpp \
   15.41  	exportoofiledialog.cpp \
   15.42  	exports.cpp \
   15.43 +	exportxhtmldialog.cpp \
   15.44 +	extrainfodialog.cpp \
   15.45  	file.cpp \
   15.46  	findwindow.cpp \
   15.47  	flagobj.cpp \
   15.48 @@ -64,6 +73,7 @@
   15.49  	mapobj.cpp \
   15.50  	misc.cpp \
   15.51  	noteobj.cpp \
   15.52 +	options.cpp \
   15.53  	ornamentedobj.cpp \
   15.54  	process.cpp \
   15.55  	showtextdialog.cpp \
   15.56 @@ -72,20 +82,18 @@
   15.57  	xml.cpp \
   15.58  	xsltproc.cpp \
   15.59  	settings.cpp \
   15.60 -	options.cpp
   15.61 +	warningdialog.cpp 
   15.62  
   15.63 -#The following line was inserted by qt3to4, use "FORMS" later
   15.64 -FORMS3	= exportxhtmldialog.ui \
   15.65 +FORMS = \
   15.66 +	exportxhtmldialog.ui \
   15.67  	extrainfodialog.ui \
   15.68  	editxlinkdialog.ui \
   15.69 +	historywindow.ui \
   15.70 +	showtextdialog.ui \
   15.71  	warningdialog.ui
   15.72  
   15.73 -FORMS = historywindow.ui \
   15.74 -	showtextdialog.ui
   15.75 -
   15.76  #The following lines were inserted by qt3to4
   15.77  QT += xml  
   15.78 -CONFIG += uic3
   15.79  
   15.80  TARGET  = vym
   15.81  TRANSLATIONS += lang/vym_de.ts
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/warningdialog.cpp	Thu Sep 14 11:38:18 2006 +0000
    16.3 @@ -0,0 +1,45 @@
    16.4 +#include "warningdialog.h"
    16.5 +
    16.6 +extern QString iconPath;
    16.7 +
    16.8 +WarningDialog::WarningDialog(QWidget* parent):QDialog (parent)
    16.9 +{
   16.10 +    ui.setupUi(this);
   16.11 +	//FIXME proper icon needed
   16.12 +	ui.okButton->setText(tr("Proceed"));
   16.13 +	/*
   16.14 +	ui.warningSign->setPixmap (QPixmap(iconPath + "icons/vym.png"));
   16.15 +	ui.showAgainBox->setText (tr("Show this message again"));
   16.16 +	*/
   16.17 +	useShowAgain=false;
   16.18 +	ui.showAgainBox->hide();
   16.19 +}
   16.20 +
   16.21 +void WarningDialog::showCancelButton (bool b)
   16.22 +{
   16.23 +	if (b)
   16.24 +	{
   16.25 +		ui.cancelButton->show();
   16.26 +		ui.cancelButton->setText(tr("Cancel"));
   16.27 +	} else
   16.28 +		ui.cancelButton->hide();
   16.29 +}
   16.30 +
   16.31 +void WarningDialog::setShowAgainName (const QString &s)
   16.32 +{
   16.33 +/*
   16.34 +	showAgainName=s;
   16.35 +	useShowAgain=true;
   16.36 +	ui.showAgainBox->show();
   16.37 +*/	
   16.38 +}
   16.39 +
   16.40 +void WarningDialog::setText (const QString &s)
   16.41 +{
   16.42 +	ui.warningTE->setText(s);
   16.43 +}
   16.44 +
   16.45 +void WarningDialog::setCaption(const QString &s)
   16.46 +{
   16.47 +	setCaption("VYM - "+s);
   16.48 +}
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/warningdialog.h	Thu Sep 14 11:38:18 2006 +0000
    17.3 @@ -0,0 +1,27 @@
    17.4 +#ifndef WARNINGDIALOG_H
    17.5 +#define WARNINGDIALOG_H
    17.6 +
    17.7 +#include "ui_warningdialog.h"
    17.8 +
    17.9 +class WarningDialog : public QDialog
   17.10 +{
   17.11 +    Q_OBJECT
   17.12 +
   17.13 +public:
   17.14 +    WarningDialog(QWidget* parent = 0);
   17.15 +
   17.16 +public slots:
   17.17 +    virtual void showCancelButton( bool b );
   17.18 +    virtual void setShowAgainName( const QString & s );
   17.19 +    virtual void setText( const QString & s );
   17.20 +    virtual void setCaption( const QString & s );
   17.21 +
   17.22 +private:
   17.23 +    void init();
   17.24 +    bool useShowAgain;
   17.25 +    QString showAgainName;
   17.26 +	Ui::WarningDialog ui;
   17.27 +
   17.28 +};
   17.29 +
   17.30 +#endif // WARNINGDIALOG_H
    18.1 --- a/warningdialog.ui	Thu Sep 14 11:38:17 2006 +0000
    18.2 +++ b/warningdialog.ui	Thu Sep 14 11:38:18 2006 +0000
    18.3 @@ -1,231 +1,140 @@
    18.4 -<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
    18.5 -<class>WarningDialog</class>
    18.6 -<widget class="QDialog">
    18.7 -    <property name="name">
    18.8 -        <cstring>WarningDialog</cstring>
    18.9 -    </property>
   18.10 -    <property name="geometry">
   18.11 -        <rect>
   18.12 -            <x>0</x>
   18.13 -            <y>0</y>
   18.14 -            <width>350</width>
   18.15 -            <height>181</height>
   18.16 -        </rect>
   18.17 -    </property>
   18.18 -    <property name="caption">
   18.19 -        <string>VYM - Warning : Foo...</string>
   18.20 -    </property>
   18.21 -    <vbox>
   18.22 -        <property name="name">
   18.23 -            <cstring>unnamed</cstring>
   18.24 -        </property>
   18.25 -        <widget class="QLayoutWidget">
   18.26 -            <property name="name">
   18.27 -                <cstring>layout6</cstring>
   18.28 -            </property>
   18.29 -            <hbox>
   18.30 -                <property name="name">
   18.31 -                    <cstring>unnamed</cstring>
   18.32 -                </property>
   18.33 -                <widget class="QLabel">
   18.34 -                    <property name="name">
   18.35 -                        <cstring>warningSign</cstring>
   18.36 -                    </property>
   18.37 -                    <property name="scaledContents">
   18.38 -                        <bool>true</bool>
   18.39 -                    </property>
   18.40 -                </widget>
   18.41 -                <widget class="QLabel">
   18.42 -                    <property name="name">
   18.43 -                        <cstring>textLabel</cstring>
   18.44 -                    </property>
   18.45 -                    <property name="text">
   18.46 -                        <string>textLabel</string>
   18.47 -                    </property>
   18.48 -                </widget>
   18.49 -                <spacer>
   18.50 -                    <property name="name">
   18.51 -                        <cstring>spacer6</cstring>
   18.52 -                    </property>
   18.53 -                    <property name="orientation">
   18.54 -                        <enum>Horizontal</enum>
   18.55 -                    </property>
   18.56 -                    <property name="sizeType">
   18.57 -                        <enum>Expanding</enum>
   18.58 -                    </property>
   18.59 -                    <property name="sizeHint">
   18.60 -                        <size>
   18.61 -                            <width>160</width>
   18.62 -                            <height>31</height>
   18.63 -                        </size>
   18.64 -                    </property>
   18.65 -                </spacer>
   18.66 -            </hbox>
   18.67 -        </widget>
   18.68 -        <spacer>
   18.69 -            <property name="name">
   18.70 -                <cstring>spacer7</cstring>
   18.71 -            </property>
   18.72 -            <property name="orientation">
   18.73 -                <enum>Vertical</enum>
   18.74 -            </property>
   18.75 -            <property name="sizeType">
   18.76 -                <enum>Expanding</enum>
   18.77 -            </property>
   18.78 -            <property name="sizeHint">
   18.79 -                <size>
   18.80 -                    <width>21</width>
   18.81 -                    <height>20</height>
   18.82 -                </size>
   18.83 -            </property>
   18.84 -        </spacer>
   18.85 -        <widget class="QLayoutWidget">
   18.86 -            <property name="name">
   18.87 -                <cstring>layout4</cstring>
   18.88 -            </property>
   18.89 -            <hbox>
   18.90 -                <property name="name">
   18.91 -                    <cstring>unnamed</cstring>
   18.92 -                </property>
   18.93 -                <spacer>
   18.94 -                    <property name="name">
   18.95 -                        <cstring>spacer3</cstring>
   18.96 -                    </property>
   18.97 -                    <property name="orientation">
   18.98 -                        <enum>Horizontal</enum>
   18.99 -                    </property>
  18.100 -                    <property name="sizeType">
  18.101 -                        <enum>Expanding</enum>
  18.102 -                    </property>
  18.103 -                    <property name="sizeHint">
  18.104 -                        <size>
  18.105 -                            <width>61</width>
  18.106 -                            <height>20</height>
  18.107 -                        </size>
  18.108 -                    </property>
  18.109 -                </spacer>
  18.110 -                <widget class="QCheckBox">
  18.111 -                    <property name="name">
  18.112 -                        <cstring>showAgainBox</cstring>
  18.113 -                    </property>
  18.114 -                    <property name="text">
  18.115 -                        <string>showAgainBox</string>
  18.116 -                    </property>
  18.117 -                    <property name="checked">
  18.118 -                        <bool>true</bool>
  18.119 -                    </property>
  18.120 -                </widget>
  18.121 -                <spacer>
  18.122 -                    <property name="name">
  18.123 -                        <cstring>spacer4</cstring>
  18.124 -                    </property>
  18.125 -                    <property name="orientation">
  18.126 -                        <enum>Horizontal</enum>
  18.127 -                    </property>
  18.128 -                    <property name="sizeType">
  18.129 -                        <enum>Expanding</enum>
  18.130 -                    </property>
  18.131 -                    <property name="sizeHint">
  18.132 -                        <size>
  18.133 -                            <width>51</width>
  18.134 -                            <height>21</height>
  18.135 -                        </size>
  18.136 -                    </property>
  18.137 -                </spacer>
  18.138 -            </hbox>
  18.139 -        </widget>
  18.140 -        <spacer>
  18.141 -            <property name="name">
  18.142 -                <cstring>spacer5</cstring>
  18.143 -            </property>
  18.144 -            <property name="orientation">
  18.145 -                <enum>Vertical</enum>
  18.146 -            </property>
  18.147 -            <property name="sizeType">
  18.148 -                <enum>Expanding</enum>
  18.149 -            </property>
  18.150 -            <property name="sizeHint">
  18.151 -                <size>
  18.152 -                    <width>21</width>
  18.153 -                    <height>20</height>
  18.154 -                </size>
  18.155 -            </property>
  18.156 -        </spacer>
  18.157 -        <widget class="QLayoutWidget">
  18.158 -            <property name="name">
  18.159 -                <cstring>layout3</cstring>
  18.160 -            </property>
  18.161 -            <hbox>
  18.162 -                <property name="name">
  18.163 -                    <cstring>unnamed</cstring>
  18.164 -                </property>
  18.165 -                <spacer>
  18.166 -                    <property name="name">
  18.167 -                        <cstring>spacer2</cstring>
  18.168 -                    </property>
  18.169 -                    <property name="orientation">
  18.170 -                        <enum>Horizontal</enum>
  18.171 -                    </property>
  18.172 -                    <property name="sizeType">
  18.173 -                        <enum>Expanding</enum>
  18.174 -                    </property>
  18.175 -                    <property name="sizeHint">
  18.176 -                        <size>
  18.177 -                            <width>161</width>
  18.178 -                            <height>31</height>
  18.179 -                        </size>
  18.180 -                    </property>
  18.181 -                </spacer>
  18.182 -                <widget class="QPushButton">
  18.183 -                    <property name="name">
  18.184 -                        <cstring>cancelButton</cstring>
  18.185 -                    </property>
  18.186 -                    <property name="text">
  18.187 -                        <string>Cancel</string>
  18.188 -                    </property>
  18.189 -                </widget>
  18.190 -                <widget class="QPushButton">
  18.191 -                    <property name="name">
  18.192 -                        <cstring>okButton</cstring>
  18.193 -                    </property>
  18.194 -                    <property name="text">
  18.195 -                        <string>Ok</string>
  18.196 -                    </property>
  18.197 -                </widget>
  18.198 -            </hbox>
  18.199 -        </widget>
  18.200 -    </vbox>
  18.201 -</widget>
  18.202 -<connections>
  18.203 -    <connection>
  18.204 -        <sender>okButton</sender>
  18.205 -        <signal>clicked()</signal>
  18.206 -        <receiver>WarningDialog</receiver>
  18.207 -        <slot>accept()</slot>
  18.208 -    </connection>
  18.209 -    <connection>
  18.210 -        <sender>cancelButton</sender>
  18.211 -        <signal>clicked()</signal>
  18.212 -        <receiver>WarningDialog</receiver>
  18.213 -        <slot>reject()</slot>
  18.214 -    </connection>
  18.215 -</connections>
  18.216 -<includes>
  18.217 -    <include location="local" impldecl="in implementation">warningdialog.ui.h</include>
  18.218 -</includes>
  18.219 -<variables>
  18.220 -    <variable>bool useShowAgain;</variable>
  18.221 -    <variable>QString showAgainName;</variable>
  18.222 -</variables>
  18.223 -<slots>
  18.224 -    <slot>setCancelButton( bool b )</slot>
  18.225 -    <slot>setShowAgainName( const QString &amp; s )</slot>
  18.226 -    <slot>setText( const QString &amp; s )</slot>
  18.227 -    <slot>setCaption( const QString &amp; s )</slot>
  18.228 -</slots>
  18.229 -<functions>
  18.230 -    <function access="private" specifier="non virtual">init()</function>
  18.231 -</functions>
  18.232 -<pixmapinproject/>
  18.233 -<layoutdefaults spacing="6" margin="11"/>
  18.234 -</UI>
  18.235 +<ui version="4.0" >
  18.236 + <author></author>
  18.237 + <comment></comment>
  18.238 + <exportmacro></exportmacro>
  18.239 + <class>WarningDialog</class>
  18.240 + <widget class="QDialog" name="WarningDialog" >
  18.241 +  <property name="geometry" >
  18.242 +   <rect>
  18.243 +    <x>0</x>
  18.244 +    <y>0</y>
  18.245 +    <width>543</width>
  18.246 +    <height>264</height>
  18.247 +   </rect>
  18.248 +  </property>
  18.249 +  <property name="windowTitle" >
  18.250 +   <string>VYM - Warning : Foo...</string>
  18.251 +  </property>
  18.252 +  <layout class="QVBoxLayout" >
  18.253 +   <property name="margin" >
  18.254 +    <number>9</number>
  18.255 +   </property>
  18.256 +   <property name="spacing" >
  18.257 +    <number>6</number>
  18.258 +   </property>
  18.259 +   <item>
  18.260 +    <widget class="QTextEdit" name="warningTE" />
  18.261 +   </item>
  18.262 +   <item>
  18.263 +    <widget class="QLabel" name="warningSign" >
  18.264 +     <property name="text" >
  18.265 +      <string/>
  18.266 +     </property>
  18.267 +    </widget>
  18.268 +   </item>
  18.269 +   <item>
  18.270 +    <spacer>
  18.271 +     <property name="orientation" >
  18.272 +      <enum>Qt::Vertical</enum>
  18.273 +     </property>
  18.274 +     <property name="sizeType" >
  18.275 +      <enum>QSizePolicy::Expanding</enum>
  18.276 +     </property>
  18.277 +     <property name="sizeHint" >
  18.278 +      <size>
  18.279 +       <width>512</width>
  18.280 +       <height>16</height>
  18.281 +      </size>
  18.282 +     </property>
  18.283 +    </spacer>
  18.284 +   </item>
  18.285 +   <item>
  18.286 +    <layout class="QHBoxLayout" >
  18.287 +     <property name="margin" >
  18.288 +      <number>0</number>
  18.289 +     </property>
  18.290 +     <property name="spacing" >
  18.291 +      <number>6</number>
  18.292 +     </property>
  18.293 +     <item>
  18.294 +      <widget class="QCheckBox" name="showAgainBox" >
  18.295 +       <property name="text" >
  18.296 +        <string>showAgainBox</string>
  18.297 +       </property>
  18.298 +       <property name="checked" >
  18.299 +        <bool>true</bool>
  18.300 +       </property>
  18.301 +      </widget>
  18.302 +     </item>
  18.303 +     <item>
  18.304 +      <spacer>
  18.305 +       <property name="orientation" >
  18.306 +        <enum>Qt::Horizontal</enum>
  18.307 +       </property>
  18.308 +       <property name="sizeType" >
  18.309 +        <enum>QSizePolicy::Expanding</enum>
  18.310 +       </property>
  18.311 +       <property name="sizeHint" >
  18.312 +        <size>
  18.313 +         <width>73</width>
  18.314 +         <height>31</height>
  18.315 +        </size>
  18.316 +       </property>
  18.317 +      </spacer>
  18.318 +     </item>
  18.319 +     <item>
  18.320 +      <widget class="QPushButton" name="cancelButton" >
  18.321 +       <property name="text" >
  18.322 +        <string>Cancel</string>
  18.323 +       </property>
  18.324 +      </widget>
  18.325 +     </item>
  18.326 +     <item>
  18.327 +      <widget class="QPushButton" name="okButton" >
  18.328 +       <property name="text" >
  18.329 +        <string>Ok</string>
  18.330 +       </property>
  18.331 +      </widget>
  18.332 +     </item>
  18.333 +    </layout>
  18.334 +   </item>
  18.335 +  </layout>
  18.336 + </widget>
  18.337 + <layoutdefault spacing="6" margin="11" />
  18.338 + <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
  18.339 + <resources/>
  18.340 + <connections>
  18.341 +  <connection>
  18.342 +   <sender>cancelButton</sender>
  18.343 +   <signal>clicked()</signal>
  18.344 +   <receiver>WarningDialog</receiver>
  18.345 +   <slot>reject()</slot>
  18.346 +   <hints>
  18.347 +    <hint type="sourcelabel" >
  18.348 +     <x>131</x>
  18.349 +     <y>244</y>
  18.350 +    </hint>
  18.351 +    <hint type="destinationlabel" >
  18.352 +     <x>266</x>
  18.353 +     <y>135</y>
  18.354 +    </hint>
  18.355 +   </hints>
  18.356 +  </connection>
  18.357 +  <connection>
  18.358 +   <sender>okButton</sender>
  18.359 +   <signal>clicked()</signal>
  18.360 +   <receiver>WarningDialog</receiver>
  18.361 +   <slot>accept()</slot>
  18.362 +   <hints>
  18.363 +    <hint type="sourcelabel" >
  18.364 +     <x>222</x>
  18.365 +     <y>244</y>
  18.366 +    </hint>
  18.367 +    <hint type="destinationlabel" >
  18.368 +     <x>266</x>
  18.369 +     <y>135</y>
  18.370 +    </hint>
  18.371 +   </hints>
  18.372 +  </connection>
  18.373 + </connections>
  18.374 +</ui>
    19.1 --- a/warningdialog.ui.h	Thu Sep 14 11:38:17 2006 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,50 +0,0 @@
    19.4 -//Added by qt3to4:
    19.5 -#include <QPixmap>
    19.6 -/****************************************************************************
    19.7 -** ui.h extension file, included from the uic-generated form implementation.
    19.8 -**
    19.9 -** If you want to add, delete, or rename functions or slots, use
   19.10 -** Qt Designer to update this file, preserving your code.
   19.11 -**
   19.12 -** You should not define a constructor or destructor in this file.
   19.13 -** Instead, write your code in functions called init() and destroy().
   19.14 -** These will automatically be called by the form's constructor and
   19.15 -** destructor.
   19.16 -*****************************************************************************/
   19.17 -
   19.18 -void WarningDialog::init()
   19.19 -{
   19.20 -	warningSign->setPixmap (QPixmap("icons/vym.png"));
   19.21 -	setCancelButton (false);
   19.22 -	okButton->setText(tr("Proceed"));
   19.23 -	showAgainBox->setText (tr("Show this message again"));
   19.24 -	useShowAgain=false;
   19.25 -	showAgainBox->hide();
   19.26 -}
   19.27 -
   19.28 -void WarningDialog::setCancelButton (bool b)
   19.29 -{
   19.30 -	if (b)
   19.31 -	{
   19.32 -		cancelButton->show();
   19.33 -		cancelButton->setText(tr("Cancel"));
   19.34 -	} else
   19.35 -		cancelButton->hide();
   19.36 -}
   19.37 -
   19.38 -void WarningDialog::setShowAgainName (const QString &s)
   19.39 -{
   19.40 -	showAgainName=s;
   19.41 -	useShowAgain=true;
   19.42 -	showAgainBox->show();
   19.43 -}
   19.44 -
   19.45 -void WarningDialog::setText (const QString &s)
   19.46 -{
   19.47 -	textLabel->setText(s);
   19.48 -}
   19.49 -
   19.50 -void WarningDialog::setCaption(const QString &s)
   19.51 -{
   19.52 -	QDialog::setCaption("VYM - "+s);
   19.53 -}
    20.1 --- a/xml.cpp	Thu Sep 14 11:38:17 2006 +0000
    20.2 +++ b/xml.cpp	Thu Sep 14 11:38:18 2006 +0000
    20.3 @@ -463,6 +463,21 @@
    20.4  	{
    20.5  		bool okx,oky;
    20.6  		int x,y;
    20.7 +		if (!a.value( "relPosX").isEmpty() && loadMode==NewMap && branchDepth<2) 
    20.8 +		{
    20.9 +			if (!a.value( "relPosY").isEmpty() ) 
   20.10 +			{
   20.11 +				x=a.value("relPosX").toInt (&okx, 10);
   20.12 +				y=a.value("relPosY").toInt (&oky, 10);
   20.13 +				if (okx && oky  )
   20.14 +				{
   20.15 +					lastOO->setUseRelPos (true);
   20.16 +					lastOO->move2RelPos (x,y);
   20.17 +				}	
   20.18 +				else
   20.19 +					return false;   // Couldn't read relPos
   20.20 +			}           
   20.21 +		}           
   20.22  		if (!a.value( "absPosX").isEmpty() && loadMode==NewMap && branchDepth<2) 
   20.23  		{
   20.24  			if (!a.value( "absPosY").isEmpty() )