- /*
+/*
Situare - A location system for Facebook
Copyright (C) 2010 Ixonos Plc. Authors:
along with Situare; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
- */
+*/
+
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QPushButton>
#include "coordinates/geocoordinate.h"
#include "friendlistitem.h"
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);
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);
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
clearFiltering();
}
+void FriendListPanel::routeToSelectedFriend()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ FriendListItem *item = dynamic_cast<FriendListItem *>(m_friendListView->selectedItem());
+
+ if (item)
+ emit routeToFriend(item->coordinates());
+}
+
void FriendListPanel::setFilteringLayoutVisibility(bool visible)
{
qDebug() << __PRETTY_FUNCTION__;
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)