connect(pPauseAction_,SIGNAL(toggled(bool)),this,SLOT(pause(bool)));
+ deviceLockPollTimer_.setInterval(20*60); // 2s
+ connect(&deviceLockPollTimer_,SIGNAL(timeout()),this,SLOT(pollDeviceLocked()));
+ deviceLockPollTimer_.start();
+
+
autopauseTimer.setSingleShot(true);
autopauseTimer.setInterval(15*60*1000);
connect(&autopauseTimer,SIGNAL(timeout()),this,SLOT(turnPauseOn()));
pPausetextItem_->hide();
autopauseTimer.start(); //Start counting towards autopause
+ deviceLockPollTimer_.start(); //Start polling whether device is locked
}
else
// else qDebug() << "No pause text available";
autopauseTimer.stop(); //No need to count toward autopause when already paused
+ deviceLockPollTimer_.stop(); //No need to check for unlock as no unpause anyway
}
}
{
pPauseAction_->setChecked(true);
}
+
+void SeaScene::handleDeviceLocked(bool isLocked)
+{
+ //pauses if locked but does not unpause if unlocked
+ if(isLocked)
+ {
+ pPauseAction_->setChecked(true);
+ }
+}
+
+void SeaScene::pollDeviceLocked()
+{
+
+ bool locked = deviceInfo_.isDeviceLocked();
+
+ if (locked)
+ {
+ if (!alreadyLocked_)
+ {
+ pPauseAction_->setChecked(true);
+ alreadyLocked_ = true;
+ }
+
+ else
+ {
+ alreadyLocked_ = false;
+ }
+ }
+}