Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Notify failed level save at end of Save All

manongjohn3f471d64dfc1
diff --git a/toonz/sources/toonzlib/sceneresources.cpp b/toonz/sources/toonzlib/sceneresources.cpp
index 7fe5de311..9c7166a85 100644
--- a/toonz/sources/toonzlib/sceneresources.cpp
+++ b/toonz/sources/toonzlib/sceneresources.cpp
@@ -237,9 +237,7 @@ void SceneLevel::save() {
try {
m_sl->save(actualFp, oldActualPath);
} catch (...) {
- DVGui::warning(
- QObject::tr("Can't save") +
- QString::fromStdWString(L": " + actualFp.getLevelNameW()));
+ throw;
}
if ((actualFp.getType() == "tlv" || actualFp.getType() == "pli") &&
actualFp != oldActualPath && m_oldRefImgPath != TFilePath()) {
@@ -497,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);
}