diff --git a/TODO b/TODO index f912237..9e49618 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,5 @@ Technology Preview 2 : - Fix the fog impression when cloud layer overlaps with ground range. -- Fix forms with layers apply and revert buttons (when deleting last cloud layer, can't apply it). - Replace zone ranges with curves (with curve input and curve dialog). - Interface for textures thickness, slope_range and thickness_transparency (and correct slider ranges). - Render tab previews should not rerender when changing render options. @@ -45,6 +44,7 @@ Technology Preview 3 : - Improve sky rendering (colors and light halo). - Add a progress indicator on previews. - Multi threaded first pass. +- Mark modified tabs and ask for losing modifications (idem for layers). - Fix potential holes in land rendering. - Progressive final render. - Propose several backgrounds for water rendering (grid, sinus...). diff --git a/gui_qt/baseform.cpp b/gui_qt/baseform.cpp index 11a8fa9..27c9ac1 100644 --- a/gui_qt/baseform.cpp +++ b/gui_qt/baseform.cpp @@ -155,16 +155,27 @@ void BaseForm::applyConfig() void BaseForm::layerAddClicked() { layerAddedEvent(); + + button_apply->setEnabled(true); + button_revert->setEnabled(true); } void BaseForm::layerDelClicked() { layerDeletedEvent(layer_list->currentIndex()); + + button_apply->setEnabled(true); + button_revert->setEnabled(true); } void BaseForm::layerListChanged() { + bool changed = button_apply->isEnabled(); + layerSelectedEvent(layer_list->currentIndex()); + + button_apply->setEnabled(changed); + button_revert->setEnabled(changed); } void BaseForm::addPreview(BasePreview* preview, QString label) diff --git a/gui_qt/basepreview.cpp b/gui_qt/basepreview.cpp index 0f26635..d8cff7d 100644 --- a/gui_qt/basepreview.cpp +++ b/gui_qt/basepreview.cpp @@ -169,6 +169,7 @@ void PreviewDrawingManager::addChunk(PreviewChunk* chunk) void PreviewDrawingManager::removeChunks(BasePreview* preview) { + int removed = 0; for (int i = 0; i < _chunks.size(); i++) { PreviewChunk* chunk; @@ -180,9 +181,12 @@ void PreviewDrawingManager::removeChunks(BasePreview* preview) _updateQueue.removeAll(chunk); _lock.unlock(); + removed++; i--; } } + + logDebug(QString("[Previews] %1 chunks removed, %2 remaining").arg(removed).arg(_chunks.size())); } void PreviewDrawingManager::updateChunks(BasePreview* preview) @@ -241,6 +245,11 @@ void PreviewDrawingManager::performOneThreadJob() } } +int PreviewDrawingManager::chunkCount() +{ + return _chunks.size(); +} + /*************** BasePreview ***************/ BasePreview::BasePreview(QWidget* parent) : QWidget(parent) @@ -301,7 +310,7 @@ void BasePreview::stopDrawers() void BasePreview::reviveAll() { - logDebug("Reviving all previews"); + logDebug("[Previews] Reviving all previews"); _drawing_manager->updateAllChunks(); } @@ -400,6 +409,7 @@ void BasePreview::showEvent(QShowEvent* event) void BasePreview::resizeEvent(QResizeEvent* event) { QImage* image; + int added = 0; this->lock_drawing->lock(); @@ -418,8 +428,10 @@ void BasePreview::resizeEvent(QResizeEvent* event) for (int y = 0; y < _height; y += 32) { _drawing_manager->addChunk(new PreviewChunk(this, x, y, x + 32 > _width ? _width - x : 32, y + 32 > _height ? _height - y : 32)); + added++; } } + logDebug(QString("[Previews] %1 chunks added, %2 total").arg(added).arg(_drawing_manager->chunkCount())); delete image; diff --git a/gui_qt/basepreview.h b/gui_qt/basepreview.h index 128da2f..356a6b8 100644 --- a/gui_qt/basepreview.h +++ b/gui_qt/basepreview.h @@ -117,6 +117,7 @@ public: void updateChunks(BasePreview* preview); void updateAllChunks(); void performOneThreadJob(); + int chunkCount(); private: int _thread_count; diff --git a/i18n/paysages_fr.ts b/i18n/paysages_fr.ts index 1856135..3293356 100644 --- a/i18n/paysages_fr.ts +++ b/i18n/paysages_fr.ts @@ -29,7 +29,7 @@ Annuler les modifications - + Layer %1 Niveau %1