Merge branch 'new_panels' of https://vcs.maemo.org/git/situare into new_panels
authorSami Rämö <sami.ramo@ixonos.com>
Mon, 16 Aug 2010 12:28:20 +0000 (15:28 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Mon, 16 Aug 2010 12:37:52 +0000 (15:37 +0300)
 - Reviewed by Sami Rämö

 - Made also some small fixes

Conflicts:
src/ui/panelbar.cpp
src/ui/paneltab.h
src/ui/tabbedpanel.cpp

19 files changed:
doc/testing/functionality-tests.doc
src/src.pro
src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h
src/ui/indicatorbuttonpanel.cpp
src/ui/indicatorbuttonpanel.h
src/ui/mainwindow.cpp
src/ui/panelbar.cpp
src/ui/panelbar.h
src/ui/panelbase.cpp
src/ui/panelbase.h
src/ui/panelcontent.cpp
src/ui/paneltab.cpp
src/ui/paneltab.h
src/ui/paneltabbar.cpp
src/ui/paneltabbar.h
src/ui/tabbedpanel.cpp
src/ui/tabbedpanel.h
tests/ui/tabbedpanel/testtabbedpanel.cpp

index 5799763..1a5b902 100644 (file)
Binary files a/doc/testing/functionality-tests.doc and b/doc/testing/functionality-tests.doc differ
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 10346f8..d535782 100644 (file)
@@ -109,6 +109,13 @@ IndicatorButtonPanel::IndicatorButtonPanel(QWidget *parent)
             this, SIGNAL(autoCenteringTriggered(bool)));
 }
 
