aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/simplewidgets.cpp19
-rw-r--r--desktop-widgets/simplewidgets.h1
2 files changed, 8 insertions, 12 deletions
diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp
index 366b57a84..e5b2d1012 100644
--- a/desktop-widgets/simplewidgets.cpp
+++ b/desktop-widgets/simplewidgets.cpp
@@ -122,15 +122,6 @@ ShiftTimesDialog::ShiftTimesDialog(QWidget *parent) : QDialog(parent),
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
}
-void ShiftImageTimesDialog::buttonClicked(QAbstractButton *button)
-{
- if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) {
- m_amount = ui.timeEdit->time().hour() * 3600 + ui.timeEdit->time().minute() * 60;
- if (ui.backwards->isChecked())
- m_amount *= -1;
- }
-}
-
void ShiftImageTimesDialog::syncCameraClicked()
{
QPixmap picture;
@@ -141,6 +132,10 @@ void ShiftImageTimesDialog::syncCameraClicked()
if (fileNames.isEmpty())
return;
+ ui.timeEdit->setEnabled(false);
+ ui.backwards->setEnabled(false);
+ ui.forward->setEnabled(false);
+
picture.load(fileNames.at(0));
ui.displayDC->setEnabled(true);
QGraphicsScene *scene = new QGraphicsScene(this);
@@ -160,7 +155,10 @@ void ShiftImageTimesDialog::dcDateTimeChanged(const QDateTime &newDateTime)
if (!dcImageEpoch)
return;
newtime.setTimeSpec(Qt::UTC);
- setOffset(dateTimeToTimestamp(newtime) - dcImageEpoch);
+
+ m_amount = dateTimeToTimestamp(newtime) - dcImageEpoch;
+ if (m_amount)
+ updateInvalid();
}
void ShiftImageTimesDialog::matchAllImagesToggled(bool state)
@@ -179,7 +177,6 @@ ShiftImageTimesDialog::ShiftImageTimesDialog(QWidget *parent, QStringList fileNa
matchAllImages(false)
{
ui.setupUi(this);
- connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
connect(ui.syncCamera, SIGNAL(clicked()), this, SLOT(syncCameraClicked()));
connect(ui.timeEdit, SIGNAL(timeChanged(const QTime &)), this, SLOT(timeEditChanged(const QTime &)));
connect(ui.backwards, SIGNAL(toggled(bool)), this, SLOT(timeEditChanged()));
diff --git a/desktop-widgets/simplewidgets.h b/desktop-widgets/simplewidgets.h
index 409395265..8a7418e33 100644
--- a/desktop-widgets/simplewidgets.h
+++ b/desktop-widgets/simplewidgets.h
@@ -75,7 +75,6 @@ public:
bool matchAll();
private
slots:
- void buttonClicked(QAbstractButton *button);
void syncCameraClicked();
void dcDateTimeChanged(const QDateTime &);
void timeEditChanged(const QTime &time);