From cec416f9b29b70c8e53c6c29dd9441afb10888ce Mon Sep 17 00:00:00 2001 From: Pekka Nissinen Date: Thu, 12 Aug 2010 11:39:25 +0300 Subject: [PATCH] Added a new signal for TabbedPanel (tabChanged) that can be used to (for example) clear the friend list filtering when tab is changed --- src/ui/friendlistpanel.cpp | 3 --- src/ui/mainwindow.cpp | 2 +- src/ui/tabbedpanel.cpp | 2 ++ src/ui/tabbedpanel.h | 5 +++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ui/friendlistpanel.cpp b/src/ui/friendlistpanel.cpp index 17eb0ef..31aa90a 100644 --- a/src/ui/friendlistpanel.cpp +++ b/src/ui/friendlistpanel.cpp @@ -74,9 +74,6 @@ FriendListPanel::FriendListPanel(QWidget *parent) connect(m_clearFilterButton, SIGNAL(clicked()), this, SLOT(clearFriendListFilter())); - -// connect(this, SIGNAL(panelOpened()), -// this, SLOT(clearFriendListFilter())); } void FriendListPanel::friendImageReady(User *user) diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 7aa8c76..16ea4fd 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -318,7 +318,7 @@ void MainWindow::buildPanels() m_tabbedPanel->addTab(m_userInfoPanel, QIcon(":/res/images/user_info.png")); m_tabbedPanel->addTab(m_friendsListPanel, QIcon(":/res/images/friend_list.png")); - connect(m_tabbedPanel, SIGNAL(panelOpened()), + connect(m_tabbedPanel, SIGNAL(tabChanged()), m_friendsListPanel, SLOT(clearFriendListFilter())); connect(m_mapView, SIGNAL(viewResized(QSize)), diff --git a/src/ui/tabbedpanel.cpp b/src/ui/tabbedpanel.cpp index e528978..9304282 100644 --- a/src/ui/tabbedpanel.cpp +++ b/src/ui/tabbedpanel.cpp @@ -154,6 +154,7 @@ void TabbedPanel::setActiveTab(int index) if(m_activeTab == -1) { m_activeTab = index; m_panelWidgetStack->setCurrentIndex(index); + emit tabChanged(); emit toggleState(); } else if(m_activeTab == index) { m_activeTab = -1; @@ -161,6 +162,7 @@ void TabbedPanel::setActiveTab(int index) } else { m_activeTab = index; m_panelWidgetStack->setCurrentIndex(index); + emit tabChanged(); } } diff --git a/src/ui/tabbedpanel.h b/src/ui/tabbedpanel.h index 716ed58..707c5fe 100644 --- a/src/ui/tabbedpanel.h +++ b/src/ui/tabbedpanel.h @@ -156,6 +156,11 @@ signals: void panelOpened(); /** + * @brief Signal that is sent when active tab has changed + */ + void tabChanged(); + + /** * @brief Signal that is sent to state machine when state must be changed * * @sa openPanel -- 1.7.9.5