Merge branch 'personalinfo' into friendlist
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Thu, 29 Apr 2010 08:32:27 +0000 (11:32 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Thu, 29 Apr 2010 08:32:27 +0000 (11:32 +0300)
Conflicts:
images.qrc
res/images/compass.png
src/images.qrc
src/src.pro
src/ui/listviewscreen.cpp
src/ui/listviewscreen.h

1  2 
images.qrc
src/images.qrc
src/src.pro
src/ui/listviewscreen.cpp
src/ui/listviewscreen.h

diff --cc images.qrc
@@@ -2,20 -2,19 +2,24 @@@
      <qresource prefix="/">
          <file>res/images/arrow_left.png</file>
          <file>res/images/arrow_right.png</file>
-         <file>res/images/clock_small.png</file>
-         <file>res/images/compas_small.png</file>
-         <file>res/images/facebook_user_64.png</file>
-         <file>res/images/list_small.png</file>
-         <file>res/images/reload_icon.png</file>
-         <file>res/images/sendPosition_icon.png</file>
 +        <file>res/images/clock.png</file>
 +        <file>res/images/compass.png</file>
 +        <file>res/images/dummy_Avatar.png</file>
 +        <file>res/images/envelope.png</file>
-         <file>res/images/list_item_bottom.png</file>
-         <file>res/images/list_item_middle.png</file>
-         <file>res/images/list_item_top.png</file>
 +        <file>res/images/list_item.png</file>
 +        <file>res/images/dummy_image.png</file>
+         <file>res/images/zoom_in.png</file>
+         <file>res/images/zoom_out.png</file>
+         <file>res/images/compass.png</file>
+         <file>res/images/envelope.png</file>
+         <file>res/images/personal_info_bckgrnd.png</file>
+         <file>res/images/profile_pic_border.png</file>
+         <file>res/images/refresh.png</file>
+         <file>res/images/send_position.png</file>
+         <file>res/images/side_bar_left.png</file>
+         <file>res/images/side_bar_right.png</file>
+         <file>res/images/situare_user.jpg</file>
+         <file>res/images/sliding_bar_left.png</file>
+         <file>res/images/sliding_bar_right.png</file>
 -        <file>res/images/clock.png</file>
      </qresource>
  </RCC>
diff --cc src/images.qrc
@@@ -1,35 -1,18 +1,52 @@@
  <RCC>
      <qresource prefix="/">
++<<<<<<< HEAD:src/images.qrc
 +        <file>resources/arrow_left.png</file>
 +        <file>resources/arrow_right.png</file>
 +        <file>resources/bkg_grid.png</file>
 +        <file>resources/clock.png</file>
 +        <file>resources/clock_small.png</file>
 +        <file>resources/compass.png</file>
 +        <file>resources/compas_small.png</file>
 +        <file>resources/dummy_Avatar.png</file>
 +        <file>resources/envelope.png</file>
 +        <file>resources/facebook_user_64.png</file>
 +        <file>resources/fb.jpg</file>
 +        <file>resources/led_red_g.png</file>
 +        <file>resources/led_red_h.png</file>
 +        <file>resources/led_red_s.png</file>
 +        <file>resources/list_item.png</file>
 +        <file>resources/list_item_selected.png</file>
 +        <file>resources/list_small.png</file>
 +        <file>resources/personal_infotab_background.png</file>
 +        <file>resources/reload_icon.png</file>
 +        <file>resources/sendPosition_icon.png</file>
 +        <file>resources/separe_line.png</file>
 +        <file>resources/side_bar_left.png</file>
 +        <file>resources/side_bar_right.png</file>
 +        <file>resources/sliding_bar_left.png</file>
 +        <file>resources/sliding_bar_right.png</file>
 +        <file>resources/top_separtor.png</file>
 +        <file>resources/zoom_in.png</file>
 +        <file>resources/zoom_out.png</file>
 +        <file>resources/list_item_bottom.png</file>
 +        <file>resources/list_item_middle.png</file>
 +        <file>resources/list_item_top.png</file>
++=======
+         <file>resources/zoom_in.png</file>
+         <file>resources/zoom_out.png</file>
+         <file>resources/clock.png</file>
+         <file>resources/compass.png</file>
+         <file>resources/envelope.png</file>
+         <file>resources/profile_pic_border.png</file>
+         <file>resources/situare_user.jpg</file>
+         <file>resources/send_position.png</file>
+         <file>resources/side_bar_left.png</file>
+         <file>resources/sliding_bar_left.png</file>
+         <file>resources/personal_info_bckgrnd.png</file>
+         <file>resources/refresh.png</file>
+         <file>resources/arrow_left.png</file>
+         <file>resources/arrow_right.png</file>
++>>>>>>> personalinfo:src/images.qrc
      </qresource>
  </RCC>
diff --cc src/src.pro
@@@ -23,11 -25,9 +25,13 @@@ SOURCES += main.cpp 
      ui/infotab.cpp \
      ui/updatelocation/updatelocationdialog.cpp \
      ui/updatelocation/texteditautoresizer.cpp \
 +    ui/friendlistview.cpp \
 +    ui/friendlistitemdelegate.cpp \
 +    ui/friendlistitem.cpp \
 +    engine/engine.cpp \
-     user/user.cpp
+     user/user.cpp \
+     ui/buttonitem.cpp \
+     ui/situareuser.cpp
  HEADERS += ui/mainwindow.h \
      ui/mapviewscreen.h \
      ui/listviewscreen.h \
      facebookservice/facebookcredentials.h \
      facebookservice/facebookauthentication.h \
      facebookservice/facebookcommon.h \
 +    ui/friendlistview.h \
 +    ui/friendlistitemdelegate.h \
 +    ui/friendlistitem.h \
 +    engine/engine.h \
-     user/user.h
+     user/user.h \
+     ui/buttonitem.h \
+     ui/situareuser.h
  QT += network \
      webkit
  
  #include <QtGui/QVBoxLayout>
  #include <QGraphicsProxyWidget>
  #include <QStateMachine>
- #include <QListView>
 -#include "listviewscreen.h"
 -#include "situareuser.h"
 -#include <QDebug>
+ #include <QtGui/QGraphicsTransform>
+ #include <QtGui/QGraphicsRotation>
 +#include <QDebug>
 +#include <QScrollArea>
 +
 +#include "listviewscreen.h"
 +#include "friendlistitemdelegate.h"
 +#include "friendlistview.h"
 +#include "friendlistitem.h"
 +#include "friendlistmodel.h"
 +#include "user/user.h"
++#include "situareuser.h"
+ const int INFOTAB_Y_LOC_STATE1 = 71;
+ const int INFOTAB_X_LOC_STATE2 = 59;
+ const int INFOTAB_Y_LOC_STATE2 = 71;
+ const int LEFTBAR_X_LOC = 0;
+ const int LEFTBAR_Y_LOC = 0;
+ const int SLIDING_BAR_X_LOC_STATE1 = 0;
+ const int SLIDING_BAR_Y_LOC_STATE1 = 0;
+ const int BACKGROUND_X_LOC_STATE1 = 400;
+ const int BACKGROUND_Y_LOC_STATE1 = 0;
+ const int RIGHTARROW_X_LOC_STATE1 = 9;
+ const int RIGHTARROW_Y_LOC_STATE1 = 205;
+ const int LEFTARROW_X_LOC_STATE1 = 9;
+ const int LEFTARROW_Y_LOC_STATE1 = 205;
+ const int PROXYWIDGET_X_LOC_STATE1 = 59;
+ const int PROXYWIDGET_Y_LOC_STATE1 = 71;
+ const int SLIDING_BAR_X_LOC_STATE2 = 376;
+ const int SLIDING_BAR_Y_LOC_STATE2 = 0;
+ const int BACKGROUND_X_LOC_STATE2 = 0;
+ const int BACKGROUND_Y_LOC_STATE2 = 0;
+ const int RIGHTARROW_X_LOC_STATE2 = 385;
+ const int RIGHTARROW_Y_LOC_STATE2 = 205;
+ const int LEFTARROW_X_LOC_STATE2 = 385;
+ const int LEFTARROW_Y_LOC_STATE2 = 205;
+ const int PROXYWIDGET_X_LOC_STATE2 = 59;
+ const int PROXYWIDGET_Y_LOC_STATE2 = 71;
  
  ListViewScreen::ListViewScreen(QWidget *parent)
      : QWidget(parent)
  {
 +    //DEBUG
 +    FriendListView *friendListView = new FriendListView(this);
 +
 +    User user1(QString("Kiviharjunlenkki 1E, 91910 Oulu"), QPointF(25.5, 65), QString("User 1"),
 +               QString("Hello Maemo Situare!"), QUrl("http://static.ak.fbcdn.net/pics/q_silhouette.gif"), QString("2 days ago" \
 +               " 2 days ago 2 days ago 2 days ago"), false, QString(),
 +               QString(), 12.2);
 +    User user2(QString("Kiviharjunlenkki 1E, 91910 Oulu"), QPointF(25.5, 65), QString("User 2"),
 +               QString("Hello Maemo Situare! Hello Maemo Situare! Hello Maemo Situare!"),
 +               QUrl("http://static.ak.fbcdn.net/pics/q_silhouette.gif"), QString("2 days ago"), false, QString(),
 +               QString(), 12.2);
 +    User user3(QString("Kiviharjunlenkki 1E, 91910 Oulu"), QPointF(25.5, 65), QString("User 2"),
 +               QString("Hello Maemo Situare! Hello Maemo Situare! Hello Maemo Situare!" \
 +                       "Hello Maemo Situare! Hello Maemo Situare! Hello Maemo Situare! " \
 +                       "Hello Maemo Situare! Hello Maemo Situare! Hello Maemo Situare! "),
 +               QUrl("http://static.ak.fbcdn.net/pics/q_silhouette.gif"), QString("2 days ago"), false, QString(),
 +               QString(), 12.2);
 +    FriendListItem *item1 = new FriendListItem(friendListView);
 +    item1->setData(user1);
 +    FriendListItem *item2 = new FriendListItem(friendListView);
 +    item2->setData(user1);
 +    FriendListItem *item3 = new FriendListItem(friendListView);
 +    item3->setData(user1);
 +    FriendListItem *item4 = new FriendListItem(friendListView);
 +    item4->setData(user2);
 +    FriendListItem *item5 = new FriendListItem(friendListView);
 +    item5->setData(user3);
 +    FriendListItem *item6 = new FriendListItem(friendListView);
 +    item6->setData(user1);
 +
 +    friendListView->addWidget(item1);
 +    friendListView->addWidget(item2);
 +    friendListView->addWidget(item3);
 +    friendListView->addWidget(item4);
 +    friendListView->addWidget(item5);
 +    friendListView->addWidget(item6);
- //    friendListView->addWidget(new QPushButton("Hep", this));
 +
 +    QScrollArea *friendListScroll = new QScrollArea();
 +    friendListScroll->setWidget(friendListView);
 +    friendListScroll->setWidgetResizable(true);
 +    //DEBUG
 +
  
-     m_arrowbutton = new Pixmap(QPixmap(":/res/images/arrow_right.png"));
+     m_leftSideBar = new Pixmap(QPixmap(":/res/images/side_bar_left.png"));
+     m_slidingLeftSideBar = new Pixmap(QPixmap(":/res/images/sliding_bar_left.png"));
+     m_personalInfoBackGround = new Pixmap(QPixmap(":/res/images/personal_info_bckgrnd.png"));
+     m_arrowLeft = new Pixmap(QPixmap(":/res/images/arrow_left.png"));
+     m_arrowRight = new Pixmap(QPixmap(":/res/images/arrow_right.png"));
      m_personalInfo = new InfoTab;
-     m_personalInfo->setAvatar(QPixmap(":/res/images/facebook_user_64.png"));
+     m_personalInfo->setAvatar(QPixmap(":/res/images/situare_user.jpg"));
      m_personalInfo->setUserName("Fred Facebook");
      m_personalInfo->setMessageText("Hello Maemo Situare !");
      m_personalInfo->setTime("1 hour ago");
      m_widgetProxy->setWidget(m_personalInfo);
  
      QGraphicsScene *scene= new QGraphicsScene(this);
--    scene->setBackgroundBrush(Qt::white);    
++//    scene->setBackgroundBrush(Qt::white);
+     scene->addItem(m_personalInfoBackGround);
      scene->addItem(m_widgetProxy);
-     scene->addItem(m_arrowbutton);
-     qDebug() << "Scene width: " << scene->width();
-     qDebug() << "Scene heigth: " << scene->height();
+     scene->addItem(m_leftSideBar);
+     scene->addItem(m_slidingLeftSideBar);
+     scene->addItem(m_arrowRight);
+     scene->addItem(m_arrowLeft);
++    //DEBUG
++    QGraphicsProxyWidget *scrollProxy = new QGraphicsProxyWidget();
++    scrollProxy->setWidget(friendListScroll);
++    scrollProxy->setZValue(m_personalInfoBackGround->zValue() - 3);
++    scrollProxy->setMinimumSize(790, 480);
++    scene->addItem(scrollProxy);
++    scrollProxy->setPos(300, 0);
++    //DEBUG
+     m_leftSideBar->setPos(0,0);
  
      QGraphicsView *view = new QGraphicsView(scene);
      view->setAlignment(Qt::AlignLeft|Qt::AlignTop);
      view->setAlignment(Qt::AlignLeft | Qt::AlignTop);
      view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
      view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-     view->setBackgroundBrush(Qt::white);
++//    view->setBackgroundBrush(Qt::white);
 +
  
      QStateMachine *machine = new QStateMachine(this);
      machine->setGlobalRestorePolicy(QStateMachine::RestoreProperties);
      machine->start();
  
      m_vbox = new QVBoxLayout(this);
- //    m_vbox->addWidget(view);
-     //DEBUG
-     //m_vbox->addWidget(friendListView);
-     m_vbox->addWidget(friendListScroll);
-     //DEBUG
+     m_vbox->addWidget(view);
++    //m_vbox->addWidget(friendListScroll);
      m_vbox->setMargin(0);
  
-     //connect(m_personalInfo,SIGNAL(launchMessageUpdate()),this,SLOT(updateMessage()));
+     connect(m_personalInfo,SIGNAL(launchMessageUpdate()),this,SLOT(updateMessage()));
  }
  
  ListViewScreen::~ListViewScreen()
@@@ -63,12 -62,14 +62,17 @@@ public slots
  /*******************************************************************************
   * DATA MEMBERS
   ******************************************************************************/
 +public:
 +    InfoTab *m_personalInfo;    ///< Personal info tab
 +
  private:
      QVBoxLayout *m_vbox;    ///< Holds the graphics view
 -    InfoTab *m_personalInfo;    ///< Personal info tab
 +    Pixmap *m_arrowbutton;    ///< Button which reveals/hides the info tab when pressed
+     Pixmap *m_leftSideBar;
+     Pixmap *m_slidingLeftSideBar;
+     Pixmap *m_personalInfoBackGround;
+     Pixmap *m_arrowLeft;
+     Pixmap *m_arrowRight;
      QGraphicsProxyWidget *m_widgetProxy; ///< Embeds InfoTab to graphics view
      QAbstractTransition *m_trans1;    ///< Animation transition from hidden state to visible
      QAbstractTransition *m_trans2;    ///< Animation transition from visible to hidden