# HG changeset patch
# User insilmaril
# Date 1266587223 0
# Node ID 0bba81dde1bc14dd29c7a041551a8beb047ed3d4
# Parent  c2ce9944148c7f0d9b32aa3cf857967a073fdee2
More fixes

diff -r c2ce9944148c -r 0bba81dde1bc attributeitem.cpp
--- a/attributeitem.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/attributeitem.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -9,10 +9,6 @@
 AttributeItem::AttributeItem(const QList<QVariant> &data, TreeItem *parent):BranchItem (data,parent)
 {
 	TreeItem::setType (Attribute);
-	//table=NULL;
-	//definition=NULL;
-	type=Attribute;
-
 	internal=false;
 }
 
@@ -20,6 +16,20 @@
 {
 }
 
+void AttributeItem::set (const QString &k, const QString &v, const Type &t)
+{
+	key=k;
+	value=QVariant (v);
+	setHeading (QString ("K: %1 | V: %2").arg(key).arg(value.toString()));
+}
+
+void AttributeItem::get (QString &k, QString &v, Type &t)
+{
+	k=key;
+	v=value.toString();
+	t=attrType;
+}
+
 void AttributeItem::setKey (const QString &k, const Type &t)
 {
 /*
@@ -145,6 +155,16 @@
 */	
 }
 
+void AttributeItem::setInternal(bool b)
+{
+	internal=b;
+}
+
+bool AttributeItem::isInternal()
+{
+	return internal;
+}
+
 QString AttributeItem::getDataXML()
 {
 	QString a=beginElement ("attribute");
diff -r c2ce9944148c -r 0bba81dde1bc attributeitem.h
--- a/attributeitem.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/attributeitem.h	Fri Feb 19 13:47:03 2010 +0000
@@ -11,7 +11,7 @@
 	A list of these tables AttributeTable is maintained for every MapEditor.
 */
 class AttributeItem:public BranchItem {
-
+public:
 enum Type {
 	Undefined,	//!< Undefined type
 	IntList,	//!< Free integer
@@ -21,9 +21,10 @@
 	UniqueString//!< UniqueString, e.g. for IDs
 };
 
-public:
 	AttributeItem(const QList<QVariant> &data, TreeItem *parent = 0);
 	virtual ~AttributeItem();
+	void set (const QString &k, const QString &v, const Type &t);
+	void get (QString &k, QString &v, Type &t);
 	void setKey (const QString &k, const Type &t);
 	QString getKey ();
 	void setValue (const QString &v);
@@ -31,10 +32,14 @@
 	void setType (const Type &t);
 	AttributeItem::Type getAttributeType ();
 	QString getTypeString ();
+	void setInternal (bool b);
+	bool isInternal();
 	QString getDataXML();
 protected:
-	QString freeString;		//!< String value for type FreeString
 	bool internal;			//!< Internal attributes cannot be edited by user
+	QString key;
+	QVariant value;
+	Type attrType;
 };
 
 #endif
diff -r c2ce9944148c -r 0bba81dde1bc branchitem.cpp
--- a/branchitem.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/branchitem.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -299,28 +299,24 @@
 	do
 	{
 		madeChanges=false;
-		if (inverse)
-			for(curChildIndex=1;curChildIndex<childCount;curChildIndex++)
+		for(curChildIndex=1;curChildIndex<childCount;curChildIndex++)
+		{
+			BranchItem* curChild =getBranchNum(curChildIndex);
+			BranchItem* prevChild=getBranchNum(curChildIndex-1);
+			if (inverse)
 			{
-				BranchItem* curChild =getBranchNum(curChildIndex);
-				BranchItem* prevChild=getBranchNum(curChildIndex-1);
 				if (prevChild->getHeading().compare(curChild->getHeading())<0)
 				{
 					model->moveUp (curChild);
 					madeChanges=true;
 				}	
-			} 
-		else
-			for(curChildIndex=1;curChildIndex<childCount;curChildIndex++)
-			{
-				BranchItem* curChild =getBranchNum(curChildIndex);
-				BranchItem* prevChild=getBranchNum(curChildIndex-1);
-				if ( prevChild->getHeading().compare(curChild->getHeading())>0)
+			} else	
+				if (prevChild->getHeading().compare(curChild->getHeading())>0)
 				{
-					model->moveUp(curChild);
+					model->moveUp (curChild);
 					madeChanges=true;
 				}	
-			}
+		} 
 	}while(madeChanges);
 }
 
diff -r c2ce9944148c -r 0bba81dde1bc branchobj.cpp
--- a/branchobj.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/branchobj.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -39,18 +39,6 @@
 		model->stopAnimation (this);
 	}
 
-	// Check, if this branch was the last child to be deleted
-	// If so, unset the scrolled flags in parent // FIXME-2 better do this in model?
-
-	/*
-	BranchObj *po=(BranchObj*)parObj;
-	BranchObj *bo;
-	if (po)
-	{
-		bo=((BranchObj*)parObj)->getLastBranch();
-		if (bo) po->unScroll();
-	}
-	*/
 	clear();
 }
 
@@ -465,11 +453,12 @@
 	heading->setFont(font );
 
 	if (mod==NewBranch && !keepFrame)
-	if (treeItem->depth()==0)
-		setFrameType (FrameObj::Rectangle);
-	else	
-		setFrameType (FrameObj::NoFrame);
-
+	{
+		if (treeItem->depth()==0)
+			setFrameType (FrameObj::Rectangle);
+		else	
+			setFrameType (FrameObj::NoFrame);
+	}
 	if (mod==NewBranch)
 		setColor (treeItem->getHeadingColor() );
 	else
@@ -630,31 +619,6 @@
 		treeItem->getBranchObjNum(i)->unsetAllRepositionRequests();
 }
 
