<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_item2.png</file>
</qresource>
</RCC>
setMinimumSize(ITEM_MIN_WIDTH, ITEM_MIN_HEIGHT);
setMaximumSize(ITEM_MIN_WIDTH, ITEM_MAX_HEIGHT);
+ this->setAutoFillBackground(false);
}
void FriendListItem::setData(User *user)
*/
#include "friendlistpanel.h"
+#include "friendlistview.h"
+#include "friendlistitem.h"
FriendListPanel::FriendListPanel(QWidget *parent)
: QWidget(parent)
{
qWarning() << __PRETTY_FUNCTION__;
- QGridLayout *friendsListGrid = new QGridLayout(this);
+ QVBoxLayout *friendsListGrid = new QVBoxLayout(this);
this->setLayout(friendsListGrid);
QPushButton *friendsDummyBTN = new QPushButton("HOOO", this);
- QLabel *friendsDummyLBL = new QLabel("FRIENDS LIST", this);
- friendsListGrid->addWidget(friendsDummyBTN,1,1,3,1);
- friendsListGrid->addWidget(friendsDummyLBL, 2,2,2,3);
- this->resize(300,600);
- this->setAutoFillBackground(true);
+// QLabel *friendsDummyLBL = new QLabel("FRIENDS LIST", this);
+ friendsListGrid->addWidget(friendsDummyBTN);
+
+
+ m_friendListView = new FriendListView(this);
+ QScrollArea *friendListScroll = new QScrollArea(this);
+ friendListScroll->setWidget(m_friendListView);
+ friendListScroll->setWidgetResizable(true);
+// m_friendListView->setAutoFillBackground(false);
+ friendListScroll->viewport()->setAutoFillBackground(false);
+
+ friendsListGrid->addWidget(friendListScroll);
+
+// friendsListGrid->addWidget(friendsDummyLBL, 2,2,2,3);
+ this->resize(420,600);
+// this->setAutoFillBackground(true);
this->move(50,50);
QStateMachine *friendsListMachine = new QStateMachine(this);
friendsListMachine->start();
}
+
+void FriendListPanel::friendInfoReceived(QList<User *> &friendList)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_friendListView->clear();
+
+ foreach (User *user, friendList) {
+ FriendListItem *item = new FriendListItem(m_friendListView);
+ item->setData(user);
+ m_friendListView->addWidget(item);
+ }
+}
#include <QtGui>
+class FriendListView;
+class User;
+
/**
* @brief Class for sliding friends list panel
*
public:
FriendListPanel(QWidget *parent = 0);
- void startti();
+
+
+ FriendListView *m_friendListView; ///< Friend list view
+
+public slots:
+ void friendInfoReceived(QList<User *> &friendList);
};
#endif // FRIENDLISTPANEL_H
connect(m_listViewScreen,SIGNAL(launchUpdateDialog()),
this,SLOT(openLocationUpdateDialog()));
- connect(this, SIGNAL(reverseGeoReady(QString)), m_locationDialog, SLOT(setAddress(QString)));
+ connect(this, SIGNAL(reverseGeoReady(QString)),
+ m_locationDialog, SLOT(setAddress(QString)));
connect(m_locationDialog, SIGNAL(statusUpdate(QString,bool)), this,
SIGNAL(statusUpdate(QString,bool)));
connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
m_mapViewScreen, SLOT(friendsLocationsReady(QList<User*>&)));
- connect(this, SIGNAL(userLocationReady(User*)), m_listViewScreen,
- SLOT(userDataReceived(User*)));
- connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)), m_listViewScreen,
- SLOT(friendInfoReceived(QList<User*>&)));
+ connect(this, SIGNAL(userLocationReady(User*)),
+ m_listViewScreen, SLOT(userDataReceived(User*)));
+ connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
+ m_listViewScreen, SLOT(friendInfoReceived(QList<User*>&)));
connect(m_listViewScreen, SIGNAL(updateFriendsData()),
this, SIGNAL(refreshUserData()));
+ connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
+ m_mapViewScreen, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)));
+
this->toggleProgressIndicator(true);
}
FriendListPanel *friendsListPanel = new FriendListPanel(this);
+ connect(this, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)),
+ friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
+
osmLicense = new QLabel(this);
osmLicense->setAttribute(Qt::WA_TranslucentBackground, true);
osmLicense->setAttribute(Qt::WA_TransparentForMouseEvents, true);
#include <QtGui>
#include "map/mapengine.h"
+#include "friendlistpanel.h"
/**
* @brief Map View class. Used to display Map
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
+signals:
+ void SIG_friendsLocationsReady(QList<User *> &friendsList);
+
+public:
+ FriendListPanel *friendsListPanel;
+
private:
MapEngine *mapEngine; ///< MapEngine
//DEBUG