# HG changeset patch # User insilmaril # Date 1138115388 0 # Node ID bd530b01f77f64087935ccd6a72e018f526c183a # Parent 60e2297bab39e507ab70a443139339f30ce48340 Introduced basic export to Open Document format diff -r 60e2297bab39 -r bd530b01f77f aboutdialog.cpp --- a/aboutdialog.cpp Tue Jan 24 15:09:48 2006 +0000 +++ b/aboutdialog.cpp Tue Jan 24 15:09:48 2006 +0000 @@ -25,7 +25,7 @@ "<h3><center><img src=\"vym_logo\">VYM - View Your Mind </h3>" "<p align=\"center\"> A tool to put the things you have got in your mind into a map.</p>" "<p align=\"center\"> (c) by Uwe Drechsel (<a href=\"mailto:vym@InSilmaril.de\">vym@InSilmaril.de</a>)</p>" - "<p align=\"center\"> Version " __VYM_VERSION__" - " __BUILD_DATE__"</p>" + "<p align=\"center\"> Version " __VYM_VERSION" - " __BUILD_DATE"</p>" "<ul>" "<li> Contact</li>" "<ul>" diff -r 60e2297bab39 -r bd530b01f77f demos/todo.vym Binary file demos/todo.vym has changed diff -r 60e2297bab39 -r bd530b01f77f exportoofiledialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exportoofiledialog.cpp Tue Jan 24 15:09:48 2006 +0000 @@ -0,0 +1,87 @@ +#include <iostream> + +#include "exportoofiledialog.h" + +ExportOOFileDialog::ExportOOFileDialog():QFileDialog() +{ + init(); +} + +ExportOOFileDialog::ExportOOFileDialog (QWidget * parent, const char* name, bool modal):QFileDialog(parent, name,modal) +{ + init(); +} + +QString ExportOOFileDialog::selectedConfig() +{ + QStringList::Iterator itpath=configPaths.begin(); + QStringList::Iterator itf=filters.begin(); + while (itf != filters.end()) + { + if (*itf==lastFilter) return *itpath; + itpath++; + itf++; + } + qWarning ("ExportOOFileDialog::selectedConfig No filter found!"); + return ""; +} + +void ExportOOFileDialog::newConfigPath(const QString &s) +{ + lastFilter=s; +} + +QString ExportOOFileDialog::selectedFile() +{ + return QFileDialog::selectedFile(); +} + + +void ExportOOFileDialog::addFilter(const QString &f) +{ + lastFilter=f; + filters.append (f); + QFileDialog::addFilter (f); +} + +void ExportOOFileDialog::init() +{ + QDir d; + d.setPath ("/usr/share/vym/exports"); + scanExportConfigs(d); + d.setPath (d.homeDirPath()+"/exports"); + scanExportConfigs(d); + d.setPath ("exports"); + scanExportConfigs(d); + + connect ( + this,SIGNAL (filterSelected(const QString&)), + this, SLOT( newConfigPath(const QString &))); +} + +void ExportOOFileDialog::scanExportConfigs(QDir d) +{ + // Scan existing export configurations + SimpleSettings set; + QFile f; + if (d.exists()) + { + // Traverse files + d.setFilter( QDir::Files| QDir::Hidden | QDir::NoSymLinks ); + const QFileInfoList *filelist = d.entryInfoList(); + QFileInfoListIterator itfile( *filelist ); + QFileInfo *fi; + + while ( (fi = itfile.current()) != 0 ) + { + if (fi->fileName().endsWith(".conf") ) + { + configPaths.append (fi->absFilePath()); + set.clear(); + set.readSettings (fi->absFilePath()); + addFilter (set.readEntry("Name") + " (*.odp)"); + } + ++itfile; + } + } +} diff -r 60e2297bab39 -r bd530b01f77f mapcenterobj.cpp --- a/mapcenterobj.cpp Tue Jan 24 15:09:48 2006 +0000 +++ b/mapcenterobj.cpp Tue Jan 24 15:09:48 2006 +0000 @@ -192,9 +192,9 @@ QString s2=version.section (".",1,1); QString s3=version.section (".",2,2); bool ok; - int vv1 =QString(__VYM_VERSION__).section (".",0,0).toInt(&ok,10); - int vv2 =QString(__VYM_VERSION__).section (".",1,1).toInt(&ok,10); - int vv3 =QString(__VYM_VERSION__).section (".",2,2).toInt(&ok,10); + int vv1 =QString(__VYM_VERSION).section (".",0,0).toInt(&ok,10); + int vv2 =QString(__VYM_VERSION).section (".",1,1).toInt(&ok,10); + int vv3 =QString(__VYM_VERSION).section (".",2,2).toInt(&ok,10); int mv1=0; int mv2=0; int mv3=0; diff -r 60e2297bab39 -r bd530b01f77f xml.cpp --- a/xml.cpp Tue Jan 24 15:09:48 2006 +0000 +++ b/xml.cpp Tue Jan 24 15:09:48 2006 +0000 @@ -61,7 +61,7 @@ "<h3>Map is newer than VYM</h3>" "<p>The map you are just trying to load was " "saved using vym " +atts.value("version")+". " - "The version of this vym is " __VYM_VERSION__ + "The version of this vym is " __VYM_VERSION ". If you run into problems after pressing " "the ok-button below, updating vym should help."); @@ -387,7 +387,18 @@ .arg( exception.message() ) .arg( exception.lineNumber() ) .arg( exception.columnNumber() ); + /* FIXME Testing only + errorProt += exception.publicId ()+"\n"; + errorProt += exception.systemId()+"\n"; + // Try to read the bogus line + int i=0; + QString s; + if (loadStringFromDisk (,s)) + { + errorProt += + } +*/ return QXmlDefaultHandler::fatalError( exception ); }