Merge branch 'master' into context_driven_buttons, review
[situare] / src / ui / friendlistpanel.cpp
index d8740af..99a2585 100644 (file)
@@ -84,7 +84,7 @@ FriendListPanel::FriendListPanel(QWidget *parent)
             this, SIGNAL(findFriend(GeoCoordinate)));
 
     connect(m_friendListView, SIGNAL(listItemSelectionChanged()),
-            this, SLOT(setRouteButtonDisabled()));
+            this, SLOT(onListItemSelectionChanged()));
 
     // --- FOOTER, TEXT BASED FILTERING ---
     QHBoxLayout *footerLayout = new QHBoxLayout();
@@ -122,7 +122,6 @@ FriendListPanel::FriendListPanel(QWidget *parent)
     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()));
 
@@ -140,9 +139,9 @@ FriendListPanel::FriendListPanel(QWidget *parent)
     connect(m_clearGroupFilteringButton, SIGNAL(clicked()),
             this, SLOT(clearFiltering()));
 
-    m_contextButtonLayout->addWidget(m_routeButton);
-    m_contextButtonLayout->addWidget(m_showContactButton);
-    m_contextButtonLayout->addWidget(m_clearGroupFilteringButton);
+    m_itemButtonsLayout->addWidget(m_routeButton);
+    m_itemButtonsLayout->addWidget(m_showContactButton);
+    m_genericButtonsLayout->addWidget(m_clearGroupFilteringButton);
 }
 
 void FriendListPanel::anyPanelClosed()
@@ -155,7 +154,6 @@ void FriendListPanel::anyPanelClosed()
     clearFiltering();
 
     m_friendListView->clearItemSelection();
-    setRouteButtonDisabled();
 }
 
 void FriendListPanel::anyPanelOpened()
@@ -244,7 +242,6 @@ void FriendListPanel::hideEvent(QHideEvent *event)
     clearFiltering();
 
     m_friendListView->clearItemSelection();
-    setRouteButtonDisabled();
 }
 
 void FriendListPanel::requestSelectedFriendContactDialog()
@@ -291,13 +288,6 @@ void FriendListPanel::updateKeyboardGrabbing()
     }
 }
 
-void FriendListPanel::setRouteButtonDisabled()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    m_routeButton->setDisabled(m_friendListView->selectedItems().isEmpty());
-}
-
 void FriendListPanel::showEvent(QShowEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;