2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Kaj Wallin - kaj.wallin@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 #include "userinfopanel.h"
25 #include "panelcommon.h"
27 UserInfoPanel::UserInfoPanel(QWidget *parent)
30 qDebug() << __PRETTY_FUNCTION__;
32 setType(SidePanel::UserPanel);
34 m_userInfo = new UserInfo(this);
36 QWidget *userInfoView = new QWidget(this);
37 QVBoxLayout *userViewLayout = new QVBoxLayout(userInfoView);
38 userViewLayout->setMargin(0);
39 userViewLayout->setSpacing(0);
40 userViewLayout->setStretch(0, 0);
41 userViewLayout->setSizeConstraint(QLayout::SetFixedSize);
42 userViewLayout->addWidget(m_userInfo);
44 QScrollArea *userInfoScroll = new QScrollArea(this);
45 userInfoScroll->setWidgetResizable(true);
46 userInfoScroll->setWidget(userInfoView);
47 userInfoScroll->setAlignment(Qt::AlignVCenter);
48 userInfoScroll->viewport()->setAutoFillBackground(false);
49 userInfoScroll->widget()->setAutoFillBackground(false);
51 m_panelVBox->addWidget(userInfoScroll);
52 m_panelVBox->setContentsMargins(USERPANEL_MARGIN_LEFT, 0, USERPANEL_MARGIN_RIGHT, 0);
54 connect(m_userInfo, SIGNAL(findUser(QPointF)),
55 this, SIGNAL(findUser(QPointF)));
57 connect(m_userInfo,SIGNAL(requestReverseGeo()),
58 this, SIGNAL(requestReverseGeo()));
60 connect(this, SIGNAL(reverseGeoReady(QString)),
61 m_userInfo, SIGNAL(reverseGeoReady(QString)));
63 connect(m_userInfo, SIGNAL(statusUpdate(QString,bool)),
64 this, SIGNAL(statusUpdate(QString,bool)));
66 connect(m_userInfo, SIGNAL(refreshUserData()),
67 this, SIGNAL(refreshUserData()));
69 connect(this, SIGNAL(clearUpdateLocationDialogData()),
70 m_userInfo, SLOT(clearUpdateLocationDialogData()));
72 connect (this, SIGNAL(messageSendingFailed(int)),
73 m_userInfo, SLOT(verifyMessageUpdateFailure(int)));
75 connect (m_userInfo, SIGNAL(notificateUpdateFailing(QString, bool)),
76 this, SIGNAL(notificateUpdateFailing(QString, bool)));
79 void UserInfoPanel::userDataReceived(User *user)
81 qDebug() << __PRETTY_FUNCTION__;
84 m_userInfo->setUserName(user->name());
85 m_userInfo->setProfileImage(user->profileImage());
86 m_userInfo->setMessageText(user->note());
87 m_userInfo->setAddress(user->address());
88 m_userInfo->setTime(user->timestamp());
89 m_userInfo->setCoordinates(user->coordinates());