Clear filtering when panel is closed.
authorSami Rämö <sami.ramo@ixonos.com>
Tue, 17 Aug 2010 06:44:35 +0000 (09:44 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Tue, 17 Aug 2010 06:44:35 +0000 (09:44 +0300)
 - Hide filtering text field when friend group filtering is initiated

src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h
src/ui/mainwindow.cpp

index 87bc1da..192972e 100644 (file)
@@ -85,7 +85,7 @@ FriendListPanel::FriendListPanel(QWidget *parent)
             this, SIGNAL(findFriend(GeoCoordinate)));
 
     connect(m_clearFilterButton, SIGNAL(clicked()),
-            this, SLOT(clearFriendListFilter()));
+            this, SLOT(clearFiltering()));
 
     connect(m_routeButton, SIGNAL(clicked()),
             this, SLOT(routeToSelectedFriend()));
@@ -128,6 +128,8 @@ void FriendListPanel::anyPanelClosed()
 
     m_somePanelIsOpen = false;
     updateKeyboardGrabbing();
+
+    clearFiltering();
 }
 
 void FriendListPanel::anyPanelOpened()
@@ -140,22 +142,15 @@ void FriendListPanel::anyPanelOpened()
 
 void FriendListPanel::clearFiltering()
 {
-    qDebug() << __PRETTY_FUNCTION__;
+    qWarning() << __PRETTY_FUNCTION__;
 
-    ///< @todo Clear the filtering when fried list panel is closed (no hideEvent dispatched)
+    m_friendListHeaderWidget->hide();
+    m_friendListView->clearFilter();
 
     // clearing the filtering text field does cause also hiding the filtering layout
     m_filterField->clear();
 }
 
-void FriendListPanel::clearFriendListFilter()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    m_friendListHeaderWidget->hide();
-    m_friendListView->clearFilter();
-}
-
 void FriendListPanel::filterTextChanged(const QString &text)
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -268,6 +263,9 @@ void FriendListPanel::showFriendsInList(const QList<QString> &userIDs)
     m_friendListHeaderWidget->show();
     m_friendListView->filter(userIDs);
 
+    // hide the text filtering fields
+    setFilteringLayoutVisibility(false);
+
     emit showPanelRequested(this);
 }
 
index e0b3997..d9ee9d3 100644 (file)
@@ -121,11 +121,6 @@ private slots:
     void anyPanelOpened();
 
     /**
-     * @brief Slot to clear friend list filter
-     */
-    void clearFriendListFilter();
-
-    /**
     * @brief Slot for clearing the friend list filtering.
     */
     void clearFiltering();
index 4242c3b..03a9f7b 100644 (file)
@@ -328,9 +328,6 @@ void MainWindow::buildPanels()
     m_tabbedPanel->addTab(m_friendsListPanel, QIcon(":/res/images/friend_list.png"));
     m_tabbedPanel->addTab(m_routingPanel, QIcon(":/res/images/routing.png"));
 
-    connect(m_tabbedPanel, SIGNAL(panelClosed()),
-            m_friendsListPanel, SLOT(clearFriendListFilter()));
-
     connect(m_mapView, SIGNAL(viewResized(QSize)),
             m_tabbedPanel, SLOT(resizePanel(QSize)));