X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fui%2Ffriendlistpanel.cpp;h=99da1316c3abd05242b8c19cc9b049a0967713fc;hb=b9e210ea869151849eb681ee170fca17ae5e305d;hp=5c0b033f501ebab30a9abaf317f600dda22518a3;hpb=31bac173fea920e4bd2133ec8ed33d244137e9b1;p=situare diff --git a/src/ui/friendlistpanel.cpp b/src/ui/friendlistpanel.cpp index 5c0b033..99da131 100644 --- a/src/ui/friendlistpanel.cpp +++ b/src/ui/friendlistpanel.cpp @@ -1,4 +1,4 @@ - /* +/* Situare - A location system for Facebook Copyright (C) 2010 Ixonos Plc. Authors: @@ -20,7 +20,11 @@ along with Situare; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ +*/ + +#include +#include +#include #include "coordinates/geocoordinate.h" #include "friendlistitem.h" @@ -50,6 +54,8 @@ FriendListPanel::FriendListPanel(QWidget *parent) m_friendListHeaderWidget->setLayout(filterLayout); m_friendListHeaderWidget->setAutoFillBackground(true); + m_routeButton = new QPushButton(tr("Route to friend")); + QPalette labelPalette = m_friendListHeaderWidget->palette(); labelPalette.setColor(QPalette::Background, Qt::black); @@ -68,6 +74,7 @@ FriendListPanel::FriendListPanel(QWidget *parent) listViewLayout->setContentsMargins(PANEL_MARGIN_LEFT, 0, PANEL_MARGIN_RIGHT, 0); listViewLayout->addWidget(m_friendListView); + friendListPanelLayout->addWidget(m_routeButton); friendListPanelLayout->addWidget(m_friendListHeaderWidget); friendListPanelLayout->addLayout(listViewLayout); @@ -77,8 +84,8 @@ FriendListPanel::FriendListPanel(QWidget *parent) connect(m_clearFilterButton, SIGNAL(clicked()), this, SLOT(clearFriendListFilter())); -// connect(this, SIGNAL(panelOpened()), -// this, SLOT(clearFriendListFilter())); + connect(m_routeButton, SIGNAL(clicked()), + this, SLOT(routeToSelectedFriend())); /// @todo remove old filterLayout when new panel are merged @@ -189,6 +196,16 @@ void FriendListPanel::hideEvent(QHideEvent *event) clearFiltering(); } +void FriendListPanel::routeToSelectedFriend() +{ + qDebug() << __PRETTY_FUNCTION__; + + FriendListItem *item = dynamic_cast(m_friendListView->selectedItem()); + + if (item) + emit routeToFriend(item->coordinates()); +} + void FriendListPanel::setFilteringLayoutVisibility(bool visible) { qDebug() << __PRETTY_FUNCTION__; @@ -229,9 +246,10 @@ void FriendListPanel::showFriendsInList(const QList &userIDs) m_friendListLabel->setText(tr("Selected: %1").arg(userIDs.count())); -// openPanel(); m_friendListHeaderWidget->show(); m_friendListView->filter(userIDs); + + emit showPanelRequested(this); } void FriendListPanel::topmostWindowChanged(bool mainWindowIsTopmost)