1.1 --- a/exports.cpp Thu Mar 23 12:38:54 2006 +0000
1.2 +++ b/exports.cpp Thu Jul 27 15:13:16 2006 +0000
1.3 @@ -1,11 +1,13 @@
1.4 #include <qfiledialog.h>
1.5 #include <qmessagebox.h>
1.6 +#include <qprocess.h>
1.7
1.8 #include "exports.h"
1.9 #include "file.h"
1.10 #include "linkablemapobj.h"
1.11 #include "misc.h"
1.12 #include "mainwindow.h"
1.13 +#include "warningdialog.h"
1.14 #include "xsltproc.h"
1.15
1.16 extern Main *mainWindow;
1.17 @@ -166,20 +168,79 @@
1.18 if (mapCenter) me=mapCenter->getMapEditor();
1.19 if (me)
1.20 {
1.21 - me->exportXML(tmpDir.path());
1.22 - //FIXME testing
1.23 - cout << "tmpDir="<<tmpDir.path()<<endl;
1.24 + WarningDialog dia;
1.25 + dia.setCancelButton (true);
1.26 + dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("KDE"));
1.27 + dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("KDE"));
1.28 + dia.setShowAgainName("/vym/warnings/overwriteKDEBookmarks");
1.29 + if (dia.exec()==QDialog::Accepted)
1.30 + {
1.31 + me->exportXML(tmpDir.path());
1.32
1.33 - XSLTProc p;
1.34 - p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml");
1.35 - p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
1.36 - p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl");
1.37 - p.process();
1.38 + XSLTProc p;
1.39 + p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml");
1.40 + p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
1.41 + p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl");
1.42 + p.process();
1.43 +
1.44 + QString ub=vymBaseDir.path()+"/scripts/update-bookmarks";
1.45 + QProcess *proc = new QProcess( );
1.46 + proc->addArgument(ub);
1.47 +
1.48 + if ( !proc->start() )
1.49 + {
1.50 + QMessageBox::warning(0,
1.51 + QObject::tr("Warning"),
1.52 + QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub));
1.53 + }
1.54 +
1.55 +
1.56 + }
1.57 }
1.58
1.59 }
1.60
1.61 ////////////////////////////////////////////////////////////////////////
1.62 +void ExportFirefoxBookmarks::doExport()
1.63 +{
1.64 + MapEditor *me=NULL;
1.65 + if (mapCenter) me=mapCenter->getMapEditor();
1.66 + if (me)
1.67 + {
1.68 + WarningDialog dia;
1.69 + dia.setCancelButton (true);
1.70 + dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("Firefox"));
1.71 + dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("Firefox"));
1.72 + dia.setShowAgainName("/vym/warnings/overwriteImportBookmarks");
1.73 + if (dia.exec()==QDialog::Accepted)
1.74 + {
1.75 + me->exportXML(tmpDir.path());
1.76 +
1.77 +/*
1.78 + XSLTProc p;
1.79 + p.setInputFile (tmpDir.path()+"/"+me->getMapName()+".xml");
1.80 + p.setOutputFile (tmpDir.home().path()+"/.kde/share/apps/konqueror/bookmarks.xml");
1.81 + p.setXSLFile (vymBaseDir.path()+"/styles/vym2kdebookmarks.xsl");
1.82 + p.process();
1.83 +
1.84 + QString ub=vymBaseDir.path()+"/scripts/update-bookmarks";
1.85 + QProcess *proc = new QProcess( );
1.86 + proc->addArgument(ub);
1.87 +
1.88 + if ( !proc->start() )
1.89 + {
1.90 + QMessageBox::warning(0,
1.91 + QObject::tr("Warning"),
1.92 + QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub));
1.93 + }
1.94 +
1.95 +*/
1.96 +
1.97 + }
1.98 + }
1.99 +}
1.100 +
1.101 +////////////////////////////////////////////////////////////////////////
1.102 void ExportTaskjuggler::doExport()
1.103 {
1.104 MapEditor *me=NULL;