diff -r 00ac7b2ac016 -r 6a7db028088e exports.cpp --- a/exports.cpp Mon May 08 13:25:46 2006 +0000 +++ b/exports.cpp Mon May 08 13:25:46 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;