Added a new method (buildPanels) for building tabbed panels
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 11 Aug 2010 07:36:14 +0000 (10:36 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 11 Aug 2010 07:36:14 +0000 (10:36 +0300)
src/ui/mainwindow.cpp
src/ui/mainwindow.h

index 6bd5c0d..5a399ac 100644 (file)
@@ -82,14 +82,12 @@ MainWindow::MainWindow(QWidget *parent)
     setCentralWidget(new QWidget());
     centralWidget()->setLayout(layout);
 
-//    buildFriendListPanel();
-    buildUserInfoPanel();
+    buildPanels();
 
     createMenus();
     setWindowTitle(tr("Situare"));
 
     // set stacking order of widgets
-//    m_zoomButtonPanel->stackUnder(m_userInfoPanel);
     m_zoomButtonPanel->stackUnder(m_tabbedPanel);
     if(m_fullScreenButton) {
         m_fullScreenButton->stackUnder(m_zoomButtonPanel);
@@ -164,9 +162,6 @@ void MainWindow::buildFriendListPanel()
     connect(this, SIGNAL(locationItemClicked(QList<QString>)),
             m_friendsListPanel, SLOT(showFriendsInList(QList<QString>)));
 
-    connect(m_mapView, SIGNAL(viewResized(QSize)),
-            m_friendsListPanel, SLOT(resizePanel(QSize)));
-
     connect(m_friendsListPanel, SIGNAL(findFriend(GeoCoordinate)),
             this, SIGNAL(findFriend(GeoCoordinate)));
 
@@ -301,6 +296,21 @@ void MainWindow::buildOsmLicense()
             this, SLOT(drawOsmLicense(QSize)));
 }
 
+void MainWindow::buildPanels()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    buildUserInfoPanel();
+    buildFriendListPanel();
+
+    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"));
+
+    connect(m_mapView, SIGNAL(viewResized(QSize)),
+            m_tabbedPanel, SLOT(resizePanel(QSize)));
+}
+
 void MainWindow::buildUserInfoPanel()
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -330,18 +340,6 @@ void MainWindow::buildUserInfoPanel()
 
     connect(m_userInfoPanel, SIGNAL(notificateUpdateFailing(QString, bool)),
             this, SLOT(buildInformationBox(QString, bool)));
-
-    m_tabbedPanel = new TabbedPanel(this);
-    m_tabbedPanel->addTab(m_userInfoPanel, QIcon(":/res/images/user_info.png"));
-
-    // This is just testing
-    m_tabbedPanel->addTab(new QPushButton("Friend List"), QIcon(":/res/images/friend_list.png"));
-
-    // Another test
-    m_tabbedPanel->addTab(new QPushButton("Routing"), QIcon(":/res/images/routing.png"));
-
-    connect(m_mapView, SIGNAL(viewResized(QSize)),
-            m_tabbedPanel, SLOT(resizePanel(QSize)));
 }
 
 void MainWindow::buildWebView()
@@ -964,6 +962,7 @@ void MainWindow::updateItemVisibility()
 //        m_friendsListPanel->closePanel();
 //        m_friendsListPanel->hide();
 //        m_friendsListPanelSidebar->hide();
+
 //        m_userPanel->closePanel();
 //        m_userPanel->hide();
 //        m_userPanelSidebar->hide();
index 52b1404..ee4e7ea 100644 (file)
@@ -249,6 +249,11 @@ private:
     void buildOsmLicense();
 
     /**
+     * @brief Build application panels
+     */
+    void buildPanels();
+
+    /**
      * @brief Build user info panel and connect slots
      */
     void buildUserInfoPanel();