Changeset d97db6d321 in tspsg for src


Ignore:
Timestamp:
Mar 22, 2011, 9:31:18 PM (13 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
a885c3d9d2
Parents:
d8a3826f87
git-author:
Oleksii Serdiuk <contacts@…> (03/22/11 21:31:18)
git-committer:
Oleksii Serdiuk <contacts@…> (06/29/12 19:45:58)
Message:
  • Improved some error messages: now they are more verbose.
  • Handheld version now includes larger icons (48x48 instead of 32x32).
  • Fixed bug #2: Solution graph is too small on high resolution screens.
Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/globals.h

    rd8a3826f87 rd97db6d321  
    143143
    144144#ifdef HANDHELD
    145 #   define ICON_SIZE "32x32"
     145#   define ICON_SIZE "48x48"
    146146#   define ICON_FORMAT "png"
    147147#else
  • src/mainwindow.cpp

    rd8a3826f87 rd97db6d321  
    606606    dlg->setWindowTitle(tr("About %1").arg(QCoreApplication::applicationName()));
    607607    dlg->setWindowIcon(GET_ICON("help-about"));
     608
    608609    dlg->setLayout(vb);
    609610
     
    715716            QMessageBox::warning(this, tr("Solution Result"), tr("Unable to find a solution.\nMaybe, this task has no solution."));
    716717        }
    717         pd.setLabelText(tr("Cleaning up..."));
     718        pd.setLabelText(tr("Memory cleanup..."));
    718719        pd.setMaximum(0);
    719720        pd.setCancelButton(NULL);
     
    801802    while ((step->next != SStep::NoNextStep) && (c < spinCities->value())) {
    802803        if (pd.wasCanceled()) {
    803             pd.setLabelText(tr("Cleaning up..."));
     804            pd.setLabelText(tr("Memory cleanup..."));
    804805            pd.setMaximum(0);
    805806            pd.setCancelButton(NULL);
     
    934935        solutionText->moveCursor(QTextCursor::Start);
    935936
    936     pd.setLabelText(tr("Cleaning up..."));
     937    pd.setLabelText(tr("Memory cleanup..."));
    937938    pd.setMaximum(0);
    938939    pd.setCancelButton(NULL);
     
    11061107int r;
    11071108    if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool())
    1108         r = 70;
     1109        r = logicalDpiX() / 1.27;
    11091110    else
    1110         r = 35;
     1111        r = logicalDpiX() / 2.54;
    11111112qreal x, y;
    11121113    if (step != NULL)
  • src/tspmodel.cpp

    rd8a3826f87 rd97db6d321  
    376376        return false;
    377377    else if (status == QDataStream::ReadPastEnd)
    378         err = tr("Unexpected end of file.");
     378        err = tr("Unexpected end of file. The file could be corrupted.");
    379379    else if (status == QDataStream::ReadCorruptData)
    380         err = tr("Corrupt data read. File possibly corrupted.");
     380        err = tr("Corrupt data read. The file could be corrupted.");
    381381    else
    382         err = tr("Unknown error.");
     382        err = tr("Unknown error. The file could be corrupted.");
    383383    QApplication::restoreOverrideCursor();
    384384    QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
     
    402402        QApplication::restoreOverrideCursor();
    403403        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()));
    405408        QApplication::restoreOverrideCursor();
    406409        return false;
     
    415418    if (loadError(ds->status()))
    416419        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()));
    421435        QApplication::restoreOverrideCursor();
    422436        return false;
     
    458472        QApplication::restoreOverrideCursor();
    459473        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()));
    461478        QApplication::restoreOverrideCursor();
    462479        return false;
     
    470487        QApplication::restoreOverrideCursor();
    471488        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."));
    473491        QApplication::restoreOverrideCursor();
    474492        return false;
Note: See TracChangeset for help on using the changeset viewer.