1.1 --- a/exports.cpp Mon May 08 13:25:46 2006 +0000
1.2 +++ b/exports.cpp Mon May 08 13:25:46 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;
2.1 --- a/exports.h Mon May 08 13:25:46 2006 +0000
2.2 +++ b/exports.h Mon May 08 13:25:46 2006 +0000
2.3 @@ -53,6 +53,13 @@
2.4 };
2.5
2.6 ///////////////////////////////////////////////////////////////////////
2.7 +class ExportFirefoxBookmarks:public ExportXMLBase
2.8 +{
2.9 +public:
2.10 + virtual void doExport();
2.11 +};
2.12 +
2.13 +///////////////////////////////////////////////////////////////////////
2.14 class ExportTaskjuggler:public ExportXMLBase
2.15 {
2.16 public:
3.1 --- a/flagrowobj.cpp Mon May 08 13:25:46 2006 +0000
3.2 +++ b/flagrowobj.cpp Mon May 08 13:25:46 2006 +0000
3.3 @@ -161,6 +161,8 @@
3.4
3.5 void FlagRowObj::activate (const QString &foname)
3.6 {
3.7 + // Note: "activate" is also called during loading of a map
3.8 + // Here we do not check for exclusive flags!
3.9 FlagObj *fo=findFlag (foname);
3.10 if (parentRow)
3.11 {
3.12 @@ -219,10 +221,14 @@
3.13 // deactivate all flags in keepof, but keep keepfo [sic!]
3.14 if (keepfo)
3.15 {
3.16 - FlagObj *fo;
3.17 - for (fo=flag.first();fo; fo=flag.next() )
3.18 - if (keepfo->getGroup()==fo->getGroup() && keepfo!=fo)
3.19 - flag.remove(fo);
3.20 + QString g=keepfo->getGroup();
3.21 + if (g!="undefined")
3.22 + {
3.23 + FlagObj *fo;
3.24 + for (fo=flag.first();fo; fo=flag.next() )
3.25 + if (g==fo->getGroup() && keepfo!=fo)
3.26 + flag.remove(fo);
3.27 + }
3.28 }
3.29 }
3.30