diff -r d3080e02b13a -r 64819498efbf exports.cpp --- a/exports.cpp Thu Mar 23 12:38:54 2006 +0000 +++ b/exports.cpp Thu Jul 13 08:40:58 2006 +0000 @@ -1,11 +1,13 @@ #include #include +#include #include "exports.h" #include "file.h" #include "linkablemapobj.h" #include "misc.h" #include "mainwindow.h" +#include "warningdialog.h" #include "xsltproc.h" extern Main *mainWindow; @@ -166,20 +168,79 @@ if (mapCenter) me=mapCenter->getMapEditor(); if (me) { - me->exportXML(tmpDir.path()); - //FIXME testing - cout << "tmpDir="<exportXML(tmpDir.path()); - XSLTProc p; - p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml"); - p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml"); - p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl"); - p.process(); + XSLTProc p; + p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml"); + p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml"); + p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl"); + p.process(); + + QString ub=vymBaseDir.path()+"/scripts/update-bookmarks"; + QProcess *proc = new QProcess( ); + proc->addArgument(ub); + + if ( !proc->start() ) + { + QMessageBox::warning(0, + QObject::tr("Warning"), + QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub)); + } + + + } } } //////////////////////////////////////////////////////////////////////// +void ExportFirefoxBookmarks::doExport() +{ + MapEditor *me=NULL; + if (mapCenter) me=mapCenter->getMapEditor(); + if (me) + { + WarningDialog dia; + dia.setCancelButton (true); + dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("Firefox")); + dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("Firefox")); + dia.setShowAgainName("/vym/warnings/overwriteImportBookmarks"); + if (dia.exec()==QDialog::Accepted) + { + me->exportXML(tmpDir.path()); + +/* + XSLTProc p; + p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml"); + p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml"); + p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl"); + p.process(); + + QString ub=vymBaseDir.path()+"/scripts/update-bookmarks"; + QProcess *proc = new QProcess( ); + proc->addArgument(ub); + + if ( !proc->start() ) + { + QMessageBox::warning(0, + QObject::tr("Warning"), + QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub)); + } + +*/ + + } + } +} + +//////////////////////////////////////////////////////////////////////// void ExportTaskjuggler::doExport() { MapEditor *me=NULL;