Merge pull request #2890 from manongjohn/warn_failed_save_all_levels
Warn on failing level save during Save All
This commit is contained in:
commit
1d386c0025
1 changed files with 19 additions and 3 deletions
|
@ -234,8 +234,11 @@ void SceneLevel::save() {
|
|||
// imageBuilder path refresh.
|
||||
m_sl->setPath(fp, false);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue