diff -r 36eb4b8f409e -r 1ad892c1a709 exporthtmldialog.cpp --- a/exporthtmldialog.cpp Thu Feb 25 11:03:52 2010 +0000 +++ b/exporthtmldialog.cpp Tue Mar 02 13:59:19 2010 +0000 @@ -20,7 +20,6 @@ filepath=""; settingsChanged=false; - scriptProc=new Process; // signals and slots connections connect(ui.browseExportDirButton, SIGNAL(pressed()), this, SLOT(browseDirectoryPressed())); @@ -31,8 +30,6 @@ connect(ui.lineEditDir, SIGNAL(textChanged(const QString&)), this, SLOT(dirChanged())); connect(ui.lineEditCSS, SIGNAL(textChanged(const QString&)), this, SLOT(cssChanged())); 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())); } @@ -88,22 +85,18 @@ } ui.lineEditCSS->setText(css); - prescript=settings.readLocalEntry - (filepath,"/export/html/prescript",""); - ui.lineEditPreScript->setText (prescript); - postscript=settings.readLocalEntry (filepath,"/export/html/postscript",""); ui.lineEditPostScript->setText (postscript); - if (!prescript.isEmpty() || !postscript.isEmpty()) + if (!postscript.isEmpty()) { QMessageBox::warning( 0, tr( "Warning" ),tr( "The settings saved in the map " - "would like to run scripts:\n\n" + "would like to run script:\n\n" "%1\n\n" "Please check, if you really\n" - "want to allow this in your system!").arg(prescript+" "+postscript)); + "want to allow this in your system!").arg(postscript)); } } @@ -195,35 +188,12 @@ } } -void ExportHTMLDialog::prescriptChanged() -{ - prescript=ui.lineEditPreScript->text(); - settingsChanged=true; -} - void ExportHTMLDialog::postscriptChanged() { postscript=ui.lineEditPostScript->text(); settingsChanged=true; } -void ExportHTMLDialog::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 ExportHTMLDialog::browsePostExportButtonPressed() { QFileDialog fd( this); @@ -241,14 +211,13 @@ } -void ExportHTMLDialog::doExport (const QString &mapname) +void ExportHTMLDialog::saveSettings () { // Save options to settings file // (but don't save at destructor, which // is called for "cancel", too) settings.setLocalEntry (filepath,"/export/html/exportDir",dir); - settings.setLocalEntry (filepath,"/export/html/prescript",prescript); settings.setLocalEntry (filepath,"/export/html/postscript",postscript); if (useImage) @@ -285,7 +254,7 @@ settings.setLocalEntry (filepath,"/export/html/saveSettingsInMap","yes"); - // Provide a smaller URL-icon to improve Layout //FIXME-1 + // Provide a smaller URL-icon to improve Layout //FIXME-1 add option to choose this QPixmap pm; if (!pm.load(ipath,"PNG") ) QMessageBox::warning( 0, tr( "Warning" ),tr("Could not open %1").arg(ipath)); @@ -294,22 +263,6 @@ if(!pm.save (dir + "flags/flag-url-16x16.png","PNG")) QMessageBox::warning( 0, tr( "Warning" ),tr("Could not write %1").arg(ipath)); - if (!prescript.isEmpty()) runScript (prescript,dir+mapname+".xml"); - - /* FIXME-1 - 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.process(); - */ - - if (!postscript.isEmpty()) runScript (postscript,dir+mapname+".html"); - } void ExportHTMLDialog::setFilePath(const QString &s) @@ -338,31 +291,3 @@ } -void ExportHTMLDialog::runScript(QString spath, QString fpath) -{ - spath.replace ("%f",fpath); - QStringList args=QStringList::split (' ',spath,false); - - //FIXME-1 p.addOutput ("vym is executing: \n" + spath+" "+args.join(" ") ); - scriptProc->start (spath,args); - if (!scriptProc->waitForStarted() ) - { - QMessageBox::critical( 0, tr( "Critical Error" ), - tr("Could not start %1").arg(spath) ); - } else - { - if (!scriptProc->waitForFinished()) - QMessageBox::critical( 0, tr( "Critical Error" ), - tr("%1 didn't exit normally").arg(spath) + - scriptProc->getErrout() ); - else - if (scriptProc->exitStatus()>0) showOutput=true; - - } - /* FIXME-1 - p.addOutput ("\n"); - p.addOutput (scriptProc->getErrout()); - p.addOutput (scriptProc->getStdout()); - */ -} -