Sorted src.pro file, added new signals/slots for showing/opening panels/tabs
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 16 Aug 2010 10:24:55 +0000 (13:24 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 16 Aug 2010 10:24:55 +0000 (13:24 +0300)
src/src.pro
src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h
src/ui/mainwindow.cpp
src/ui/paneltabbar.cpp
src/ui/paneltabbar.h
src/ui/tabbedpanel.cpp
src/ui/tabbedpanel.h

index c880fed..c5e3962 100644 (file)
@@ -64,15 +64,19 @@ SOURCES += main.cpp \
     ui/listitemdelegate.cpp \
     ui/friendlistitemdelegate.cpp \
     ui/searchdialog.cpp \
-    ui/paneltab.cpp \
-    ui/tabbedpanel.cpp \
+    ui/panelbase.cpp \    
     ui/panelbar.cpp \
     ui/panelcontent.cpp \
-    ui/panelbase.cpp \
+    ui/paneltab.cpp \
+    ui/paneltabbar.cpp \
+    ui/tabbedpanel.cpp \
     user/user.cpp
 HEADERS += application.h \
     common.h \
+    coordinates/geocoordinate.h \
+    coordinates/scenecoordinate.h \
     engine/engine.h \
+    engine/mce.h \
     error.h \
     facebookservice/facebookauthentication.h \
     facebookservice/facebookcommon.h \
@@ -87,16 +91,24 @@ HEADERS += application.h \
     map/mapcommon.h \
     map/mapengine.h \
     map/mapfetcher.h \
+    map/maprouteitem.h \
     map/mapscene.h \
     map/mapscroller.h \
     map/maptile.h \
     map/maptilerequest.h \
     map/mapview.h \
+    map/osm.h \
     map/ownlocationitem.h \
     network/networkaccessmanager.h \
     network/networkcookiejar.h \
     network/networkhandler.h \
     network/networkreply.h \
+    routing/geocodingservice.h \
+    routing/location.h \
+    routing/route.h \
+    routing/routesegment.h \
+    routing/routingcommon.h \    
+    routing/routingservice.h \
     situareservice/imagefetcher.h \
     situareservice/situarecommon.h \
     situareservice/situareservice.h \
@@ -104,43 +116,33 @@ HEADERS += application.h \
     ui/updatelocation/updatelocationdialog.h \
     ui/avatarimage.h \
     ui/friendlistitem.h \
+    ui/friendlistitemdelegate.h \
     ui/friendlistpanel.h \
+    ui/fullscreenbutton.h \
     ui/imagebutton.h \
+    ui/indicatorbutton.h \
+    ui/indicatorbuttonpanel.h \
     ui/logindialog.h \
     ui/mainwindow.h \
     ui/mapscale.h \
-    ui/panelcommon.h \
     ui/settingsdialog.h \
     ui/userinfo.h \
     ui/userinfopanel.h \
     ui/zoombutton.h \
     ui/zoombuttonpanel.h \
-    user/user.h \
-    ui/fullscreenbutton.h \
-    engine/mce.h \
-    ui/indicatorbutton.h \
-    ui/indicatorbuttonpanel.h \
-    routing/geocodingservice.h \
-    routing/routingservice.h \
-    routing/routingcommon.h \
-    routing/routesegment.h \
-    routing/route.h \
-    routing/location.h \
-    map/maprouteitem.h \
-    map/osm.h \
-    coordinates/scenecoordinate.h \
-    coordinates/geocoordinate.h \
+    ui/listcommon.h \    
     ui/listview.h \
     ui/listitem.h \
     ui/listitemdelegate.h \
-    ui/friendlistitemdelegate.h \
-    ui/listcommon.h \
     ui/searchdialog.h \
-    ui/paneltab.h \
-    ui/tabbedpanel.h \
+    ui/panelbase.h \    
     ui/panelbar.h \
     ui/panelcontent.h \
-    ui/panelbase.h
+    ui/panelcommon.h \
+    ui/paneltab.h \
+    ui/paneltabbar.h \
+    ui/tabbedpanel.h \
+    user/user.h
 QT += network \
     webkit
 
index 8892ca4..49cbae4 100644 (file)
@@ -136,4 +136,6 @@ void FriendListPanel::showFriendsInList(const QList<QString> &userIDs)
 
     m_friendListHeaderWidget->show();
     m_friendListView->filter(userIDs);
+
+    emit showPanelRequested(this);
 }