-
-QRectF BranchObj::getTotalBBox() // FIXME-2 not really needed, get rid of this
-{
-	QRectF r=bbox;
-
-	if ( ((BranchItem*)treeItem)->isScrolled() ) return r;
-
-/* FIXME-2 really include children _here_ ?  likely not needed anymore, but done in TreeItem */
-	for (int i=0; i<treeItem->branchCount(); ++i)
-		if (!treeItem->getBranchNum(i)->isHidden())
-			r=addBBox(treeItem->getBranchObjNum(i)->getTotalBBox(),r);
-
-/* FIXME-3 lots of occurences of treeItem->getBranchObjNum(i) in branchobj.cpp
-            better check if they are not NULL and maybe simplify...
-			(have been NULL at least in calcBBoxSizeWithChilds...)
-*/			
-
-/* FIXME-2 in
-	for (int i=0; i<treeItem->imageCount(); ++i
-		if (!treeItem->isHidden())
-			r=addBBox(treeItem->getImageObjNum(i)->getTotalBBox(),r);
-*/			
-	return r;
-}
-
 QRectF BranchObj::getBBoxSizeWithChildren()
 {
 	return bboxTotal;
@@ -678,7 +642,7 @@
 		return MapObj::getBoundingPolygon();
 	}
 
-	calcBBoxSizeWithChildren();	//FIXME-2 really needed?
+	calcBBoxSizeWithChildren();	//FIXME-3 really needed?
 	QPolygonF p;
 	p<<bboxTotal.topLeft();
 	p<<bboxTotal.topRight();
diff -r c2ce9944148c -r 0bba81dde1bc branchobj.h
--- a/branchobj.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/branchobj.h	Fri Feb 19 13:47:03 2010 +0000
@@ -46,7 +46,6 @@
 	virtual void reposition();
 	virtual void unsetAllRepositionRequests();
 
-	virtual QRectF getTotalBBox();			// return BBox including children			
 	virtual QRectF getBBoxSizeWithChildren();	// return size of BBox including children  
 	virtual ConvexPolygon getBoundingPolygon();
 	virtual void calcBBoxSizeWithChildren();	// calc size of  BBox including children recursivly
diff -r c2ce9944148c -r 0bba81dde1bc bugagent.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bugagent.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -0,0 +1,127 @@
+#include "bugagent.h"
+
+#include "branchitem.h"
+#include "mainwindow.h"
+#include "vymmodel.h"
+
+extern Main *mainWindow;
+
+BugAgent::BugAgent (BranchItem *bi,const QString &bug)
+{
+	if (!bi) 
+	{
+		qWarning ("Const BugAgent: bi==NULL");
+		return;
+	}
+	branchID=bi->getID();
+	modelID=bi->getModel()->getID();
+	bugID=bug;
+
+	script="test/vym-bug.pl";
+
+	p=new Process;
+
+	connect (p, SIGNAL (finished(int,QProcess::ExitStatus) ), 
+		this, SLOT (processFinished(int,QProcess::ExitStatus) ));
+
+	p->start (script,QStringList()<<bugID);
+	if (!p->waitForStarted())
+	{
+		qWarning()<<"BugAgent::getBugzillaData couldn't start "<<script;
+		return;
+	}	
+
+	/*
+	QString result=getStdout();
+	while (result.endsWith("\n")) result.chop(1); 
+	//qWarning << QString(result);
+	QString err=getErrout();
+	if (!err.isEmpty())
+	{
+		qWarning << "BugAgent::getBugzillaData Error:\n";
+		qWarning <<err;
+	}
+	else if (!result.isEmpty())
+	{
+		qWarning << "ok\n";
+	}
+
+	*/
+}
+
+BugAgent::~BugAgent ()
+{
+	delete p;
+	qDebug ()<<"dest BugAgent";
+}
+
+void BugAgent::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
+{
+	if (exitStatus==QProcess::NormalExit)
+	{
+		VymModel *model=mainWindow->getModel (modelID);
+		if (model)
+		{
+			BranchItem *bi=(BranchItem*)(model->findID (branchID));		
+			if (bi)
+			{
+				QString oldsel=model->getSelectString ();
+				model->select (bi);
+
+				// Now do needed changes:
+
+				QString result=p->getStdout();
+				while (result.endsWith("\n")) result.chop(1); 
+				//qWarning() << QString(result);
+				QString err=p->getErrout();
+				if (!err.isEmpty())
+				{
+					qWarning() << "VM::BugAgent Error:\n";
+					qWarning() <<err;
+				}
+				else if (!result.isEmpty())
+				{
+					QString heading,cdate,mdate,state,whiteboard;
+					QRegExp re("short_desc:(.*)\n");
+					re.setMinimal(true);
+					if (re.indexIn (result) !=-1) heading=re.cap(1);
+
+					re.setPattern ("creation_ts:(.*)\n");
+					if (re.indexIn (result) !=-1) cdate=re.cap(1);
+
+					re.setPattern ("delta_ts:(.*)\n");
+					if (re.indexIn (result) !=-1) mdate=re.cap(1);
+
+					re.setPattern ("bug_status:(.*)\n");
+					if (re.indexIn (result) !=-1) state=re.cap(1);
+
+					re.setPattern ("status_whiteboard:(.*)\n");
+					if (re.indexIn (result) !=-1) whiteboard=re.cap(1);
+
+					model->setHeading (bugID + " - " + heading);
+					qDebug() << "VM: heading="<<heading;
+					qDebug() << "VM:   cdate="<<cdate;
+					qDebug() << "VM:   mdate="<<mdate;
+					qDebug() << "VM:   state="<<state;
+					qDebug() << "VM:  wboard="<<whiteboard;
+					
+					//qDebug() <<"VM::getBugzillaData  "<<script<<" returned:\n";
+					//qDebug() <<QString(result);
+				} else	
+					qWarning() << "VM::getBugzillaData "<<script<<"  returned nothing\n";
+
+
+
+				// Changes finished
+				model->select (oldsel);
+			} else
+				qWarning ()<<"BugAgent: Found model, but not branch #"<<branchID;
+		} else
+			qWarning ()<<"BugAgent: Couldn't find model #"<<modelID;
+	} else		
+		qWarning()<< "BugAgent: Process finished with exitCode="<<exitCode;
+	delete (this);
+}
+
+
+
diff -r c2ce9944148c -r 0bba81dde1bc bugagent.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bugagent.h	Fri Feb 19 13:47:03 2010 +0000
@@ -0,0 +1,28 @@
+#ifndef BUGAGENT_H
+#define BUGAGENT_H
+
+#include <QObject>
+
+#include "process.h"
+
+class BranchItem;
+
+class BugAgent:public QObject
+{
+	Q_OBJECT
+public:	
+	BugAgent (BranchItem *bi,const QString &bug);
+	~BugAgent();
+
+public slots:
+	virtual void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
+
+private:
+	uint branchID;
+	uint modelID;
+	QString bugID;
+	QString script;
+	Process *p;
+};
+#endif
+
diff -r c2ce9944148c -r 0bba81dde1bc exports.cpp
--- a/exports.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/exports.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -519,7 +519,7 @@
 			s+=QString ("<img src=\"flags/flag-url-16x16.png\">%1</a>").arg(quotemeta(current->getHeading()));
 			s+="</a>";
 			
