Fixed broken check for non-existen OO-export configuration
authorinsilmaril
Thu Jul 13 08:40:58 2006 +0000 (2006-07-13)
changeset 35764819498efbf
parent 356 08b3473cb7ab
child 358 1cec1d19a157
Fixed broken check for non-existen OO-export configuration
exportoofiledialog.cpp
exportoofiledialog.h
lang/vym_de.ts
lang/vym_en.ts
lang/vym_es.ts
lang/vym_it.ts
mainwindow.cpp
     1.1 --- a/exportoofiledialog.cpp	Thu Jul 13 08:40:03 2006 +0000
     1.2 +++ b/exportoofiledialog.cpp	Thu Jul 13 08:40:58 2006 +0000
     1.3 @@ -12,6 +12,11 @@
     1.4  	init();
     1.5  }
     1.6  
     1.7 +bool ExportOOFileDialog::foundConfig()
     1.8 +{
     1.9 +	return !filters.isEmpty();
    1.10 +}
    1.11 +
    1.12  QString ExportOOFileDialog::selectedConfig()
    1.13  {
    1.14  	QStringList::Iterator itpath=configPaths.begin();
     2.1 --- a/exportoofiledialog.h	Thu Jul 13 08:40:03 2006 +0000
     2.2 +++ b/exportoofiledialog.h	Thu Jul 13 08:40:58 2006 +0000
     2.3 @@ -14,6 +14,7 @@
     2.4  
     2.5  	ExportOOFileDialog (QWidget * parent = 0, const char * name = 0, bool
     2.6  	modal = false);
     2.7 +	bool foundConfig();
     2.8  	QString selectedConfig();
     2.9  	QString selectedFile();
    2.10  	void addFilter(const QString &);
     3.1 --- a/lang/vym_de.ts	Thu Jul 13 08:40:03 2006 +0000
     3.2 +++ b/lang/vym_de.ts	Thu Jul 13 08:40:58 2006 +0000
     3.3 @@ -1292,7 +1292,7 @@
     3.4      </message>
     3.5      <message>
     3.6          <source>No matches found for &lt;b&gt;%1&lt;/b&gt;</source>
     3.7 -        <translation>Kein Treffer gefunden für &lt;b&gt;%1&lt;/b&gt;</translation>
     3.8 +        <translation type="obsolete">Kein Treffer gefunden für &lt;b&gt;%1&lt;/b&gt;</translation>
     3.9      </message>
    3.10      <message>
    3.11          <source>Couldn&apos;t open map %1</source>
    3.12 @@ -1640,6 +1640,16 @@
    3.13          <source>Couldn&apos;t start %1 to open a new tab</source>
    3.14          <translation>Konnte %1 nicht starten um einen neuen Tab zu öffnen.</translation>
    3.15      </message>
    3.16 +    <message>
    3.17 +        <source>Couldn&apos;t find configuration for export to Open Office
    3.18 +</source>
    3.19 +        <translation>Die Konfigurationsdateien für den Export ins Open Office
    3.20 +Format konnten nicht gefunden werden.</translation>
    3.21 +    </message>
    3.22 +    <message>
    3.23 +        <source>No matches found for &quot;%1&quot;</source>
    3.24 +        <translation>Keine Treffer gefunden für &quot;%1&quot;</translation>
    3.25 +    </message>
    3.26  </context>
    3.27  <context>
    3.28      <name>MapEditor</name>
     4.1 --- a/lang/vym_en.ts	Thu Jul 13 08:40:03 2006 +0000
     4.2 +++ b/lang/vym_en.ts	Thu Jul 13 08:40:58 2006 +0000
     4.3 @@ -863,10 +863,6 @@
     4.4          <translation type="unfinished"></translation>
     4.5      </message>
     4.6      <message>
     4.7 -        <source>No matches found for &lt;b&gt;%1&lt;/b&gt;</source>
     4.8 -        <translation type="unfinished"></translation>
     4.9 -    </message>
    4.10 -    <message>
    4.11          <source>Couldn&apos;t open map %1</source>
    4.12          <translation type="unfinished"></translation>
    4.13      </message>
    4.14 @@ -1196,6 +1192,15 @@
    4.15          <source>Couldn&apos;t start %1 to open a new tab</source>
    4.16          <translation type="unfinished"></translation>
    4.17      </message>
    4.18 +    <message>
    4.19 +        <source>Couldn&apos;t find configuration for export to Open Office
    4.20 +</source>
    4.21 +        <translation type="unfinished"></translation>
    4.22 +    </message>
    4.23 +    <message>
    4.24 +        <source>No matches found for &quot;%1&quot;</source>
    4.25 +        <translation type="unfinished"></translation>
    4.26 +    </message>
    4.27  </context>
    4.28  <context>
    4.29      <name>MapEditor</name>
     5.1 --- a/lang/vym_es.ts	Thu Jul 13 08:40:03 2006 +0000
     5.2 +++ b/lang/vym_es.ts	Thu Jul 13 08:40:58 2006 +0000
     5.3 @@ -1173,10 +1173,6 @@
     5.4          <translation type="unfinished"></translation>
     5.5      </message>
     5.6      <message>
     5.7 -        <source>No matches found for &lt;b&gt;%1&lt;/b&gt;</source>
     5.8 -        <translation type="unfinished"></translation>
     5.9 -    </message>
    5.10 -    <message>
    5.11          <source>Couldn&apos;t open map %1</source>
    5.12          <translation type="unfinished"></translation>
    5.13      </message>
    5.14 @@ -1494,6 +1490,15 @@
    5.15          <source>Couldn&apos;t start %1 to open a new tab</source>
    5.16          <translation type="unfinished"></translation>
    5.17      </message>
    5.18 +    <message>
    5.19 +        <source>Couldn&apos;t find configuration for export to Open Office
    5.20 +</source>
    5.21 +        <translation type="unfinished"></translation>
    5.22 +    </message>
    5.23 +    <message>
    5.24 +        <source>No matches found for &quot;%1&quot;</source>
    5.25 +        <translation type="unfinished"></translation>
    5.26 +    </message>
    5.27  </context>
    5.28  <context>
    5.29      <name>MapEditor</name>
     6.1 --- a/lang/vym_it.ts	Thu Jul 13 08:40:03 2006 +0000
     6.2 +++ b/lang/vym_it.ts	Thu Jul 13 08:40:58 2006 +0000
     6.3 @@ -1412,10 +1412,6 @@
     6.4          <translation type="unfinished"></translation>
     6.5      </message>
     6.6      <message>
     6.7 -        <source>No matches found for &lt;b&gt;%1&lt;/b&gt;</source>
     6.8 -        <translation type="unfinished"></translation>
     6.9 -    </message>
    6.10 -    <message>
    6.11          <source>Couldn&apos;t open map %1</source>
    6.12          <translation type="unfinished"></translation>
    6.13      </message>
    6.14 @@ -1503,6 +1499,15 @@
    6.15          <source>Couldn&apos;t start %1 to open a new tab</source>
    6.16          <translation type="unfinished"></translation>
    6.17      </message>
    6.18 +    <message>
    6.19 +        <source>Couldn&apos;t find configuration for export to Open Office
    6.20 +</source>
    6.21 +        <translation type="unfinished"></translation>
    6.22 +    </message>
    6.23 +    <message>
    6.24 +        <source>No matches found for &quot;%1&quot;</source>
    6.25 +        <translation type="unfinished"></translation>
    6.26 +    </message>
    6.27  </context>
    6.28  <context>
    6.29      <name>MapEditor</name>
     7.1 --- a/mainwindow.cpp	Thu Jul 13 08:40:03 2006 +0000
     7.2 +++ b/mainwindow.cpp	Thu Jul 13 08:40:58 2006 +0000
     7.3 @@ -2039,14 +2039,22 @@
     7.4  	//fd->setPreviewMode( QFileDialog::Contents );
     7.5  	fd->setCaption(__VYM " - " +tr("Export to")+" Open Office");
     7.6  	//fd->setDir (lastImageDir);
     7.7 -	fd->show();
     7.8 +	if (fd->foundConfig())
     7.9 +	{
    7.10 +		fd->show();
    7.11  
    7.12 -	if ( fd->exec() == QDialog::Accepted )
    7.13 +		if ( fd->exec() == QDialog::Accepted )
    7.14 +		{
    7.15 +			QString fn=fd->selectedFile();
    7.16 +			//lastImageDir=fn.left(fn.findRev ("/"));
    7.17 +			if (currentMapEditor())
    7.18 +				currentMapEditor()->exportOOPresentation(fn,fd->selectedConfig());	
    7.19 +		}
    7.20 +	} else
    7.21  	{
    7.22 -		QString fn=fd->selectedFile();
    7.23 -		//lastImageDir=fn.left(fn.findRev ("/"));
    7.24 -		if (currentMapEditor())
    7.25 -			currentMapEditor()->exportOOPresentation(fn,fd->selectedConfig());	
    7.26 +		QMessageBox::warning(0, 
    7.27 +			tr("Warning"),
    7.28 +			tr("Couldn't find configuration for export to Open Office\n"));
    7.29  	}
    7.30  }
    7.31