From: Heli Hyvättinen Date: Mon, 25 Jul 2011 12:25:55 +0000 (+0300) Subject: The togglable vibration menu item now works correctly X-Git-Tag: v0.3.0_fremantle~17^2 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=5ffd6d89882854d2d4f15107f817f4dc3a83eedb;p=ghostsoverboard The togglable vibration menu item now works correctly --- diff --git a/seascene.cpp b/seascene.cpp index 719d130..480c99e 100644 --- a/seascene.cpp +++ b/seascene.cpp @@ -412,8 +412,16 @@ void SeaScene::handleScreenTapped() else if (pItem == pSettingsItem_) { pVibrateAction_->toggle(); + QSettings settings; settings.setValue("vibration",pVibrateAction_->isChecked()); + + QString text = pSettingsItem_->toHtml(); + if (pVibrateAction_->isChecked()) + text.replace(" on"," off"); //don't remove spaces or you get vibratioff... + else + text.replace(" off"," on"); + pSettingsItem_->setHtml(text); } else if (pItem == pAboutItem_) @@ -431,10 +439,12 @@ void SeaScene::handleScreenTapped() clearSelection(); - //The user propably went to paused state just to access menu, so unpause - - pPauseAction_->setChecked(false); + //The user propably went to paused state just to access menu, so unpause unless vibration set (so the user sees its changed) + if (pItem != pSettingsItem_) + { + pPauseAction_->setChecked(false); + } } @@ -467,7 +477,7 @@ void SeaScene::createMenuItems() prepareForMenu(pRestartLevelItem_); pSettingsItem_ = new QGraphicsTextItem; - QString vibraText(tr("Vibration
effects")); + QString vibraText(tr("Vibration
effects ")); QString statusText; if (pVibrateAction_->isChecked()) {