-			QRectF fbox=current->getBBoxFlag ("system-url");
+			QRectF fbox=current->getBBoxURLFlag ();
 			if (vis)
 				imageMap+=QString("  <area shape='rect' coords='%1,%2,%3,%4' href='%5'>\n")
 					.arg(fbox.left()-offset.x())
diff -r c2ce9944148c -r 0bba81dde1bc flag.cpp
--- a/flag.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/flag.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -1,7 +1,6 @@
 #include "flag.h"
 
-#include <iostream>
-using namespace std;
+#include <QDebug>
 
 /////////////////////////////////////////////////////////////////
 // Flag
@@ -49,7 +48,8 @@
 
 void Flag::load (const QString &fn)
 {
-	pixmap.load(fn);
+	if (!pixmap.load(fn))
+		qDebug()<<"Flag::load failed to load "<<fn;
 }
 
 void Flag::load (const QPixmap &pm)
diff -r c2ce9944148c -r 0bba81dde1bc flagrow.cpp
--- a/flagrow.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/flagrow.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -1,8 +1,7 @@
+#include <QDebug>
+
 #include "flagrow.h"
 
-#include <iostream>
-using namespace std;
-
 /////////////////////////////////////////////////////////////////
 // FlagRow
 /////////////////////////////////////////////////////////////////
@@ -47,9 +46,12 @@
 }
 
 
-bool FlagRow::isActive (const QString &name)
+bool FlagRow::isActive (const QString &name)	//FIXME-2 regression
 {
-	return activeNames.contains (name);
+	QString n;
+	foreach (n,activeNames)
+		if (n==name) return true;
+	return false;	
 }
 
 void FlagRow::toggle (const QString &name, FlagRow *masterRow)
@@ -76,14 +78,14 @@
 
 void FlagRow::activate (const QString &name)
 {
-	if (!activeNames.contains (name))
+	if (!isActive (name))
 		activeNames.append (name);
 	else
 		qWarning (QString("FlagRow::activate - %1 is already active").arg(name));
 }
 
 
-void FlagRow::deactivate (const QString &name)
+void FlagRow::deactivate (const QString &name)	//FIXME-4 complaints if CTRL-E is pressed with focus on NoteEditor ?!
 {
 	int n=activeNames.indexOf (name);
 	if (n>=0)
@@ -142,23 +144,22 @@
 
 void FlagRow::setMasterRow (FlagRow *row)
 {
-	masterRow=row;
+	masterRow=row; 
 }
 
 void FlagRow::updateToolBar (const QStringList &activeNames)
 {
 	if (toolBar )
 	{
-		if (activeNames.isEmpty() )
-			for (int i=0;i<flags.size();++i)
-				flags.at(i)->getAction()->setChecked (false);
-		else		
-			for (int i=0;i<flags.size();++i)
-				flags.at(i)->getAction()->setChecked (
-					activeNames.contains (flags.at(i)->getName()));
+		for (int i=0;i<flags.size();++i)
+			flags.at(i)->getAction()->setChecked (false);
+		for (int i=0;i<flags.size();++i)
+		{
+			int n=activeNames.indexOf (flags.at(i)->getName());
+			if (n>=0)
+				flags.at(i)->getAction()->setChecked (true);	
+		}
 	}
-	return;
-		
 }
 
 
diff -r c2ce9944148c -r 0bba81dde1bc floatimageobj.cpp
--- a/floatimageobj.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/floatimageobj.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -8,15 +8,6 @@
 // FloatImageObj
 /////////////////////////////////////////////////////////////////
 
-/* FIXME-3
-FloatImageObj::FloatImageObj ():FloatObj()
-{
-//    cout << "Const FloatImageObj ()\n";
-    setParObj (this);	
-    init();
-}
-*/
-
 FloatImageObj::FloatImageObj (QGraphicsScene* s,TreeItem *ti):FloatObj(s,ti)
 {
    //cout << "Const FloatImageObj s="<<s<<"  ti="<<ti<<endl;
@@ -24,14 +15,6 @@
     init();
 }
 
-/* FIXME-3 needed
-FloatImageObj::FloatImageObj (QGraphicsScene *s, OrnamentedObj* p):FloatObj(s,p)
-{
- //   cout << "Const FloatImageObj (c,p)\n";
-    init();
-}
-*/
-
 FloatImageObj::~FloatImageObj ()
 {
 //	cout << "Destr FloatImageObj "<<this<<"\n";
@@ -154,11 +137,6 @@
 	// TODO
 }
 
-QRectF FloatImageObj::getTotalBBox()
-{
-	return bbox;
-}
-
 QRectF FloatImageObj::getBBoxSizeWithChildren()
 {
 	//TODO abstract in linkablemapobj.h, not calculated
diff -r c2ce9944148c -r 0bba81dde1bc floatimageobj.h
--- a/floatimageobj.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/floatimageobj.h	Fri Feb 19 13:47:03 2010 +0000
@@ -12,9 +12,7 @@
 /////////////////////////////////////////////////////////////////////////////
 class FloatImageObj:public FloatObj {
 public:
-    //FIXME-3 FloatImageObj ();
     FloatImageObj (QGraphicsScene*,TreeItem *ti=NULL);
-    //FIXME-3 FloatImageObj (QGraphicsScene*, OrnamentedObj* parent);
     ~FloatImageObj ();
     virtual void init ();
     virtual void copy (FloatImageObj*);
@@ -31,7 +29,6 @@
     virtual void move (QPointF);
 	virtual void positionBBox();
 	virtual void calcBBoxSize();
-	virtual QRectF getTotalBBox();			// return BBox including children			
 	virtual QRectF getBBoxSizeWithChildren();	// return size of BBox including children  
 	virtual void calcBBoxSizeWithChildren();	// calc size of  BBox including children recursivly
 
diff -r c2ce9944148c -r 0bba81dde1bc floatobj.cpp
--- a/floatobj.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/floatobj.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -1,7 +1,5 @@
 #include "floatobj.h"
-
-#include <iostream>
-using namespace std;
+#include "mapitem.h"
 
 /////////////////////////////////////////////////////////////////
 // FloatObj
@@ -19,13 +17,11 @@
 //   cout << "Destr FloatObj\n";
 }
 
-#include <iostream>
-using namespace std;
 void FloatObj::init () 
 {
 	zPlane=Z_ICON;
 	setLinkStyle (LinkableMapObj::Parabel);
-	//FIXME-2 setHideLinkUnselected(true);
+	((MapItem*)treeItem)->setHideLinkUnselected(true);
 }
 
 void FloatObj::copy (FloatObj* other)
@@ -66,11 +62,6 @@
 	updateLinkGeometry();	
 }
 
-QRectF FloatObj::getTotalBBox()
-{
-	return bbox;
-}
-
 QRectF FloatObj::getBBoxSizeWithChildren()
 {
 	return bboxTotal;
diff -r c2ce9944148c -r 0bba81dde1bc floatobj.h
--- a/floatobj.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/floatobj.h	Fri Feb 19 13:47:03 2010 +0000
@@ -22,7 +22,6 @@
 	virtual void setDockPos();
 	virtual void reposition();
 											
-	virtual QRectF getTotalBBox();			// return BBox including children			
 	virtual QRectF getBBoxSizeWithChildren();	// return size of BBox including children  
 
 protected:
diff -r c2ce9944148c -r 0bba81dde1bc linkablemapobj.cpp
--- a/linkablemapobj.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/linkablemapobj.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -272,12 +272,6 @@
 	return style;
 }
 
-void LinkableMapObj::setHideLinkUnselected()
-{
-	setVisibility (visible);
-	updateLinkGeometry();
-}
-
 void LinkableMapObj::setLinkPos(Position lp)
 {
 	linkpos=lp;
diff -r c2ce9944148c -r 0bba81dde1bc linkablemapobj.h
--- a/linkablemapobj.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/linkablemapobj.h	Fri Feb 19 13:47:03 2010 +0000
@@ -73,7 +73,6 @@
     void setLinkStyle(Style);            
 	Style getLinkStyle();
 
-	void setHideLinkUnselected();
 	void setLinkPos (Position);
 	Position getLinkPos ();
 
diff -r c2ce9944148c -r 0bba81dde1bc mainwindow.cpp
--- a/mainwindow.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/mainwindow.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -1133,6 +1133,15 @@
 	connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
 	actionViewToggleNoteEditor=a;
 
+	a = new QAction(QPixmap(), tr( "Show tree editor","View action" ),this);
+	a->setStatusTip ( tr( "Show tree editor" ));
+	a->setShortcut ( Qt::CTRL + Qt::Key_T );	// Toggle Note Editor // FIXME-3 originally: color subtree
+	a->setToggleAction(true);
+	a->addTo( tb );
+	viewMenu->addAction (a);
+	connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleTreeEditor() ) );
+	actionViewToggleTreeEditor=a;
+
 	a = new QAction(QPixmap(iconPath+"history.png"),  tr( "History Window","View action" ),this );
 	a->setStatusTip ( tr( "Show History Window" ));
 	a->setShortcut ( Qt::CTRL + Qt::Key_H  );	// Toggle history window
