Changeset 0e264872 in subsurface


Ignore:
Timestamp:
Feb 7, 2015, 8:56:27 AM (3 years ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
Mtest, android_test, dcDownload, foratdotde, gitMerge, gitdebug, gitpictures, ios, master, mergeKirigamiPort, pictimeshift, resolutionIndependence, spinner, testTomaz, testing, v4.5-branch
Children:
02e52c8
Parents:
936fc2da
git-author:
Miika Turkia <miika.turkia@…> (02/07/15 06:42:28)
git-committer:
Dirk Hohndel <dirk@…> (02/07/15 08:56:27)
Message:

Select the known import for APD automatically

If the filename has extension of .apd, then set the known import
automatically.

Signed-off-by: Miika Turkia <miika.turkia@…>
Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qt-ui/divelogimportdialog.cpp

    r2dc1a42 r0e264872  
    362362        bool seabear = false;
    363363        bool xp5 = false;
     364        bool apd = false;
    364365
    365366        // reset everything
     
    388389
    389390        // Special handling for APD Log Viewer
    390         if (triggeredBy == KNOWNTYPES && value == 1) {
     391        if ((triggeredBy == KNOWNTYPES && value == 1) || (triggeredBy == INITIAL && fileNames.first().endsWith(".apd", Qt::CaseInsensitive))) {
     392                apd=true;
    391393                firstLine = "Sample time\tSample depth\t\t\t\t\tSample pO₂\t\t\t\t\t\t\t\t\tSample temperature\t\tSample CNS\tSample stopdepth";
    392394                blockSignals(true);
    393395                ui->CSVSeparator->setCurrentText(tr("Tab"));
     396                if (triggeredBy == INITIAL && fileNames.first().contains(".apd", Qt::CaseInsensitive))
     397                        ui->knownImports->setCurrentText("APD Log Viewer");
    394398                blockSignals(false);
    395399        }
     
    434438                if (matchedSome) {
    435439                        ui->dragInstructions->setText(tr("Some column headers were pre-populated; please drag and drop the headers so they match the column they are in."));
    436                         if (triggeredBy != KNOWNTYPES && !seabear && !xp5) {
     440                        if (triggeredBy != KNOWNTYPES && !seabear && !xp5 && !apd) {
    437441                                blockSignals(true);
    438442                                ui->knownImports->setCurrentIndex(0); // <- that's "Manual import"
Note: See TracChangeset for help on using the changeset viewer.