From 00f75bc88cef45a5be33a459e1eb9c2b0db998cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sami=20R=C3=A4m=C3=B6?= Date: Tue, 17 Aug 2010 09:44:35 +0300 Subject: [PATCH] Clear filtering when panel is closed. - Hide filtering text field when friend group filtering is initiated --- src/ui/friendlistpanel.cpp | 20 +++++++++----------- src/ui/friendlistpanel.h | 5 ----- src/ui/mainwindow.cpp | 3 --- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/ui/friendlistpanel.cpp b/src/ui/friendlistpanel.cpp index 87bc1da..192972e 100644 --- a/src/ui/friendlistpanel.cpp +++ b/src/ui/friendlistpanel.cpp @@ -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 &userIDs) m_friendListHeaderWidget->show(); m_friendListView->filter(userIDs); + // hide the text filtering fields + setFilteringLayoutVisibility(false); + emit showPanelRequested(this); } diff --git a/src/ui/friendlistpanel.h b/src/ui/friendlistpanel.h index e0b3997..d9ee9d3 100644 --- a/src/ui/friendlistpanel.h +++ b/src/ui/friendlistpanel.h @@ -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(); diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 4242c3b..03a9f7b 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -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))); -- 1.7.9.5