@@ -1220,22 +1229,25 @@
 	Flag *flag=new Flag;;
 	flag->setVisible(true);
 
-	flag->load(QPixmap(flagsPath+"flag-note.png"));
+	flag->load(flagsPath+"flag-note.png");
 	setupFlag (flag,tb,"system-note",tr("Note","SystemFlag"));
 
-	flag->load(QPixmap(flagsPath+"flag-url.png"));
+	flag->load(flagsPath+"flag-url.png");
 	setupFlag (flag,tb,"system-url",tr("URL to Document ","SystemFlag"));
 
-	flag->load(QPixmap(flagsPath+"flag-vymlink.png"));
+	flag->load(flagsPath+"flag-url-bugzilla-novell.png");
+	setupFlag (flag,tb,"system-url-bugzilla-novell",tr("URL to Bugzilla ","SystemFlag"));
+
+	flag->load(flagsPath+"flag-vymlink.png");
 	setupFlag (flag,tb,"system-vymLink",tr("Link to another vym map","SystemFlag"));
 
-	flag->load(QPixmap(flagsPath+"flag-scrolled-right.png"));
+	flag->load(flagsPath+"flag-scrolled-right.png");
 	setupFlag (flag,tb,"system-scrolledright",tr("subtree is scrolled","SystemFlag"));
 
-	flag->load(QPixmap(flagsPath+"flag-tmpUnscrolled-right.png"));
+	flag->load(flagsPath+"flag-tmpUnscrolled-right.png");
 	setupFlag (flag,tb,"system-tmpUnscrolledRight",tr("subtree is temporary scrolled","SystemFlag"));
 
-	flag->load(QPixmap(flagsPath+"flag-hideexport.png"));
+	flag->load(flagsPath+"flag-hideexport.png");
 	setupFlag (flag,tb,"system-hideInExport",tr("Hide object in exported maps","SystemFlag"));
 
 	// Create Standard Flags
@@ -1569,13 +1581,13 @@
 	QAction *a;
 	a = new QAction( "Test function 1" , this);
 	a->setStatusTip( "Call test function 1" );
-	a->setShortcut (Qt::CTRL + Qt::Key_T);	// Test function 1  //FIXME-2 originally: color subtree
+	a->setShortcut (Qt::SHIFT + Qt::Key_T);	// Test function 1  
 	testMenu->addAction (a);
 	connect( a, SIGNAL( triggered() ), this, SLOT( testFunction1() ) );
 
 	a = new QAction( "Test function 2" , this);
 	a->setStatusTip( "Call test function 2" );
-	a->setShortcut (Qt::SHIFT + Qt::Key_T);		// Test function 2
+	a->setShortcut (Qt::ALT + Qt::Key_T);	// Test function 2
 	testMenu->addAction (a);
 	connect( a, SIGNAL( triggered() ), this, SLOT( testFunction2() ) );
 
@@ -1788,6 +1800,13 @@
 	return NULL;	
 }
 
