paysages: Small improvements.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@299 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-04-16 19:24:46 +00:00 committed by ThunderK
parent 6ebd78f030
commit c3348b93f4
3 changed files with 71 additions and 18 deletions

View file

@ -194,9 +194,13 @@ void FormRender::saveRender()
{ {
QString filepath; QString filepath;
filepath = QFileDialog::getSaveFileName(this, tr("Choose a filename to save the last render")); filepath = QFileDialog::getSaveFileName(this, tr("Paysages 3D - Choose a filename to save the last render"), QString(), tr("Images (*.png *.jpg)"));
if (!filepath.isNull()) if (!filepath.isNull())
{ {
if (!filepath.toLower().endsWith(".jpg") && !filepath.toLower().endsWith(".jpeg") && !filepath.toLower().endsWith(".png"))
{
filepath = filepath.append(".png");
}
renderSaveToFile(_renderer.render_area, (char*)filepath.toStdString().c_str()); renderSaveToFile(_renderer.render_area, (char*)filepath.toStdString().c_str());
QMessageBox::information(this, "Message", QString(tr("The picture %1 has been saved.")).arg(filepath)); QMessageBox::information(this, "Message", QString(tr("The picture %1 has been saved.")).arg(filepath));
} }

View file

@ -137,7 +137,7 @@ void MainWindow::refreshAll()
void MainWindow::fileNew() void MainWindow::fileNew()
{ {
if (QMessageBox::question(this, tr("New lanscape"), tr("Do you want to start a new landscape ? Any unsaved changes will be lost."), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) if (QMessageBox::question(this, tr("Paysages 3D - New scenery"), tr("Do you want to start a new scenery ? Any unsaved changes will be lost."), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
{ {
autoGenRealisticLandscape(0); autoGenRealisticLandscape(0);
autoSetDaytime(8, 30); autoSetDaytime(8, 30);
@ -147,18 +147,22 @@ void MainWindow::fileNew()
void MainWindow::fileSave() void MainWindow::fileSave()
{ {
QString filepath = QFileDialog::getSaveFileName(this); QString filepath = QFileDialog::getSaveFileName(this, tr("Paysages 3D - Choose a file to save the scenery"), QString(), tr("Paysages 3D Scenery (*.p3d)"));
if (!filepath.isNull()) if (!filepath.isNull())
{ {
if (!filepath.toLower().endsWith(".p3d"))
{
filepath = filepath.append(".p3d");
}
paysagesSave((char*)filepath.toStdString().c_str()); paysagesSave((char*)filepath.toStdString().c_str());
} }
} }
void MainWindow::fileLoad() void MainWindow::fileLoad()
{ {
if (QMessageBox::question(this, tr("Load lanscape"), tr("Do you want to load a landscape ? Any unsaved changes will be lost."), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) if (QMessageBox::question(this, tr("Paysages 3D - Load scenery"), tr("Do you want to load a scenery from file ? Any unsaved changes will be lost."), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
{ {
QString filepath = QFileDialog::getOpenFileName(this); QString filepath = QFileDialog::getOpenFileName(this, tr("Paysages 3D - Choose a scenery file to load"), QString(), tr("Paysages 3D Scenery (*.p3d)"));
if (!filepath.isNull()) if (!filepath.isNull())
{ {
paysagesLoad((char*)filepath.toStdString().c_str()); paysagesLoad((char*)filepath.toStdString().c_str());

View file

@ -394,11 +394,24 @@ Maintenir Ctrl : Plus rapide</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="197"/> <location filename="../gui_qt/formrender.cpp" line="197"/>
<source>Choose a filename to save the last render</source> <source>Paysages 3D - Choose a filename to save the last render</source>
<translation>Choisissez un nom de fichier pour le rendu</translation> <translation>Paysages 3D - Choisissez un nom de fichier pour le rendu</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="201"/> <location filename="../gui_qt/formrender.cpp" line="197"/>
<source>Images (*.png *.jpg)</source>
<translation>Images (*.png *.jpg)</translation>
</message>
<message>
<source>Images (*.png, *.jpg)</source>
<translation type="obsolete">Images (*.png *.jpg)</translation>
</message>
<message>
<source>Choose a filename to save the last render</source>
<translation type="obsolete">Choisissez un nom de fichier pour le rendu</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="205"/>
<source>The picture %1 has been saved.</source> <source>The picture %1 has been saved.</source>
<translation>L&apos;image %1 a é sauvegardée.</translation> <translation>L&apos;image %1 a é sauvegardée.</translation>
</message> </message>
@ -742,6 +755,42 @@ rapide (F5)</translation>
<source>F5</source> <source>F5</source>
<translation>F5</translation> <translation>F5</translation>
</message> </message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="140"/>
<source>Do you want to start a new scenery ? Any unsaved changes will be lost.</source>
<translation>Voulez-vous commencer un nouveau paysage ? Les modifications non sauvegardées seront perdues.</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="140"/>
<source>Paysages 3D - New scenery</source>
<translation>Paysages 3D - Nouvelle scène</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="150"/>
<source>Paysages 3D - Choose a file to save the scenery</source>
<translation>Paysages 3D - Choisissez un fichier pour enregistrer la scène</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="150"/>
<location filename="../gui_qt/mainwindow.cpp" line="165"/>
<source>Paysages 3D Scenery (*.p3d)</source>
<translation>Scène Paysages 3D</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="163"/>
<source>Do you want to load a scenery from file ? Any unsaved changes will be lost.</source>
<translation>Voulez-vous charger une scène ? Les modifications nons sauvegardées seront perdues.</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="163"/>
<source>Paysages 3D - Load scenery</source>
<translation>Paysages 3D - Charger une scène</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="165"/>
<source>Paysages 3D - Choose a scenery file to load</source>
<translation>Paysages 3D - Choisissez un fichier de scène à charger</translation>
</message>
<message> <message>
<location filename="../gui_qt/mainwindow.cpp" line="88"/> <location filename="../gui_qt/mainwindow.cpp" line="88"/>
<source>Sky</source> <source>Sky</source>
@ -823,32 +872,28 @@ rapide (F5)</translation>
<translation>&amp;A propos</translation> <translation>&amp;A propos</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/mainwindow.cpp" line="140"/>
<source>New lanscape</source> <source>New lanscape</source>
<translation type="unfinished"></translation> <translation type="obsolete">Nouveau paysage</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/mainwindow.cpp" line="140"/>
<source>Do you want to start a new landscape ? Any unsaved changes will be lost.</source> <source>Do you want to start a new landscape ? Any unsaved changes will be lost.</source>
<translation type="unfinished"></translation> <translation type="obsolete">Voulez-vous commencer un nouveau paysage ? Les modifications non sauvegardées seront perdues.</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/mainwindow.cpp" line="159"/>
<source>Load lanscape</source> <source>Load lanscape</source>
<translation type="unfinished"></translation> <translation type="obsolete">Charger un paysage</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/mainwindow.cpp" line="159"/>
<source>Do you want to load a landscape ? Any unsaved changes will be lost.</source> <source>Do you want to load a landscape ? Any unsaved changes will be lost.</source>
<translation type="unfinished"></translation> <translation type="obsolete">Voulez-vous charger un paysage ? Les modifications nons sauvegardées seront perdues.</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/mainwindow.cpp" line="172"/> <location filename="../gui_qt/mainwindow.cpp" line="176"/>
<source>Paysages 3D</source> <source>Paysages 3D</source>
<translation>Paysages 3D</translation> <translation>Paysages 3D</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/mainwindow.cpp" line="172"/> <location filename="../gui_qt/mainwindow.cpp" line="176"/>
<source>A 3D landscape editing and rendering software. <source>A 3D landscape editing and rendering software.
Credits : Credits :