paysages : Disable auto preview updating for render tab.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@367 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-06-27 13:28:12 +00:00 committed by ThunderK
parent 474e4284d4
commit 73e6c40f75
5 changed files with 40 additions and 19 deletions

1
TODO
View file

@ -10,7 +10,6 @@ Technology Preview 2 :
- Replace zone ranges with curves (with curve input and curve dialog).
- Interface for textures thickness, slope_range and thickness_transparency (and correct slider ranges).
- Add "hardness to light" and shadow control ("minimum lighting") to material.
- Render tab previews should not rerender when changing render options.
- Add layer sorting/naming.
- Add logarithmic sliders for some float values.
- Improve previews.

View file

@ -92,6 +92,8 @@ BaseForm::BaseForm(QWidget* parent, bool auto_apply, bool with_layers) : QWidget
button_revert->setEnabled(false);
connect(button_revert, SIGNAL(clicked()), this, SLOT(revertConfig()));
auto_update_previews = true;
if (auto_apply)
{
hideButtons();
@ -144,10 +146,9 @@ void BaseForm::configChangeEvent()
inputs[i]->checkVisibility();
}
QList<BasePreview*> list_previews = previews->findChildren<BasePreview*>("_form_preview_");
for (int i = 0; i < list_previews.size(); i++)
if (auto_update_previews)
{
list_previews[i]->redraw();
updatePreviews();
}
}
@ -167,7 +168,8 @@ void BaseForm::revertConfig()
}
}
BaseForm::configChangeEvent();
updatePreviews();
configChangeEvent();
button_apply->setEnabled(false);
button_revert->setEnabled(false);
@ -300,6 +302,20 @@ BaseInput* BaseForm::addInputEnum(QString label, int* value, const QStringList&
return addInput(new InputEnum(form, label, value, values));
}
void BaseForm::updatePreviews()
{
QList<BasePreview*> list_previews = previews->findChildren<BasePreview*>("_form_preview_");
for (int i = 0; i < list_previews.size(); i++)
{
list_previews[i]->redraw();
}
}
void BaseForm::disablePreviewsUpdate()
{
auto_update_previews = false;
}
int BaseForm::currentLayer()
{
if (with_layers)

View file

@ -51,6 +51,9 @@ protected:
BaseInput* addInputMaterial(QString label, SurfaceMaterial* material);
BaseInput* addInputEnum(QString label, int* value, const QStringList& values);
void updatePreviews();
void disablePreviewsUpdate();
int currentLayer();
void setLayerCount(int layer_count);
@ -59,6 +62,7 @@ protected:
virtual void layerSelectedEvent(int layer);
private:
bool auto_update_previews;
bool auto_apply;
bool with_layers;
QComboBox* layer_list;

View file

@ -116,6 +116,8 @@ FormRender::FormRender(QWidget *parent) :
_renderer_inited = false;
disablePreviewsUpdate();
_preview_landscape = new PreviewRenderLandscape(this);
addPreview(_preview_landscape, QString(tr("Top-down preview")));

View file

@ -29,7 +29,7 @@
<translation>Annuler les modifications</translation>
</message>
<message>
<location filename="../gui_qt/baseform.cpp" line="326"/>
<location filename="../gui_qt/baseform.cpp" line="342"/>
<source>Layer %1</source>
<translation>Niveau %1</translation>
</message>
@ -530,62 +530,62 @@ Maintenir Ctrl : Plus rapide</translation>
<context>
<name>FormRender</name>
<message>
<location filename="../gui_qt/formrender.cpp" line="120"/>
<location filename="../gui_qt/formrender.cpp" line="122"/>
<source>Top-down preview</source>
<translation>Aperçu plongeant</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="122"/>
<location filename="../gui_qt/formrender.cpp" line="124"/>
<source>Camera</source>
<translation>Caméra</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="123"/>
<location filename="../gui_qt/formrender.cpp" line="125"/>
<source>Quality</source>
<translation>Qualité de rendu</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="124"/>
<location filename="../gui_qt/formrender.cpp" line="126"/>
<source>Image width</source>
<translation>Largeur de l&apos;image</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="125"/>
<location filename="../gui_qt/formrender.cpp" line="127"/>
<source>Image height</source>
<translation>Hauteur de l&apos;image</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="126"/>
<location filename="../gui_qt/formrender.cpp" line="128"/>
<source>Anti aliasing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="128"/>
<location filename="../gui_qt/formrender.cpp" line="130"/>
<source>Start new render</source>
<translation>Démarrer un rendu</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="130"/>
<location filename="../gui_qt/formrender.cpp" line="132"/>
<source>Show last render</source>
<translation>Voir le dernier rendu</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="132"/>
<location filename="../gui_qt/formrender.cpp" line="134"/>
<source>Save last render</source>
<translation>Sauvegarder le dernier rendu</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="234"/>
<location filename="../gui_qt/formrender.cpp" line="236"/>
<source>Paysages 3D - Choose a filename to save the last render</source>
<translation>Paysages 3D - Choisissez un nom de fichier pour le rendu</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="234"/>
<location filename="../gui_qt/formrender.cpp" line="236"/>
<source>Images (*.png *.jpg)</source>
<translation>Images (*.png *.jpg)</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="247"/>
<location filename="../gui_qt/formrender.cpp" line="249"/>
<source>Can&apos;t write to file : %1</source>
<translation type="unfinished"></translation>
</message>
@ -598,7 +598,7 @@ Maintenir Ctrl : Plus rapide</translation>
<translation type="obsolete">Choisissez un nom de fichier pour le rendu</translation>
</message>
<message>
<location filename="../gui_qt/formrender.cpp" line="243"/>
<location filename="../gui_qt/formrender.cpp" line="245"/>
<source>The picture %1 has been saved.</source>
<translation>L&apos;image %1 a é sauvegardée.</translation>
</message>