+VymModel* Main::getModel(uint id) const
+{
+	if ( tabWidget->currentPage())
+		return vymViews.at(tabWidget->currentIndex())->getModel();
+	return NULL;	
+}
+
 
 void Main::editorChanged(QWidget *)
 {
@@ -3354,6 +3373,12 @@
 		windowShowNoteEditor();
 }
 
+void Main::windowToggleTreeEditor()
+{
+	if ( tabWidget->currentPage())
+		vymViews.at(tabWidget->currentIndex())->toggleTreeEditor();
+}
+
 void Main::windowToggleHistory()
 {
 	if (historyWindow->isVisible())
@@ -3754,65 +3779,26 @@
 	}
 }
 
+
+#include "attributeitem.h"
 void Main::testFunction1()
 {
-
-	Process p;
-	QString script="test/sleep.sh";
-	p.start (script);
-	if (!p.waitForStarted())
+	VymModel *m=currentModel();
+	if (!m) return;
+
+	BranchItem *selbi=m->getSelectedBranch();
+	if (selbi)
 	{
-		cout <<"VM::getBugzillaData couldn't start "<<script.toStdString()<<endl;
-		return;
-	}	
-	if (!p.waitForFinished())
-	{
-		cout <<"VM::getBugzillaData couldn't finish "<<script.toStdString()<<endl;
-		return;
+		QList<QVariant> cData;
+		cData << "new ai" << "undef";
+
+		AttributeItem *ai=new AttributeItem (cData,selbi);
+		ai->set ("Key 1","Val a",AttributeItem::FreeString);
+
+		m->addAttribute (ai);
 	}
-	//QByteArray result=p.readAll();
-	QString result=p.getStdout();
-	while (result.endsWith("\n")) result.chop(1); 
-	//cout << QString(result).toStdString()<<endl;
-	QString err=p.getErrout();
-	if (!err.isEmpty())
-	{
-		cout << "VM::getBugzillaData Error:\n";
-		cout <<err.toStdString()<<endl;
-	}
-	else if (!result.isEmpty())
-	{
-		cout << "ok\n";
-	}	
-/*
-	int max=100000;
-	QProgressDialog p ("testprogress","cancel",0,max,this);
-	p.setWindowModality (Qt::WindowModal);
-	p.setAutoReset (false);
-	p.setAutoClose (false);
-	p.show();
-	for (int i=0;i<max;i++)
-	{
-		p.setValue(i);
-		if (p.wasCanceled()) break;
-	}
-
-	cout << "Doing it again...\n";
-	p.reset();
-	p.hide();
-	max=max+10;
-	p.setRange(0,max);
-	p.setValue (0);
-	p.show();
-	for (int i=0;i<max;i++)
-	{
-		p.setValue (i);
-		if (p.wasCanceled()) break;
-	}
-	p.setValue (max);
-	cout << "Done.\n";
 	return;
-*/
+
 /*
 	if (!currentMapEditor()) return;
 	currentMapEditor()->testFunction1();
diff -r c2ce9944148c -r 0bba81dde1bc mainwindow.h
--- a/mainwindow.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/mainwindow.h	Fri Feb 19 13:47:03 2010 +0000
@@ -73,6 +73,8 @@
 	void showEvent (QShowEvent * );
 	MapEditor* currentMapEditor() const;
 	VymModel* currentModel() const;
+public:	
+	VymModel* getModel(uint) const;
     
 private slots:
 	void editorChanged(QWidget*);
@@ -209,6 +211,7 @@
 	void settingsToggleAnimation();
 
 	void windowToggleNoteEditor();
+	void windowToggleTreeEditor();
 	void windowToggleHistory();
 	void windowToggleProperty();
 	void updateHistory(SimpleSettings &);
@@ -355,6 +358,7 @@
 	QAction *actionFormatHideLinkUnselected;
 
 	QAction *actionViewToggleNoteEditor;
+	QAction *actionViewToggleTreeEditor;
 	QAction *actionViewToggleHistoryWindow;
 	QAction *actionViewTogglePropertyWindow;
 	QAction *actionViewToggleAntiAlias;
diff -r c2ce9944148c -r 0bba81dde1bc mapeditor.cpp
--- a/mapeditor.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/mapeditor.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -1,8 +1,6 @@
 #include "mapeditor.h"
 
-#include <iostream>
-#include <cstdlib>
-#include <typeinfo>
+#include <iostream>	
 
 #include <QObject>
 
@@ -89,13 +87,13 @@
     a = new QAction( "Select left branch", this);
 	a->setShortcut (Qt::Key_Left );
 //	a->setShortcutContext (Qt::WindowShortcut);
-	a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
+//	a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
 	addAction (a);
     connect( a, SIGNAL( triggered() ), this, SLOT( cursorLeft() ) );
 
     a = new QAction( "Select child branch", this);
 	a->setShortcut (Qt::Key_Right);
-	a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
+//	a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
 	addAction (a);
     connect( a, SIGNAL( triggered() ), this, SLOT( cursorRight() ) );
 
@@ -940,7 +938,9 @@
 	editingHeading=false;
 	lineEdit->releaseKeyboard();
 	lineEdit->clearFocus();
-	model->setHeading (lineEdit->text() );
+	QString s=lineEdit->text();
+	s.replace (QRegExp ("\\n")," ");	// Don't paste newline chars
+	model->setHeading (s);
 	model->setSelectionBlocked(false);
 	delete (lineEdit);
 
@@ -1055,7 +1055,7 @@
 		{
 			// systemFlag clicked
 			model->select (lmo);	
-			if (foname=="system-url") 
+			if (foname.contains("system-url")) 
 			{
 				if (e->state() & Qt::ControlModifier)
 					mainWindow->editOpenURLTab();
diff -r c2ce9944148c -r 0bba81dde1bc mapitem.cpp
--- a/mapitem.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/mapitem.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -3,6 +3,8 @@
 #include "linkablemapobj.h"
 #include "ornamentedobj.h"
 
+#include <QDebug>
+
 MapItem::MapItem()
 {
 	init();
@@ -62,7 +64,12 @@
 void MapItem::setHideLinkUnselected (bool b)
 {
 	hideLinkUnselected=b;
-	if (lmo) lmo->setHideLinkUnselected();
+	if (lmo) 
+	{
+		//lmo->setHideLinkUnselected();
+		lmo->setVisibility (lmo->isVisibleObj());
+		lmo->updateLinkGeometry();
+	}	
 }
 
 bool MapItem::getHideLinkUnselected()
@@ -104,6 +111,17 @@
 	return s;
 }
 
+QRectF MapItem::getBBoxURLFlag ()
+{
+	QStringList list=systemFlags.activeFlagNames().filter ("system-url");
+	if (list.count()>1)
+	{
+		qWarning()<<"MapItem::getBBoxURLFlag found more than one system-url*";
+		return QRectF ();
+	}	
+	return getBBoxFlag (list.first());
+}
+
 QRectF MapItem::getBBoxFlag (const QString &fname)
 {
 	if (lmo)
diff -r c2ce9944148c -r 0bba81dde1bc mapitem.h
--- a/mapitem.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/mapitem.h	Fri Feb 19 13:47:03 2010 +0000
@@ -54,6 +54,7 @@
 
 	virtual QString getMapAttr();	//! Get attributes for saving as XML
 
+	virtual QRectF getBBoxURLFlag();//! get bbox of url flag
 	virtual QRectF getBBoxFlag   (const QString &fname);	//! get bbox of flag
 
 
diff -r c2ce9944148c -r 0bba81dde1bc tex/vym.changelog
--- a/tex/vym.changelog	Wed Feb 10 13:48:42 2010 +0000
+++ b/tex/vym.changelog	Fri Feb 19 13:47:03 2010 +0000
@@ -1,3 +1,19 @@
+-------------------------------------------------------------------
+Fri Feb 19 08:05:02 CET 2010 - vym@insilmaril.de
+
+- Bugfix: Fixed regression of flags
+
+-------------------------------------------------------------------
+Wed Feb 17 16:31:34 CET 2010 - vym@insilmaril.de
+
+- Bugfix: When pasting a heading into the LineEdit, newlines are removed
+          to avoid broken rendering
+
+-------------------------------------------------------------------
+Wed Feb 17 11:49:09 CET 2010 - vym@insilmaril.de
+
+- Feature: Novell Bugzilla now has extra flag
+
 -------------------------------------------------------------------
 Wed Feb 10 14:47:49 CET 2010 - vym@insilmaril.de
 
diff -r c2ce9944148c -r 0bba81dde1bc texteditor.cpp
--- a/texteditor.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/texteditor.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -521,7 +521,8 @@
 		// Load note
 		QFileDialog *fd=new QFileDialog( this);
 		QStringList types;
-		types<< "VYM notes (*.html)" <<
+		types<< "Text (*.txt *.html)"<<
+			"VYM notes and HTML (*.html)" <<
 			"ASCII texts (*.txt)" <<
 			"All filed (*)";
 		fd->setFilters (types);
diff -r c2ce9944148c -r 0bba81dde1bc treeitem.cpp
--- a/treeitem.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/treeitem.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -52,7 +52,7 @@
 {
 	model=NULL;
 
-	// Reset ID  //FIXME-2 compare objID (string), so far only used for xLinks during load/save (Id=selString)
+	// Assign ID  
 	idLast++;
 	id=idLast;
 
@@ -342,9 +342,26 @@
 {
 	url=u;
 	if (!url.isEmpty())
-		systemFlags.activate ("system-url");
+	{
+		if (url.contains ("bugzilla.novell.com"))
+		{
+			systemFlags.activate ("system-url-bugzilla-novell");
+			if (systemFlags.isActive ("system-url"))
+				systemFlags.deactivate ("system-url");
+		} else
+		{
+			systemFlags.activate ("system-url");
+			if (systemFlags.isActive ("system-url-bugzilla-novell"))
+				systemFlags.deactivate ("system-url-bugzilla-novell");
+		}
+	}
 	else
-		systemFlags.deactivate ("system-url");
+	{
+		if (systemFlags.isActive ("system-url"))
+			systemFlags.deactivate ("system-url");
+		if (systemFlags.isActive ("system-url-bugzilla-novell"))
+			systemFlags.deactivate ("system-url-bugzilla-novell");
+	}
 }
 
 QString TreeItem::getURL ()
@@ -520,14 +537,10 @@
 
 TreeItem* TreeItem::findID (const uint &n)
 {
-	if (n>=0 && n<childItems.count() )
-	{
-		for (int i=0;i<childItems.count(); i++)
-			if (n==childItems.at(i)->id)
-				return childItems.at(n);
-	}
-	else
-		return NULL;
+	for (int i=0;i<childItems.count(); i++)
+		if (n==childItems.at(i)->id)
+			return childItems.at(n);
+	return NULL;
 }
 
 
@@ -635,14 +648,14 @@
 }
 
 
-void TreeItem::setHideTmp (HideTmpMode mode)  //FIXME-2	update visibility in derived objects
+void TreeItem::setHideTmp (HideTmpMode mode)  //FIXME-3	update visibility in derived objects
 {
 	if (type==Image || type==Branch || type==MapCenter)
 //		((ImageItem*)this)->updateVisibility();
 	{
 		LinkableMapObj* lmo=((MapItem*)this)->getLMO();
 
-		if (mode==HideExport && (hideExport || hasHiddenExportParent() ) ) // FIXME-2  try to avoid calling hasScrolledParent repeatedly
+		if (mode==HideExport && (hideExport || hasHiddenExportParent() ) ) // FIXME-3  try to avoid calling hasScrolledParent repeatedly
 
 		{
 			// Hide stuff according to hideExport flag and parents
diff -r c2ce9944148c -r 0bba81dde1bc version.h
--- a/version.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/version.h	Fri Feb 19 13:47:03 2010 +0000
@@ -7,7 +7,7 @@
 #define __VYM_VERSION "1.13.0"
 //#define __VYM_CODENAME "Codename: RC-1"
 #define __VYM_CODENAME "Codename: development version, not for production!"
-#define __VYM_BUILD_DATE "2010-02-10"
+#define __VYM_BUILD_DATE "2010-02-19"
 
 
 bool checkVersion(const QString &);
diff -r c2ce9944148c -r 0bba81dde1bc vym.pro
--- a/vym.pro	Wed Feb 10 13:48:42 2010 +0000
+++ b/vym.pro	Fri Feb 19 13:47:03 2010 +0000
@@ -41,6 +41,7 @@
 	branchitem.h \
 	branchobj.h \
 	branchpropwindow.h\
+	bugagent.h \
 	editxlinkdialog.h \
 	exportoofiledialog.h \
 	exportxhtmldialog.h\
@@ -106,6 +107,7 @@
 	branchitem.cpp \
 	branchobj.cpp \
 	branchpropwindow.cpp \
+	bugagent.cpp \
 	editxlinkdialog.cpp \
 	exportoofiledialog.cpp \
 	exports.cpp \
diff -r c2ce9944148c -r 0bba81dde1bc vymmodel.cpp
--- a/vymmodel.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/vymmodel.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -6,6 +6,7 @@
 #include "attributeitem.h"
 #include "treeitem.h"
 #include "branchitem.h"
+#include "bugagent.h"
 #include "editxlinkdialog.h"
 #include "exports.h"
 #include "exportxhtmldialog.h"
@@ -48,9 +49,7 @@
 
 extern Settings settings;
 
-
-
-int VymModel::mapNum=0;	// make instance
+uint VymModel::idLast=0;	// make instance
 
 VymModel::VymModel()
 {
@@ -83,7 +82,8 @@
 	mapScene=NULL;
 
 	// History 
-	mapNum++;
+	idLast++;
+	mapID=idLast;
     mapChanged=false;
 	mapDefault=true;
 	mapUnsaved=false;
@@ -145,14 +145,14 @@
 
 	//Initialize DBUS object
 	adaptorModel=new AdaptorModel(this);	// Created and not deleted as documented in Qt
-    if (!dbusConnection.registerObject (QString("/vymmodel_%1").arg(mapNum),this))
+    if (!dbusConnection.registerObject (QString("/vymmodel_%1").arg(mapID),this))
 		qWarning ("VymModel: Couldn't register DBUS object!");
 }
 
 void VymModel::makeTmpDirectories()
 {
 	// Create unique temporary directories
-	tmpMapDir = tmpVymDir+QString("/model-%1").arg(mapNum);
+	tmpMapDir = tmpVymDir+QString("/model-%1").arg(mapID);
 	histPath = tmpMapDir+"/history";
 	QDir d;
 	d.mkdir (tmpMapDir);
@@ -169,7 +169,7 @@
 	return blockReposition;
 }
 
-void VymModel::updateActions()	// FIXME-2  maybe don't update if blockReposition is set
+void VymModel::updateActions()	// FIXME-4  maybe don't update if blockReposition is set
 {
 	//cout << "VM::updateActions \n";
 	// Tell mainwindow to update states of actions
@@ -354,8 +354,6 @@
 	if (lmode==NewMap)
 	{
 		selModel->clearSelection();
-		// FIXME-2 VM not needed??? model->setMapEditor(this);
-		// (map state is set later at end of load...)
 	} else
 	{
 		BranchItem *bi=getSelectedBranch();
@@ -470,7 +468,7 @@
 		file.close();
 		if ( ok ) 
 		{
-			reposition();	// FIXME-2 VM reposition the view instead...
+			reposition();	
 			emitSelectionChanged();
 			if (lmode==NewMap)
 			{
@@ -952,7 +950,7 @@
 		QDateTime tmod=QFileInfo (filePath).lastModified();
 		if (tmod>fileChangedTime)
 		{
-			// FIXME-2 VM switch to current mapeditor and finish lineedits...
+			// FIXME-3 VM switch to current mapeditor and finish lineedits...
 			QMessageBox mb( vymName,
 				tr("The file of the map  on disk has changed:\n\n"  
 				   "   %1\n\nDo you want to reload that map with the new file?").arg(filePath),
@@ -1877,7 +1875,7 @@
 	}	
 }
 
-void VymModel::setHideLinkUnselected (bool b) // FIXME-2 Images still have visible link after load
+void VymModel::setHideLinkUnselected (bool b) 
 {
 	TreeItem *ti=getSelectedItem();
 	if (ti && (ti->getType()==TreeItem::Image ||ti->isBranchLikeType()))
@@ -2489,7 +2487,7 @@
 	return false;
 }
 
-void VymModel::deleteSelection()	
+void VymModel::deleteSelection()	//FIXME-2 xLinks in a deleted subtree are not restored on undo	
 {
 	BranchItem *selbi=getSelectedBranch();
 
@@ -2532,7 +2530,7 @@
 			emitShowSelection();
 		} else if (ti->getType()==TreeItem::XLink)
 		{
-			//FIXME-2 savestate missing
+			//FIXME-2 savestate for deleting xlink missing
 			deleteItem (ti);
 		} else
 			qWarning ("VymmModel::deleteSelection()  unknown type?!");
@@ -2728,7 +2726,7 @@
 	// saveState & reposition are called in above functions
 }
 
-void VymModel::unscrollChildren() 	//FIXME-2 does not update flag yet, possible segfault
+void VymModel::unscrollChildren() 
 {
 	BranchItem *selbi=getSelectedBranch();
 	BranchItem *prev=NULL;
@@ -2929,72 +2927,19 @@
 
 void VymModel::getBugzillaData()	
 {
-	TreeItem *selti=getSelectedItem();
-	if (selti)
+	BranchItem *selbi=getSelectedBranch();
+	if (selbi)
 	{		
-		QString url=selti->getURL();
+		QString url=selbi->getURL();
 		if (!url.isEmpty())
 		{
 			QRegExp rx("(\\d+)");
 			if (rx.indexIn(url) !=-1)
 			{
 				QString bugID=rx.cap(1);
-				cout << "VM::getBugzillaData bug="<<bugID.toStdString()<<endl;
-
-				Process p;
-				//QString script="test/sleep.sh";
-				QString script="test/vym-bug.pl";
-				p.start (script,QStringList()<<bugID);
-				if (!p.waitForStarted())
-				{
-					cout <<"VM::getBugzillaData couldn't start "<<script.toStdString()<<endl;
-					return;
-				}	
-				if (!p.waitForFinished())
-				{
-					cout <<"VM::getBugzillaData couldn't finish "<<script.toStdString()<<endl;
-					return;
-				}
-				//QByteArray result=p.readAll();
-				QString result=p.getStdout();
-				while (result.endsWith("\n")) result.chop(1); 
-				//cout << QString(result).toStdString()<<endl;
-				QString err=p.getErrout();
-				if (!err.isEmpty())
-				{
-					cout << "VM::getBugzillaData Error:\n";
-					cout <<err.toStdString()<<endl;
-				}
-				else if (!result.isEmpty())
-				{
-					QString heading,cdate,mdate,state,whiteboard;
-					QRegExp re("short_desc:(.*)\n");
-					re.setMinimal(true);
-					if (re.indexIn (result) !=-1) heading=re.cap(1);
-
-					re.setPattern ("creation_ts:(.*)\\s");
-					if (re.indexIn (result) !=-1) cdate=re.cap(1);
-
-					re.setPattern ("delta_ts:(.*)\\s");
-					if (re.indexIn (result) !=-1) mdate=re.cap(1);
-
-					re.setPattern ("bug_status:(.*)\n");
-					if (re.indexIn (result) !=-1) state=re.cap(1);
-
-					re.setPattern ("status_whiteboard:(.*)\n");
-					if (re.indexIn (result) !=-1) whiteboard=re.cap(1);
-
-					setHeading (bugID + " - " + heading);
-					cout << "VM: heading="<<heading.toStdString()<<endl;
-					cout << "VM:   cdate="<<cdate.toStdString()<<endl;
-					cout << "VM:   mdate="<<mdate.toStdString()<<endl;
-					cout << "VM:   state="<<state.toStdString()<<endl;
-					cout << "VM:  wboard="<<whiteboard.toStdString()<<endl;
-					
-					//cout <<"VM::getBugzillaData  "<<script.toStdString()<<" returned:\n";
-					//cout <<QString(result).toStdString()<<endl;
-				} else	
-					cout << "VM::getBugzillaData "<<script.toStdString()<<"  returned nothing\n";
+				qDebug()<< "VM::getBugzillaData bug="<<bugID;
+
+				new BugAgent (selbi,bugID);
 			}	
 		}
 	}
@@ -3044,12 +2989,12 @@
 				"setVymLink (\""+fd->selectedFile()+"\")",
 				QString("Set vymlink of %1 to %2").arg(getObjectName(bi)).arg(fd->selectedFile())
 			);	
-			setVymLink (fd->selectedFile() );	// FIXME-2 ok?
+			setVymLink (fd->selectedFile() );	
 		}
 	}
 }
 
-void VymModel::setVymLink (const QString &s)	// FIXME-3 no savestate?
+void VymModel::setVymLink (const QString &s)	
 {
 	// Internal function, no saveState needed
 	TreeItem *selti=getSelectedItem();
@@ -3297,7 +3242,7 @@
 			parser.setError (Aborted,"Type of selection is not a branch");
 		} else if (parser.checkParCount(0))
 		{
-			selbi->deactivateAllStandardFlags();	
+			selbi->deactivateAllStandardFlags();	//FIXME-2 this probably should emitDataChanged and also setChanged. Similar all other direct changes should be done...
 		}
 	/////////////////////////////////////////////////////////////////////
 	} else if (com=="colorBranch")
@@ -4151,7 +4096,6 @@
 	// Any errors?
 	if (parser.errorLevel()==NoError)
 	{
-		// setChanged();  FIXME-2 should not be called e.g. for export?!
 		reposition();
 		errorMsg.clear();
 		noErr=true;
@@ -4536,6 +4480,11 @@
 	return linkstyle;
 }	
 
+uint VymModel::getID()
+{
+	return mapID;
+}
+
 void VymModel::setMapDefLinkColor(QColor col)
 {
 	if ( !col.isValid() ) return;
diff -r c2ce9944148c -r 0bba81dde1bc vymmodel.h
--- a/vymmodel.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/vymmodel.h	Fri Feb 19 13:47:03 2010 +0000
@@ -34,6 +34,9 @@
 	QString comment;
 	QDate date;
 
+	static uint idLast;		//! the last used unique ID
+	uint mapID;
+
 public:
 	VymModel();
 	~VymModel ();
@@ -42,6 +45,7 @@
 	void makeTmpDirectories();		//!< create temporary directories e.g. for history
 
 	MapEditor* getMapEditor();			// FIXME-2 still necessary?
+	uint getID();						//! Return unique ID of model
 
 	bool isRepositionBlocked();		//!< While load or undo there is no need to update graphicsview
 
diff -r c2ce9944148c -r 0bba81dde1bc vymview.cpp
--- a/vymview.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/vymview.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -72,7 +72,7 @@
 			mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
 			*/
 
-		// FIXME-2 testing, if that reenables updating selbox during animation
+		// Needed to update selbox during animation
 		connect (
 			model, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)), 
 			mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
