1.1 --- a/exportxhtmldialog.ui.h Wed Jan 25 09:04:00 2006 +0000
1.2 +++ b/exportxhtmldialog.ui.h Tue Feb 21 16:18:23 2006 +0000
1.3 @@ -12,10 +12,9 @@
1.4
1.5 void ExportXHTMLDialog::init()
1.6 {
1.7 - dia=new ShowTextDialog ();
1.8 - xsltprocessor="xsltproc";
1.9 filepath="";
1.10 settingsChanged=false;
1.11 + scriptProc=new Process;
1.12 }
1.13
1.14 void ExportXHTMLDialog::readSettings()
1.15 @@ -93,7 +92,6 @@
1.16
1.17 void ExportXHTMLDialog::destroy()
1.18 {
1.19 - delete (dia);
1.20 }
1.21
1.22 void ExportXHTMLDialog::dirChanged()
1.23 @@ -296,7 +294,7 @@
1.24 else
1.25 {
1.26 if (!css_dst.open( IO_WriteOnly))
1.27 - QMessageBox::warning( 0, tr( "Warning" ), tr("Could not open!").arg(dir+"vym.css"));
1.28 + QMessageBox::warning( 0, tr( "Warning" ), tr("Could not open %1").arg(dir+"vym.css"));
1.29 else
1.30 {
1.31
1.32 @@ -311,52 +309,18 @@
1.33
1.34 if (!prescript.isEmpty()) runScript (prescript,dir+mapname+".xml");
1.35
1.36 - Process *xsltProc=new Process ();
1.37 - xsltProc->clearArguments();
1.38 - xsltProc->addArgument (xsltprocessor);
1.39 if (useImage)
1.40 - {
1.41 - xsltProc->addArgument ("--stringparam");
1.42 - xsltProc->addArgument ("imagemap");
1.43 - xsltProc->addArgument ("images/"+mapname+".png");
1.44 - }
1.45 + p.addStringParam ("imagemap","images/"+mapname+".png");
1.46 if (useTextColor)
1.47 - {
1.48 - xsltProc->addArgument ("--stringparam");
1.49 - xsltProc->addArgument ("use.textcolor");
1.50 - xsltProc->addArgument ("1");
1.51 - }
1.52 - xsltProc->addArgument ("--stringparam");
1.53 - xsltProc->addArgument ("mapname");
1.54 - xsltProc->addArgument (mapname+".vym");
1.55 + p.addStringParam ("use.textcolor","1");
1.56 + p.addStringParam ("mapname",mapname+".vym");
1.57
1.58 - xsltProc->addArgument ("--output");
1.59 - xsltProc->addArgument (dir+mapname+".html");
1.60 - xsltProc->addArgument (xsl);
1.61 - xsltProc->addArgument (dir+mapname+".xml");
1.62 - dia->append ("vym is executing: \n" + xsltProc->arguments().join(" ") );
1.63 - if (!xsltProc->start() )
1.64 - {
1.65 - QMessageBox::critical( 0, tr( "Critical Error" ),
1.66 - tr("Could not start %1").arg(xsltprocessor) );
1.67 - } else
1.68 - {
1.69 - xsltProc->waitFinished();
1.70 - if (!xsltProc->normalExit() )
1.71 - QMessageBox::critical( 0, tr( "Critical Error" ),
1.72 - tr("%1 didn't exit normally").arg(xsltprocessor) +
1.73 - xsltProc->getErrout() );
1.74 - else
1.75 - if (xsltProc->exitStatus()>0) showOutput=true;
1.76 -
1.77 - }
1.78 - dia->append ("\n");
1.79 - dia->append (xsltProc->getErrout());
1.80 - dia->append (xsltProc->getStdout());
1.81 -
1.82 + p.setOutputFile (dir+mapname+".html");
1.83 + p.setInputFile (dir+mapname+".xml");
1.84 + p.process();
1.85 +
1.86 if (!postscript.isEmpty()) runScript (postscript,dir+mapname+".html");
1.87
1.88 - if (showOutput) dia->exec();
1.89 }
1.90
1.91 void ExportXHTMLDialog::setFilePath(const QString &s)
1.92 @@ -390,14 +354,13 @@
1.93 spath.replace ("%f",fpath);
1.94 QStringList args=QStringList::split (' ',spath,false);
1.95
1.96 - Process *scriptProc=new Process ();
1.97 scriptProc->clearArguments();
1.98 scriptProc->setArguments (args);
1.99 - dia->append ("vym is executing: \n" + scriptProc->arguments().join(" ") );
1.100 + p.addOutput ("vym is executing: \n" + scriptProc->arguments().join(" ") );
1.101 if (!scriptProc->start() )
1.102 {
1.103 QMessageBox::critical( 0, tr( "Critical Error" ),
1.104 - tr("Couldn't start %1").arg(spath) );
1.105 + tr("Could not start %1").arg(spath) );
1.106 } else
1.107 {
1.108 scriptProc->waitFinished();
1.109 @@ -409,7 +372,7 @@
1.110 if (scriptProc->exitStatus()>0) showOutput=true;
1.111
1.112 }
1.113 - dia->append ("\n");
1.114 - dia->append (scriptProc->getErrout());
1.115 - dia->append (scriptProc->getStdout());
1.116 + p.addOutput ("\n");
1.117 + p.addOutput (scriptProc->getErrout());
1.118 + p.addOutput (scriptProc->getStdout());
1.119 }