From 330979bbf53bc17e97e42503624a9df6146e0db4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Heli=20Hyv=C3=A4ttinen?= Date: Mon, 27 Jun 2011 14:39:07 +0300 Subject: [PATCH] Vibration when hitting rocks and octopuses Vibrates when hits or gets hit by something that drops ghots (or would drop if there were any). Bit too loud vibrating sound. --- ghostsoverboard.pro | 1 + ship.cpp | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ghostsoverboard.pro b/ghostsoverboard.pro index 58faafd..6ba1f78 100644 --- a/ghostsoverboard.pro +++ b/ghostsoverboard.pro @@ -5,6 +5,7 @@ #------------------------------------------------- QT += core gui +QT += dbus TARGET = ghostsoverboard TEMPLATE = app diff --git a/ship.cpp b/ship.cpp index 426cd63..7ab50ff 100644 --- a/ship.cpp +++ b/ship.cpp @@ -23,6 +23,9 @@ #include "ship.h" #include +#include +#include + Ship::Ship(QList pixmapList, QGraphicsItem *parent) : OrientationControlledGraphicsPixmapObject(pixmapList.at(0),parent) @@ -87,5 +90,21 @@ void Ship::dropAllGhosts() emit droppingGhosts(ghostsAboard_); ghostsAboard_ = 0; updateShipImage(); + + //vibrate + + + QDBusMessage message = QDBusMessage::createMethodCall("com.nokia.mce","/com/nokia/mce/request","com.nokia.mce.request","req_vibrator_pattern_activate"); + + QList arguments; + + arguments.append("PatternChatAndEmail"); + + message.setArguments(arguments); + + message = QDBusConnection::systemBus().call(message); + + qDebug() << message; + } -- 1.7.9.5