# HG changeset patch # User insilmaril # Date 1152780058 0 # Node ID 64819498efbf8840c686e173b8a4d73d87b88f2e # Parent 08b3473cb7abd7dd330a3efdf5055bcebbe92bd9 Fixed broken check for non-existen OO-export configuration diff -r 08b3473cb7ab -r 64819498efbf exportoofiledialog.cpp --- a/exportoofiledialog.cpp Thu Jul 13 08:40:03 2006 +0000 +++ b/exportoofiledialog.cpp Thu Jul 13 08:40:58 2006 +0000 @@ -12,6 +12,11 @@ init(); } +bool ExportOOFileDialog::foundConfig() +{ + return !filters.isEmpty(); +} + QString ExportOOFileDialog::selectedConfig() { QStringList::Iterator itpath=configPaths.begin(); diff -r 08b3473cb7ab -r 64819498efbf exportoofiledialog.h --- a/exportoofiledialog.h Thu Jul 13 08:40:03 2006 +0000 +++ b/exportoofiledialog.h Thu Jul 13 08:40:58 2006 +0000 @@ -14,6 +14,7 @@ ExportOOFileDialog (QWidget * parent = 0, const char * name = 0, bool modal = false); + bool foundConfig(); QString selectedConfig(); QString selectedFile(); void addFilter(const QString &); diff -r 08b3473cb7ab -r 64819498efbf lang/vym_de.ts --- a/lang/vym_de.ts Thu Jul 13 08:40:03 2006 +0000 +++ b/lang/vym_de.ts Thu Jul 13 08:40:58 2006 +0000 @@ -1292,7 +1292,7 @@ </message> <message> <source>No matches found for <b>%1</b></source> - <translation>Kein Treffer gefunden für <b>%1</b></translation> + <translation type="obsolete">Kein Treffer gefunden für <b>%1</b></translation> </message> <message> <source>Couldn't open map %1</source> @@ -1640,6 +1640,16 @@ <source>Couldn't start %1 to open a new tab</source> <translation>Konnte %1 nicht starten um einen neuen Tab zu öffnen.</translation> </message> + <message> + <source>Couldn't find configuration for export to Open Office +</source> + <translation>Die Konfigurationsdateien für den Export ins Open Office +Format konnten nicht gefunden werden.</translation> + </message> + <message> + <source>No matches found for "%1"</source> + <translation>Keine Treffer gefunden für "%1"</translation> + </message> </context> <context> <name>MapEditor</name> diff -r 08b3473cb7ab -r 64819498efbf lang/vym_en.ts --- a/lang/vym_en.ts Thu Jul 13 08:40:03 2006 +0000 +++ b/lang/vym_en.ts Thu Jul 13 08:40:58 2006 +0000 @@ -863,10 +863,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>No matches found for <b>%1</b></source> - <translation type="unfinished"></translation> - </message> - <message> <source>Couldn't open map %1</source> <translation type="unfinished"></translation> </message> @@ -1196,6 +1192,15 @@ <source>Couldn't start %1 to open a new tab</source> <translation type="unfinished"></translation> </message> + <message> + <source>Couldn't find configuration for export to Open Office +</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>No matches found for "%1"</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>MapEditor</name> diff -r 08b3473cb7ab -r 64819498efbf lang/vym_es.ts --- a/lang/vym_es.ts Thu Jul 13 08:40:03 2006 +0000 +++ b/lang/vym_es.ts Thu Jul 13 08:40:58 2006 +0000 @@ -1173,10 +1173,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>No matches found for <b>%1</b></source> - <translation type="unfinished"></translation> - </message> - <message> <source>Couldn't open map %1</source> <translation type="unfinished"></translation> </message> @@ -1494,6 +1490,15 @@ <source>Couldn't start %1 to open a new tab</source> <translation type="unfinished"></translation> </message> + <message> + <source>Couldn't find configuration for export to Open Office +</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>No matches found for "%1"</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>MapEditor</name> diff -r 08b3473cb7ab -r 64819498efbf lang/vym_it.ts --- a/lang/vym_it.ts Thu Jul 13 08:40:03 2006 +0000 +++ b/lang/vym_it.ts Thu Jul 13 08:40:58 2006 +0000 @@ -1412,10 +1412,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>No matches found for <b>%1</b></source> - <translation type="unfinished"></translation> - </message> - <message> <source>Couldn't open map %1</source> <translation type="unfinished"></translation> </message> @@ -1503,6 +1499,15 @@ <source>Couldn't start %1 to open a new tab</source> <translation type="unfinished"></translation> </message> + <message> + <source>Couldn't find configuration for export to Open Office +</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>No matches found for "%1"</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>MapEditor</name> diff -r 08b3473cb7ab -r 64819498efbf mainwindow.cpp --- a/mainwindow.cpp Thu Jul 13 08:40:03 2006 +0000 +++ b/mainwindow.cpp Thu Jul 13 08:40:58 2006 +0000 @@ -2039,14 +2039,22 @@ //fd->setPreviewMode( QFileDialog::Contents ); fd->setCaption(__VYM " - " +tr("Export to")+" Open Office"); //fd->setDir (lastImageDir); - fd->show(); + if (fd->foundConfig()) + { + fd->show(); - if ( fd->exec() == QDialog::Accepted ) + if ( fd->exec() == QDialog::Accepted ) + { + QString fn=fd->selectedFile(); + //lastImageDir=fn.left(fn.findRev ("/")); + if (currentMapEditor()) + currentMapEditor()->exportOOPresentation(fn,fd->selectedConfig()); + } + } else { - QString fn=fd->selectedFile(); - //lastImageDir=fn.left(fn.findRev ("/")); - if (currentMapEditor()) - currentMapEditor()->exportOOPresentation(fn,fd->selectedConfig()); + QMessageBox::warning(0, + tr("Warning"), + tr("Couldn't find configuration for export to Open Office\n")); } }