comparison framework/MainWindowBase.cpp @ 258:a7ab511107fa

Ensure that file load is actually cancelled when user hits Cancel! (fixing SV bug #487)
author Chris Cannam
date Fri, 22 Jun 2012 09:26:09 +0100
parents f3f9e3d647c1
children 7ee215c095dd
comparison
equal deleted inserted replaced
257:368b1f7c7325 258:a7ab511107fa
1219 } 1219 }
1220 1220
1221 bool loadedTemplate = false; 1221 bool loadedTemplate = false;
1222 1222
1223 if (mode == ReplaceSession) { 1223 if (mode == ReplaceSession) {
1224
1225 if (!checkSaveModified()) return FileOpenCancelled;
1226
1224 std::cerr << "SV looking for template " << templateName << std::endl; 1227 std::cerr << "SV looking for template " << templateName << std::endl;
1225 if (templateName != "") { 1228 if (templateName != "") {
1226 FileOpenStatus tplStatus = openSessionTemplate(templateName); 1229 FileOpenStatus tplStatus = openSessionTemplate(templateName);
1230 if (tplStatus == FileOpenCancelled) {
1231 std::cerr << "Template load cancelled" << std::endl;
1232 return FileOpenCancelled;
1233 }
1227 if (tplStatus != FileOpenFailed) { 1234 if (tplStatus != FileOpenFailed) {
1228 std::cerr << "Template load succeeded" << std::endl; 1235 std::cerr << "Template load succeeded" << std::endl;
1229 loadedTemplate = true; 1236 loadedTemplate = true;
1230 } 1237 }
1231 } 1238 }