Changeset d5af6cab in subsurface


Ignore:
Timestamp:
May 1, 2017, 9:23:42 PM (6 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
9c91264
Parents:
fff253e
git-author:
Stefan Fuchs <sfuchs@…> (04/30/17 13:24:08)
git-committer:
Dirk Hohndel <dirk@…> (05/01/17 21:23:42)
Message:

Picture feature: Improve UI and translation of shift image times...

... dialog (part 2)

Show date/time of first/last selected dive instead of displayed_dive.
Thats more useful to identify the right time offset for the images.

Trigger first update of image info already in constructor of the dialog.

Update the results and UI also when the "backwards" radio button is changed.

Signed-off-by: Stefan Fuchs <sfuchs@…>

Location:
desktop-widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • desktop-widgets/simplewidgets.cpp

    rfff253e rd5af6cab  
    356356        connect(ui.syncCamera, SIGNAL(clicked()), this, SLOT(syncCameraClicked()));
    357357        connect(ui.timeEdit, SIGNAL(timeChanged(const QTime &)), this, SLOT(timeEditChanged(const QTime &)));
     358        connect(ui.backwards, SIGNAL(toggled(bool)), this, SLOT(timeEditChanged()));
    358359        connect(ui.matchAllImages, SIGNAL(toggled(bool)), this, SLOT(matchAllImagesToggled(bool)));
    359360        dcImageEpoch = (time_t)0;
     361       
     362        updateInvalid();
    360363}
    361364
     
    382385        ui.warningLabel->hide();
    383386        ui.invalidFilesText->hide();
    384         QDateTime time = QDateTime::fromTime_t(displayed_dive.when, Qt::UTC);
    385         ui.invalidFilesText->setPlainText(tr("Dive date/time") + ": " + time.toString() + "\n");
    386         ui.invalidFilesText->append(tr("Files with inappropriate date/time") + ":");
     387        QDateTime time_first = QDateTime::fromTime_t(first_selected_dive()->when, Qt::UTC);
     388        QDateTime time_last = QDateTime::fromTime_t(last_selected_dive()->when, Qt::UTC);
     389        if (first_selected_dive() == last_selected_dive())
     390                ui.invalidFilesText->setPlainText(tr("Selected dive date/time") + ": " + time_first.toString());
     391        else {
     392                ui.invalidFilesText->setPlainText(tr("First selected dive date/time") + ": " + time_first.toString());
     393                ui.invalidFilesText->append(tr("Last selected dive date/time") + ": " + time_last.toString());
     394        }
     395        ui.invalidFilesText->append(tr("\nFiles with inappropriate date/time") + ":");
    387396
    388397        Q_FOREACH (const QString &fileName, fileNames) {
     
    392401                // We've found invalid image
    393402                timestamp = picture_get_timestamp(fileName.toUtf8().data());
    394                 time.setTime_t(timestamp + m_amount);
    395                 ui.invalidFilesText->append(fileName + " " + time.toString());
     403                time_first.setTime_t(timestamp + m_amount);
     404                ui.invalidFilesText->append(fileName + " " + time_first.toString());
    396405                allValid = false;
    397406        }
     
    409418                        m_amount *= -1;
    410419        updateInvalid();
     420}
     421
     422void ShiftImageTimesDialog::timeEditChanged()
     423{
     424        if (m_amount > 0 == ui.backwards->isChecked())
     425                        m_amount *= -1;
     426        if (m_amount) updateInvalid();
    411427}
    412428
  • desktop-widgets/simplewidgets.h

    r9021a44 rd5af6cab  
    112112        void dcDateTimeChanged(const QDateTime &);
    113113        void timeEditChanged(const QTime &time);
     114        void timeEditChanged();
    114115        void updateInvalid();
    115116        void matchAllImagesToggled(bool);
Note: See TracChangeset for help on using the changeset viewer.