case timeRemainingColumnNumber_:
+ if (currentTimers_.at(index.row())->isRunning()) //timer running
+ {
+
allseconds = currentTimers_.at(index.row())->getRemainingTimeInSeconds();
- if (allseconds < 0)
- {
- timeAsText = tr("-", "negative sign");
- allseconds = -allseconds;
+ if (allseconds < 0)
+ {
+ timeAsText = tr("-", "negative sign");
+ allseconds = -allseconds;
+
+ }
+ }
+
+ else //timer stopped or never started
+ {
+ //use original time
+ allseconds = currentTimers_.at(index.row())->getOriginalTimeInSeconds();
}
hoursOnly.setNum( allseconds/(60*60));
case statusColumnNumber_:
if (currentTimers_.at(index.row())->isAlerting() == true)
- return QString("ALERT!");
+ return tr("ALERT!");
+
+ if (!currentTimers_.at(index.row())->isRunning())
+ return tr("stopped");
else return QString();
return true;
}
-//QString Timer::getFilename()
-//{
-// return filenameWithPath_;
-//}
+bool Timer::isRunning()
+{
+ return _actualTimer.isActive();
+}
*/
bool load(QString filename);
+ /*! Returns wheter the alert is running or not.
+ Alerting timers are considered running. */
+ bool isRunning();
+
signals:
/*! Emitted when the remaining time in the timer has changed */
+
+
};
#endif // TIMER_H