Bug #6576 ยป bug_6576.patch
| src/Wt/WTimer.C | ||
|---|---|---|
|
*/
|
||
|
#include "Wt/WApplication"
|
||
|
#include "Wt/WEnvironment"
|
||
|
#include "Wt/WTimer"
|
||
|
#include "Wt/WTimerWidget"
|
||
|
#include "Wt/WContainerWidget"
|
||
| ... | ... | |
|
void WTimer::start()
|
||
|
{
|
||
|
WApplication *app = WApplication::instance();
|
||
|
if (!active_) {
|
||
|
WApplication *app = WApplication::instance();
|
||
|
if (app && app->timerRoot())
|
||
|
app->timerRoot()->addWidget(timerWidget_);
|
||
|
}
|
||
| ... | ... | |
|
active_ = true;
|
||
|
*timeout_ = Time() + interval_;
|
||
|
bool jsRepeat = !singleShot_ &&
|
||
|
((app && app->environment().ajax()) ||
|
||
|
!timeout().isExposedSignal());
|
||
|
bool jsRepeat = !timeout().isExposedSignal() && !singleShot_;
|
||
|
timerWidget_->timerStart(jsRepeat);
|
||
| ... | ... | |
|
if (active_) {
|
||
|
if (!singleShot_) {
|
||
|
*timeout_ = Time() + interval_;
|
||
|
if (!timerWidget_->jsRepeat()) {
|
||
|
WApplication *app = WApplication::instance();
|
||
|
timerWidget_->timerStart(app->environment().ajax());
|
||
|
}
|
||
|
timerWidget_->timerStart(false);
|
||
|
} else
|
||
|
stop();
|
||
|
}
|
||
| src/Wt/WTimerWidget | ||
|---|---|---|
|
void timerStart(bool jsRepeat);
|
||
|
bool timerExpired();
|
||
|
bool jsRepeat() const { return jsRepeat_; }
|
||
|
private:
|
||
|
WTimer *timer_;
|
||
|
bool timerStarted_;
|
||