Should pause at device lock
[ghostsoverboard] / seascene.cpp
index fa17ec2..b29c068 100644 (file)
@@ -89,10 +89,12 @@ SeaScene::SeaScene(QObject *parent) :
     pPauseAction_->setCheckable(true);
     connect(pPauseAction_,SIGNAL(toggled(bool)),this,SLOT(pause(bool)));
 
+    connect(&deviceInfo_,SIGNAL(lockStatusChanged(bool)),this,SLOT(handleDeviceLocked(bool)));
+
 
     autopauseTimer.setSingleShot(true);
     autopauseTimer.setInterval(15*60*1000);
-    connect(&autopauseTimer,SIGNAL(timeout()),this,SLOT(forcePause()));
+    connect(&autopauseTimer,SIGNAL(timeout()),this,SLOT(turnPauseOn()));
 
 
 }
@@ -528,7 +530,7 @@ void SeaScene::createMenuItems()
     prepareForMenu(pRestartLevelItem_);
 
     pSettingsItem_ = new QGraphicsTextItem;
-    QString vibraText(tr("Vibration <br> effects "));
+    QString vibraText(tr("Turn vibration <br> effects "));
     QString statusText;
     if (pVibrateAction_->isChecked())
     {
@@ -651,7 +653,7 @@ void SeaScene::createVictoryItems()
     pVictoryCongratulationsItem_ = new QGraphicsTextItem;
     pVictoryCongratulationsItem_->setHtml("<font size=\"6\" color = darkorange> Victory!");
     pVictoryCongratulationsItem_->hide();
-    pVictoryCongratulationsItem_->setPos(300,50);
+    pVictoryCongratulationsItem_->setPos(355,50);
     pVictoryCongratulationsItem_->setZValue(1000);
     addItem(pVictoryCongratulationsItem_);
 
@@ -707,3 +709,17 @@ void SeaScene::setItemPointersNull()
     pVictoryCongratulationsItem_ = NULL;
 
 }
+
+void SeaScene::turnPauseOn()
+{
+    pPauseAction_->setChecked(true);
+}
+
+void SeaScene::handleDeviceLocked(bool isLocked)
+{
+    //pauses if locked but does not unpause if unlocked
+    if(isLocked)
+    {
+        pPauseAction_->setChecked(true);
+    }
+}