this, SIGNAL(findFriend(GeoCoordinate)));
connect(m_friendListView, SIGNAL(listItemSelectionChanged()),
- this, SLOT(setRouteButtonDisabled()));
-
- connect(m_friendListView, SIGNAL(listItemSelectionChanged()),
this, SLOT(onListItemSelectionChanged()));
// --- FOOTER, TEXT BASED FILTERING ---
m_routeButton = new ImageButton(":res/images/route_to_friend.png",
":res/images/route_to_friend_s.png",
":res/images/route_to_friend_d.png", this);
- m_routeButton->setDisabled(true);
connect(m_routeButton, SIGNAL(clicked()),
this, SLOT(routeToSelectedFriend()));
clearFiltering();
m_friendListView->clearItemSelection();
- setRouteButtonDisabled();
}
void FriendListPanel::anyPanelOpened()
clearFiltering();
m_friendListView->clearItemSelection();
- setRouteButtonDisabled();
}
void FriendListPanel::routeToSelectedFriend()
}
}
-void FriendListPanel::setRouteButtonDisabled()
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- m_routeButton->setDisabled(m_friendListView->selectedItems().isEmpty());
-}
-
void FriendListPanel::showEvent(QShowEvent *event)
{
qDebug() << __PRETTY_FUNCTION__;
void routeToSelectedFriend();
/**
- * @brief Sets route button disabled.
- *
- * Disabled if there isn't any list item selected.
- */
- void setRouteButtonDisabled();
-
- /**
* @brief Slot to show friends in list.
*
* Shows only friends that are on userIDs list
*/
#include <QDebug>
+#include <QLayout>
#include <QPainter>
#include <QPropertyAnimation>
#include <QStateMachine>
{
qDebug() << __PRETTY_FUNCTION__;
- m_state = StateOpening;
- m_animation->setDirection(QAbstractAnimation::Forward);
- m_animation->start();
+ if (m_contextButtons->layout()->count() > 0) {
+ m_state = StateOpening;
+ m_animation->setDirection(QAbstractAnimation::Forward);
+ m_animation->start();
+ }
}
SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)));
connect(m_locationListView, SIGNAL(listItemSelectionChanged()),
- this, SLOT(setRouteButtonDisabled()));
-
- connect(m_locationListView, SIGNAL(listItemSelectionChanged()),
this, SLOT(onListItemSelectionChanged()));
QVBoxLayout *resultsListViewLayout = new QVBoxLayout;
panelLayout->addLayout(resultsListViewLayout);
// --- CONTEXT BUTTONS ---
- m_routeButton = new ImageButton(":res/images/compass.png", "", "", this);
- m_routeButton->setDisabled(true);
+ m_routeButton = new ImageButton(":res/images/routing.png", "", "", this);
connect(m_routeButton, SIGNAL(clicked()),
this, SLOT(routeToSelectedLocation()));
qDebug() << __PRETTY_FUNCTION__;
m_locationListView->clearItemSelection();
-
- setRouteButtonDisabled();
}
void LocationSearchPanel::hideEvent(QHideEvent *event)
m_resultsLabel->setText(tr("Search results: %1").arg(count));
}
-
-void LocationSearchPanel::setRouteButtonDisabled()
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- m_routeButton->setDisabled(m_locationListView->selectedItems().isEmpty());
-}
*/
void routeToSelectedLocation();
- /**
- * @brief Sets route button disabled.
- *
- * Disabled if there isn't any list item selected.
- */
- void setRouteButtonDisabled();
-
/*******************************************************************************
* SIGNALS
******************************************************************************/