Changeset 157 in tspsg-svn for trunk/src/tspmodel.cpp
- Timestamp:
- Mar 22, 2011, 9:31:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tspmodel.cpp
r155 r157 376 376 return false; 377 377 else if (status == QDataStream::ReadPastEnd) 378 err = tr("Unexpected end of file. ");378 err = tr("Unexpected end of file. The file could be corrupted."); 379 379 else if (status == QDataStream::ReadCorruptData) 380 err = tr("Corrupt data read. File possiblycorrupted.");380 err = tr("Corrupt data read. The file could be corrupted."); 381 381 else 382 err = tr("Unknown error. ");382 err = tr("Unknown error. The file could be corrupted."); 383 383 QApplication::restoreOverrideCursor(); 384 384 QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); … … 402 402 QApplication::restoreOverrideCursor(); 403 403 QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); 404 QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("File version is newer than application supports.\nPlease, try to update application.")); 404 QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" 405 + tr("File version (%1) is newer than this version of %3 supports (%2).\n" 406 "Please, try to update the application. Also, the file might be corrupted.") 407 .arg(version).arg(TSPT_VERSION).arg(QApplication::applicationName())); 405 408 QApplication::restoreOverrideCursor(); 406 409 return false; … … 415 418 if (loadError(ds->status())) 416 419 return false; 417 if ((size < 3) || (size > MAX_NUM_CITIES)) { 418 QApplication::restoreOverrideCursor(); 419 QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); 420 QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("Unexpected data read.\nFile is possibly corrupted.")); 420 if (size < 3) { 421 QApplication::restoreOverrideCursor(); 422 QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); 423 QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" 424 + tr("Unexpected data read. The file could be corrupted.")); 425 QApplication::restoreOverrideCursor(); 426 return false; 427 } 428 if (size > MAX_NUM_CITIES) { 429 QApplication::restoreOverrideCursor(); 430 QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); 431 QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" 432 + tr("The task contains more cities (%1) than this version of %3 supports (%2).\n" 433 "You might be using an old version of the application or the file could be corrupted.") 434 .arg(size).arg(MAX_NUM_CITIES).arg(QApplication::applicationName())); 421 435 QApplication::restoreOverrideCursor(); 422 436 return false; … … 458 472 QApplication::restoreOverrideCursor(); 459 473 QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); 460 QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("File version is newer than application supports.\nPlease, try to update application.")); 474 QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" 475 + tr("File version (%1) is newer than this version of %3 supports (%2).\n" 476 "Please, try to update the application. Also, the file could be corrupted.") 477 .arg(version).arg(TSPT_VERSION).arg(QApplication::applicationName())); 461 478 QApplication::restoreOverrideCursor(); 462 479 return false; … … 470 487 QApplication::restoreOverrideCursor(); 471 488 QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); 472 QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" + tr("Unexpected data read.\nFile is possibly corrupted.")); 489 QMessageBox::critical(QApplication::activeWindow(), tr("Task Load"), tr("Unable to load task:") + "\n" 490 + tr("Unexpected data read. The file could be corrupted.")); 473 491 QApplication::restoreOverrideCursor(); 474 492 return false;
Note: See TracChangeset
for help on using the changeset viewer.