@@ -184,7 +184,7 @@
 	//cout << "VV::changeProxySelection   newsel.count="<<newsel.indexes().count()<<endl;
 	if (!newsel.indexes().isEmpty())
 	{
-	/* FIXME-2 need to set current, too
+	/* FIXME-3 need to set current, too
 	*/
 		proxySelModel->setCurrentIndex (
 			newsel.indexes().first(),
@@ -319,3 +319,12 @@
 	if (mapEditor) mapEditor->setFocus();
 }
 
+void VymView::toggleTreeEditor()
+{
+	if (treeEditor->isVisible() )
+		treeEditor->hide();
+	else
+		treeEditor->show();
+}
+
+
diff -r c2ce9944148c -r 0bba81dde1bc vymview.h
--- a/vymview.h	Wed Feb 10 13:48:42 2010 +0000
+++ b/vymview.h	Fri Feb 19 13:47:03 2010 +0000
@@ -32,6 +32,7 @@
 	void hideFindWidget();
 	void findNext (QString s);
 	void findReset();
+	void toggleTreeEditor();
 
 private:
 	VymModel *model;
diff -r c2ce9944148c -r 0bba81dde1bc xml-vym.cpp
--- a/xml-vym.cpp	Wed Feb 10 13:48:42 2010 +0000
+++ b/xml-vym.cpp	Fri Feb 19 13:47:03 2010 +0000
@@ -502,7 +502,7 @@
 {
 	lastMI=lastImage;
 	
-	//if (!readOOAttr(a)) return false;   FIXME-3
+	if (!readOOAttr(a)) return false;  
 
 	if (!a.value( "href").isEmpty() )
 	{