# HG changeset patch
# User insilmaril
# Date 1158233897 0
# Node ID 8b0ab4c0f76741d74b97589974dc1c97ee7031a9
# Parent  c79df732d09524805c1e75821a551a990aad84ca
1.8.57 - more changes in history window, Note Editor is QT4 now

diff -r c79df732d095 -r 8b0ab4c0f767 branchobj.cpp
--- a/branchobj.cpp	Fri Sep 08 12:30:09 2006 +0000
+++ b/branchobj.cpp	Thu Sep 14 11:38:17 2006 +0000
@@ -664,6 +664,7 @@
 
 void BranchObj::setDockPos()
 {
+	// Sets childpos and parpos depending on orientation
 	if (getOrientation()==OrientLeftOfCenter )
     {
 		childPos=QPoint (ornamentsBBox.bottomLeft().x(), ornamentsBBox.bottomLeft().y() );
@@ -674,6 +675,7 @@
 		parPos=QPoint (ornamentsBBox.bottomLeft().x(),ornamentsBBox.bottomLeft().y() );
     }
 }
+
 LinkableMapObj* BranchObj::findMapObj(QPoint p, LinkableMapObj* excludeLMO)
 {
 	// Search branches
@@ -1242,30 +1244,42 @@
 	int th = bboxTotal.height();	
 // TODO testing
 /*
-	cout << "BO::alignRelTo "<<getHeading()<<endl;
+	cout << "BO::alignRelTo "<<getHeading().ascii()<<endl;
 	cout << "  d="<<depth<<
 		"  ref="<<ref<<
 //		"  bbox.topLeft="<<bboxTotal.topLeft()<<
 		"  absPos="<<absPos<<
+		"  relPos="<<relPos<<
+		"  orient="<<orientation<<
 //		"  pad="<<topPad<<","<<botPad<<","<<leftPad<<","<<rightPad<<
-		"  hidden="<<hidden<<
-		"  th="<<th<<endl;
+//		"  hidden="<<hidden<<
+//		"  th="<<th<<
+		endl;
 */
 
-	// If I am the mapcenter or a mainbranch, reposition heading
+	setOrientation();
+	//updateLink();
+
 	if (depth<2)
 	{
 		if (depth==1)
+		{
+			// Position relatively, if needed
+			//if (useRelPos) move2RelPos (relPos.x(), relPos.y());
+
 			// Calc angle to mapCenter if I am a mainbranch
 			// needed for reordering the mainbranches clockwise 
 			// around mapcenter 
 			angle=getAngle (QPoint ((int)(x() - parObj->getChildPos().x() ), 
 									(int)(y() - parObj->getChildPos().y() ) ) );
+		}							
 	} 
 	else
     {
 		// Align myself depending on orientation and parent, but
-		// only if I am not the mainbranch or mapcenter itself
+		// only if I am not a mainbranch or mapcenter itself
+		LinkOrient o;
+		o=parObj->getOrientation();
 		switch (orientation) 
 		{
 			case OrientLeftOfCenter:
@@ -1311,10 +1325,13 @@
 {	
 /* TODO testing only
 	if (!getHeading().isEmpty())
-		cout << "BO::reposition  "<<getHeading()<<endl;
+		cout << "BO::reposition  "<<getHeading().ascii()<<endl;
 	else	
 		cout << "BO::reposition  ???"<<endl;
+
+	cout << "  orient="<<orientation<<endl;
 */		
+
 	if (depth==0)
 	{
 		// only calculate the sizes once. If the deepest LMO 
@@ -1323,6 +1340,7 @@
 		calcBBoxSizeWithChilds();
 		updateLink();	// This update is needed if the canvas is resized 
 						// due to excessive moving of a FIO
+						// FIXME really needed? reposition is also called from updateLink...
 
 	    alignRelativeTo ( QPoint (absPos.x(),
 			absPos.y()-(bboxTotal.height()-bbox.height())/2) );
@@ -1337,6 +1355,16 @@
 	}
 }
 
+void BranchObj::unsetAllRepositionRequests()
+{
+	repositionRequest=false;
+	BranchObj *b;
+	for (b=branch.first(); b; b=branch.next() ) 
+	{
+		b->unsetAllRepositionRequests();
+	}	
+}
+
 
 QRect BranchObj::getTotalBBox()
 {
diff -r c79df732d095 -r 8b0ab4c0f767 branchobj.h
--- a/branchobj.h	Fri Sep 08 12:30:09 2006 +0000
+++ b/branchobj.h	Thu Sep 14 11:38:17 2006 +0000
@@ -113,6 +113,7 @@
     virtual BranchObj* moveBranchTo (BranchObj*, int);
     virtual void alignRelativeTo(const QPoint );
 	virtual void reposition();
+	virtual void unsetAllRepositionRequests();
 
 	virtual QRect getTotalBBox();			// return BBox including childs			
 	virtual QRect getBBoxSizeWithChilds();	// return size of BBox including childs  
diff -r c79df732d095 -r 8b0ab4c0f767 editxlinkdialog.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/editxlinkdialog.cpp	Thu Sep 14 11:38:17 2006 +0000
@@ -0,0 +1,77 @@
+#include "editxlinkdialog.h"
+
+#include <QColorDialog>
+
+EditXLinkDialog::EditXLinkDialog (QWidget *parent):QDialog (parent)
+{
+	ui.setupUi (this);
+
+	delink=false;
+	xlo=false;
+	selection=NULL;
+
+	connect ( ui.widthBox, SIGNAL (valueChanged( int)), this, SLOT (widthChanged (int)));
+	connect ( ui.colorButton, SIGNAL (clicked( )), this, SLOT (colorButtonPressed()));
+	connect ( ui.setColorHeadingButton, SIGNAL (clicked( )), this, SLOT (setColorHeadingButtonPressed()));
+	connect ( ui.deleteButton, SIGNAL (clicked( )), this, SLOT (deleteButtonPressed()));
+}
+
+void EditXLinkDialog::deleteButtonPressed()
+{
+	delink=true;
+	accept();
+}
+
+bool EditXLinkDialog::deleteXLink()
+{
+	return delink;
+}	
+
+
+void EditXLinkDialog::widthChanged( int  w)
+{
+	xlo->setWidth(w);
+}
+
+void EditXLinkDialog::setXLink( XLinkObj * xo)
+{
+	xlo=xo;
+	ui.colorButton->setPaletteBackgroundColor (xlo->getColor() );
+	ui.widthBox->setValue(xlo->getWidth());
+}
+
+void EditXLinkDialog::setSelection(LinkableMapObj *s)
+{
+	selection=s;
+}
+
+void EditXLinkDialog::colorButtonPressed()
+{
+	if (xlo)
+	{	
+		QColor col = QColorDialog::getColor(xlo->getColor(), this );
+		if ( !col.isValid() ) return;
+		xlo->setColor( col );
+		ui.colorButton->setPaletteBackgroundColor (col);
+	}
+}
+
+void EditXLinkDialog::setColorHeadingButtonPressed()
+{
+	if (xlo)
+	{	
+		if (selection && 
+			(typeid(*selection) == typeid(BranchObj)) || 
+			(typeid(*selection) == typeid(MapCenterObj))  )
+		{
+			QColor col=((BranchObj*)(selection))->getColor();
+			xlo->setColor(col);
+			ui.colorButton->setPaletteBackgroundColor (col);
+		}
+	}
+}
+
+bool EditXLinkDialog::useSettingsGlobal ()
+{
+	return ui.useSettings->isChecked();
+}
diff -r c79df732d095 -r 8b0ab4c0f767 editxlinkdialog.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/editxlinkdialog.h	Thu Sep 14 11:38:17 2006 +0000
@@ -0,0 +1,29 @@
+#ifndef EDITXLINKDIALOG_H
+#define EDITXLINKDIALOG_H
+
+#include "ui_editxlinkdialog.h"
+
+class EditXLinkDialog:public QDialog
+{
+	Q_OBJECT
+public:
+	EditXLinkDialog (QWidget *parent=0);
+	void setXLink (XLinkObj *);
+	void setSelection (LinkableMapObj *);
+	bool useSettingsGlobal();
+	bool deleteXLink();
+
+private slots:
+	void deleteButtonPressed();
+	void widthChanged (int);
+	void colorButtonPressed();
+	void setColorHeadingButtonPressed ();
+
+private:
+	Ui::EditXLinkDialog ui;
+	bool delink;
+	XLinkObj *xlo;
+	LinkableMapObj *selection;
+};
+
+#endif // EDITXLINKDIALOG_H
diff -r c79df732d095 -r 8b0ab4c0f767 editxlinkdialog.ui.h
--- a/editxlinkdialog.ui.h	Fri Sep 08 12:30:09 2006 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/****************************************************************************
-** ui.h extension file, included from the uic-generated form implementation.
-**
-** If you wish to add, delete or rename functions or slots use
-** Qt Designer which will update this file, preserving your code. Create an
-** init() function in place of a constructor, and a destroy() function in
-** place of a destructor.
-*****************************************************************************/
-void EditXLinkDialog::init()
-{
-	delink=false;
-	xlo=false;
-	selection=NULL;
-}
-
-void EditXLinkDialog::deleteButtonPressed()
-{
-	delink=true;
-	accept();
-}
-
-bool EditXLinkDialog::deleteXLink()
-{
-	return delink;
-}	
-
-
-void EditXLinkDialog::widthChanged( int  w)
-{
-	xlo->setWidth(w);
-}
-
-void EditXLinkDialog::setXLink( XLinkObj * xo)
-{
-	xlo=xo;
-	colorButton->setPaletteBackgroundColor (xlo->getColor() );
-	widthBox->setValue(xlo->getWidth());
-}
-
-void EditXLinkDialog::setSelection(LinkableMapObj *s)
-{
-	selection=s;
-}
-
-void EditXLinkDialog::colorButtonPressed()
-{
-	if (xlo)
-	{	
-		QColor col = QColorDialog::getColor(xlo->getColor(), this );
-		if ( !col.isValid() ) return;
-		xlo->setColor( col );
-		colorButton->setPaletteBackgroundColor (col);
-	}
-}
-
-void EditXLinkDialog::setColorHeadingButtonPressed()
-{
-	if (xlo)
-	{	
-		if (selection && 
-			(typeid(*selection) == typeid(BranchObj)) || 
-			(typeid(*selection) == typeid(MapCenterObj))  )
-		{
-			QColor col=((BranchObj*)(selection))->getColor();
-			xlo->setColor(col);
-			colorButton->setPaletteBackgroundColor (col);
-		}
-	}
-}
-
-bool EditXLinkDialog::useSettingsGlobal ()
-{
-	return useSettings->isChecked();
-}
diff -r c79df732d095 -r 8b0ab4c0f767 exportxhtmldialog.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exportxhtmldialog.cpp	Thu Sep 14 11:38:17 2006 +0000
@@ -0,0 +1,411 @@
+#include "exportxhtmldialog.h"
+
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QTextStream>
+
+#include "options.h"
+#include "settings.h"
+
+
+extern Options options;
+extern QDir vymBaseDir;
+extern Settings settings;
+
+ExportXHTMLDialog::ExportXHTMLDialog(QWidget* parent) : QDialog(parent)
+{
+    ui.setupUi(this);
+
+	filepath="";
+	settingsChanged=false;
+	scriptProc=new Process;
+
+    // signals and slots connections
+    connect(ui.browseExportDirButton, SIGNAL(pressed()), this, SLOT(browseDirectoryPressed()));
+    connect(ui.outputButton, SIGNAL(toggled(bool)), this, SLOT(outputButtonPressed(bool)));
+    connect(ui.browseXSLButton, SIGNAL(pressed()), this, SLOT(browseXSLPressed()));
+    connect(ui.browseCSSButton, SIGNAL(pressed()), this, SLOT(browseCSSPressed()));
+    connect(ui.imageButton, SIGNAL(toggled(bool)), this, SLOT(imageButtonPressed(bool)));
+    connect(ui.textColorButton, SIGNAL(toggled(bool)), this, SLOT(textcolorButtonPressed(bool)));
+    connect(ui.lineEditDir, SIGNAL(textChanged(const QString&)), this, SLOT(dirChanged()));
+    connect(ui.lineEditCSS, SIGNAL(textChanged(const QString&)), this, SLOT(cssChanged()));
+    connect(ui.lineEditXSL, SIGNAL(textChanged(const QString&)), this, SLOT(xslChanged()));
+    connect(ui.warningsButton, SIGNAL(toggled(bool)), this, SLOT(warningsButtonPressed(bool)));
+    connect(ui.saveSettingsInMapButton, SIGNAL(toggled(bool)), this, SLOT(saveSettingsInMapButtonPressed(bool)));
+    connect(ui.browsePreExportButton, SIGNAL(pressed()), this, SLOT(browsePreExportButtonPressed()));
+    connect(ui.lineEditPreScript, SIGNAL(textChanged(const QString&)), this, SLOT(prescriptChanged()));
+    connect(ui.lineEditPostScript, SIGNAL(textChanged(const QString&)), this, SLOT(postscriptChanged()));
+    connect(ui.browsePostExportButton, SIGNAL(pressed()), this, SLOT(browsePostExportButtonPressed()));
+}	
+
+
+void ExportXHTMLDialog::readSettings()
+{
+
+	dir=settings.readLocalEntry (filepath,"/export/xhtml/exportDir",vymBaseDir.currentDirPath() );
+	ui.lineEditDir->setText(dir);
+	
+    if ( settings.readLocalEntry (filepath,"/export/xhtml/useImage","yes")=="yes")
+		useImage=true;
+	else	
+		useImage=false;
+	ui.imageButton->setChecked(useImage);
+		
+	if ( settings.readLocalEntry (filepath,"/export/xhtml/useTextColor","no")=="yes")
+		useTextColor=true;
+	else	
+		useTextColor=false;
+	ui.textColorButton->setChecked(useTextColor);
+	
+/* FIXME this was used in old html export, is not yet in new stylesheet
+	if ( settings.readEntry ("/export/html/useHeading","no")=="yes")
+		useHeading=true;
+	else	
+		useHeading=false;
+	checkBox4_2->setChecked(useHeading);
+*/		
+
+	if ( settings.readLocalEntry (filepath,"/export/xhtml/saveSettingsInMap","no")=="yes")
+		saveSettingsInMap=true;
+	else	
+		saveSettingsInMap=false;
+	ui.saveSettingsInMapButton->setChecked(saveSettingsInMap);
+
+	if ( settings.readEntry ("/export/xhtml/showWarnings","yes")=="yes")
+		showWarnings=true;
+	else	
+		showWarnings=false;
+	ui.warningsButton->setChecked(showWarnings);
+	
+	if ( settings.readEntry ("/export/xhtml/showOutput","no")=="yes")
+		showOutput=true;
+	else	
+		showOutput=false;
+	ui.outputButton->setChecked(showOutput);
+
+	// For testing better use local styles
+	if (options.isOn ("local"))
+	{
+		xsl=vymBaseDir.path()+"/styles/vym2xhtml.xsl";
+		css=vymBaseDir.path()+"/styles/vym.css";
+	} else
+	{
+		xsl=settings.readLocalEntry 
+			(filepath,"/export/xhtml/xsl","/usr/share/vym/styles/vym2xhtml.xsl");
+		css=settings.readLocalEntry 
+			(filepath,"/export/xhtml/css","/usr/share/vym/styles/vym.css");	
+	}
+	ui.lineEditXSL->setText(xsl);
+	ui.lineEditCSS->setText(css);
+	
+	prescript=settings.readLocalEntry
+		(filepath,"/export/xhtml/prescript","");
+	ui.lineEditPreScript->setText (prescript);	
+	
+	postscript=settings.readLocalEntry
+		(filepath,"/export/xhtml/postscript","");
+	ui.lineEditPostScript->setText (postscript);	
+
+	if (!prescript.isEmpty() || !postscript.isEmpty())
+	{
+		QMessageBox::warning( 0, tr( "Warning" ),tr(
+		"The settings saved in the map "
+		"would like to run scripts:\n\n"
+		"%1\n\n"
+		"Please check, if you really\n"
+		"want to allow this in your system!").arg(prescript+"  "+postscript));
+		
+	}
+}
+
+void ExportXHTMLDialog::dirChanged()
+{
+	dir=ui.lineEditDir->text();
+	if (dir.right(1)!="/")
+		dir+="/";
+	settingsChanged=true;
+}
+
+void ExportXHTMLDialog::browseDirectoryPressed()
+{
+   	QFileDialog fd( this);
+	fd.setMode (QFileDialog::DirectoryOnly);
+	fd.setCaption(tr("VYM - Export HTML to directory"));
+	fd.setModal (true);
+	fd.setDirectory (QDir::current());
+	fd.show();
+
+	if ( fd.exec() == QDialog::Accepted )
+	{
+		dir=fd.selectedFile();
+		ui.lineEditDir->setText (dir );
+		settingsChanged=true;
+	}
+}
+
+void ExportXHTMLDialog::imageButtonPressed(bool b)
+{
+	useImage=b;
+	settingsChanged=true;
+}
+
+void ExportXHTMLDialog::textcolorButtonPressed(bool b)
+{
+	useTextColor=b;	
+	settingsChanged=true;
+}
+
+void ExportXHTMLDialog::saveSettingsInMapButtonPressed(bool b)
+{
+	saveSettingsInMap=b;	
+	settingsChanged=true;
+}
+
+void ExportXHTMLDialog::warningsButtonPressed(bool b)
+{
+	showWarnings=b;
+	settingsChanged=true;
+}
+
+
+void ExportXHTMLDialog::outputButtonPressed(bool b)
+{
+	showOutput=b;
+	settingsChanged=true;
+}
+
+void ExportXHTMLDialog::cssChanged()
+{
+	css=ui.lineEditCSS->text();
+	settingsChanged=true;
+}
+
+void ExportXHTMLDialog::browseCSSPressed()
+{
+   	QFileDialog fd( this);
+	fd.setModal (true);
+	fd.setFilter ("Cascading Stylesheet (*.css)");
+	fd.setDirectory (QDir::current());
+	fd.show();
+
+	if ( fd.exec() == QDialog::Accepted )
+	{
+		css=fd.selectedFile();
+		ui.lineEditCSS->setText (css );
+		settingsChanged=true;
+	}
+}
+
+void ExportXHTMLDialog::xslChanged()
+{
+	xsl=ui.lineEditXSL->text();
+	settingsChanged=true;
+}
+
+void ExportXHTMLDialog::prescriptChanged()
+{
+	prescript=ui.lineEditPreScript->text();
+	settingsChanged=true;
+}
+
+void ExportXHTMLDialog::browseXSLPressed()
+{
+   	QFileDialog fd( this);
+	fd.setModal (true);
+	fd.setFilter ("Extensible Stylesheet Language (*.xsl)");
+	fd.setDirectory (QDir::current());
+	fd.show();
+
+	if ( fd.exec() == QDialog::Accepted )
+	{
+		xsl=fd.selectedFile();
+		ui.lineEditXSL->setText (xsl );
+		settingsChanged=true;
+	}
+}
+
+void ExportXHTMLDialog::postscriptChanged()
+{
+	postscript=ui.lineEditPostScript->text();
+	settingsChanged=true;
+}
+
+void ExportXHTMLDialog::browsePreExportButtonPressed()
+{
+	QFileDialog fd( this);
+	fd.setModal (true);
+	fd.setFilter ("Scripts (*.sh *.pl *.py *.php)");
+	fd.setDirectory (QDir::current());
+	fd.show();
+
+	if ( fd.exec() == QDialog::Accepted )
+	{
+		prescript=fd.selectedFile();
+		ui.lineEditPreScript->setText (prescript );
+		settingsChanged=true;
+	}
+
+}
+
+void ExportXHTMLDialog::browsePostExportButtonPressed()
+{
+	QFileDialog fd( this);
+	fd.setModal (true);
+	fd.setFilter ("Scripts (*.sh *.pl *.py *.php)");
+	fd.setDirectory (QDir::current());
+	fd.show();
+
+	if ( fd.exec() == QDialog::Accepted )
+	{
+		postscript=fd.selectedFile();
+		ui.lineEditPostScript->setText (postscript );
+		settingsChanged=true;
+	}
+}
+
+
+void ExportXHTMLDialog::doExport (const QString &mapname)
+{
+	// Save options to settings file 
+	// (but don't save at destructor, which
+	// is called for "cancel", too)
+	settings.setLocalEntry (filepath,"/export/xhtml/exportDir",dir);
+	settings.setLocalEntry (filepath,"/export/xhtml/prescript",prescript);
+	settings.setLocalEntry (filepath,"/export/xhtml/postscript",postscript);
+
+    if (useImage)
+		settings.setLocalEntry (filepath,"/export/xhtml/useImage","yes");
+    else
+		settings.setLocalEntry (filepath,"/export/xhtml/useImage","no");	
+	
+  if (useTextColor)
+		settings.setLocalEntry (filepath,"/export/xhtml/useTextColor","yes");
+    else
+		settings.setLocalEntry (filepath,"/export/xhtml/useTextColor","no");	
+	
+   if (showWarnings)
+		settings.writeEntry ("/export/xhtml/showWarnings","yes");
+    else
+		settings.writeEntry ("/export/xhtml/showWarnings","no");	
+			
+	if (showOutput)
+		settings.writeEntry ("/export/xhtml/showOutput","yes");
+	else
+		settings.writeEntry ("/export/xhtml/showOutput","no");	
+
+	QString ipath;	
+	ipath=vymBaseDir.path()+"/flags/flag-url-16x16.png";
+	if (!options.isOn ("local"))
+	{
+		settings.setLocalEntry 
+			(filepath,"/export/xhtml/xsl",xsl);
+		settings.setLocalEntry 
+			(filepath,"/export/xhtml/css",css);	
+	}
+
+	// Provide a smaller URL-icon to improve Layout
+	QPixmap pm;
+	if (!pm.load(ipath,"PNG") )
+		QMessageBox::warning( 0, tr( "Warning" ),tr("Could not open %1").arg(ipath));
+		
+		
+	if(!pm.save (dir + "flags/flag-url-16x16.png","PNG"))
+		QMessageBox::warning( 0, tr( "Warning" ),tr("Could not write %1").arg(ipath));
+	if (!saveSettingsInMap)
+		settings.clearLocal("/export/xhtml");
+	else	
+		settings.setLocalEntry 
+			(filepath,"/export/xhtml/saveSettingsInMap","yes");
+
+	// Copy CSS file
+	QFile css_src (css);
+	QFile css_dst (dir+"vym.css");
+	if (!css_src.open ( QIODevice::ReadOnly))
+		QMessageBox::warning( 0, tr( "Warning" ),tr("Could not open %1").arg(css));
+	else
+	{
+		if (!css_dst.open( QIODevice::WriteOnly))
+			QMessageBox::warning( 0, tr( "Warning" ), tr("Could not open %1").arg(dir+"vym.css"));
+		else
+		{	
+		
+			QTextStream tsout( &css_dst);
+			QTextStream tsin ( &css_src);
+			QString s= tsin.read();
+			tsout << s;
+			css_dst.close();
+		}	
+		css_src.close();
+	}
+
+	if (!prescript.isEmpty()) runScript (prescript,dir+mapname+".xml");
+	
+	if (useImage)
+		p.addStringParam ("imagemap","images/"+mapname+".png");
+	if (useTextColor)
+		p.addStringParam ("use.textcolor","1");
+	p.addStringParam ("mapname",mapname+".vym");
+	
+	p.setOutputFile (dir+mapname+".html");
+	p.setInputFile (dir+mapname+".xml");
+	p.setXSLFile (xsl);
+	p.process();
+
+	if (!postscript.isEmpty()) runScript (postscript,dir+mapname+".html");
+
+}
+
+void ExportXHTMLDialog::setFilePath(const QString &s)
+{
+	filepath=s;
+}
+
+void ExportXHTMLDialog::setMapName(const QString &s)
+{
+	mapname=s;
+}
+
+QString ExportXHTMLDialog::getDir()
+{
+	return dir;
+}
+
+bool ExportXHTMLDialog::warnings()
+{
+	return showWarnings;
+}
+
+bool ExportXHTMLDialog::hasChanged()
+{
+	return settingsChanged;
+}
+
+
+void ExportXHTMLDialog::runScript(QString spath, QString fpath)
+{
+	spath.replace ("%f",fpath);
+	QStringList args=QStringList::split (' ',spath,false);
+		
+	scriptProc->clearArguments();
+	scriptProc->setArguments (args);	
+	p.addOutput ("vym is executing: \n" + scriptProc->arguments().join(" ") );	
+	if (!scriptProc->start() )
+	{
+		QMessageBox::critical( 0, tr( "Critical Error" ),
+					   tr("Could not start %1").arg(spath) );
+	} else
+	{
+		scriptProc->waitFinished();
+		if (!scriptProc->normalExit() )
+			QMessageBox::critical( 0, tr( "Critical Error" ),
+			   tr("%1 didn't exit normally").arg(spath) +
+			   scriptProc->getErrout() );
+		else
+			if (scriptProc->exitStatus()>0) showOutput=true;
+			
+	}	
+	p.addOutput ("\n");
+	p.addOutput (scriptProc->getErrout());
+	p.addOutput (scriptProc->getStdout());
+}
+
diff -r c79df732d095 -r 8b0ab4c0f767 exportxhtmldialog.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exportxhtmldialog.h	Thu Sep 14 11:38:17 2006 +0000
@@ -0,0 +1,62 @@
+#ifndef EXPORTXHTMLDIALOG_H
+#define EXPORTXHTMLDIALOG_H
+
+#include "ui_exportxhtmldialog.h"
+
+class ExportXHTMLDialog:public QDialog
+{
+	Q_OBJECT
+public:
+    ExportXHTMLDialog(QWidget* parent = 0);
+
+    virtual QString getDir();
+    virtual bool warnings();
+    virtual bool hasChanged();
+
+public slots:
+    virtual void readSettings();
+    virtual void dirChanged();
+    virtual void browseDirectoryPressed();
+    virtual void imageButtonPressed( bool b );
+    virtual void textcolorButtonPressed( bool b );
+    virtual void saveSettingsInMapButtonPressed( bool b );
+    virtual void warningsButtonPressed( bool b );
+    virtual void outputButtonPressed( bool b );
+    virtual void cssChanged();
+    virtual void browseCSSPressed();
+    virtual void xslChanged();
+    virtual void prescriptChanged();
+    virtual void browseXSLPressed();
+    virtual void postscriptChanged();
+    virtual void browsePreExportButtonPressed();
+    virtual void browsePostExportButtonPressed();
+    virtual void doExport( const QString & mapname );
+    virtual void setFilePath( const QString & s );
+    virtual void setMapName( const QString & s );
+
+protected:
+    bool useTextColor;
+    bool showWarnings;
+    QString xsl;
+    QString css;
+    bool useImage;
+    bool showOutput;
+    QString dir;
+    QString filepath;
+    QString prescript;
+    QString postscript;
+    bool settingsChanged;
+    QString mapname;
+    bool saveSettingsInMap;
+    XSLTProc p;
+    Process *scriptProc;
+
+private:
+	Ui::ExportXHTMLDialog ui;
+    void init();
+    void destroy();
+    void runScript( QString spath, QString fpath );
+
+};
+
+#endif // EXPORTXHTMLDIALOG_H
diff -r c79df732d095 -r 8b0ab4c0f767 extrainfodialog.ui.h
--- a/extrainfodialog.ui.h	Fri Sep 08 12:30:09 2006 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/****************************************************************************
-** ui.h extension file, included from the uic-generated form implementation.
-**
-** If you wish to add, delete or rename functions or slots use
-** Qt Designer which will update this file, preserving your code. Create an
-** init() function in place of a constructor, and a destroy() function in
-** place of a destructor.
-*****************************************************************************/
-
-void ExtraInfoDialog::setMapName(const QString &s)
-{
-	lineEdit7->setText (s);
-}
-
-void ExtraInfoDialog::setComment (const QString &s)
-{
-	textEdit4->setText (s);
-}
-
-QString ExtraInfoDialog::getComment()
-{
-	return textEdit4->text();
-}	
-
-
-void ExtraInfoDialog::setAuthor(const QString &s)
-{
-	lineEdit2->setText (s);
-}
-
-QString ExtraInfoDialog::getAuthor()
-{
-	return lineEdit2->text();
-}
-
-void ExtraInfoDialog::setStats(const QString &s)
-{
-	textEdit4_2->setText (s);
-}