More fixes
authorinsilmaril
Fri, 19 Feb 2010 13:47:03 +0000
changeset 8230bba81dde1bc
parent 822 c2ce9944148c
child 824 36eb4b8f409e
More fixes
attributeitem.cpp
attributeitem.h
branchitem.cpp
branchobj.cpp
branchobj.h
bugagent.cpp
bugagent.h
exports.cpp
flag.cpp
flagrow.cpp
floatimageobj.cpp
floatimageobj.h
floatobj.cpp
floatobj.h
linkablemapobj.cpp
linkablemapobj.h
mainwindow.cpp
mainwindow.h
mapeditor.cpp
mapitem.cpp
mapitem.h
tex/vym.changelog
texteditor.cpp
treeitem.cpp
version.h
vym.pro
vymmodel.cpp
vymmodel.h
vymview.cpp
vymview.h
xml-vym.cpp
     1.1 --- a/attributeitem.cpp	Wed Feb 10 13:48:42 2010 +0000
     1.2 +++ b/attributeitem.cpp	Fri Feb 19 13:47:03 2010 +0000
     1.3 @@ -9,10 +9,6 @@
     1.4  AttributeItem::AttributeItem(const QList<QVariant> &data, TreeItem *parent):BranchItem (data,parent)
     1.5  {
     1.6  	TreeItem::setType (Attribute);
     1.7 -	//table=NULL;
     1.8 -	//definition=NULL;
     1.9 -	type=Attribute;
    1.10 -
    1.11  	internal=false;
    1.12  }
    1.13  
    1.14 @@ -20,6 +16,20 @@
    1.15  {
    1.16  }
    1.17  
    1.18 +void AttributeItem::set (const QString &k, const QString &v, const Type &t)
    1.19 +{
    1.20 +	key=k;
    1.21 +	value=QVariant (v);
    1.22 +	setHeading (QString ("K: %1 | V: %2").arg(key).arg(value.toString()));
    1.23 +}
    1.24 +
    1.25 +void AttributeItem::get (QString &k, QString &v, Type &t)
    1.26 +{
    1.27 +	k=key;
    1.28 +	v=value.toString();
    1.29 +	t=attrType;
    1.30 +}
    1.31 +
    1.32  void AttributeItem::setKey (const QString &k, const Type &t)
    1.33  {
    1.34  /*
    1.35 @@ -145,6 +155,16 @@
    1.36  */	
    1.37  }
    1.38  
    1.39 +void AttributeItem::setInternal(bool b)
    1.40 +{
    1.41 +	internal=b;
    1.42 +}
    1.43 +
    1.44 +bool AttributeItem::isInternal()
    1.45 +{
    1.46 +	return internal;
    1.47 +}
    1.48 +
    1.49  QString AttributeItem::getDataXML()
    1.50  {
    1.51  	QString a=beginElement ("attribute");
     2.1 --- a/attributeitem.h	Wed Feb 10 13:48:42 2010 +0000
     2.2 +++ b/attributeitem.h	Fri Feb 19 13:47:03 2010 +0000
     2.3 @@ -11,7 +11,7 @@
     2.4  	A list of these tables AttributeTable is maintained for every MapEditor.
     2.5  */
     2.6  class AttributeItem:public BranchItem {
     2.7 -
     2.8 +public:
     2.9  enum Type {
    2.10  	Undefined,	//!< Undefined type
    2.11  	IntList,	//!< Free integer
    2.12 @@ -21,9 +21,10 @@
    2.13  	UniqueString//!< UniqueString, e.g. for IDs
    2.14  };
    2.15  
    2.16 -public:
    2.17  	AttributeItem(const QList<QVariant> &data, TreeItem *parent = 0);
    2.18  	virtual ~AttributeItem();
    2.19 +	void set (const QString &k, const QString &v, const Type &t);
    2.20 +	void get (QString &k, QString &v, Type &t);
    2.21  	void setKey (const QString &k, const Type &t);
    2.22  	QString getKey ();
    2.23  	void setValue (const QString &v);
    2.24 @@ -31,10 +32,14 @@
    2.25  	void setType (const Type &t);
    2.26  	AttributeItem::Type getAttributeType ();
    2.27  	QString getTypeString ();
    2.28 +	void setInternal (bool b);
    2.29 +	bool isInternal();
    2.30  	QString getDataXML();
    2.31  protected:
    2.32 -	QString freeString;		//!< String value for type FreeString
    2.33  	bool internal;			//!< Internal attributes cannot be edited by user
    2.34 +	QString key;
    2.35 +	QVariant value;
    2.36 +	Type attrType;
    2.37  };
    2.38  
    2.39  #endif
     3.1 --- a/branchitem.cpp	Wed Feb 10 13:48:42 2010 +0000
     3.2 +++ b/branchitem.cpp	Fri Feb 19 13:47:03 2010 +0000
     3.3 @@ -299,28 +299,24 @@
     3.4  	do
     3.5  	{
     3.6  		madeChanges=false;
     3.7 -		if (inverse)
     3.8 -			for(curChildIndex=1;curChildIndex<childCount;curChildIndex++)
     3.9 +		for(curChildIndex=1;curChildIndex<childCount;curChildIndex++)
    3.10 +		{
    3.11 +			BranchItem* curChild =getBranchNum(curChildIndex);
    3.12 +			BranchItem* prevChild=getBranchNum(curChildIndex-1);
    3.13 +			if (inverse)
    3.14  			{
    3.15 -				BranchItem* curChild =getBranchNum(curChildIndex);
    3.16 -				BranchItem* prevChild=getBranchNum(curChildIndex-1);
    3.17  				if (prevChild->getHeading().compare(curChild->getHeading())<0)
    3.18  				{
    3.19  					model->moveUp (curChild);
    3.20  					madeChanges=true;
    3.21  				}	
    3.22 -			} 
    3.23 -		else
    3.24 -			for(curChildIndex=1;curChildIndex<childCount;curChildIndex++)
    3.25 -			{
    3.26 -				BranchItem* curChild =getBranchNum(curChildIndex);
    3.27 -				BranchItem* prevChild=getBranchNum(curChildIndex-1);
    3.28 -				if ( prevChild->getHeading().compare(curChild->getHeading())>0)
    3.29 +			} else	
    3.30 +				if (prevChild->getHeading().compare(curChild->getHeading())>0)
    3.31  				{
    3.32 -					model->moveUp(curChild);
    3.33 +					model->moveUp (curChild);
    3.34  					madeChanges=true;
    3.35  				}	
    3.36 -			}
    3.37 +		} 
    3.38  	}while(madeChanges);
    3.39  }
    3.40  
     4.1 --- a/branchobj.cpp	Wed Feb 10 13:48:42 2010 +0000
     4.2 +++ b/branchobj.cpp	Fri Feb 19 13:47:03 2010 +0000
     4.3 @@ -39,18 +39,6 @@
     4.4  		model->stopAnimation (this);
     4.5  	}
     4.6  
     4.7 -	// Check, if this branch was the last child to be deleted
     4.8 -	// If so, unset the scrolled flags in parent // FIXME-2 better do this in model?
     4.9 -
    4.10 -	/*
    4.11 -	BranchObj *po=(BranchObj*)parObj;
    4.12 -	BranchObj *bo;
    4.13 -	if (po)
    4.14 -	{
    4.15 -		bo=((BranchObj*)parObj)->getLastBranch();
    4.16 -		if (bo) po->unScroll();
    4.17 -	}
    4.18 -	*/
    4.19  	clear();
    4.20  }
    4.21  
    4.22 @@ -465,11 +453,12 @@
    4.23  	heading->setFont(font );
    4.24  
    4.25  	if (mod==NewBranch && !keepFrame)
    4.26 -	if (treeItem->depth()==0)
    4.27 -		setFrameType (FrameObj::Rectangle);
    4.28 -	else	
    4.29 -		setFrameType (FrameObj::NoFrame);
    4.30 -
    4.31 +	{
    4.32 +		if (treeItem->depth()==0)
    4.33 +			setFrameType (FrameObj::Rectangle);
    4.34 +		else	
    4.35 +			setFrameType (FrameObj::NoFrame);
    4.36 +	}
    4.37  	if (mod==NewBranch)
    4.38  		setColor (treeItem->getHeadingColor() );
    4.39  	else
    4.40 @@ -630,31 +619,6 @@
    4.41  		treeItem->getBranchObjNum(i)->unsetAllRepositionRequests();
    4.42  }
    4.43  
    4.44 -
    4.45 -QRectF BranchObj::getTotalBBox() // FIXME-2 not really needed, get rid of this
    4.46 -{
    4.47 -	QRectF r=bbox;
    4.48 -
    4.49 -	if ( ((BranchItem*)treeItem)->isScrolled() ) return r;
    4.50 -
    4.51 -/* FIXME-2 really include children _here_ ?  likely not needed anymore, but done in TreeItem */
    4.52 -	for (int i=0; i<treeItem->branchCount(); ++i)
    4.53 -		if (!treeItem->getBranchNum(i)->isHidden())
    4.54 -			r=addBBox(treeItem->getBranchObjNum(i)->getTotalBBox(),r);
    4.55 -
    4.56 -/* FIXME-3 lots of occurences of treeItem->getBranchObjNum(i) in branchobj.cpp
    4.57 -            better check if they are not NULL and maybe simplify...
    4.58 -			(have been NULL at least in calcBBoxSizeWithChilds...)
    4.59 -*/			
    4.60 -
    4.61 -/* FIXME-2 in
    4.62 -	for (int i=0; i<treeItem->imageCount(); ++i
    4.63 -		if (!treeItem->isHidden())
    4.64 -			r=addBBox(treeItem->getImageObjNum(i)->getTotalBBox(),r);
    4.65 -*/			
    4.66 -	return r;
    4.67 -}
    4.68 -
    4.69  QRectF BranchObj::getBBoxSizeWithChildren()
    4.70  {
    4.71  	return bboxTotal;
    4.72 @@ -678,7 +642,7 @@
    4.73  		return MapObj::getBoundingPolygon();
    4.74  	}
    4.75  
    4.76 -	calcBBoxSizeWithChildren();	//FIXME-2 really needed?
    4.77 +	calcBBoxSizeWithChildren();	//FIXME-3 really needed?
    4.78  	QPolygonF p;
    4.79  	p<<bboxTotal.topLeft();
    4.80  	p<<bboxTotal.topRight();
     5.1 --- a/branchobj.h	Wed Feb 10 13:48:42 2010 +0000
     5.2 +++ b/branchobj.h	Fri Feb 19 13:47:03 2010 +0000
     5.3 @@ -46,7 +46,6 @@
     5.4  	virtual void reposition();
     5.5  	virtual void unsetAllRepositionRequests();
     5.6  
     5.7 -	virtual QRectF getTotalBBox();			// return BBox including children			
     5.8  	virtual QRectF getBBoxSizeWithChildren();	// return size of BBox including children  
     5.9  	virtual ConvexPolygon getBoundingPolygon();
    5.10  	virtual void calcBBoxSizeWithChildren();	// calc size of  BBox including children recursivly
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/bugagent.cpp	Fri Feb 19 13:47:03 2010 +0000
     6.3 @@ -0,0 +1,127 @@
     6.4 +#include "bugagent.h"
     6.5 +
     6.6 +#include "branchitem.h"
     6.7 +#include "mainwindow.h"
     6.8 +#include "vymmodel.h"
     6.9 +
    6.10 +extern Main *mainWindow;
    6.11 +
    6.12 +BugAgent::BugAgent (BranchItem *bi,const QString &bug)
    6.13 +{
    6.14 +	if (!bi) 
    6.15 +	{
    6.16 +		qWarning ("Const BugAgent: bi==NULL");
    6.17 +		return;
    6.18 +	}
    6.19 +	branchID=bi->getID();
    6.20 +	modelID=bi->getModel()->getID();
    6.21 +	bugID=bug;
    6.22 +
    6.23 +	script="test/vym-bug.pl";
    6.24 +
    6.25 +	p=new Process;
    6.26 +
    6.27 +	connect (p, SIGNAL (finished(int,QProcess::ExitStatus) ), 
    6.28 +		this, SLOT (processFinished(int,QProcess::ExitStatus) ));
    6.29 +
    6.30 +	p->start (script,QStringList()<<bugID);
    6.31 +	if (!p->waitForStarted())
    6.32 +	{
    6.33 +		qWarning()<<"BugAgent::getBugzillaData couldn't start "<<script;
    6.34 +		return;
    6.35 +	}	
    6.36 +
    6.37 +	/*
    6.38 +	QString result=getStdout();
    6.39 +	while (result.endsWith("\n")) result.chop(1); 
    6.40 +	//qWarning << QString(result);
    6.41 +	QString err=getErrout();
    6.42 +	if (!err.isEmpty())
    6.43 +	{
    6.44 +		qWarning << "BugAgent::getBugzillaData Error:\n";
    6.45 +		qWarning <<err;
    6.46 +	}
    6.47 +	else if (!result.isEmpty())
    6.48 +	{
    6.49 +		qWarning << "ok\n";
    6.50 +	}
    6.51 +
    6.52 +	*/
    6.53 +}
    6.54 +
    6.55 +BugAgent::~BugAgent ()
    6.56 +{
    6.57 +	delete p;
    6.58 +	qDebug ()<<"dest BugAgent";
    6.59 +}
    6.60 +
    6.61 +void BugAgent::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
    6.62 +{
    6.63 +	if (exitStatus==QProcess::NormalExit)
    6.64 +	{
    6.65 +		VymModel *model=mainWindow->getModel (modelID);
    6.66 +		if (model)
    6.67 +		{
    6.68 +			BranchItem *bi=(BranchItem*)(model->findID (branchID));		
    6.69 +			if (bi)
    6.70 +			{
    6.71 +				QString oldsel=model->getSelectString ();
    6.72 +				model->select (bi);
    6.73 +
    6.74 +				// Now do needed changes:
    6.75 +
    6.76 +				QString result=p->getStdout();
    6.77 +				while (result.endsWith("\n")) result.chop(1); 
    6.78 +				//qWarning() << QString(result);
    6.79 +				QString err=p->getErrout();
    6.80 +				if (!err.isEmpty())
    6.81 +				{
    6.82 +					qWarning() << "VM::BugAgent Error:\n";
    6.83 +					qWarning() <<err;
    6.84 +				}
    6.85 +				else if (!result.isEmpty())
    6.86 +				{
    6.87 +					QString heading,cdate,mdate,state,whiteboard;
    6.88 +					QRegExp re("short_desc:(.*)\n");
    6.89 +					re.setMinimal(true);
    6.90 +					if (re.indexIn (result) !=-1) heading=re.cap(1);
    6.91 +
    6.92 +					re.setPattern ("creation_ts:(.*)\n");
    6.93 +					if (re.indexIn (result) !=-1) cdate=re.cap(1);
    6.94 +
    6.95 +					re.setPattern ("delta_ts:(.*)\n");
    6.96 +					if (re.indexIn (result) !=-1) mdate=re.cap(1);
    6.97 +
    6.98 +					re.setPattern ("bug_status:(.*)\n");
    6.99 +					if (re.indexIn (result) !=-1) state=re.cap(1);
   6.100 +
   6.101 +					re.setPattern ("status_whiteboard:(.*)\n");
   6.102 +					if (re.indexIn (result) !=-1) whiteboard=re.cap(1);
   6.103 +
   6.104 +					model->setHeading (bugID + " - " + heading);
   6.105 +					qDebug() << "VM: heading="<<heading;
   6.106 +					qDebug() << "VM:   cdate="<<cdate;
   6.107 +					qDebug() << "VM:   mdate="<<mdate;
   6.108 +					qDebug() << "VM:   state="<<state;
   6.109 +					qDebug() << "VM:  wboard="<<whiteboard;
   6.110 +					
   6.111 +					//qDebug() <<"VM::getBugzillaData  "<<script<<" returned:\n";
   6.112 +					//qDebug() <<QString(result);
   6.113 +				} else	
   6.114 +					qWarning() << "VM::getBugzillaData "<<script<<"  returned nothing\n";
   6.115 +
   6.116 +
   6.117 +
   6.118 +				// Changes finished
   6.119 +				model->select (oldsel);
   6.120 +			} else
   6.121 +				qWarning ()<<"BugAgent: Found model, but not branch #"<<branchID;
   6.122 +		} else
   6.123 +			qWarning ()<<"BugAgent: Couldn't find model #"<<modelID;
   6.124 +	} else		
   6.125 +		qWarning()<< "BugAgent: Process finished with exitCode="<<exitCode;
   6.126 +	delete (this);
   6.127 +}
   6.128 +
   6.129 +
   6.130 +
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/bugagent.h	Fri Feb 19 13:47:03 2010 +0000
     7.3 @@ -0,0 +1,28 @@
     7.4 +#ifndef BUGAGENT_H
     7.5 +#define BUGAGENT_H
     7.6 +
     7.7 +#include <QObject>
     7.8 +
     7.9 +#include "process.h"
    7.10 +
    7.11 +class BranchItem;
    7.12 +
    7.13 +class BugAgent:public QObject
    7.14 +{
    7.15 +	Q_OBJECT
    7.16 +public:	
    7.17 +	BugAgent (BranchItem *bi,const QString &bug);
    7.18 +	~BugAgent();
    7.19 +
    7.20 +public slots:
    7.21 +	virtual void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
    7.22 +
    7.23 +private:
    7.24 +	uint branchID;
    7.25 +	uint modelID;
    7.26 +	QString bugID;
    7.27 +	QString script;
    7.28 +	Process *p;
    7.29 +};
    7.30 +#endif
    7.31 +
     8.1 --- a/exports.cpp	Wed Feb 10 13:48:42 2010 +0000
     8.2 +++ b/exports.cpp	Fri Feb 19 13:47:03 2010 +0000
     8.3 @@ -519,7 +519,7 @@
     8.4  			s+=QString ("<img src=\"flags/flag-url-16x16.png\">%1</a>").arg(quotemeta(current->getHeading()));
     8.5  			s+="</a>";
     8.6  			
     8.7 -			QRectF fbox=current->getBBoxFlag ("system-url");
     8.8 +			QRectF fbox=current->getBBoxURLFlag ();
     8.9  			if (vis)
    8.10  				imageMap+=QString("  <area shape='rect' coords='%1,%2,%3,%4' href='%5'>\n")
    8.11  					.arg(fbox.left()-offset.x())
     9.1 --- a/flag.cpp	Wed Feb 10 13:48:42 2010 +0000
     9.2 +++ b/flag.cpp	Fri Feb 19 13:47:03 2010 +0000
     9.3 @@ -1,7 +1,6 @@
     9.4  #include "flag.h"
     9.5  
     9.6 -#include <iostream>
     9.7 -using namespace std;
     9.8 +#include <QDebug>
     9.9  
    9.10  /////////////////////////////////////////////////////////////////
    9.11  // Flag
    9.12 @@ -49,7 +48,8 @@
    9.13  
    9.14  void Flag::load (const QString &fn)
    9.15  {
    9.16 -	pixmap.load(fn);
    9.17 +	if (!pixmap.load(fn))
    9.18 +		qDebug()<<"Flag::load failed to load "<<fn;
    9.19  }
    9.20  
    9.21  void Flag::load (const QPixmap &pm)
    10.1 --- a/flagrow.cpp	Wed Feb 10 13:48:42 2010 +0000
    10.2 +++ b/flagrow.cpp	Fri Feb 19 13:47:03 2010 +0000
    10.3 @@ -1,8 +1,7 @@
    10.4 +#include <QDebug>
    10.5 +
    10.6  #include "flagrow.h"
    10.7  
    10.8 -#include <iostream>
    10.9 -using namespace std;
   10.10 -
   10.11  /////////////////////////////////////////////////////////////////
   10.12  // FlagRow
   10.13  /////////////////////////////////////////////////////////////////
   10.14 @@ -47,9 +46,12 @@
   10.15  }
   10.16  
   10.17  
   10.18 -bool FlagRow::isActive (const QString &name)
   10.19 +bool FlagRow::isActive (const QString &name)	//FIXME-2 regression
   10.20  {
   10.21 -	return activeNames.contains (name);
   10.22 +	QString n;
   10.23 +	foreach (n,activeNames)
   10.24 +		if (n==name) return true;
   10.25 +	return false;	
   10.26  }
   10.27  
   10.28  void FlagRow::toggle (const QString &name, FlagRow *masterRow)
   10.29 @@ -76,14 +78,14 @@
   10.30  
   10.31  void FlagRow::activate (const QString &name)
   10.32  {
   10.33 -	if (!activeNames.contains (name))
   10.34 +	if (!isActive (name))
   10.35  		activeNames.append (name);
   10.36  	else
   10.37  		qWarning (QString("FlagRow::activate - %1 is already active").arg(name));
   10.38  }
   10.39  
   10.40  
   10.41 -void FlagRow::deactivate (const QString &name)
   10.42 +void FlagRow::deactivate (const QString &name)	//FIXME-4 complaints if CTRL-E is pressed with focus on NoteEditor ?!
   10.43  {
   10.44  	int n=activeNames.indexOf (name);
   10.45  	if (n>=0)
   10.46 @@ -142,23 +144,22 @@
   10.47  
   10.48  void FlagRow::setMasterRow (FlagRow *row)
   10.49  {
   10.50 -	masterRow=row;
   10.51 +	masterRow=row; 
   10.52  }
   10.53  
   10.54  void FlagRow::updateToolBar (const QStringList &activeNames)
   10.55  {
   10.56  	if (toolBar )
   10.57  	{
   10.58 -		if (activeNames.isEmpty() )
   10.59 -			for (int i=0;i<flags.size();++i)
   10.60 -				flags.at(i)->getAction()->setChecked (false);
   10.61 -		else		
   10.62 -			for (int i=0;i<flags.size();++i)
   10.63 -				flags.at(i)->getAction()->setChecked (
   10.64 -					activeNames.contains (flags.at(i)->getName()));
   10.65 +		for (int i=0;i<flags.size();++i)
   10.66 +			flags.at(i)->getAction()->setChecked (false);
   10.67 +		for (int i=0;i<flags.size();++i)
   10.68 +		{
   10.69 +			int n=activeNames.indexOf (flags.at(i)->getName());
   10.70 +			if (n>=0)
   10.71 +				flags.at(i)->getAction()->setChecked (true);	
   10.72 +		}
   10.73  	}
   10.74 -	return;
   10.75 -		
   10.76  }
   10.77  
   10.78  
    11.1 --- a/floatimageobj.cpp	Wed Feb 10 13:48:42 2010 +0000
    11.2 +++ b/floatimageobj.cpp	Fri Feb 19 13:47:03 2010 +0000
    11.3 @@ -8,15 +8,6 @@
    11.4  // FloatImageObj
    11.5  /////////////////////////////////////////////////////////////////
    11.6  
    11.7 -/* FIXME-3
    11.8 -FloatImageObj::FloatImageObj ():FloatObj()
    11.9 -{
   11.10 -//    cout << "Const FloatImageObj ()\n";
   11.11 -    setParObj (this);	
   11.12 -    init();
   11.13 -}
   11.14 -*/
   11.15 -
   11.16  FloatImageObj::FloatImageObj (QGraphicsScene* s,TreeItem *ti):FloatObj(s,ti)
   11.17  {
   11.18     //cout << "Const FloatImageObj s="<<s<<"  ti="<<ti<<endl;
   11.19 @@ -24,14 +15,6 @@
   11.20      init();
   11.21  }
   11.22  
   11.23 -/* FIXME-3 needed
   11.24 -FloatImageObj::FloatImageObj (QGraphicsScene *s, OrnamentedObj* p):FloatObj(s,p)
   11.25 -{
   11.26 - //   cout << "Const FloatImageObj (c,p)\n";
   11.27 -    init();
   11.28 -}
   11.29 -*/
   11.30 -
   11.31  FloatImageObj::~FloatImageObj ()
   11.32  {
   11.33  //	cout << "Destr FloatImageObj "<<this<<"\n";
   11.34 @@ -154,11 +137,6 @@
   11.35  	// TODO
   11.36  }
   11.37  
   11.38 -QRectF FloatImageObj::getTotalBBox()
   11.39 -{
   11.40 -	return bbox;
   11.41 -}
   11.42 -
   11.43  QRectF FloatImageObj::getBBoxSizeWithChildren()
   11.44  {
   11.45  	//TODO abstract in linkablemapobj.h, not calculated
    12.1 --- a/floatimageobj.h	Wed Feb 10 13:48:42 2010 +0000
    12.2 +++ b/floatimageobj.h	Fri Feb 19 13:47:03 2010 +0000
    12.3 @@ -12,9 +12,7 @@
    12.4  /////////////////////////////////////////////////////////////////////////////
    12.5  class FloatImageObj:public FloatObj {
    12.6  public:
    12.7 -    //FIXME-3 FloatImageObj ();
    12.8      FloatImageObj (QGraphicsScene*,TreeItem *ti=NULL);
    12.9 -    //FIXME-3 FloatImageObj (QGraphicsScene*, OrnamentedObj* parent);
   12.10      ~FloatImageObj ();
   12.11      virtual void init ();
   12.12      virtual void copy (FloatImageObj*);
   12.13 @@ -31,7 +29,6 @@
   12.14      virtual void move (QPointF);
   12.15  	virtual void positionBBox();
   12.16  	virtual void calcBBoxSize();
   12.17 -	virtual QRectF getTotalBBox();			// return BBox including children			
   12.18  	virtual QRectF getBBoxSizeWithChildren();	// return size of BBox including children  
   12.19  	virtual void calcBBoxSizeWithChildren();	// calc size of  BBox including children recursivly
   12.20  
    13.1 --- a/floatobj.cpp	Wed Feb 10 13:48:42 2010 +0000
    13.2 +++ b/floatobj.cpp	Fri Feb 19 13:47:03 2010 +0000
    13.3 @@ -1,7 +1,5 @@
    13.4  #include "floatobj.h"
    13.5 -
    13.6 -#include <iostream>
    13.7 -using namespace std;
    13.8 +#include "mapitem.h"
    13.9  
   13.10  /////////////////////////////////////////////////////////////////
   13.11  // FloatObj
   13.12 @@ -19,13 +17,11 @@
   13.13  //   cout << "Destr FloatObj\n";
   13.14  }
   13.15  
   13.16 -#include <iostream>
   13.17 -using namespace std;
   13.18  void FloatObj::init () 
   13.19  {
   13.20  	zPlane=Z_ICON;
   13.21  	setLinkStyle (LinkableMapObj::Parabel);
   13.22 -	//FIXME-2 setHideLinkUnselected(true);
   13.23 +	((MapItem*)treeItem)->setHideLinkUnselected(true);
   13.24  }
   13.25  
   13.26  void FloatObj::copy (FloatObj* other)
   13.27 @@ -66,11 +62,6 @@
   13.28  	updateLinkGeometry();	
   13.29  }
   13.30  
   13.31 -QRectF FloatObj::getTotalBBox()
   13.32 -{
   13.33 -	return bbox;
   13.34 -}
   13.35 -
   13.36  QRectF FloatObj::getBBoxSizeWithChildren()
   13.37  {
   13.38  	return bboxTotal;
    14.1 --- a/floatobj.h	Wed Feb 10 13:48:42 2010 +0000
    14.2 +++ b/floatobj.h	Fri Feb 19 13:47:03 2010 +0000
    14.3 @@ -22,7 +22,6 @@
    14.4  	virtual void setDockPos();
    14.5  	virtual void reposition();
    14.6  											
    14.7 -	virtual QRectF getTotalBBox();			// return BBox including children			
    14.8  	virtual QRectF getBBoxSizeWithChildren();	// return size of BBox including children  
    14.9  
   14.10  protected:
    15.1 --- a/linkablemapobj.cpp	Wed Feb 10 13:48:42 2010 +0000
    15.2 +++ b/linkablemapobj.cpp	Fri Feb 19 13:47:03 2010 +0000
    15.3 @@ -272,12 +272,6 @@
    15.4  	return style;
    15.5  }
    15.6  
    15.7 -void LinkableMapObj::setHideLinkUnselected()
    15.8 -{
    15.9 -	setVisibility (visible);
   15.10 -	updateLinkGeometry();
   15.11 -}
   15.12 -
   15.13  void LinkableMapObj::setLinkPos(Position lp)
   15.14  {
   15.15  	linkpos=lp;
    16.1 --- a/linkablemapobj.h	Wed Feb 10 13:48:42 2010 +0000
    16.2 +++ b/linkablemapobj.h	Fri Feb 19 13:47:03 2010 +0000
    16.3 @@ -73,7 +73,6 @@
    16.4      void setLinkStyle(Style);            
    16.5  	Style getLinkStyle();
    16.6  
    16.7 -	void setHideLinkUnselected();
    16.8  	void setLinkPos (Position);
    16.9  	Position getLinkPos ();
   16.10  
    17.1 --- a/mainwindow.cpp	Wed Feb 10 13:48:42 2010 +0000
    17.2 +++ b/mainwindow.cpp	Fri Feb 19 13:47:03 2010 +0000
    17.3 @@ -1133,6 +1133,15 @@
    17.4  	connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
    17.5  	actionViewToggleNoteEditor=a;
    17.6  
    17.7 +	a = new QAction(QPixmap(), tr( "Show tree editor","View action" ),this);
    17.8 +	a->setStatusTip ( tr( "Show tree editor" ));
    17.9 +	a->setShortcut ( Qt::CTRL + Qt::Key_T );	// Toggle Note Editor // FIXME-3 originally: color subtree
   17.10 +	a->setToggleAction(true);
   17.11 +	a->addTo( tb );
   17.12 +	viewMenu->addAction (a);
   17.13 +	connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleTreeEditor() ) );
   17.14 +	actionViewToggleTreeEditor=a;
   17.15 +
   17.16  	a = new QAction(QPixmap(iconPath+"history.png"),  tr( "History Window","View action" ),this );
   17.17  	a->setStatusTip ( tr( "Show History Window" ));
   17.18  	a->setShortcut ( Qt::CTRL + Qt::Key_H  );	// Toggle history window
   17.19 @@ -1220,22 +1229,25 @@
   17.20  	Flag *flag=new Flag;;
   17.21  	flag->setVisible(true);
   17.22  
   17.23 -	flag->load(QPixmap(flagsPath+"flag-note.png"));
   17.24 +	flag->load(flagsPath+"flag-note.png");
   17.25  	setupFlag (flag,tb,"system-note",tr("Note","SystemFlag"));
   17.26  
   17.27 -	flag->load(QPixmap(flagsPath+"flag-url.png"));
   17.28 +	flag->load(flagsPath+"flag-url.png");
   17.29  	setupFlag (flag,tb,"system-url",tr("URL to Document ","SystemFlag"));
   17.30  
   17.31 -	flag->load(QPixmap(flagsPath+"flag-vymlink.png"));
   17.32 +	flag->load(flagsPath+"flag-url-bugzilla-novell.png");
   17.33 +	setupFlag (flag,tb,"system-url-bugzilla-novell",tr("URL to Bugzilla ","SystemFlag"));
   17.34 +
   17.35 +	flag->load(flagsPath+"flag-vymlink.png");
   17.36  	setupFlag (flag,tb,"system-vymLink",tr("Link to another vym map","SystemFlag"));
   17.37  
   17.38 -	flag->load(QPixmap(flagsPath+"flag-scrolled-right.png"));
   17.39 +	flag->load(flagsPath+"flag-scrolled-right.png");
   17.40  	setupFlag (flag,tb,"system-scrolledright",tr("subtree is scrolled","SystemFlag"));
   17.41  
   17.42 -	flag->load(QPixmap(flagsPath+"flag-tmpUnscrolled-right.png"));
   17.43 +	flag->load(flagsPath+"flag-tmpUnscrolled-right.png");
   17.44  	setupFlag (flag,tb,"system-tmpUnscrolledRight",tr("subtree is temporary scrolled","SystemFlag"));
   17.45  
   17.46 -	flag->load(QPixmap(flagsPath+"flag-hideexport.png"));
   17.47 +	flag->load(flagsPath+"flag-hideexport.png");
   17.48  	setupFlag (flag,tb,"system-hideInExport",tr("Hide object in exported maps","SystemFlag"));
   17.49  
   17.50  	// Create Standard Flags
   17.51 @@ -1569,13 +1581,13 @@
   17.52  	QAction *a;
   17.53  	a = new QAction( "Test function 1" , this);
   17.54  	a->setStatusTip( "Call test function 1" );
   17.55 -	a->setShortcut (Qt::CTRL + Qt::Key_T);	// Test function 1  //FIXME-2 originally: color subtree
   17.56 +	a->setShortcut (Qt::SHIFT + Qt::Key_T);	// Test function 1  
   17.57  	testMenu->addAction (a);
   17.58  	connect( a, SIGNAL( triggered() ), this, SLOT( testFunction1() ) );
   17.59  
   17.60  	a = new QAction( "Test function 2" , this);
   17.61  	a->setStatusTip( "Call test function 2" );
   17.62 -	a->setShortcut (Qt::SHIFT + Qt::Key_T);		// Test function 2
   17.63 +	a->setShortcut (Qt::ALT + Qt::Key_T);	// Test function 2
   17.64  	testMenu->addAction (a);
   17.65  	connect( a, SIGNAL( triggered() ), this, SLOT( testFunction2() ) );
   17.66  
   17.67 @@ -1788,6 +1800,13 @@
   17.68  	return NULL;	
   17.69  }
   17.70  
   17.71 +VymModel* Main::getModel(uint id) const
   17.72 +{
   17.73 +	if ( tabWidget->currentPage())
   17.74 +		return vymViews.at(tabWidget->currentIndex())->getModel();
   17.75 +	return NULL;	
   17.76 +}
   17.77 +
   17.78  
   17.79  void Main::editorChanged(QWidget *)
   17.80  {
   17.81 @@ -3354,6 +3373,12 @@
   17.82  		windowShowNoteEditor();
   17.83  }
   17.84  
   17.85 +void Main::windowToggleTreeEditor()
   17.86 +{
   17.87 +	if ( tabWidget->currentPage())
   17.88 +		vymViews.at(tabWidget->currentIndex())->toggleTreeEditor();
   17.89 +}
   17.90 +
   17.91  void Main::windowToggleHistory()
   17.92  {
   17.93  	if (historyWindow->isVisible())
   17.94 @@ -3754,65 +3779,26 @@
   17.95  	}
   17.96  }
   17.97  
   17.98 +
   17.99 +#include "attributeitem.h"
  17.100  void Main::testFunction1()
  17.101  {
  17.102 -
  17.103 -	Process p;
  17.104 -	QString script="test/sleep.sh";
  17.105 -	p.start (script);
  17.106 -	if (!p.waitForStarted())
  17.107 +	VymModel *m=currentModel();
  17.108 +	if (!m) return;
  17.109 +
  17.110 +	BranchItem *selbi=m->getSelectedBranch();
  17.111 +	if (selbi)
  17.112  	{
  17.113 -		cout <<"VM::getBugzillaData couldn't start "<<script.toStdString()<<endl;
  17.114 -		return;
  17.115 -	}	
  17.116 -	if (!p.waitForFinished())
  17.117 -	{
  17.118 -		cout <<"VM::getBugzillaData couldn't finish "<<script.toStdString()<<endl;
  17.119 -		return;
  17.120 +		QList<QVariant> cData;
  17.121 +		cData << "new ai" << "undef";
  17.122 +
  17.123 +		AttributeItem *ai=new AttributeItem (cData,selbi);
  17.124 +		ai->set ("Key 1","Val a",AttributeItem::FreeString);
  17.125 +
  17.126 +		m->addAttribute (ai);
  17.127  	}
  17.128 -	//QByteArray result=p.readAll();
  17.129 -	QString result=p.getStdout();
  17.130 -	while (result.endsWith("\n")) result.chop(1); 
  17.131 -	//cout << QString(result).toStdString()<<endl;
  17.132 -	QString err=p.getErrout();
  17.133 -	if (!err.isEmpty())
  17.134 -	{
  17.135 -		cout << "VM::getBugzillaData Error:\n";
  17.136 -		cout <<err.toStdString()<<endl;
  17.137 -	}
  17.138 -	else if (!result.isEmpty())
  17.139 -	{
  17.140 -		cout << "ok\n";
  17.141 -	}	
  17.142 -/*
  17.143 -	int max=100000;
  17.144 -	QProgressDialog p ("testprogress","cancel",0,max,this);
  17.145 -	p.setWindowModality (Qt::WindowModal);
  17.146 -	p.setAutoReset (false);
  17.147 -	p.setAutoClose (false);
  17.148 -	p.show();
  17.149 -	for (int i=0;i<max;i++)
  17.150 -	{
  17.151 -		p.setValue(i);
  17.152 -		if (p.wasCanceled()) break;
  17.153 -	}
  17.154 -
  17.155 -	cout << "Doing it again...\n";
  17.156 -	p.reset();
  17.157 -	p.hide();
  17.158 -	max=max+10;
  17.159 -	p.setRange(0,max);
  17.160 -	p.setValue (0);
  17.161 -	p.show();
  17.162 -	for (int i=0;i<max;i++)
  17.163 -	{
  17.164 -		p.setValue (i);
  17.165 -		if (p.wasCanceled()) break;
  17.166 -	}
  17.167 -	p.setValue (max);
  17.168 -	cout << "Done.\n";
  17.169  	return;
  17.170 -*/
  17.171 +
  17.172  /*
  17.173  	if (!currentMapEditor()) return;
  17.174  	currentMapEditor()->testFunction1();
    18.1 --- a/mainwindow.h	Wed Feb 10 13:48:42 2010 +0000
    18.2 +++ b/mainwindow.h	Fri Feb 19 13:47:03 2010 +0000
    18.3 @@ -73,6 +73,8 @@
    18.4  	void showEvent (QShowEvent * );
    18.5  	MapEditor* currentMapEditor() const;
    18.6  	VymModel* currentModel() const;
    18.7 +public:	
    18.8 +	VymModel* getModel(uint) const;
    18.9      
   18.10  private slots:
   18.11  	void editorChanged(QWidget*);
   18.12 @@ -209,6 +211,7 @@
   18.13  	void settingsToggleAnimation();
   18.14  
   18.15  	void windowToggleNoteEditor();
   18.16 +	void windowToggleTreeEditor();
   18.17  	void windowToggleHistory();
   18.18  	void windowToggleProperty();
   18.19  	void updateHistory(SimpleSettings &);
   18.20 @@ -355,6 +358,7 @@
   18.21  	QAction *actionFormatHideLinkUnselected;
   18.22  
   18.23  	QAction *actionViewToggleNoteEditor;
   18.24 +	QAction *actionViewToggleTreeEditor;
   18.25  	QAction *actionViewToggleHistoryWindow;
   18.26  	QAction *actionViewTogglePropertyWindow;
   18.27  	QAction *actionViewToggleAntiAlias;
    19.1 --- a/mapeditor.cpp	Wed Feb 10 13:48:42 2010 +0000
    19.2 +++ b/mapeditor.cpp	Fri Feb 19 13:47:03 2010 +0000
    19.3 @@ -1,8 +1,6 @@
    19.4  #include "mapeditor.h"
    19.5  
    19.6 -#include <iostream>
    19.7 -#include <cstdlib>
    19.8 -#include <typeinfo>
    19.9 +#include <iostream>	
   19.10  
   19.11  #include <QObject>
   19.12  
   19.13 @@ -89,13 +87,13 @@
   19.14      a = new QAction( "Select left branch", this);
   19.15  	a->setShortcut (Qt::Key_Left );
   19.16  //	a->setShortcutContext (Qt::WindowShortcut);
   19.17 -	a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
   19.18 +//	a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
   19.19  	addAction (a);
   19.20      connect( a, SIGNAL( triggered() ), this, SLOT( cursorLeft() ) );
   19.21  
   19.22      a = new QAction( "Select child branch", this);
   19.23  	a->setShortcut (Qt::Key_Right);
   19.24 -	a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
   19.25 +//	a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
   19.26  	addAction (a);
   19.27      connect( a, SIGNAL( triggered() ), this, SLOT( cursorRight() ) );
   19.28  
   19.29 @@ -940,7 +938,9 @@
   19.30  	editingHeading=false;
   19.31  	lineEdit->releaseKeyboard();
   19.32  	lineEdit->clearFocus();
   19.33 -	model->setHeading (lineEdit->text() );
   19.34 +	QString s=lineEdit->text();
   19.35 +	s.replace (QRegExp ("\\n")," ");	// Don't paste newline chars
   19.36 +	model->setHeading (s);
   19.37  	model->setSelectionBlocked(false);
   19.38  	delete (lineEdit);
   19.39  
   19.40 @@ -1055,7 +1055,7 @@
   19.41  		{
   19.42  			// systemFlag clicked
   19.43  			model->select (lmo);	
   19.44 -			if (foname=="system-url") 
   19.45 +			if (foname.contains("system-url")) 
   19.46  			{
   19.47  				if (e->state() & Qt::ControlModifier)
   19.48  					mainWindow->editOpenURLTab();
    20.1 --- a/mapitem.cpp	Wed Feb 10 13:48:42 2010 +0000
    20.2 +++ b/mapitem.cpp	Fri Feb 19 13:47:03 2010 +0000
    20.3 @@ -3,6 +3,8 @@
    20.4  #include "linkablemapobj.h"
    20.5  #include "ornamentedobj.h"
    20.6  
    20.7 +#include <QDebug>
    20.8 +
    20.9  MapItem::MapItem()
   20.10  {
   20.11  	init();
   20.12 @@ -62,7 +64,12 @@
   20.13  void MapItem::setHideLinkUnselected (bool b)
   20.14  {
   20.15  	hideLinkUnselected=b;
   20.16 -	if (lmo) lmo->setHideLinkUnselected();
   20.17 +	if (lmo) 
   20.18 +	{
   20.19 +		//lmo->setHideLinkUnselected();
   20.20 +		lmo->setVisibility (lmo->isVisibleObj());
   20.21 +		lmo->updateLinkGeometry();
   20.22 +	}	
   20.23  }
   20.24  
   20.25  bool MapItem::getHideLinkUnselected()
   20.26 @@ -104,6 +111,17 @@
   20.27  	return s;
   20.28  }
   20.29  
   20.30 +QRectF MapItem::getBBoxURLFlag ()
   20.31 +{
   20.32 +	QStringList list=systemFlags.activeFlagNames().filter ("system-url");
   20.33 +	if (list.count()>1)
   20.34 +	{
   20.35 +		qWarning()<<"MapItem::getBBoxURLFlag found more than one system-url*";
   20.36 +		return QRectF ();
   20.37 +	}	
   20.38 +	return getBBoxFlag (list.first());
   20.39 +}
   20.40 +
   20.41  QRectF MapItem::getBBoxFlag (const QString &fname)
   20.42  {
   20.43  	if (lmo)
    21.1 --- a/mapitem.h	Wed Feb 10 13:48:42 2010 +0000
    21.2 +++ b/mapitem.h	Fri Feb 19 13:47:03 2010 +0000
    21.3 @@ -54,6 +54,7 @@
    21.4  
    21.5  	virtual QString getMapAttr();	//! Get attributes for saving as XML
    21.6  
    21.7 +	virtual QRectF getBBoxURLFlag();//! get bbox of url flag
    21.8  	virtual QRectF getBBoxFlag   (const QString &fname);	//! get bbox of flag
    21.9  
   21.10  
    22.1 --- a/tex/vym.changelog	Wed Feb 10 13:48:42 2010 +0000
    22.2 +++ b/tex/vym.changelog	Fri Feb 19 13:47:03 2010 +0000
    22.3 @@ -1,3 +1,19 @@
    22.4 +-------------------------------------------------------------------
    22.5 +Fri Feb 19 08:05:02 CET 2010 - vym@insilmaril.de
    22.6 +
    22.7 +- Bugfix: Fixed regression of flags
    22.8 +
    22.9 +-------------------------------------------------------------------
   22.10 +Wed Feb 17 16:31:34 CET 2010 - vym@insilmaril.de
   22.11 +
   22.12 +- Bugfix: When pasting a heading into the LineEdit, newlines are removed
   22.13 +          to avoid broken rendering
   22.14 +
   22.15 +-------------------------------------------------------------------
   22.16 +Wed Feb 17 11:49:09 CET 2010 - vym@insilmaril.de
   22.17 +
   22.18 +- Feature: Novell Bugzilla now has extra flag
   22.19 +
   22.20  -------------------------------------------------------------------
   22.21  Wed Feb 10 14:47:49 CET 2010 - vym@insilmaril.de
   22.22  
    23.1 --- a/texteditor.cpp	Wed Feb 10 13:48:42 2010 +0000
    23.2 +++ b/texteditor.cpp	Fri Feb 19 13:47:03 2010 +0000
    23.3 @@ -521,7 +521,8 @@
    23.4  		// Load note
    23.5  		QFileDialog *fd=new QFileDialog( this);
    23.6  		QStringList types;
    23.7 -		types<< "VYM notes (*.html)" <<
    23.8 +		types<< "Text (*.txt *.html)"<<
    23.9 +			"VYM notes and HTML (*.html)" <<
   23.10  			"ASCII texts (*.txt)" <<
   23.11  			"All filed (*)";
   23.12  		fd->setFilters (types);
    24.1 --- a/treeitem.cpp	Wed Feb 10 13:48:42 2010 +0000
    24.2 +++ b/treeitem.cpp	Fri Feb 19 13:47:03 2010 +0000
    24.3 @@ -52,7 +52,7 @@
    24.4  {
    24.5  	model=NULL;
    24.6  
    24.7 -	// Reset ID  //FIXME-2 compare objID (string), so far only used for xLinks during load/save (Id=selString)
    24.8 +	// Assign ID  
    24.9  	idLast++;
   24.10  	id=idLast;
   24.11  
   24.12 @@ -342,9 +342,26 @@
   24.13  {
   24.14  	url=u;
   24.15  	if (!url.isEmpty())
   24.16 -		systemFlags.activate ("system-url");
   24.17 +	{
   24.18 +		if (url.contains ("bugzilla.novell.com"))
   24.19 +		{
   24.20 +			systemFlags.activate ("system-url-bugzilla-novell");
   24.21 +			if (systemFlags.isActive ("system-url"))
   24.22 +				systemFlags.deactivate ("system-url");
   24.23 +		} else
   24.24 +		{
   24.25 +			systemFlags.activate ("system-url");
   24.26 +			if (systemFlags.isActive ("system-url-bugzilla-novell"))
   24.27 +				systemFlags.deactivate ("system-url-bugzilla-novell");
   24.28 +		}
   24.29 +	}
   24.30  	else
   24.31 -		systemFlags.deactivate ("system-url");
   24.32 +	{
   24.33 +		if (systemFlags.isActive ("system-url"))
   24.34 +			systemFlags.deactivate ("system-url");
   24.35 +		if (systemFlags.isActive ("system-url-bugzilla-novell"))
   24.36 +			systemFlags.deactivate ("system-url-bugzilla-novell");
   24.37 +	}
   24.38  }
   24.39  
   24.40  QString TreeItem::getURL ()
   24.41 @@ -520,14 +537,10 @@
   24.42  
   24.43  TreeItem* TreeItem::findID (const uint &n)
   24.44  {
   24.45 -	if (n>=0 && n<childItems.count() )
   24.46 -	{
   24.47 -		for (int i=0;i<childItems.count(); i++)
   24.48 -			if (n==childItems.at(i)->id)
   24.49 -				return childItems.at(n);
   24.50 -	}
   24.51 -	else
   24.52 -		return NULL;
   24.53 +	for (int i=0;i<childItems.count(); i++)
   24.54 +		if (n==childItems.at(i)->id)
   24.55 +			return childItems.at(n);
   24.56 +	return NULL;
   24.57  }
   24.58  
   24.59  
   24.60 @@ -635,14 +648,14 @@
   24.61  }
   24.62  
   24.63  
   24.64 -void TreeItem::setHideTmp (HideTmpMode mode)  //FIXME-2	update visibility in derived objects
   24.65 +void TreeItem::setHideTmp (HideTmpMode mode)  //FIXME-3	update visibility in derived objects
   24.66  {
   24.67  	if (type==Image || type==Branch || type==MapCenter)
   24.68  //		((ImageItem*)this)->updateVisibility();
   24.69  	{
   24.70  		LinkableMapObj* lmo=((MapItem*)this)->getLMO();
   24.71  
   24.72 -		if (mode==HideExport && (hideExport || hasHiddenExportParent() ) ) // FIXME-2  try to avoid calling hasScrolledParent repeatedly
   24.73 +		if (mode==HideExport && (hideExport || hasHiddenExportParent() ) ) // FIXME-3  try to avoid calling hasScrolledParent repeatedly
   24.74  
   24.75  		{
   24.76  			// Hide stuff according to hideExport flag and parents
    25.1 --- a/version.h	Wed Feb 10 13:48:42 2010 +0000
    25.2 +++ b/version.h	Fri Feb 19 13:47:03 2010 +0000
    25.3 @@ -7,7 +7,7 @@
    25.4  #define __VYM_VERSION "1.13.0"
    25.5  //#define __VYM_CODENAME "Codename: RC-1"
    25.6  #define __VYM_CODENAME "Codename: development version, not for production!"
    25.7 -#define __VYM_BUILD_DATE "2010-02-10"
    25.8 +#define __VYM_BUILD_DATE "2010-02-19"
    25.9  
   25.10  
   25.11  bool checkVersion(const QString &);
    26.1 --- a/vym.pro	Wed Feb 10 13:48:42 2010 +0000
    26.2 +++ b/vym.pro	Fri Feb 19 13:47:03 2010 +0000
    26.3 @@ -41,6 +41,7 @@
    26.4  	branchitem.h \
    26.5  	branchobj.h \
    26.6  	branchpropwindow.h\
    26.7 +	bugagent.h \
    26.8  	editxlinkdialog.h \
    26.9  	exportoofiledialog.h \
   26.10  	exportxhtmldialog.h\
   26.11 @@ -106,6 +107,7 @@
   26.12  	branchitem.cpp \
   26.13  	branchobj.cpp \
   26.14  	branchpropwindow.cpp \
   26.15 +	bugagent.cpp \
   26.16  	editxlinkdialog.cpp \
   26.17  	exportoofiledialog.cpp \
   26.18  	exports.cpp \
    27.1 --- a/vymmodel.cpp	Wed Feb 10 13:48:42 2010 +0000
    27.2 +++ b/vymmodel.cpp	Fri Feb 19 13:47:03 2010 +0000
    27.3 @@ -6,6 +6,7 @@
    27.4  #include "attributeitem.h"
    27.5  #include "treeitem.h"
    27.6  #include "branchitem.h"
    27.7 +#include "bugagent.h"
    27.8  #include "editxlinkdialog.h"
    27.9  #include "exports.h"
   27.10  #include "exportxhtmldialog.h"
   27.11 @@ -48,9 +49,7 @@
   27.12  
   27.13  extern Settings settings;
   27.14  
   27.15 -
   27.16 -
   27.17 -int VymModel::mapNum=0;	// make instance
   27.18 +uint VymModel::idLast=0;	// make instance
   27.19  
   27.20  VymModel::VymModel()
   27.21  {
   27.22 @@ -83,7 +82,8 @@
   27.23  	mapScene=NULL;
   27.24  
   27.25  	// History 
   27.26 -	mapNum++;
   27.27 +	idLast++;
   27.28 +	mapID=idLast;
   27.29      mapChanged=false;
   27.30  	mapDefault=true;
   27.31  	mapUnsaved=false;
   27.32 @@ -145,14 +145,14 @@
   27.33  
   27.34  	//Initialize DBUS object
   27.35  	adaptorModel=new AdaptorModel(this);	// Created and not deleted as documented in Qt
   27.36 -    if (!dbusConnection.registerObject (QString("/vymmodel_%1").arg(mapNum),this))
   27.37 +    if (!dbusConnection.registerObject (QString("/vymmodel_%1").arg(mapID),this))
   27.38  		qWarning ("VymModel: Couldn't register DBUS object!");
   27.39  }
   27.40  
   27.41  void VymModel::makeTmpDirectories()
   27.42  {
   27.43  	// Create unique temporary directories
   27.44 -	tmpMapDir = tmpVymDir+QString("/model-%1").arg(mapNum);
   27.45 +	tmpMapDir = tmpVymDir+QString("/model-%1").arg(mapID);
   27.46  	histPath = tmpMapDir+"/history";
   27.47  	QDir d;
   27.48  	d.mkdir (tmpMapDir);
   27.49 @@ -169,7 +169,7 @@
   27.50  	return blockReposition;
   27.51  }
   27.52  
   27.53 -void VymModel::updateActions()	// FIXME-2  maybe don't update if blockReposition is set
   27.54 +void VymModel::updateActions()	// FIXME-4  maybe don't update if blockReposition is set
   27.55  {
   27.56  	//cout << "VM::updateActions \n";
   27.57  	// Tell mainwindow to update states of actions
   27.58 @@ -354,8 +354,6 @@
   27.59  	if (lmode==NewMap)
   27.60  	{
   27.61  		selModel->clearSelection();
   27.62 -		// FIXME-2 VM not needed??? model->setMapEditor(this);
   27.63 -		// (map state is set later at end of load...)
   27.64  	} else
   27.65  	{
   27.66  		BranchItem *bi=getSelectedBranch();
   27.67 @@ -470,7 +468,7 @@
   27.68  		file.close();
   27.69  		if ( ok ) 
   27.70  		{
   27.71 -			reposition();	// FIXME-2 VM reposition the view instead...
   27.72 +			reposition();	
   27.73  			emitSelectionChanged();
   27.74  			if (lmode==NewMap)
   27.75  			{
   27.76 @@ -952,7 +950,7 @@
   27.77  		QDateTime tmod=QFileInfo (filePath).lastModified();
   27.78  		if (tmod>fileChangedTime)
   27.79  		{
   27.80 -			// FIXME-2 VM switch to current mapeditor and finish lineedits...
   27.81 +			// FIXME-3 VM switch to current mapeditor and finish lineedits...
   27.82  			QMessageBox mb( vymName,
   27.83  				tr("The file of the map  on disk has changed:\n\n"  
   27.84  				   "   %1\n\nDo you want to reload that map with the new file?").arg(filePath),
   27.85 @@ -1877,7 +1875,7 @@
   27.86  	}	
   27.87  }
   27.88  
   27.89 -void VymModel::setHideLinkUnselected (bool b) // FIXME-2 Images still have visible link after load
   27.90 +void VymModel::setHideLinkUnselected (bool b) 
   27.91  {
   27.92  	TreeItem *ti=getSelectedItem();
   27.93  	if (ti && (ti->getType()==TreeItem::Image ||ti->isBranchLikeType()))
   27.94 @@ -2489,7 +2487,7 @@
   27.95  	return false;
   27.96  }
   27.97  
   27.98 -void VymModel::deleteSelection()	
   27.99 +void VymModel::deleteSelection()	//FIXME-2 xLinks in a deleted subtree are not restored on undo	
  27.100  {
  27.101  	BranchItem *selbi=getSelectedBranch();
  27.102  
  27.103 @@ -2532,7 +2530,7 @@
  27.104  			emitShowSelection();
  27.105  		} else if (ti->getType()==TreeItem::XLink)
  27.106  		{
  27.107 -			//FIXME-2 savestate missing
  27.108 +			//FIXME-2 savestate for deleting xlink missing
  27.109  			deleteItem (ti);
  27.110  		} else
  27.111  			qWarning ("VymmModel::deleteSelection()  unknown type?!");
  27.112 @@ -2728,7 +2726,7 @@
  27.113  	// saveState & reposition are called in above functions
  27.114  }
  27.115  
  27.116 -void VymModel::unscrollChildren() 	//FIXME-2 does not update flag yet, possible segfault
  27.117 +void VymModel::unscrollChildren() 
  27.118  {
  27.119  	BranchItem *selbi=getSelectedBranch();
  27.120  	BranchItem *prev=NULL;
  27.121 @@ -2929,72 +2927,19 @@
  27.122  
  27.123  void VymModel::getBugzillaData()	
  27.124  {
  27.125 -	TreeItem *selti=getSelectedItem();
  27.126 -	if (selti)
  27.127 +	BranchItem *selbi=getSelectedBranch();
  27.128 +	if (selbi)
  27.129  	{		
  27.130 -		QString url=selti->getURL();
  27.131 +		QString url=selbi->getURL();
  27.132  		if (!url.isEmpty())
  27.133  		{
  27.134  			QRegExp rx("(\\d+)");
  27.135  			if (rx.indexIn(url) !=-1)
  27.136  			{
  27.137  				QString bugID=rx.cap(1);
  27.138 -				cout << "VM::getBugzillaData bug="<<bugID.toStdString()<<endl;
  27.139 -
  27.140 -				Process p;
  27.141 -				//QString script="test/sleep.sh";
  27.142 -				QString script="test/vym-bug.pl";
  27.143 -				p.start (script,QStringList()<<bugID);
  27.144 -				if (!p.waitForStarted())
  27.145 -				{
  27.146 -					cout <<"VM::getBugzillaData couldn't start "<<script.toStdString()<<endl;
  27.147 -					return;
  27.148 -				}	
  27.149 -				if (!p.waitForFinished())
  27.150 -				{
  27.151 -					cout <<"VM::getBugzillaData couldn't finish "<<script.toStdString()<<endl;
  27.152 -					return;
  27.153 -				}
  27.154 -				//QByteArray result=p.readAll();
  27.155 -				QString result=p.getStdout();
  27.156 -				while (result.endsWith("\n")) result.chop(1); 
  27.157 -				//cout << QString(result).toStdString()<<endl;
  27.158 -				QString err=p.getErrout();
  27.159 -				if (!err.isEmpty())
  27.160 -				{
  27.161 -					cout << "VM::getBugzillaData Error:\n";
  27.162 -					cout <<err.toStdString()<<endl;
  27.163 -				}
  27.164 -				else if (!result.isEmpty())
  27.165 -				{
  27.166 -					QString heading,cdate,mdate,state,whiteboard;
  27.167 -					QRegExp re("short_desc:(.*)\n");
  27.168 -					re.setMinimal(true);
  27.169 -					if (re.indexIn (result) !=-1) heading=re.cap(1);
  27.170 -
  27.171 -					re.setPattern ("creation_ts:(.*)\\s");
  27.172 -					if (re.indexIn (result) !=-1) cdate=re.cap(1);
  27.173 -
  27.174 -					re.setPattern ("delta_ts:(.*)\\s");
  27.175 -					if (re.indexIn (result) !=-1) mdate=re.cap(1);
  27.176 -
  27.177 -					re.setPattern ("bug_status:(.*)\n");
  27.178 -					if (re.indexIn (result) !=-1) state=re.cap(1);
  27.179 -
  27.180 -					re.setPattern ("status_whiteboard:(.*)\n");
  27.181 -					if (re.indexIn (result) !=-1) whiteboard=re.cap(1);
  27.182 -
  27.183 -					setHeading (bugID + " - " + heading);
  27.184 -					cout << "VM: heading="<<heading.toStdString()<<endl;
  27.185 -					cout << "VM:   cdate="<<cdate.toStdString()<<endl;
  27.186 -					cout << "VM:   mdate="<<mdate.toStdString()<<endl;
  27.187 -					cout << "VM:   state="<<state.toStdString()<<endl;
  27.188 -					cout << "VM:  wboard="<<whiteboard.toStdString()<<endl;
  27.189 -					
  27.190 -					//cout <<"VM::getBugzillaData  "<<script.toStdString()<<" returned:\n";
  27.191 -					//cout <<QString(result).toStdString()<<endl;
  27.192 -				} else	
  27.193 -					cout << "VM::getBugzillaData "<<script.toStdString()<<"  returned nothing\n";
  27.194 +				qDebug()<< "VM::getBugzillaData bug="<<bugID;
  27.195 +
  27.196 +				new BugAgent (selbi,bugID);
  27.197  			}	
  27.198  		}
  27.199  	}
  27.200 @@ -3044,12 +2989,12 @@
  27.201  				"setVymLink (\""+fd->selectedFile()+"\")",
  27.202  				QString("Set vymlink of %1 to %2").arg(getObjectName(bi)).arg(fd->selectedFile())
  27.203  			);	
  27.204 -			setVymLink (fd->selectedFile() );	// FIXME-2 ok?
  27.205 +			setVymLink (fd->selectedFile() );	
  27.206  		}
  27.207  	}
  27.208  }
  27.209  
  27.210 -void VymModel::setVymLink (const QString &s)	// FIXME-3 no savestate?
  27.211 +void VymModel::setVymLink (const QString &s)	
  27.212  {
  27.213  	// Internal function, no saveState needed
  27.214  	TreeItem *selti=getSelectedItem();
  27.215 @@ -3297,7 +3242,7 @@
  27.216  			parser.setError (Aborted,"Type of selection is not a branch");
  27.217  		} else if (parser.checkParCount(0))
  27.218  		{
  27.219 -			selbi->deactivateAllStandardFlags();	
  27.220 +			selbi->deactivateAllStandardFlags();	//FIXME-2 this probably should emitDataChanged and also setChanged. Similar all other direct changes should be done...
  27.221  		}
  27.222  	/////////////////////////////////////////////////////////////////////
  27.223  	} else if (com=="colorBranch")
  27.224 @@ -4151,7 +4096,6 @@
  27.225  	// Any errors?
  27.226  	if (parser.errorLevel()==NoError)
  27.227  	{
  27.228 -		// setChanged();  FIXME-2 should not be called e.g. for export?!
  27.229  		reposition();
  27.230  		errorMsg.clear();
  27.231  		noErr=true;
  27.232 @@ -4536,6 +4480,11 @@
  27.233  	return linkstyle;
  27.234  }	
  27.235  
  27.236 +uint VymModel::getID()
  27.237 +{
  27.238 +	return mapID;
  27.239 +}
  27.240 +
  27.241  void VymModel::setMapDefLinkColor(QColor col)
  27.242  {
  27.243  	if ( !col.isValid() ) return;
    28.1 --- a/vymmodel.h	Wed Feb 10 13:48:42 2010 +0000
    28.2 +++ b/vymmodel.h	Fri Feb 19 13:47:03 2010 +0000
    28.3 @@ -34,6 +34,9 @@
    28.4  	QString comment;
    28.5  	QDate date;
    28.6  
    28.7 +	static uint idLast;		//! the last used unique ID
    28.8 +	uint mapID;
    28.9 +
   28.10  public:
   28.11  	VymModel();
   28.12  	~VymModel ();
   28.13 @@ -42,6 +45,7 @@
   28.14  	void makeTmpDirectories();		//!< create temporary directories e.g. for history
   28.15  
   28.16  	MapEditor* getMapEditor();			// FIXME-2 still necessary?
   28.17 +	uint getID();						//! Return unique ID of model
   28.18  
   28.19  	bool isRepositionBlocked();		//!< While load or undo there is no need to update graphicsview
   28.20  
    29.1 --- a/vymview.cpp	Wed Feb 10 13:48:42 2010 +0000
    29.2 +++ b/vymview.cpp	Fri Feb 19 13:47:03 2010 +0000
    29.3 @@ -72,7 +72,7 @@
    29.4  			mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
    29.5  			*/
    29.6  
    29.7 -		// FIXME-2 testing, if that reenables updating selbox during animation
    29.8 +		// Needed to update selbox during animation
    29.9  		connect (
   29.10  			model, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)), 
   29.11  			mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
   29.12 @@ -184,7 +184,7 @@
   29.13  	//cout << "VV::changeProxySelection   newsel.count="<<newsel.indexes().count()<<endl;
   29.14  	if (!newsel.indexes().isEmpty())
   29.15  	{
   29.16 -	/* FIXME-2 need to set current, too
   29.17 +	/* FIXME-3 need to set current, too
   29.18  	*/
   29.19  		proxySelModel->setCurrentIndex (
   29.20  			newsel.indexes().first(),
   29.21 @@ -319,3 +319,12 @@
   29.22  	if (mapEditor) mapEditor->setFocus();
   29.23  }
   29.24  
   29.25 +void VymView::toggleTreeEditor()
   29.26 +{
   29.27 +	if (treeEditor->isVisible() )
   29.28 +		treeEditor->hide();
   29.29 +	else
   29.30 +		treeEditor->show();
   29.31 +}
   29.32 +
   29.33 +
    30.1 --- a/vymview.h	Wed Feb 10 13:48:42 2010 +0000
    30.2 +++ b/vymview.h	Fri Feb 19 13:47:03 2010 +0000
    30.3 @@ -32,6 +32,7 @@
    30.4  	void hideFindWidget();
    30.5  	void findNext (QString s);
    30.6  	void findReset();
    30.7 +	void toggleTreeEditor();
    30.8  
    30.9  private:
   30.10  	VymModel *model;
    31.1 --- a/xml-vym.cpp	Wed Feb 10 13:48:42 2010 +0000
    31.2 +++ b/xml-vym.cpp	Fri Feb 19 13:47:03 2010 +0000
    31.3 @@ -502,7 +502,7 @@
    31.4  {
    31.5  	lastMI=lastImage;
    31.6  	
    31.7 -	//if (!readOOAttr(a)) return false;   FIXME-3
    31.8 +	if (!readOOAttr(a)) return false;  
    31.9  
   31.10  	if (!a.value( "href").isEmpty() )
   31.11  	{