Friendlist mockup.
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Fri, 23 Apr 2010 12:54:52 +0000 (15:54 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Fri, 23 Apr 2010 12:54:52 +0000 (15:54 +0300)
src/images.qrc
src/src.pro
src/ui/infotab.cpp
src/ui/listviewscreen.cpp
src/ui/listviewscreen.h
src/ui/mainwindow.cpp

index 7095d4f..d809018 100644 (file)
@@ -8,5 +8,9 @@
         <file>resources/clock_small.png</file>
         <file>resources/arrow_left.png</file>
         <file>resources/arrow_right.png</file>
+        <file>resources/list_item.png</file>
+        <file>resources/dummy_Avatar.png</file>
+        <file>resources/fb.jpg</file>
+        <file>resources/list_item_selected.png</file>
     </qresource>
 </RCC>
index 692831f..6372405 100644 (file)
@@ -20,7 +20,10 @@ SOURCES += main.cpp \
     ui/pixmap.cpp \
     ui/infotab.cpp \
     ui/updatelocation/updatelocationdialog.cpp \
-    ui/updatelocation/texteditautoresizer.cpp
+    ui/updatelocation/texteditautoresizer.cpp \
+    ui/friendlistview.cpp \
+    ui/friendlistitemdelegate.cpp \
+    ui/friendlistitem.cpp
 HEADERS += ui/mainwindow.h \
     ui/mapviewscreen.h \
     ui/listviewscreen.h \
@@ -39,7 +42,10 @@ HEADERS += ui/mainwindow.h \
     cookiehandler/cookiehandler.h \
     facebookservice/facebookcredentials.h \
     facebookservice/facebookauthentication.h \
-    facebookservice/facebookcommon.h
+    facebookservice/facebookcommon.h \
+    ui/friendlistview.h \
+    ui/friendlistitemdelegate.h \
+    ui/friendlistitem.h
 QT += network \
     webkit
 
index 48e2f8f..230ba1f 100644 (file)
@@ -1,3 +1,24 @@
+/*
+   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 "infotab.h"
 
 InfoTab::InfoTab(QWidget *parent)
@@ -60,29 +81,29 @@ InfoTab::~InfoTab()
 
 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();
+//    //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)
index 8e62d0a..3360dc6 100644 (file)
 #include "listviewscreen.h"
 #include <QDebug>
 
+#include "friendlistitemdelegate.h"
+#include "friendlistview.h"
+
 ListViewScreen::ListViewScreen(QWidget *parent)
     : QWidget(parent)
 {
+    //DEBUG
+    FriendListView *friendListView = new FriendListView(this);
+    friendListView->setItemDelegate(new FriendListItemDelegate());
+    QListWidgetItem *item1 = new QListWidgetItem();
+    item1->setData(Qt::DisplayRole, "Nimi");
+    item1->setData(Qt::UserRole +1, "Sijainti");
+    item1->setData(Qt::DecorationRole, QPixmap(":/resources/dummy_Avatar.png"));
+    QListWidgetItem *item2 = new QListWidgetItem();
+    item2->setData(Qt::DisplayRole, "Nimi2");
+    item2->setData(Qt::UserRole +1, "Sijainti");
+    item2->setData(Qt::DecorationRole, QPixmap(":/resources/dummy_Avatar.png"));
+    QListWidgetItem *item3 = new QListWidgetItem();
+    item3->setData(Qt::DisplayRole, "Nimi3");
+    item3->setData(Qt::UserRole +1, "Sijainti");
+    item3->setData(Qt::DecorationRole, QPixmap(":/resources/dummy_Avatar.png"));
+    QListWidgetItem *item4 = new QListWidgetItem();
+    item4->setData(Qt::DisplayRole, "Nimi4");
+    item4->setData(Qt::UserRole +1, "Sijainti");
+    item4->setData(Qt::DecorationRole, QPixmap(":/resources/dummy_Avatar.png"));
+    QListWidgetItem *item5 = new QListWidgetItem();
+    item5->setData(Qt::DisplayRole, "Nimi5");
+    item5->setData(Qt::UserRole +1, "Sijainti");
+    item5->setData(Qt::DecorationRole, QPixmap(":/resources/dummy_Avatar.png"));
+    friendListView->addItem(item1);
+    friendListView->addItem(item2);
+    friendListView->addItem(item3);
+    friendListView->addItem(item4);
+    friendListView->addItem(item5);
+    //DEBUG
 
     m_arrowbutton = new Pixmap(QPixmap(":/resources/arrow_right.png"));
 
@@ -61,6 +93,8 @@ ListViewScreen::ListViewScreen(QWidget *parent)
     view->setAlignment(Qt::AlignLeft | Qt::AlignTop);
     view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    view->setBackgroundBrush(Qt::white);
+
 
     QStateMachine *machine = new QStateMachine(this);
     machine->setGlobalRestorePolicy(QStateMachine::RestoreProperties);
@@ -91,8 +125,11 @@ ListViewScreen::ListViewScreen(QWidget *parent)
 
     machine->start();
 
-    m_vbox = new QVBoxLayout(this);
-    m_vbox->addWidget(view);
+    m_vbox = new QHBoxLayout(this);
+    //m_vbox->addWidget(view);
+    //DEBUG
+    m_vbox->addWidget(friendListView);
+    //DEBUG
     m_vbox->setMargin(0);
 
     connect(m_personalInfo,SIGNAL(launchMessageUpdate()),this,SLOT(updateMessage()));
index 2d746ab..200d9d4 100644 (file)
@@ -63,7 +63,7 @@ public slots:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    QVBoxLayout *m_vbox;    ///< Holds the graphics view
+    QHBoxLayout *m_vbox;    ///< Holds the graphics view
     InfoTab *m_personalInfo;    ///< Personal info tab
     Pixmap *m_arrowbutton;    ///< Button which reveals/hides the info tab when pressed
     QGraphicsProxyWidget *m_widgetProxy; ///< Embeds InfoTab to graphics view
index fe270bc..7981015 100644 (file)
    USA.
 */
 
+#include <QGraphicsScene>
+#include <QGraphicsView>
+#include <QGraphicsWidget>
+#include <QtGui/QVBoxLayout>
+#include <QGraphicsProxyWidget>
 #include <QtGui>
 #include "mainwindow.h"
 #include "listviewscreen.h"
@@ -76,6 +81,7 @@ void MainWindow::createViews()
     m_situareViews = new QStackedWidget;
     m_situareViews->addWidget(new ListViewScreen);
     m_situareViews->addWidget(new MapViewScreen);
+
 }
 
 void MainWindow::toListView()