Commit d2f30322 authored by Marc R.'s avatar Marc R.

added correct display of seconds to sync control

parent 696914cf
......@@ -193,7 +193,7 @@ MSyncControl::MSyncControl(QString id, QWidget *parent) :
timeAnimationFromWidget = new QWidget(this);
timeAnimationFrom = new QDateTimeEdit(timeAnimationFromWidget);
timeAnimationFrom->setDisplayFormat("ddd yyyy-MM-dd hh:mm UTC");
timeAnimationFrom->setDisplayFormat("ddd yyyy-MM-dd hh:mm:ss UTC");
timeAnimationFrom->setTimeSpec(Qt::UTC);
copyInitTimeToAnimationFromButton = new QPushButton("IT", timeAnimationFromWidget);
copyInitTimeToAnimationFromButton->setMinimumWidth(widthOfCopyButtons);
......@@ -226,7 +226,7 @@ MSyncControl::MSyncControl(QString id, QWidget *parent) :
timeAnimationToWidget = new QWidget(this);
timeAnimationTo = new QDateTimeEdit(timeAnimationToWidget);
timeAnimationTo->setDisplayFormat("ddd yyyy-MM-dd hh:mm UTC");
timeAnimationTo->setDisplayFormat("ddd yyyy-MM-dd hh:mm:ss UTC");
timeAnimationTo->setTimeSpec(Qt::UTC);
copyInitTimeToAnimationToButton = new QPushButton("IT", timeAnimationToWidget);
copyInitTimeToAnimationToButton->setMinimumWidth(widthOfCopyButtons);
......@@ -1682,8 +1682,15 @@ void MSyncControl::updateTimeDifference()
{
QDateTime validTime = ui->validTimeEdit->dateTime();
QDateTime initTime = ui->initTimeEdit->dateTime();
QString s = QString("%1 hrs from").arg(
int(initTime.secsTo(validTime) / 3600.));
int timeDifferenceSecs = initTime.secsTo(validTime);
int timeDifferenceHrs = timeDifferenceSecs / 3600.;
timeDifferenceSecs = fmod(timeDifferenceSecs, 3600.);
int timeDifferenceMin = timeDifferenceSecs / 60.;
timeDifferenceSecs = fmod(timeDifferenceSecs, 60.);
QString s = QString("%1:%2:%3 hrs from").arg(
timeDifferenceHrs, 2, 10, QLatin1Char('0')).arg(
timeDifferenceMin, 2, 10, QLatin1Char('0')).arg(
timeDifferenceSecs, 2, 10, QLatin1Char('0'));
ui->differenceValidInitLabel->setText(s);
}
......
......@@ -132,7 +132,7 @@
</property>
<property name="dateTime">
<datetime>
<hour>11</hour>
<hour>9</hour>
<minute>0</minute>
<second>0</second>
<year>2011</year>
......@@ -148,7 +148,7 @@
</date>
</property>
<property name="displayFormat">
<string>ddd yyyy-MM-dd hh:mm UTC</string>
<string>ddd yyyy-MM-dd hh:mm:ss UTC</string>
</property>
<property name="calendarPopup">
<bool>true</bool>
......@@ -290,7 +290,7 @@
</property>
<property name="dateTime">
<datetime>
<hour>11</hour>
<hour>9</hour>
<minute>0</minute>
<second>0</second>
<year>2011</year>
......@@ -307,7 +307,7 @@
</property>
<property name="minimumDateTime">
<datetime>
<hour>23</hour>
<hour>22</hour>
<minute>0</minute>
<second>0</second>
<year>1752</year>
......@@ -316,7 +316,7 @@
</datetime>
</property>
<property name="displayFormat">
<string>ddd yyyy-MM-dd hh:mm UTC</string>
<string>ddd yyyy-MM-dd hh:mm:ss UTC</string>
</property>
<property name="calendarPopup">
<bool>true</bool>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment