Added a new signal for TabbedPanel (tabChanged) that can be used to (for example...
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Thu, 12 Aug 2010 08:39:25 +0000 (11:39 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Thu, 12 Aug 2010 08:39:25 +0000 (11:39 +0300)
src/ui/friendlistpanel.cpp
src/ui/mainwindow.cpp
src/ui/tabbedpanel.cpp
src/ui/tabbedpanel.h

index 17eb0ef..31aa90a 100644 (file)
@@ -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)
index 7aa8c76..16ea4fd 100644 (file)
@@ -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)),
index e528978..9304282 100644 (file)
@@ -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();
     }
 }
 
index 716ed58..707c5fe 100644 (file)
@@ -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