From 1d386c002562e5f0e32506c38012b7fd1263c31c Mon Sep 17 00:00:00 2001 From: Rodney Date: Nov 20 2019 22:38:38 +0000 Subject: Merge pull request #2890 from manongjohn/warn_failed_save_all_levels Warn on failing level save during Save All --- diff --git a/toonz/sources/toonzlib/sceneresources.cpp b/toonz/sources/toonzlib/sceneresources.cpp index 513c5f5..9c7166a 100644 --- a/toonz/sources/toonzlib/sceneresources.cpp +++ b/toonz/sources/toonzlib/sceneresources.cpp @@ -234,8 +234,11 @@ void SceneLevel::save() { // imageBuilder path refresh. m_sl->setPath(fp, false); } else { - m_sl->save(actualFp, oldActualPath); - + try { + m_sl->save(actualFp, oldActualPath); + } catch (...) { + throw; + } if ((actualFp.getType() == "tlv" || actualFp.getType() == "pli") && actualFp != oldActualPath && m_oldRefImgPath != TFilePath()) { // Devo preoccuparmi dell'eventuale livello colormodel @@ -492,7 +495,20 @@ void SceneResources::getResources() { void SceneResources::save(const TFilePath newScenePath) { TFilePath oldScenePath = m_scene->getScenePath(); m_scene->setScenePath(newScenePath); - for (int i = 0; i < (int)m_resources.size(); i++) m_resources[i]->save(); + bool failedSave = false; + QString failedList; + for (int i = 0; i < (int)m_resources.size(); i++) { + m_resources[i]->save(); + if (m_resources[i]->isDirty()) // didn't save for some reason + { + failedList += "\n" + m_resources[i]->getResourceName(); + failedSave = true; + } + } + + if (failedSave) + DVGui::warning(QObject::tr("Failed to save the following resources:\n") + + failedList); m_scene->setScenePath(oldScenePath); }