Merge branch 'vibrationrecovery' into harmattan
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Mon, 26 Sep 2011 20:00:23 +0000 (23:00 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Tue, 27 Sep 2011 16:08:49 +0000 (19:08 +0300)
Vibration works again (did not work before with the beta2 firmware).
This time real vibration, not just a "tak tak" sound.

Conflicts:
seascene.cpp

1  2 
seascene.cpp
seascene.h

diff --cc seascene.cpp
@@@ -864,42 -823,15 +886,58 @@@ void SeaScene::createLevelCompletedItem
      pTapForNextLevelItem->setHtml("<font size=\"7\" color = darkorange>Tap to start the next level");
  }
  
 -void SeaScene::resourcesAvailable()
 +void SeaScene::createSelectLevelsetFromListItems()
  {
 -    qDebug() << "Resources available";
 -    vibrationAllowed_ = true;
 -}
 -void SeaScene::resourcesLost()
 -{
 -    qDebug() << "Resources lost";
 -    vibrationAllowed_ = false;
 -}
 +    if (availableLevelsets_.isEmpty()) //Something is badly wrong in code if this is true...
 +            return;
 +
 +
 +    pSelectLevelsetFromListItem_ = new QGraphicsTextItem;
 +    addItem(pSelectLevelsetFromListItem_);
 +    pSelectLevelsetFromListItem_->setPos(295,60);
 +    pSelectLevelsetFromListItem_->setZValue(1000);
 +    pSelectLevelsetFromListItem_->hide();
 +
++
 +    QString fontstring ("<font color = darkorange size = \"7\">");
 +
 +    pSelectLevelsetFromListItem_->setHtml(tr("Choose a levelset").prepend(fontstring));
 +
 +    int yPos = 100;
 +
 +    levelsetItems_.clear();
 +
  
 +    foreach (Levelset set, availableLevelsets_)
 +    {
 +        QGraphicsTextItem * pItem = new QGraphicsTextItem(pSelectLevelsetFromListItem_);
 +        QString text (fontstring);
 +        if (levelset_.getName() == set.getName())
 +            text.append("<b>");
 +        text.append(set.getName());
 +        pItem->setHtml(text);
 +        pItem->setPos(65,yPos);
 +        yPos+=80;
 +        pItem->setZValue(1000);
 +        pItem->setFlag(QGraphicsItem::ItemIsSelectable);
 +        pItem->setData(0,QVariant::fromValue(set));
 +        levelsetItems_.append(pItem);
 +
 +    }
 +
 +  }
++
++
++    void SeaScene::resourcesAvailable()
++    {
++        qDebug() << "Resources available";
++        vibrationAllowed_ = true;
++    }
++
++
++    void SeaScene::resourcesLost()
++    {
++        qDebug() << "Resources lost";
++        vibrationAllowed_ = false;
++    }
diff --cc seascene.h
@@@ -86,10 -88,12 +88,14 @@@ public slots
  
      void turnPauseOn();
  
+     void resourcesAvailable();
+     void resourcesLost();
  
  
 +
 +
  protected:
  
      /*! Gives a pointer to a random position if a free one is found. Otherwise returns NULL.