"show contact dialog" functionality exposed to qml
authorJanne Kiiski <janne.kiiski@ixonos.com>
Mon, 22 Nov 2010 11:01:33 +0000 (13:01 +0200)
committerJanne Kiiski <janne.kiiski@ixonos.com>
Mon, 22 Nov 2010 11:01:33 +0000 (13:01 +0200)
src/engine/engine.cpp
src/engine/engine.h
src/qmlui/FriendsView.qml

index dc25b35..3d4444a 100644 (file)
 #include "qmlui/userimageprovider.h"
 #include "updatelocation.h"
 
+#ifdef Q_WS_MAEMO_5
+#include <QX11Info>
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#endif
+
 const QString SETTINGS_GPS_ENABLED = "GPS_ENABLED"; ///< GPS setting
 const QString SETTINGS_AUTO_CENTERING_ENABLED = "AUTO_CENTERING_ENABLED";///< Auto centering setting
 const int DEFAULT_ZOOM_LEVEL_WHEN_GPS_IS_AVAILABLE = 12;  ///< Default zoom level when GPS available
index fa2e4e7..dcc9889 100644 (file)
@@ -153,6 +153,14 @@ public slots:
       */
     void routeFromTo(double fromLatitude, double fromLongitude, double toLatitude, double toLongitude);
 
+    /**
+    * @brief Shows contact dialog.
+    *
+    * Calls MainWindow showContactDialog with contact guid defined by contact's Facebook ID.
+    * @param facebookId contact's facebookId
+    */
+    void showContactDialog(const QString &facebookId);
+
 private:
     /**
     * @brief Read settings and determine whether to use GPS and autocentering.
@@ -292,14 +300,6 @@ private slots:
     void setPowerSaving(bool enabled);
 
     /**
-    * @brief Shows contact dialog.
-    *
-    * Calls MainWindow showContactDialog with contact guid defined by contact's Facebook ID.
-    * @param facebookId contact's facebookId
-    */
-    void showContactDialog(const QString &facebookId);
-
-    /**
     * @brief Automatic update interval timer timeout.
     *
     * Requests update location if user has moved.
index 444c4f7..961fcd2 100644 (file)
@@ -25,9 +25,9 @@ ListBase {
         Row {
             Image {
                 id: routeButton
-                source: "qrc:/res/images/route_to_friend.png"
+                source: routeButtonArea.pressed ? "qrc:/res/images/route_to_friend_s.png" : "qrc:/res/images/route_to_friend.png"
                 MouseArea {
-                    id: mouseArea
+                    id: routeButtonArea
                     anchors.fill: parent
                     onClicked: {
                         engine.routeFromTo(map.gpsLocationLatitude, map.gpsLocationLongitude, latitude, longitude);
@@ -36,7 +36,14 @@ ListBase {
             }
             Image {
                 id: contactButton
-                source: "qrc:/res/images/contact.png"
+                source: contactButtonArea.pressed ? "qrc:/res/images/contact_s.png" : "qrc:/res/images/contact.png"
+                MouseArea {
+                    id: contactButtonArea
+                    anchors.fill: parent
+                    onClicked: {
+                        engine.showContactDialog(userId);
+                    }
+                }
             }
         }
     }