+IndicatorButtonPanel::~IndicatorButtonPanel()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    delete m_normalColor;
+}
+
 void IndicatorButtonPanel::forceMouseRelease()
 {
     qDebug() << __PRETTY_FUNCTION__;
index 3dcaecf..2fc9f9f 100644 (file)
@@ -52,6 +52,12 @@ public:
      */
     IndicatorButtonPanel(QWidget *parent = 0);
 
+    /**
+     * @brief Desctructor
+     * Destroys m_normalColor
+     */
+    ~IndicatorButtonPanel();
+
 /*******************************************************************************
  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
  ******************************************************************************/
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 1bfbfaf..7044eed 100644 (file)
@@ -28,8 +28,6 @@
 
 #include "panelcommon.h"
 
-///< @todo requires clean-up, there is some commented code
-
 PanelBar::PanelBar(QWidget *parent)
     : QWidget(parent)
 {
@@ -37,19 +35,18 @@ PanelBar::PanelBar(QWidget *parent)
 
     m_barTile.load(":/res/images/sliding_bar_tile.png");
     m_menuDropShadowTile.load(":/res/images/menu_bar_drop_shadow.png");
-
+    ///< @todo magic
     m_barRect.setRect(0, 0, PANEL_BAR_WIDTH, PANEL_HEIGHT);
 
-//    m_sliderRegion = QRegion(m_buttonRect).united(QRegion(m_topRect).united(QRegion(m_bottomRect)));
-//    setMask(m_sliderRegion);
-
     this->resize(PANEL_BAR_WIDTH, PANEL_HEIGHT);
 }
 
-void PanelBar::paintEvent(QPaintEvent *)
+void PanelBar::paintEvent(QPaintEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    Q_UNUSED(event);
+
     QPainter painter(this);
 
     painter.drawTiledPixmap(m_barRect, m_barTile);
@@ -65,8 +62,5 @@ void PanelBar::resizeBar(const QSize &size)
     ///< @todo magic
     m_barRect.setRect(0, 0, PANEL_BAR_WIDTH, size.height());
 
-//    m_sliderRegion = QRegion(m_buttonRect).united(QRegion(m_topRect).united(QRegion(m_bottomRect)));
-//    setMask(m_sliderRegion);
-
     this->resize(PANEL_BAR_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
 }
index 8520e51..9da3f7b 100644 (file)
@@ -25,9 +25,8 @@
 
 #include <QWidget>
 
-///< @todo Comment does not tell what this class is actually for (=draws the vertical line between panel contents and tab buttons)
 /**
- * @brief Generic class for panel bars
+ * @brief Class for for drawing a vertical line between panel content and tab bar
  *
  * @author Kaj Wallin - kaj.wallin (at) ixonos.com
  * @author Pekka Nissinen - pekka.nissinen@ixonos.com
@@ -48,13 +47,12 @@ public:
  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
  ******************************************************************************/
 protected:
-    ///< @todo parameter name missing (also in .cpp)
     /**
      * @brief Draws the bar
      *
-     * @param * QPaintEvent unused
+     * @param event Paint event
      */
-    void paintEvent(QPaintEvent *);
+    void paintEvent(QPaintEvent *event);
 
 /*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
index 3771888..5186828 100644 (file)
@@ -39,10 +39,12 @@ PanelBase::PanelBase(QWidget *parent)
     setAutoFillBackground(true);
 }
 
-void PanelBase::paintEvent(QPaintEvent *)
+void PanelBase::paintEvent(QPaintEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    Q_UNUSED(event);
+
     QPainter painter(this);
 
     QRect shadowRect = QRect(0, 0, this->rect().width(), m_menuDropShadowTile.height());
index b75a7ab..f0a7db2 100644 (file)
@@ -49,13 +49,12 @@ public:
  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
  ******************************************************************************/
 protected:
-    ///< @todo parameter name (also in .cpp)
     /**
      * @brief Draws the panel content base
      *
-     * @param * QPaintEvent unused
+     * @param event Paint event
      */
-    void paintEvent(QPaintEvent *);
+    void paintEvent(QPaintEvent *event);
 
 /*******************************************************************************
  * DATA MEMBERS
index b8d320b..ec65575 100644 (file)
@@ -34,7 +34,7 @@ PanelContent::PanelContent(QWidget *parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    this->resize(PANEL_WIDTH, PANEL_HEIGHT);
+    resize(PANEL_WIDTH, PANEL_HEIGHT);
 
     m_panelVBox = new QVBoxLayout(this);
     m_panelVBox->setMargin(0);
@@ -56,7 +56,7 @@ void PanelContent::resizePanelContent(const QSize &size)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    this->resize(PANEL_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
+    resize(PANEL_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
 
     m_panelBase->resize(this->size());
 }
index 9d393c7..68a74c0 100644 (file)
@@ -26,8 +26,6 @@
 
 #include "paneltab.h"
 
-///< @todo TAB_WIDTH not global? move into paintEvent()
-const int TAB_WIDTH = 66;
 const int TAB_WIDTH_ACTIVE = 74;
 const int TAB_HEIGHT = 66;
 
@@ -38,10 +36,9 @@ PanelTab::PanelTab(QWidget *parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    ///< @todo magic, use enum, check also .h todo comment, fix everywhere
-    m_tabPixmaps[0].load(":/res/images/tab_inactive.png");
-    m_tabPixmaps[1].load(":/res/images/tab_inactive2.png");
-    m_tabPixmaps[2].load(":/res/images/tab_active.png");
+    m_tabActiveImage.load(":/res/images/tab_active.png");
+    m_tabInactiveImage.load(":/res/images/tab_inactive.png");
+    m_tabInactiveImage2.load(":/res/images/tab_inactive2.png");
 
     setCheckable(true);
 
@@ -74,33 +71,37 @@ void PanelTab::mouseReleaseEvent(QMouseEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    ///< @todo mouse button is not checked, add check here or remove from mousePressEvent
+    if (event->button() == Qt::LeftButton) {
+        if(this->rect().contains(event->pos())) {
+            click();
 
-    if(this->rect().contains(event->pos())) {
-        click();
+            if(isChecked())
+                setChecked(false);
+            else
+                setChecked(true);
+        }
 
-        if(isChecked())
-            setChecked(false);
-        else
-            setChecked(true);
+        setDown(false);
+        m_tabSelected = false;
     }
-
-    setDown(false);
-    m_tabSelected = false;
 }
 
-void PanelTab::paintEvent(QPaintEvent *)
+void PanelTab::paintEvent(QPaintEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    Q_UNUSED(event);
+
+    const int TAB_WIDTH = 66;
+
     QPainter painter(this);
 
     if(isChecked()) {
         m_tabRect.setRect(0, 0, TAB_WIDTH_ACTIVE, TAB_HEIGHT);
-        painter.drawPixmap(m_tabRect, m_tabPixmaps[2]);
+        painter.drawPixmap(m_tabRect, m_tabActiveImage);
     } else {
         m_tabRect.setRect(TAB_WIDTH_ACTIVE - TAB_WIDTH, 0, TAB_WIDTH, TAB_HEIGHT);
-        painter.drawPixmap(m_tabRect, m_tabPixmaps[0]);
+        painter.drawPixmap(m_tabRect, m_tabInactiveImage);
     }
 
     if(isDown())
@@ -110,14 +111,3 @@ void PanelTab::paintEvent(QPaintEvent *)
     else
         icon().paint(&painter, m_tabRect, Qt::AlignCenter, QIcon::Disabled);
 }
-
-///< @todo setActive() method is not used
-void PanelTab::setActive(bool state)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    if(state)
-        setChecked(true);
-    else
-        setChecked(false);
-}
index f4fe610..a5e3e13 100644 (file)
@@ -68,22 +68,12 @@ protected:
      */
     void mouseReleaseEvent(QMouseEvent *event);
 
-///< @todo parameter name missing (also in .cpp)
     /**
      * @brief Draws the tab button
      *
-     * @param * QPaintEvent unused
+     * @param event Paint event
      */
-    void paintEvent(QPaintEvent *);
-
-/*******************************************************************************
- * MEMBER FUNCTIONS AND SLOTS
- ******************************************************************************/
-public:
-    /**
-     * @brief This slot is used to change tab button state
-     */
-    void setActive(bool state);
+    void paintEvent(QPaintEvent *event);
 
 /*******************************************************************************
  * DATA MEMBERS
@@ -92,10 +82,11 @@ private:
     bool m_tabActive;   ///< Boolean used to track whether the tab button is active or not
     bool m_tabSelected; ///< Boolean used to track whether the tab button is selected or not
 
-    ///< @todo magic, replace with enum?
-    QPixmap m_tabPixmaps[3];    ///< Pixmap table for tab button images
+    QPixmap m_tabActiveImage;    ///< Pixmap for active tab button
+    QPixmap m_tabInactiveImage;  ///< Pixmap for inactive tab button
+    QPixmap m_tabInactiveImage2; ///< Pixmap for inactive tab button below active tab button
 
-    QRect m_tabRect;            ///< Rect for the tab button
+    QRect m_tabRect;        ///< Rect for the tab button
 };
 
 #endif // PANELTAB_H
index 99c2776..4a43ba2 100644 (file)
@@ -28,7 +28,7 @@
 
 PanelTabBar::PanelTabBar(QWidget *parent)
     : QWidget(parent),
-      m_activeTab(-1)
+      m_activeTab(-1) ///< @todo magic
 {
     qDebug() << __PRETTY_FUNCTION__;
 
@@ -42,7 +42,9 @@ int PanelTabBar::addTab(const QIcon& icon)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    return insertTab(-1, icon);
+    const int APPEND_INDEX = -1;
+
+    return insertTab(APPEND_INDEX, icon);
 }
 
 void PanelTabBar::deselectTabs()
@@ -63,7 +65,7 @@ int PanelTabBar::insertTab(int index, const QIcon& icon)
     m_tabButtonGroup->addButton(new PanelTab(this), index);
     m_tabButtonGroup->button(index)->setIcon(icon);
 
-    // [BEGIN]: Purkkaa (to be removed ASAP!!!)
+    ///< @todo  [BEGIN]: Purkkaa (to be removed ASAP!!!)
     if(index > 0)
         verticalStartPoint += 65 * index;
 
@@ -83,11 +85,20 @@ 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__;
 
     if(m_activeTab == index) {
+        ///< @todo magic
         m_activeTab = -1;
         emit tabCloseRequested(index);
     } else {
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 f534a86..424496a 100644 (file)
@@ -38,9 +38,8 @@ TabbedPanel::TabbedPanel(QWidget *parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    ///< @todo Do not use this, REMOVE ALL OCCURENCES IN ALL FILES!
-    this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH, PANEL_HEIGHT);
-    this->move(PANEL_CLOSED_X, PANEL_TOP_PADDING);
+    resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH, PANEL_HEIGHT);
+    move(PANEL_CLOSED_X, PANEL_TOP_PADDING);
 
     // --- TABS ---
     m_panelWidgetStack = new QStackedWidget(this);
@@ -48,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()));
@@ -98,17 +97,23 @@ int TabbedPanel::addTab(QWidget *widget, const QIcon& icon)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    ///< @todo magic
-    return insertTab(-1, widget, icon);
+
+    const int APPEND_INDEX = -1;
+
+    return insertTab(APPEND_INDEX, widget, icon);
 }
 
-int TabbedPanel::insertTab(int index, QWidget *widget, const QIcon& icon)
+void TabbedPanel::closePanel()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    ///< @todo callers responsibility to call with right parameters
-    if(!widget)
-        return -1;
+    if(m_isOpen)
+        emit toggleState();
+}
+
+int TabbedPanel::insertTab(int index, QWidget *widget, const QIcon& icon)
+{
+    qDebug() << __PRETTY_FUNCTION__;
 
     index = m_panelWidgetStack->insertWidget(index, widget);
     m_panelTabBar->insertTab(index, icon);
@@ -126,59 +131,50 @@ void TabbedPanel::removeTab(int index)
     }
 }
 
-///< @todo sort alphabetically (other methods too)
-void TabbedPanel::closePanel()
+void TabbedPanel::resizePanel(const QSize &size)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if(m_isOpen)
-        emit toggleState();
-}
+    resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH,
+           size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
 
-void TabbedPanel::openPanel()
-{
-    qDebug() << __PRETTY_FUNCTION__;
+    if (!m_isOpen)
+        move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
+    else
+        move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH, PANEL_TOP_PADDING);
+
+    m_panelBar->resizeBar(size);
+
+    m_panelContent->resizePanelContent(size);
+
+    QPoint closedPosition(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
+    m_panelStateClosed->assignProperty(this, "pos", closedPosition);
+
+    QPoint openedPosition(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH,
+                          PANEL_TOP_PADDING);
+    m_panelStateOpened->assignProperty(this, "pos", openedPosition);
 
-    if(!m_isOpen)
-        emit toggleState();
 }
 
-void TabbedPanel::showTab(int index)
+void TabbedPanel::showPanel(QWidget *widget)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-///< @todo if ((first) && (second)) {
-    if (index < m_panelWidgetStack->count() && index >= 0) {
-        m_panelWidgetStack->setCurrentIndex(index);
-        openPanel();
-        emit currentChanged(index);
-    }
+    m_panelTabBar->selectTab(m_panelWidgetStack->indexOf(widget));
 }
 
-void TabbedPanel::resizePanel(const QSize &size)
+void TabbedPanel::setCurrentIndex(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH,
-                 size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
-
-    if (!m_isOpen) {
-        this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
-    } else {
-        this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH,
-                   PANEL_TOP_PADDING);
-    }
-
-    m_panelBar->resizeBar(size);
+    if ((index < m_panelWidgetStack->count()) && (index >= 0)) {
+        m_panelWidgetStack->setCurrentIndex(index);
 
-    m_panelContent->resizePanelContent(size);
+        if(!m_isOpen)
+            emit toggleState();
 
-    ///< @todo alignment
-    m_panelStateClosed->assignProperty(this, "pos",
-                        QPoint(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING));
-    m_panelStateOpened->assignProperty(this, "pos",
-                        QPoint(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH,
-                               PANEL_TOP_PADDING));
+        emit currentChanged(index);
+    }
 }
 
 void TabbedPanel::stateChanged()
index a54332c..7357229 100644 (file)
@@ -70,7 +70,6 @@ public:
      */
     int addTab(QWidget *widget, const QIcon& icon);
 
-    ///< @todo define "out of range"
     /**
      * @brief Inserts a tab to the panel
      *
@@ -98,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
@@ -114,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
      */
index 4cf8c4a..9f8325a 100644 (file)
@@ -1,9 +1,9 @@
-///< @todo Pekka missing from authors?
 /*
     Situare - A location system for Facebook
     Copyright (C) 2010  Ixonos Plc. Authors:
 
         Kaj Wallin - kaj.wallin@ixonos.com
+        Pekka Nissinen - pekka.nissinen@ixonos.com
 
     Situare is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License