Vibration when hitting rocks and octopuses
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Mon, 27 Jun 2011 11:39:07 +0000 (14:39 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Mon, 27 Jun 2011 11:39:07 +0000 (14:39 +0300)
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
ship.cpp

index 58faafd..6ba1f78 100644 (file)
@@ -5,6 +5,7 @@
 #-------------------------------------------------
 
 QT       += core gui
 #-------------------------------------------------
 
 QT       += core gui
+QT      += dbus
 
 TARGET = ghostsoverboard
 TEMPLATE = app
 
 TARGET = ghostsoverboard
 TEMPLATE = app
index 426cd63..7ab50ff 100644 (file)
--- a/ship.cpp
+++ b/ship.cpp
@@ -23,6 +23,9 @@
 
 #include "ship.h"
 #include <QDebug>
 
 #include "ship.h"
 #include <QDebug>
+#include <QDBusMessage>
+#include <QDBusConnection>
+
 
 Ship::Ship(QList<QPixmap> pixmapList, QGraphicsItem *parent) :
     OrientationControlledGraphicsPixmapObject(pixmapList.at(0),parent)
 
 Ship::Ship(QList<QPixmap> pixmapList, QGraphicsItem *parent) :
     OrientationControlledGraphicsPixmapObject(pixmapList.at(0),parent)
@@ -87,5 +90,21 @@ void Ship::dropAllGhosts()
     emit droppingGhosts(ghostsAboard_);
     ghostsAboard_ = 0;
     updateShipImage();
     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<QVariant> arguments;
+
+    arguments.append("PatternChatAndEmail");
+
+    message.setArguments(arguments);
+
+    message = QDBusConnection::systemBus().call(message);
+
+    qDebug() << message;
+
 }
 
 }