Merge branch 'master' of https://vcs.maemo.org/git/situare into map
authorSami Rämö <sami.ramo@ixonos.com>
Fri, 16 Apr 2010 12:01:20 +0000 (15:01 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Fri, 16 Apr 2010 12:01:20 +0000 (15:01 +0300)
33 files changed:
debian/Situare/usr/bin/Situare [deleted file]
debian/situare/DEBIAN/control [deleted file]
debian/situare/DEBIAN/md5sums [deleted file]
debian/situare/usr/share/doc/situare/README.Debian [deleted file]
debian/situare/usr/share/doc/situare/copyright [deleted file]
doc/test_cases/functionality-tests.doc
scripts/master_test_script.sh [changed mode: 0755->0644]
src/images.qrc [new file with mode: 0644]
src/resources/arrow_button.png [new file with mode: 0644]
src/resources/arrow_left.png [new file with mode: 0755]
src/resources/arrow_right.png [new file with mode: 0755]
src/resources/clock_small.png [new file with mode: 0644]
src/resources/compas_small.png [new file with mode: 0644]
src/resources/facebook_user_64.png [new file with mode: 0644]
src/resources/list_small.png [new file with mode: 0644]
src/resources/personal_infotab_background.png [new file with mode: 0644]
src/resources/reload_icon.png [new file with mode: 0644]
src/resources/sendPosition_icon.png [new file with mode: 0644]
src/resources/separe_line.png [new file with mode: 0644]
src/resources/top_separtor.png [new file with mode: 0644]
src/src.pro
src/ui/infotab.cpp [new file with mode: 0644]
src/ui/infotab.h [new file with mode: 0644]
src/ui/listviewscreen.cpp
src/ui/listviewscreen.h
src/ui/mainwindow.cpp
src/ui/mainwindow.h
src/ui/mapviewscreen.cpp
src/ui/pixmap.cpp [new file with mode: 0644]
src/ui/pixmap.h [new file with mode: 0644]
tests/ui/pixmap/dummy_personal_infotab_background.png [new file with mode: 0644]
tests/ui/pixmap/testpixmap.cpp [new file with mode: 0644]
tests/ui/pixmap/testpixmap.pro [new file with mode: 0644]

diff --git a/debian/Situare/usr/bin/Situare b/debian/Situare/usr/bin/Situare
deleted file mode 100755 (executable)
index a830655..0000000
Binary files a/debian/Situare/usr/bin/Situare and /dev/null differ
diff --git a/debian/situare/DEBIAN/control b/debian/situare/DEBIAN/control
deleted file mode 100644 (file)
index f845cbb..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-Package: situare
-Version: 1.0-1
-Section: user/other
-Priority: extra
-Architecture: armel
-Installed-Size: 40
-Maintainer: Jukka Saastamoinen <jukka.saastamoinen@ixonos.com>
-Description: This is the Situare client for Maemo
- This application is done with Qt, requires Qt4.6.2 libraries
-Maemo-Icon-26: 
- iVBORw0KGgoAAAANSUhEUgAAACkAAAArCAYAAADlqKH9AAAAAXNSR0IArs4c
- 6QAAAAlwSFlzAAAHsQAAB7EBBsVhhgAADBBJREFUWMO1mTlsXFl2hr9736vl
- vaoii7WqWNxEipQoSq2lW+pGG04Mpw5bjtzhdGQ4c+KgAQcOnBgCDBgewHDg
- TJPMeIABbAdttO0ZG2319KKV4l77vm+v3nvXAUWJEosUu+E5wEUF9eq+/55z
- /nP+c0vwO7AvvvhCJx73dypDf7VYNbKlmt8jNXPOo2bmnn0X7krx1R/9zV/l
- zruffp6HlFIS0F4+f/SpA0EgAkSPrUhvMIx++d/fzWzvZCOu7UR0TZvxjK0Z
- s1oxe43mIB+Y/kvg7wD1g0E+evTICwQLjWEwFPAHb19bCwghphzHiWialgAu
- AMmXKwGEAT/gO75ara5WqjTEYGCBUgjXJTHoEM7use84wUYq/dGDBw/+8d69
- e4NzgfzlL3+dLrRbf9zpDVK/+o+n0amQEb6+tjCzsjgXFlKGdU0LAwYgAPny
- 8/h6w8Zjm2fbGUrV5lEYiA36XKwWqdXK1C5ekSo8cyvX5DLwzblA7uRzi0NH
- /bnjODGPR9OuXlrg2pVlQkETIcQPykVXKXYzRZ68OMBxXFCKqX6fK506Mr9P
- XvcxTqRQQq5YtrqtlPpWCPHOkEs8Oo7jGJomtffWl3n/vTWmQoEfDBCg0+nz
- eHOfTneAAMzhkCu9FtFShkypRDs5B2YQgTAk8u5f/8MvgufZV9q26wohWF1K
- 8+GtK5iG70cx2nVdtvfz7GWKoBQey2K522KxUyW/+YyiEcJNL4CUh2l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+7GdnX/m9qrmh
- UAiv14vXbzAcjShW27jqtQfVobZS1njsbu8XVLZQdRKxcGsxnSzHo6FyIhYp
- TYeCBV2X+ZeKOjccDkt+v7/TrNdG//ptYTQv29Zf/NmfOPxI018yWo1sm2K5
- SX8wHiPoC8FAIPoK1VRKZaWQe16vtq+UOtg9KJa2dwuNqaC/EQ8Mm59++mmP
- 36HplmVZXq/v695wZA2GVkFBAUTB8PryHo8otMbd6rhvD3yWNl5IauNPPvlk
- fJ5/DP4/7f8A9z7iC7WTvksAAAAASUVORK5CYII
diff --git a/debian/situare/DEBIAN/md5sums b/debian/situare/DEBIAN/md5sums
deleted file mode 100644 (file)
index 0a0e22e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-8c7083f125b902bd501890c05ca030ba  usr/share/doc/situare/copyright
-287ad157edc49b37b8f3947f9c170c87  usr/share/doc/situare/README.Debian
diff --git a/debian/situare/usr/share/doc/situare/README.Debian b/debian/situare/usr/share/doc/situare/README.Debian
deleted file mode 100644 (file)
index 55c3210..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-situare for Debian
-------------------
-
-<possible notes regarding this package - if none, delete this file>
-
- -- unknown <jukka.saastamoinen@ixonos.com>  Wed, 31 Mar 2010 10:36:08 +0300
diff --git a/debian/situare/usr/share/doc/situare/copyright b/debian/situare/usr/share/doc/situare/copyright
deleted file mode 100644 (file)
index 8c1771a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-This package was debianized by unknown <jukka.saastamoinen@ixonos.com> on
-Wed, 31 Mar 2010 10:36:08 +0300.
-
-It was downloaded from <fill in http/ftp site>
-
-Upstream Author: <put author(s) name and email here>
-
-Copyright: <put the year(s) of the copyright, and the names of the
-            copyright holder(s) here>
-
-License:
-
-   This package is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This package is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this package; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-On Debian systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL'.
-
-The Debian packaging is (C) 2010, unknown <jukka.saastamoinen@ixonos.com> and
-is licensed under the GPL, see above.
-
-
-# Please also look if there are files or directories which have a
-# different copyright/license attached and list them here.
index 22e6f2b..55198eb 100644 (file)
Binary files a/doc/test_cases/functionality-tests.doc and b/doc/test_cases/functionality-tests.doc differ
old mode 100755 (executable)
new mode 100644 (file)
index 52cc33a..0f80199
@@ -1,5 +1,8 @@
 #!/bin/bash
 
+if [$1 -eq ""]; then
+   echo "Usage of the script: ./master_test_script.sh destination_folder_for_test_reports tests_folder_location"
+else
 ##########################################################
 # This script is executed from /scripts directory        #
 # in situare project folder                              #
@@ -11,12 +14,16 @@ echo "As a final step, it creates summary report from all tests executed."
 #Environment settings                                   #
 ##########################################################
 #Store all directory names to a list
-MODULES=(`ls ../tests/`)
 #Modify these paths to point to correct path
-location=$HOME/situare/repository/situare/tests/
-FILE=$HOME/situare/repository/situare/reports/tests_summary.txt
-if [ ! -e $FILE ]; then
-    touch tests_summary.txt
+location=$2
+echo $location
+echo "Tests situate at: $location"
+
+TEST_REPORT=$1
+echo "Directory to store test report: $1"
+#cd $location
+if [ ! -e $1/tests_summary.txt ]; then
+    touch $1/tests_summary.txt
     echo "##########################################" >> tests_summary.txt
     echo "# Summary of unit tests executed         #" >> tests_summary.txt
     echo "# Date: `date`    #" >> tests_summary.txt
@@ -24,13 +31,23 @@ if [ ! -e $FILE ]; then
     echo "##########################################" >> tests_summary.txt
 fi  
 
+FILE=$1/tests_summary.txt
+cd $location
+MODULES=(`ls`)
+echo $MODULES
+
+for component in "${MODULES[@]}"
+do 
+  echo "Found test directory: $component"
+done
+
 ##########################################################
 #First part: Execution of all tests                      #
 ##########################################################
 for component in "${MODULES[@]}" #Loop through components
 do
   cd $location/$component
-  CASES=(`ls`) #List all test cases uner component directory
+  CASES=(`ls`) #List all test cases under component directory
   for unittest in "${CASES[@]}"
   do
     cd $location/$component/$unittest
@@ -61,4 +78,5 @@ do
     grep Totals *.txt >> $FILE
   done
 done
+fi
 exit 0
diff --git a/src/images.qrc b/src/images.qrc
new file mode 100644 (file)
index 0000000..7095d4f
--- /dev/null
@@ -0,0 +1,12 @@
+<RCC>
+    <qresource prefix="/">
+        <file>resources/facebook_user_64.png</file>
+        <file>resources/compas_small.png</file>
+        <file>resources/reload_icon.png</file>
+        <file>resources/sendPosition_icon.png</file>
+        <file>resources/list_small.png</file>
+        <file>resources/clock_small.png</file>
+        <file>resources/arrow_left.png</file>
+        <file>resources/arrow_right.png</file>
+    </qresource>
+</RCC>
diff --git a/src/resources/arrow_button.png b/src/resources/arrow_button.png
new file mode 100644 (file)
index 0000000..0de60a2
Binary files /dev/null and b/src/resources/arrow_button.png differ
diff --git a/src/resources/arrow_left.png b/src/resources/arrow_left.png
new file mode 100755 (executable)
index 0000000..454fbdb
Binary files /dev/null and b/src/resources/arrow_left.png differ
diff --git a/src/resources/arrow_right.png b/src/resources/arrow_right.png
new file mode 100755 (executable)
index 0000000..4a43016
Binary files /dev/null and b/src/resources/arrow_right.png differ
diff --git a/src/resources/clock_small.png b/src/resources/clock_small.png
new file mode 100644 (file)
index 0000000..50efd6e
Binary files /dev/null and b/src/resources/clock_small.png differ
diff --git a/src/resources/compas_small.png b/src/resources/compas_small.png
new file mode 100644 (file)
index 0000000..a85e802
Binary files /dev/null and b/src/resources/compas_small.png differ
diff --git a/src/resources/facebook_user_64.png b/src/resources/facebook_user_64.png
new file mode 100644 (file)
index 0000000..b828219
Binary files /dev/null and b/src/resources/facebook_user_64.png differ
diff --git a/src/resources/list_small.png b/src/resources/list_small.png
new file mode 100644 (file)
index 0000000..d250a1f
Binary files /dev/null and b/src/resources/list_small.png differ
diff --git a/src/resources/personal_infotab_background.png b/src/resources/personal_infotab_background.png
new file mode 100644 (file)
index 0000000..a9b30ec
Binary files /dev/null and b/src/resources/personal_infotab_background.png differ
diff --git a/src/resources/reload_icon.png b/src/resources/reload_icon.png
new file mode 100644 (file)
index 0000000..7ffa4ec
Binary files /dev/null and b/src/resources/reload_icon.png differ
diff --git a/src/resources/sendPosition_icon.png b/src/resources/sendPosition_icon.png
new file mode 100644 (file)
index 0000000..5c44ea3
Binary files /dev/null and b/src/resources/sendPosition_icon.png differ
diff --git a/src/resources/separe_line.png b/src/resources/separe_line.png
new file mode 100644 (file)
index 0000000..8d9bb0e
Binary files /dev/null and b/src/resources/separe_line.png differ
diff --git a/src/resources/top_separtor.png b/src/resources/top_separtor.png
new file mode 100644 (file)
index 0000000..d21c24a
Binary files /dev/null and b/src/resources/top_separtor.png differ
index 4068f33..633c529 100644 (file)
@@ -11,7 +11,9 @@ SOURCES += main.cpp \
     map/mapview.cpp \
     map/mapscene.cpp \
     map/maptile.cpp \
-    map/mapfetcher.cpp
+    map/mapfetcher.cpp\
+    ui/pixmap.cpp \
+    ui/infotab.cpp
 HEADERS += ui/mainwindow.h \
     ui/mapviewscreen.h \
     ui/listviewscreen.h \
@@ -20,7 +22,9 @@ HEADERS += ui/mainwindow.h \
     map/mapscene.h \
     map/maptile.h \
     map/mapfetcher.h \
-    map/mapcommon.h
+    map/mapcommon.h \
+    ui/pixmap.h \
+    ui/infotab.h
 QT += network \
     webkit
 
diff --git a/src/ui/infotab.cpp b/src/ui/infotab.cpp
new file mode 100644 (file)
index 0000000..3f11fa0
--- /dev/null
@@ -0,0 +1,122 @@
+#include "infotab.h"
+
+InfoTab::InfoTab(QWidget *parent)
+    : QWidget(parent, Qt::FramelessWindowHint)
+{
+    layout = new QGridLayout(this);
+    userPicture = new QLabel;
+    userNameLabel = new QLabel;
+    messageLabel = new QLabel;
+    addressLabel = new QLabel;
+    timeLabel = new QLabel;
+    QLabel *clockLabel = new QLabel;
+    QLabel *envelopeLabel = new QLabel;
+    QLabel *compassLabel = new QLabel;
+    QToolButton *sendLocationButton = new QToolButton;
+    QToolButton *updateStatusMessageButton = new QToolButton;
+
+    sendLocationButton->setIcon(QIcon(QPixmap(":/resources/reload_icon.png")));
+    updateStatusMessageButton->setIcon(QIcon(QPixmap(":/resources/sendPosition_icon.png")));
+
+    clockLabel->setPixmap(QPixmap(":/resources/clock_small.png"));
+    envelopeLabel->setPixmap(QPixmap(":/resources/list_small.png"));
+    compassLabel->setPixmap(QPixmap(":/resources/compas_small.png"));
+    layout->addWidget(userPicture,0,0,4,1);
+    layout->addWidget(userNameLabel,0,2,1,2);
+    layout->addWidget(clockLabel,1,1,1,1);
+    layout->addWidget(envelopeLabel,2,1,1,1);
+    layout->addWidget(compassLabel,3,1,1,1);
+    layout->addWidget(timeLabel,1,2,1,1);
+    layout->addWidget(messageLabel,2,2,1,1);
+    layout->addWidget(addressLabel,3,2,1,1);
+    layout->addWidget(sendLocationButton,0,3,2,1);
+    layout->addWidget(updateStatusMessageButton,1,3,2,1);
+
+}
+
+InfoTab::~InfoTab()
+{
+    if (userPicture)
+        delete userPicture;
+    if (userNameLabel)
+        delete userNameLabel;
+    if (messageLabel)
+        delete messageLabel;
+    if (addressLabel)
+        delete addressLabel;
+    if (timeLabel)
+        delete timeLabel;
+    if (layout)
+        delete layout;
+    userPicture=NULL;
+    userNameLabel=NULL;
+    messageLabel=NULL;
+    addressLabel=NULL;
+    timeLabel=NULL;
+    layout=NULL;
+}
+
+void InfoTab::paintEvent(QPaintEvent *aPaintEvent)
+{
+    //Look and feel settings
+    QPalette qpalette;
+    QColor myColor(Qt::black);
+    myColor.setAlpha(50);
+    qpalette.setColor(QPalette::Background,myColor);
+    setPalette(qpalette);
+    int roundness(6);
+
+    QRect widgetRect = this->rect();
+    QPainter painter(this);
+    painter.save();
+
+    painter.setRenderHint(QPainter::Antialiasing);
+    QPainterPath roundedRect;
+    roundedRect.addRoundedRect(1,1,widgetRect.width() - 2, widgetRect.height()-2,roundness,roundness);
+
+    painter.setClipPath(roundedRect);
+    QRegion maskRegion = painter.clipRegion();
+
+    setMask(maskRegion);
+
+    painter.fillPath(roundedRect,QBrush(myColor));
+    painter.restore();
+}
+
+void InfoTab::setAvatar(const QPixmap &avat)
+{
+    avatar = avat;
+    userPicture->setPixmap(avat);
+}
+
+void InfoTab::setUserName(const QString &usernam)
+{
+    if(userName == usernam)
+      return;
+    userName = usernam;
+    userNameLabel->setText(userName);
+}
+
+void InfoTab::setMessageText(const QString &text)
+{
+    if(messageText == text)
+      return;
+    messageText = text;
+    messageLabel->setText(messageText);
+}
+
+void InfoTab::setAddress(const QString &addr)
+{
+    if(address == addr)
+      return;
+    address = addr;
+    addressLabel->setText(address);
+}
+
+void InfoTab::setTime(const QString &tim)
+{
+    if(time == tim)
+      return;
+    time = tim;
+    timeLabel->setText(time);
+}
diff --git a/src/ui/infotab.h b/src/ui/infotab.h
new file mode 100644 (file)
index 0000000..4171d97
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+   Situare - A location system for Facebook
+   Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Jukka Saastamoinen - jukka.saastamoinen@ixonos.com
+
+   Situare is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   version 2 as published by the Free Software Foundation.
+
+   Situare is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Situare; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+   USA.
+*/
+
+#ifndef INFOTAB_H
+#define INFOTAB_H
+
+#include <QtGui>
+#include <QWidget>
+
+/**
+* @brief Pixmap class.
+* Composite custom widget class used to show user information
+* @author Jukka Saastamoinen
+*/
+
+class InfoTab : public QWidget
+{
+    Q_OBJECT
+public:
+    /**
+    * @brief Constructor
+    *
+    * @param parent Parent
+    */
+    InfoTab(QWidget *parent=0);
+    /**
+    *
+    * @brief Destructor
+    */
+    ~InfoTab();
+public slots:
+    /**
+    * @brief Sets the user picture
+    *
+    * @param avat Reference to user picture
+    */
+    void setAvatar(const QPixmap & avat);
+    /**
+    * @brief Sets the user name
+    *
+    * @param usernam Reference to user name
+    */
+    void setUserName(const QString &usernam);
+    /**
+    * @brief Sets the message text
+    *
+    * @param text Reference to user message
+    */
+    void setMessageText(const QString &text);
+    /**
+    * @brief Sets the users current address
+    *
+    * @param addr Reference to users current address
+    */
+    void setAddress(const QString &addr);
+    /**
+    * @brief Sets the time of updated message
+    *
+    * @param tim Reference to time when message was sent.
+    */
+    void setTime(const QString &tim);
+protected:
+    /**
+    * @brief This function is called when the widget is drawn
+    *
+    * @param aPaintEvent Pointer to paint event
+    */
+    void paintEvent(QPaintEvent *aPaintEvent);
+private:
+    QLabel *userPicture;
+    QLabel *userNameLabel;
+    QLabel *messageLabel;
+    QLabel *addressLabel;
+    QLabel *timeLabel;
+    QGridLayout *layout;
+    QString messageText;
+    QString userName;
+    QString address;
+    QString time;
+    QPixmap avatar;
+};
+
+#endif // INFOTAB_H
index c1084d2..2e02e2c 100644 (file)
@@ -3,6 +3,7 @@
    Copyright (C) 2010  Ixonos Plc. Authors:
 
       Kaj Wallin - kaj.wallin@ixonos.com
+      Jukka Saastamoinen jukka.saastamoinen@ixonos.com
 
    Situare is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    USA.
 */
 
+#include <QGraphicsScene>
+#include <QGraphicsView>
+#include <QGraphicsWidget>
+#include <QtGui/QVBoxLayout>
+#include <QGraphicsProxyWidget>
+#include <QStateMachine>
 #include "listviewscreen.h"
+#include "pixmap.h"
+#include "infotab.h"
+#include <QDebug>
 
 ListViewScreen::ListViewScreen(QWidget *parent)
    : QWidget(parent)
 {
-   QPushButton *listViewButton = new QPushButton(tr("This is listview"));
-   QHBoxLayout *listViewLayout = new QHBoxLayout;
-   listViewLayout->addWidget(listViewButton);
-   setLayout(listViewLayout);
+    Pixmap *arrowbutton = new Pixmap(QPixmap(":/resources/arrow_right.png"));
+
+    InfoTab *personalInfo = new InfoTab;
+    personalInfo->setAvatar(QPixmap(":/resources/facebook_user_64.png"));
+    personalInfo->setUserName("Fred Facebook");
+    personalInfo->setMessageText("Hello Maemo Situare !");
+    personalInfo->setTime("1 hour ago");
+    personalInfo->setAddress("Kiviharjunlenkki 1E, 91910 Oulu");
+
+    QGraphicsProxyWidget *widgetProxy = new QGraphicsProxyWidget();
+    widgetProxy->setWidget(personalInfo);
+
+    QGraphicsScene *scene= new QGraphicsScene();
+    QGraphicsWidget *graphWidget = new QGraphicsWidget();
+    graphLayout = new QGraphicsLinearLayout(graphWidget);
+    graphLayout->setOrientation(Qt::Horizontal);
+    graphLayout->addItem(widgetProxy);
+    scene->setBackgroundBrush(Qt::white);    
+    scene->addItem(graphWidget);
+    scene->addItem(arrowbutton);
+    qDebug() << "Scene width: " << scene->width();
+    qDebug() << "Scene heigth: " << scene->height();
+
+    QGraphicsView *view = new QGraphicsView(scene);
+    view->setAlignment(Qt::AlignLeft|Qt::AlignTop);
+    view->setSceneRect(0,0,7000,3000);
+    view->centerOn(QPointF(0,0));
+    view->setFrameStyle(0);
+    view->setAlignment(Qt::AlignLeft | Qt::AlignTop);
+    view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
+    QStateMachine *machine = new QStateMachine;
+    machine->setGlobalRestorePolicy(QStateMachine::RestoreProperties);
+
+    QState *state1 = new QState(machine);
+    QState *state2 = new QState(machine);
+    machine->setInitialState(state1);
+
+    // State 1
+    state1->assignProperty(graphWidget,"pos",QPointF(-(personalInfo->width()+20),0));
+    state1->assignProperty(arrowbutton,"pos",QPointF(0,(arrowbutton->boundingRect().height()/2)+10));
+
+    // State 2
+    state2->assignProperty(graphWidget,"pos",QPointF(-20,0));
+    state2->assignProperty(arrowbutton,"pos",QPointF((personalInfo->width()-5),(arrowbutton->boundingRect().height()/2)+10));
+
+    QAbstractTransition *trans1 = state1->addTransition(arrowbutton,SIGNAL(clicked()),state2);
+    trans1->addAnimation(new QPropertyAnimation(graphWidget,"pos"));
+    trans1->addAnimation(new QPropertyAnimation(arrowbutton,"pos"));
+
+    QAbstractTransition *trans2 = state2->addTransition(arrowbutton,SIGNAL(clicked()),state1);
+    trans2->addAnimation(new QPropertyAnimation(graphWidget,"pos"));
+    trans2->addAnimation(new QPropertyAnimation(arrowbutton,"pos"));
+
+    machine->start();
+
+    vbox = new QVBoxLayout(this);
+    vbox->addWidget(view);
+}
+
+ListViewScreen::~ListViewScreen()
+{
+    if (vbox)
+        delete vbox;
+    if (graphLayout)
+        delete graphLayout;
+    vbox=NULL;
+    graphLayout=NULL;
 }
index f9578a3..67f4e20 100644 (file)
@@ -34,6 +34,10 @@ class ListViewScreen : public QWidget
 {
 public:
     ListViewScreen(QWidget *parent = 0);
+    ~ListViewScreen();
+private:
+    QVBoxLayout *vbox;
+    QGraphicsLinearLayout *graphLayout;
 };
 
 #endif // LISTVIEWTAB_H
index 91ef5a3..b6c02e1 100644 (file)
@@ -29,17 +29,9 @@ MainWindow::MainWindow(QWidget *parent)
     : QMainWindow(parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
-    QWidget *widget = new QWidget;
-    setCentralWidget(widget);
     createViews();
-    QVBoxLayout *mainLayout = new QVBoxLayout;
-    infoLabel = new QLabel(tr("Click \"view\", to change between views"),this);
-    infoLabel->setAttribute(Qt::WA_TranslucentBackground, true);
-    mainLayout->addWidget(infoLabel);
-    mainLayout->addWidget(situareViews);
-    widget->setLayout(mainLayout);
+    setCentralWidget(situareViews);
     createMenus();
-
     setWindowTitle(tr("View"));
 }
 
@@ -49,7 +41,6 @@ MainWindow::~MainWindow()
     delete toListViewAct;
     delete toMapViewAct;
     delete situareViews;
-    delete infoLabel;
 }
 
 void MainWindow::createMenus()