index a3e6c6c..5b7f3bc 100644 (file)
@@ -73,14 +73,14 @@ public slots:
 
 private slots:
     /**
-     * @brief Slot to clear friend list filter.
+     * @brief Slot to clear friend list filter
      */
     void clearFriendListFilter();
 
     /**
-     * @brief Slot to show friends in list.
+     * @brief Slot to show friends in list
      *
-     * Shows only friends that are on userIDs list.
+     * Shows only friends that are on userIDs list
      * @param userIDs list of user ID's
      */
     void showFriendsInList(const QList<QString> &userIDs);
@@ -90,12 +90,19 @@ private slots:
  ******************************************************************************/
 signals:
     /**
-     * @brief Signal for friend finding.
+     * @brief Signal for friend finding
      *
      * @param coordinates Target coordinate
      */
     void findFriend(const GeoCoordinate &coordinates);
 
+    /**
+     * @brief Signal for requesting a panel to be opened
+     *
+     * @param widget Pointer to the widget that emitted the signal
+     */
+    void showPanelRequested(QWidget *widget);
+
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
index 31927a6..1d9fde4 100644 (file)
@@ -327,6 +327,9 @@ void MainWindow::buildPanels()
 
     connect(m_mapView, SIGNAL(viewResized(QSize)),
             m_tabbedPanel, SLOT(resizePanel(QSize)));
+
+    connect(m_friendsListPanel, SIGNAL(showPanelRequested(QWidget*)),
+            m_tabbedPanel, SLOT(showPanel(QWidget*)));
 }
 
 void MainWindow::buildUserInfoPanel()
index 99c2776..e911645 100644 (file)
@@ -83,6 +83,14 @@ void PanelTabBar::removeTab(int index)
     }
 }
 
+void PanelTabBar::selectTab(int index)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    if (!m_tabButtonGroup->button(index)->isChecked())
+        m_tabButtonGroup->button(index)->click();
+}
+
 void PanelTabBar::setCurrentIndex(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
index 3c2d4cf..6714abd 100644 (file)
@@ -85,6 +85,12 @@ public slots:
     void deselectTabs();
 
     /**
+     * @brief This slot selects a tab at given index
+     */
+    void selectTab(int index);
+
+private slots:
+    /**
      * @brief Sets the tab at current index active
      *
      * @param index Index of the tab
index 2321ceb..e753c68 100644 (file)
@@ -47,7 +47,7 @@ TabbedPanel::TabbedPanel(QWidget *parent)
     m_panelTabBar = new PanelTabBar(this);
 
     connect(m_panelTabBar, SIGNAL(currentChanged(int)),
-            this, SLOT(showTab(int)));
+            this, SLOT(setCurrentIndex(int)));
 
     connect(m_panelTabBar, SIGNAL(tabCloseRequested(int)),
              this, SLOT(closePanel()));
@@ -131,21 +131,23 @@ void TabbedPanel::closePanel()
         emit toggleState();
 }
 
-void TabbedPanel::openPanel()
+void TabbedPanel::showPanel(QWidget *widget)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if(!m_isOpen)
-        emit toggleState();
+    m_panelTabBar->selectTab(m_panelWidgetStack->indexOf(widget));
 }
 
-void TabbedPanel::showTab(int index)
+void TabbedPanel::setCurrentIndex(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
     if (index < m_panelWidgetStack->count() && index >= 0) {
         m_panelWidgetStack->setCurrentIndex(index);
-        openPanel();
+
+        if(!m_isOpen)
+            emit toggleState();
+
         emit currentChanged(index);
     }
 }
index 5c9398a..7357229 100644 (file)
@@ -97,14 +97,16 @@ public:
 
 public slots:
     /**
-     * @brief Public slot that will close the panel unless already closed
+     * @brief Slot that closes the panel
      */
     void closePanel();
 
     /**
-     * @brief Public slot that will open the panel unless already open
+     * @brief Slot that shows the tab (and opens it if closed) with the desired widget
+     *
+     * @param widget Widget
      */
-    void openPanel();
+    void showPanel(QWidget *widget);
 
     /**
      * @brief Slot to redraw the panel after window resize event
@@ -113,14 +115,14 @@ public slots:
      */
     void resizePanel(const QSize &size);
 
+private slots:
     /**
-     * @brief Shows the tab at given index active
+     * @brief Sets the panel at current index active
      *
-     * @param index Index of the tab
+     * @param index Index of the panel
      */
-    void showTab(int index);
+    void setCurrentIndex(int index);
 
-private slots:
     /**
      * @brief Internal slot used to track statemachine state
      */