# HG changeset patch
# User insilmaril
# Date 1183129924 0
# Node ID 32b71ba642aad286c7d98877572df10941944a02
# Parent  96b0a867c0fa3834fbb591b5126f823aca4f8aa0
1.8.76 Hackweek version

diff -r 96b0a867c0fa -r 32b71ba642aa demos/vym-projectplan.vym
Binary file demos/vym-projectplan.vym has changed
diff -r 96b0a867c0fa -r 32b71ba642aa mainwindow.cpp
--- a/mainwindow.cpp	Fri Jun 29 09:43:54 2007 +0000
+++ b/mainwindow.cpp	Fri Jun 29 15:12:04 2007 +0000
@@ -2892,6 +2892,7 @@
 		BranchObj *bo=(BranchObj*)me->getSelection();
 		BranchObj *newbo=me->addNewBranch(0);
 
+		prevSelection=bo->getSelectString();
 		if (newbo) 
 			me->select (newbo->getSelectString());
 		else
@@ -2899,10 +2900,19 @@
 
 		if (actionSettingsAutoEdit->isOn())
 		{
-			if (!actionSettingsAutoSelectHeading->isOn())
-				prevSelection=bo->getSelectString();
 			editHeading();
+			return;
+		}	
+			/*
+		if (!actionSettingsAutoSelectHeading->isOn())
+			me->select(bo->getSelectString());
+			*/	
+		if (!prevSelection.isEmpty()) 
+		{
+			me->select(prevSelection);
+			prevSelection="";
 		}
+
 	}	
 }
 
diff -r 96b0a867c0fa -r 32b71ba642aa mapeditor.cpp
--- a/mapeditor.cpp	Fri Jun 29 09:43:54 2007 +0000
+++ b/mapeditor.cpp	Fri Jun 29 15:12:04 2007 +0000
@@ -775,7 +775,10 @@
 						// Get number in parent
 						x=parser.parInt (ok,1);
 						if (ok)
+						{
 							selb->linkTo ((BranchObj*)(dst),x);
+							xelection.update();
+						}	
 					} else if (typeid(*dst) == typeid(MapCenterObj) ) 
 					{
 						selb->linkTo ((BranchObj*)(dst),-1);
@@ -784,7 +787,11 @@
 						if (ok)
 						{
 							y=parser.parInt (ok,3);
-							if (ok) selb->move (x,y);
+							if (ok) 
+							{
+								selb->move (x,y);
+								xelection.update();
+							}
 						}
 					}	
 				}	
@@ -2450,11 +2457,9 @@
 			// so we have to pass on this information via saveState.
 			// TODO: Get rid of this positioning workaround
 			QString ps=qpointfToString (newbo->getAbsPos());
-			saveState(
-				newbo, "move "+ps, 
-				newbo, "move "+ps, 
-				QString("Move %1 to  %2").arg(getName(newbo)).arg(ps));
-
+			sendData ("selectLastBranch ()");
+			sendData (QString("move %1").arg(ps));
+			sendSelection();
 			xelection.update();
 		}
 	}	
@@ -4090,7 +4095,6 @@
 
 void MapEditor::testFunction1()
 {
-	newServer();
 
 /*
 	BranchObj *bo=xelection.getBranch();
@@ -4139,7 +4143,6 @@
 	
 void MapEditor::testFunction2()
 {
-	sendData("Foo");
 }
 
 void MapEditor::contextMenuEvent ( QContextMenuEvent * e )
@@ -4800,8 +4803,7 @@
     }
 	connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newClient()));
 	netstate=Server;
-	if (debug)
-		cout<<"Server is running on port "<<tcpServer->serverPort()<<endl;
+	cout<<"Server is running on port "<<tcpServer->serverPort()<<endl;
 }
 
 void MapEditor::connectToServer()
@@ -4865,33 +4867,24 @@
 
 void MapEditor::readData ()
 {
-	cout <<"readData  bytesAvail="<<clientSocket->bytesAvailable()<<endl;
-    quint16 recCounter;
-	quint16 blockSize;
-
-    QDataStream in(clientSocket);
-    in.setVersion(QDataStream::Qt_4_0);
-
-    in >> blockSize;
-    in >> recCounter;
-	
-	char *sp; 
-	uint l;
-	in.readBytes (sp,l);
-	cout << "  sp="<<sp<<"  l="<<l<<endl;
-	QString t;
-	in >>t;
-	cout << "  t="<<t.ascii()<<endl;
-
 	while (clientSocket->bytesAvailable() >=(int)sizeof(quint16) )
 	{
-		//cout <<"readData 1 bytesAvail="<<clientSocket->bytesAvailable()<<"  readData bS="<<blockSize<<"  rC="<<recCounter<<endl;
-		QString s;
-		in >> s;
-		//cout << "Received: "<< recCounter<< "  "<<s.ascii() <<endl;
-	cout <<"  bytesAvail="<<clientSocket->bytesAvailable()<<"   bS="<<blockSize<<"  counter="<<recCounter<<"  s="<<s.ascii()<<endl;
-		parseAtom (s);
+		cout <<"readData  bytesAvail="<<clientSocket->bytesAvailable();
+		quint16 recCounter;
+		quint16 blockSize;
+
+		QDataStream in(clientSocket);
+		in.setVersion(QDataStream::Qt_4_0);
+
+		in >> blockSize;
+		in >> recCounter;
+		
+		QString t;
+		in >>t;
+		cout << "  t="<<t.ascii()<<endl;
+		parseAtom (t);
 	}
+	return;
 }
 
 void MapEditor::displayNetworkError(QAbstractSocket::SocketError socketError)
diff -r 96b0a867c0fa -r 32b71ba642aa parser.cpp
--- a/parser.cpp	Fri Jun 29 09:43:54 2007 +0000
+++ b/parser.cpp	Fri Jun 29 15:12:04 2007 +0000
@@ -31,8 +31,6 @@
 	QRegExp re;
 	int pos;
 
-	cout << "parseAtom s="<<s.ascii()<<endl;
-
 	// Strip WS at beginning
 	re.setPattern ("\\w");
 	re.setMinimal (true);