From: Heli Hyvättinen Date: Mon, 25 Jul 2011 11:42:14 +0000 (+0300) Subject: Togglable vibration effects menu item X-Git-Tag: v0.3.0_fremantle~17^2~3 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=4d2372fbb866d4d264e91ee3dd7a8808af440bf3;p=ghostsoverboard Togglable vibration effects menu item Does not update its text. --- diff --git a/seascene.cpp b/seascene.cpp index 24c4a0c..7005071 100644 --- a/seascene.cpp +++ b/seascene.cpp @@ -408,14 +408,7 @@ void SeaScene::handleScreenTapped() else if (pItem == pSettingsItem_) { - //Temporary code for settings, likely to be turned into a QML dialog - - QMessageBox::StandardButton buttonpressed = QMessageBox::question(NULL,"Settings","Do you wish to have vibration effects enabled?", QMessageBox::Yes | QMessageBox::No); - - if (buttonpressed == QMessageBox::Yes) - pVibrateAction_->setChecked(true); - if (buttonpressed == QMessageBox::No) - pVibrateAction_->setChecked(false); + pVibrateAction_->toggle(); } else if (pItem == pAboutItem_) @@ -469,7 +462,18 @@ void SeaScene::createMenuItems() prepareForMenu(pRestartLevelItem_); pSettingsItem_ = new QGraphicsTextItem; - pSettingsItem_->setHtml(tr("Vibration
effects").prepend(menufonthtml)); + QString vibraText(tr("Vibration
effects")); + QString statusText; + if (pVibrateAction_->isChecked()) + { + statusText = "off"; + } + else + { + statusText = "on"; + } + vibraText.append(statusText); + pSettingsItem_->setHtml(vibraText.prepend(menufonthtml)); prepareForMenu(pSettingsItem_); pAboutItem_ = new QGraphicsTextItem;