# HG changeset patch
# User insilmaril
# Date 1147094746 0
# Node ID 6a7db028088e8a1d6d7ffefd1a3f6db59a4b53df
# Parent  00ac7b2ac0167fcec9656467be13e338b6c81ebe
1.7.16 Small bugfixes

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 <qfiledialog.h>
 #include <qmessagebox.h>
+#include <qprocess.h>
 
 #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="<<tmpDir.path()<<endl;
+		WarningDialog dia;
+		dia.setCancelButton (true);
+		dia.setText(QObject::tr("Exporting the %1 bookmarks will overwrite\nyour existing bookmarks file.").arg("KDE"));
+		dia.setCaption(QObject::tr("Warning: Overwriting %1 bookmarks").arg("KDE"));
+		dia.setShowAgainName("/vym/warnings/overwriteKDEBookmarks");
+		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();
+			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;
diff -r 00ac7b2ac016 -r 6a7db028088e exports.h
--- a/exports.h	Mon May 08 13:25:46 2006 +0000
+++ b/exports.h	Mon May 08 13:25:46 2006 +0000
@@ -53,6 +53,13 @@
 };	
 
 ///////////////////////////////////////////////////////////////////////
+class ExportFirefoxBookmarks:public ExportXMLBase
+{
+public:
+	virtual void doExport();
+};	
+
+///////////////////////////////////////////////////////////////////////
 class ExportTaskjuggler:public ExportXMLBase
 {
 public:
diff -r 00ac7b2ac016 -r 6a7db028088e flagrowobj.cpp
--- a/flagrowobj.cpp	Mon May 08 13:25:46 2006 +0000
+++ b/flagrowobj.cpp	Mon May 08 13:25:46 2006 +0000
@@ -161,6 +161,8 @@
 
 void FlagRowObj::activate (const QString &foname)
 {
+	// Note: "activate" is also called during loading of a map
+	// Here we do not check for exclusive flags!
 	FlagObj *fo=findFlag (foname);
 	if (parentRow)
 	{
@@ -219,10 +221,14 @@
 	// deactivate all flags in keepof, but keep keepfo [sic!]
 	if (keepfo)
 	{
-		FlagObj *fo;
-		for (fo=flag.first();fo; fo=flag.next() )
-			if (keepfo->getGroup()==fo->getGroup() && keepfo!=fo) 
-				flag.remove(fo);
+		QString g=keepfo->getGroup();
+		if (g!="undefined")
+		{
+			FlagObj *fo;
+			for (fo=flag.first();fo; fo=flag.next() )
+				if (g==fo->getGroup() && keepfo!=fo) 
+					flag.remove(fo);
+		}		
 	}	
 }