Added method to disable tabs.
[situare] / src / ui / mainwindow.cpp
index 0d4c574..3766c2c 100644 (file)
@@ -324,8 +324,10 @@ void MainWindow::buildPanels()
     buildRoutingPanel();
 
     m_tabbedPanel = new TabbedPanel(this);
-    m_tabbedPanel->addTab(m_userInfoPanel, QIcon(":/res/images/user_info.png"));
-    m_tabbedPanel->addTab(m_friendsListPanel, QIcon(":/res/images/friend_list.png"));
+    m_situareTabsIndexes.append(
+            m_tabbedPanel->addTab(m_userInfoPanel, QIcon(":/res/images/user_info.png")));
+    m_situareTabsIndexes.append(
+            m_tabbedPanel->addTab(m_friendsListPanel, QIcon(":/res/images/friend_list.png")));
     m_tabbedPanel->addTab(m_routingPanel, QIcon(":/res/images/routing.png"));
 
     connect(m_mapView, SIGNAL(viewResized(QSize)),
@@ -952,25 +954,6 @@ void MainWindow::showInformationBox()
     }
 }
 
-void MainWindow::showPanels()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-///< @todo check how this is called and can this method be removed
-
-//    if(m_loggedIn) {
-//        if(!m_friendsListPanel->isVisible()) {
-//            m_friendsListPanel->show();
-//            m_friendsListPanelSidebar->show();
-//        }
-
-//        if(!m_userPanel->isVisible()) {
-//            m_userPanel->show();
-//            m_userPanelSidebar->show();
-//        }
-//    }
-}
-
 void MainWindow::startLocationSearch()
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -1029,17 +1012,10 @@ void MainWindow::updateItemVisibility()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-///< @todo can this be removed?
-
-//    if(!m_loggedIn) {
-//        m_friendsListPanel->closePanel();
-//        m_friendsListPanel->hide();
-//        m_friendsListPanelSidebar->hide();
+    if (!m_loggedIn)
+        m_tabbedPanel->closePanel();
 
-//        m_userPanel->closePanel();
-//        m_userPanel->hide();
-//        m_userPanelSidebar->hide();
-//    }
+    m_tabbedPanel->setTabsEnabled(m_situareTabsIndexes, m_loggedIn);
 }
 
 const QString MainWindow::username()