Mercurial > retraceit > retraceit
diff src/pngplayer.cpp @ 44:73e6b6b12412
(issue 1,2) Make the column used for the Timestamp value configurable
If the column contains a number it is interpreted as seconds since
epoch. Otherwise its a verbatim copy of the column string.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 06 May 2015 19:45:26 +0200 |
parents | ee696abaab99 |
children | 43af5fccf61e |
line wrap: on
line diff
--- a/src/pngplayer.cpp Wed May 06 18:20:13 2015 +0200 +++ b/src/pngplayer.cpp Wed May 06 19:45:26 2015 +0200 @@ -111,7 +111,7 @@ } void PNGPlayer::showPicture(const QString& fileName, int current, int max, - const QDateTime& timestamp, int number) { + const QString& timestamp, int number) { QPixmap pic(mBaseDir.filePath(fileName)); /* If this is too slow we could use a pixmap cache here and do * some intelligent preloading */ @@ -126,7 +126,7 @@ updatePositions(current, max, timestamp, number); } -void PNGPlayer::updatePositions(int current, int max, const QDateTime& timestamp, +void PNGPlayer::updatePositions(int current, int max, const QString& timestamp, int number) { mMax = max; mSlider->blockSignals(true); /* We only want user generated changes */ @@ -135,9 +135,8 @@ mSlider->setMaximum(max); mPositionLabel->setText("<b>" + tr("Screenshot Nr.:") + " </b>" + QString("%1 (%2)").arg(current + 1).arg(max + 1) + - "<b> " + tr("Index Nr.:") + " </b>" + QString::number(number) + " / <b>" + - tr("Timestamp:") + " </b>" + (timestamp.isValid() ? - timestamp.toString(LONG_DATE_FORMAT) : tr("Unknown"))); + "/ <b>" + tr("Index Nr.:") + " </b>" + QString::number(number) + " / <b>" + + tr("Timestamp:") + " </b>" + timestamp); if (mMax == current && mAdvanceTimer.isActive()) { togglePlay(); @@ -203,7 +202,14 @@ } void PNGPlayer::togglePicFullscreen() { - qDebug() << "togglePicFullscreen"; + QSettings settings; + bool enabled = settings.value(DETACHABLE_IMAGE_KEY, DETACHABLE_IMAGE_DEFAULT).toBool(); + settings.setValue(DETACHABLE_IMAGE_KEY, enabled); + + if (!enabled) { + return; + } + QVBoxLayout *baseLayout = qobject_cast<QVBoxLayout*>(layout()); if (!baseLayout) { qWarning() << "Wrong layout!";