@@ -92,7 +83,6 @@ void MainWindow::switchView(int nextIndex)
         return;
     }
     situareViews->setCurrentIndex(nextIndex);
-    infoLabel->setText(tr("Current: %1").arg(situareViews->currentIndex()));
     switch (situareViews->currentIndex()) {
         case 0:
             setWindowTitle(tr("List"));
index 7651280..4377605 100644 (file)
@@ -94,15 +94,6 @@ private:
     */
     void switchView(int);
 
-    /**
-    * @brief DUMMY LABEL, REMOVE WHEN BOTH VIEWS ARE COMPLETE
-    *
-    * @var infoLabel
-    * @todo REMOVE THIS
-    */
-    QLabel *infoLabel;
-
-
 public slots:
     /**
     * @brief Public slot, which initiates toListViewAct action to switch view
index a736179..bdb6dcd 100644 (file)
 */
 
 #include "mapviewscreen.h"
+#include "infotab.h"
 #include "../map/mapview.h"
 #include "../map/mapengine.h"
+#include "infotab.h"
 
 MapViewScreen::MapViewScreen(QWidget *parent)
    : QWidget(parent)
diff --git a/src/ui/pixmap.cpp b/src/ui/pixmap.cpp
new file mode 100644 (file)
index 0000000..387358e
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+   Situare - A location system for Facebook
+   Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Jukka Saastamoinen - jukka.saastamoinen@ixonos.com
+
+   Situare is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   version 2 as published by the Free Software Foundation.
+
+   Situare is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Situare; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+   USA.
+*/
+
+#include "pixmap.h"
+#include <QDebug>
+
+Pixmap::Pixmap(const QPixmap &picture, QGraphicsObject *parent)
+    : QGraphicsObject(parent), p(picture)
+{
+}
+
+void Pixmap::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+    emit clicked();
+    qDebug() << __PRETTY_FUNCTION__;
+}
+
+void Pixmap::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+    painter->drawPixmap(QPointF(), p);
+}
+
+QRectF Pixmap::boundingRect() const
+{
+    return QRectF( QPointF(0, 0), p.size());
+}
diff --git a/src/ui/pixmap.h b/src/ui/pixmap.h
new file mode 100644 (file)
index 0000000..40e2c63
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+   Situare - A location system for Facebook
+   Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Jukka Saastamoinen - jukka.saastamoinen@ixonos.com
+
+   Situare is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   version 2 as published by the Free Software Foundation.
+
+   Situare is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Situare; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+   USA.
+*/
+
+#ifndef PIXMAP_H
+#define PIXMAP_H
+
+#include <QtCore>
+#include <QtGui>
+
+/**
+* @brief Pixmap class.
+*
+* General purpose class used to display graphical objects
+* that can be animated.
+* @author Jukka Saastamoinen
+*/
+
+class Pixmap : public QGraphicsObject
+{
+    Q_OBJECT
+public:
+    /**
+    * @brief Constructor
+    *
+    * @param Reference to the picture displayed
+    * @param parent Parent
+    */
+    Pixmap(const QPixmap &, QGraphicsObject *parent = 0);
+    /**
+    * @brief Mouse press event
+    *
+    * @param event Mouse event
+    */
+    void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    /**
+    * @brief Bounding box of the drawed pixmap
+    *
+    * @return Rectangle shaped bounding box of the pixmap
+    */
+    QRectF boundingRect() const;
+protected:
+    /**
+    * @brief Drawer of the given picture
+    *
+    * @param painter Pointer to painting class
+    * @param Pointer to class describing parameters needed to draw the item
+    * @param Pointer to the widget
+    */
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
+signals:
+    /**
+    * @brief Signal which is emitted when the pixmap
+    * bounding box area is clicked.
+    */
+    void clicked();
+private:
+    QPixmap p;
+};
+
+#endif // PIXMAP_H
diff --git a/tests/ui/pixmap/dummy_personal_infotab_background.png b/tests/ui/pixmap/dummy_personal_infotab_background.png
new file mode 100644 (file)
index 0000000..08dca9d
Binary files /dev/null and b/tests/ui/pixmap/dummy_personal_infotab_background.png differ
diff --git a/tests/ui/pixmap/testpixmap.cpp b/tests/ui/pixmap/testpixmap.cpp
new file mode 100644 (file)
index 0000000..e229a79
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+     Situare - A location system for Facebook
+     Copyright (C) 2010  Ixonos Plc. Authors:
+
+         Jukka Saastamoinen - jukka.saastamoinen@ixonos.com
+
+     Situare is free software; you can redistribute it and/or
+     modify it under the terms of the GNU General Public License
+     version 2 as published by the Free Software Foundation.
+
+     Situare is distributed in the hope that it will be useful,
+     but WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+     GNU General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with Situare; if not, write to the Free Software
+     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+     USA.
+*/
+
+#include <QtTest>
+#include <QtGui>
+#include "ui/pixmap.h"
+
+
+class TestPixmap: public QObject
+{
+    Q_OBJECT
+private slots:
+    void constructorTest();
+    void boundingRegionTest();
+};
+
+/**
+* @brief Tests that the class accepts the png file used to draw the image
+*/
+void TestPixmap::constructorTest()
+{
+    Pixmap *infoTab = new Pixmap(QPixmap("dummy_personal_infotab_background.png"));
+    delete infoTab;
+    infoTab=NULL;
+    QVERIFY(!infoTab);
+}
+
+/**
+* @brief Tests that the bounding area reserved for the picture is the same as
+* the picture size.
+*/
+
+void TestPixmap::boundingRegionTest()
+{
+    Pixmap testPic(QPixmap("dummy_personal_infotab_background.png")); //350x300 pix
+    QPixmap refPic("dummy_personal_infotab_background.png");
+    QRectF boundArea = testPic.boundingRect();
+    QRectF refArea;
+    refArea.setSize(refPic.size());
+    QVERIFY(boundArea.size()==refArea.size());
+}
+
+
+QTEST_MAIN(TestPixmap)
+#include "testpixmap.moc"
+
+
diff --git a/tests/ui/pixmap/testpixmap.pro b/tests/ui/pixmap/testpixmap.pro
new file mode 100644 (file)
index 0000000..b562322
--- /dev/null
@@ -0,0 +1,10 @@
+CONFIG += qtestlib
+TEMPLATE = app
+TARGET = pixmap 
+DEPENDPATH += .
+INCLUDEPATH += . \
+    ../../../src/
+
+SOURCES += testpixmap.cpp \
+       ../../../src/ui/pixmap.cpp
+HEADERS += ../../../src/ui/pixmap.h