Reviewed panels
authorSami Rämö <sami.ramo@ixonos.com>
Fri, 13 Aug 2010 13:34:13 +0000 (16:34 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Fri, 13 Aug 2010 13:34:13 +0000 (16:34 +0300)
 - Reviewed by Sami Rämö

13 files changed:
src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h
src/ui/indicatorbutton.cpp
src/ui/indicatorbutton.h
src/ui/indicatorbuttonpanel.cpp
src/ui/mainwindow.cpp
src/ui/mainwindow.h
src/ui/panelcommon.h
src/ui/tabbedpanel.h
src/ui/userinfo.cpp
src/ui/userinfo.h
src/ui/userinfopanel.h
src/ui/zoombuttonpanel.cpp

index 3e258f1..b02fadb 100644 (file)
@@ -41,10 +41,12 @@ FriendListPanel::FriendListPanel(QWidget *parent)
     QVBoxLayout *friendListPanelLayout = new QVBoxLayout();
     friendListPanelLayout->setMargin(0);
     friendListPanelLayout->setSpacing(0);
+///< @todo magic
     friendListPanelLayout->setContentsMargins(PANEL_MARGIN_LEFT, 0, PANEL_MARGIN_RIGHT, 0);
     setLayout(friendListPanelLayout);
 
     QHBoxLayout *filterLayout = new QHBoxLayout();
+///< @todo magic
     filterLayout->setContentsMargins(FRIENDPANEL_FILTER_MARGIN_LEFT, 0,
                                      FRIENDPANEL_FILTER_MARGIN_RIGHT, 0);
 
@@ -132,7 +134,6 @@ void FriendListPanel::showFriendsInList(const QList<QString> &userIDs)
 
     m_friendListLabel->setText(tr("Selected: %1").arg(userIDs.count()));
 
-//    openPanel();
     m_friendListHeaderWidget->show();
     m_friendListView->filter(userIDs);
 }
index a10a6b5..a3e6c6c 100644 (file)
@@ -40,8 +40,6 @@ class User;
  * @author Kaj Wallin - kaj.wallin (at) ixonos.com
  * @author Henri Lampela - henri.lampela (at) ixonos.com
  * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
- *
- * @class FriendListPanel friendlistpanel.h "ui/friendlistpanel.h"
  */
 class FriendListPanel : public QWidget
 {
@@ -102,14 +100,14 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    QWidget *m_friendListHeaderWidget;  ///< Friend list header widget
-
     QLabel *m_friendListLabel;          ///< Friend list label
 
     QPushButton *m_clearFilterButton;   ///< Button to clear list filtering
 
-    ListView *m_friendListView;                         ///< Friend list view
+    QWidget *m_friendListHeaderWidget;  ///< Friend list header widget
+
     FriendListItemDelegate *m_friendListItemDelegate;   ///< Friend list item delegate
+    ListView *m_friendListView;                         ///< Friend list view
 };
 
 #endif // FRIENDLISTPANEL_H
index ac508ed..d2a5fed 100644 (file)
     USA.
 */
 
+#include "math.h"
+
 #include <QDebug>
 #include <QPainter>
 #include <QSettings>
 
 #include "common.h"
-#include "math.h"
 #include "panelcommon.h"
 
 #include "indicatorbutton.h"
index 5affe55..bfd153c 100644 (file)
@@ -3,6 +3,7 @@
     Copyright (C) 2010  Ixonos Plc. Authors:
 
         Katri Kaikkonen - katri.kaikkonen@ixonos.com
+        Kaj Wallin - kaj.wallin@ixonos.com
         Sami Rämö - sami.ramo@ixonos.com
 
     Situare is free software; you can redistribute it and/or
@@ -32,8 +33,6 @@
  *
  * @author Katri Kaikkonen - katri.kaikkonen (at) ixonos.com
  * @author Sami Rämö - sami.ramo (at) ixonos.com
- *
- * @class IndicatorButton indicatorbutton.h "ui/indicatorbutton.h"
  */
 class IndicatorButton : public  QToolButton
 {
index 79a9ec5..91d777f 100644 (file)
@@ -81,7 +81,7 @@ IndicatorButtonPanel::IndicatorButtonPanel(QWidget *parent)
                                           QPoint(DIRECTION_INDICATOR_POSITION_X,
                                                  DIRECTION_INDICATOR_POSITION_Y)).toPoint();
 
-    if((savedLocation.x() > DEFAULT_SCREEN_WIDTH) || (savedLocation.y() > DEFAULT_SCREEN_HEIGHT)) {
+    if ((savedLocation.x() > DEFAULT_SCREEN_WIDTH) || (savedLocation.y() > DEFAULT_SCREEN_HEIGHT)) {
         savedLocation.rx() = DIRECTION_INDICATOR_POSITION_X;
         savedLocation.ry() = DIRECTION_INDICATOR_POSITION_Y;
     }
@@ -127,12 +127,12 @@ void IndicatorButtonPanel::mouseMoveEvent(QMouseEvent *event)
 
             if (newLocation.x() < 0)
                 newLocation.rx() = 0;
-            else if (newLocation.x() > m_screenSize.width() - width() - PANEL_BAR_WIDTH)
+            else if (newLocation.x() > (m_screenSize.width() - width() - PANEL_BAR_WIDTH))
                 newLocation.rx() =  m_screenSize.width() - width() - PANEL_BAR_WIDTH;
 
             if (newLocation.y() < 0)
                 newLocation.ry() = 0;
-            else if (newLocation.y() > m_screenSize.height() - height())
+            else if (newLocation.y() > (m_screenSize.height() - height()))
                 newLocation.ry() = m_screenSize.height() - height();
 
             move(newLocation);
@@ -158,7 +158,7 @@ void IndicatorButtonPanel::mouseReleaseEvent(QMouseEvent *event)
     m_dragStartTimer->stop();
 
     Q_UNUSED(event);
-    if(m_isDraggable) {
+    if (m_isDraggable) {
         setDraggable(false);
 
         QSettings settings(DIRECTORY_NAME, FILE_NAME);
@@ -194,7 +194,7 @@ void IndicatorButtonPanel::paintEvent(QPaintEvent *event)
         painter.fillPath(backgroundPath, QBrush(*m_normalColor));
     }
 
-    if(m_isDraggable) {
+    if (m_isDraggable) {
         const int ROUNDING_RADIUS = 9;
 
         QPainterPath backgroundPath;
@@ -211,12 +211,12 @@ void IndicatorButtonPanel::screenResized(const QSize &newSize)
     int oldHeight = 0;
     int oldWidth = 0;
 
-    if(m_screenSize.height() < 0)
+    if (m_screenSize.height() < 0)
         oldHeight = DEFAULT_NON_FULLSCREEN_HEIGHT;
     else
         oldHeight = m_screenSize.height();
 
-    if(m_screenSize.width() < 0)
+    if (m_screenSize.width() < 0)
         oldWidth = DEFAULT_SCREEN_WIDTH;
     else
         oldWidth = m_screenSize.width();
@@ -227,18 +227,18 @@ void IndicatorButtonPanel::screenResized(const QSize &newSize)
 
     if (resizedPosition.x() < 0)
         resizedPosition.rx() = 0;
-    else if(resizedPosition.x() > newSize.width() - rect().width() - PANEL_BAR_WIDTH)
+    else if (resizedPosition.x() > (newSize.width() - rect().width() - PANEL_BAR_WIDTH))
         resizedPosition.rx() = newSize.width() - rect().width() - PANEL_BAR_WIDTH;
 
     if (resizedPosition.y() < 0)
         resizedPosition.ry() = 0;
-    else if(resizedPosition.y() > newSize.height() - rect().height())
+    else if (resizedPosition.y() > (newSize.height() - rect().height()))
         resizedPosition.ry() = newSize.height() - rect().height();
 
-    if(pos().y() + rect().center().y() > oldHeight / 2)
+    if ((pos().y() + rect().center().y()) > (oldHeight / 2))
         resizedPosition.ry() = newSize.height() - (oldHeight - pos().y());
 
-    if(pos().x() + rect().center().x() > oldWidth / 2)
+    if ((pos().x() + rect().center().x()) > (oldWidth / 2))
         resizedPosition.rx() = newSize.width() - (oldWidth - pos().x());
 
     move(resizedPosition);
@@ -250,7 +250,7 @@ void IndicatorButtonPanel::setDraggable(bool mode, QPoint eventPosition)
 
     m_isDraggable = mode;
 
-    if(mode) {
+    if (mode) {
         emit draggingModeTriggered();
         grabMouse();
         m_forceReleaseTimer->start();
@@ -296,18 +296,18 @@ void IndicatorButtonPanel::updateValues(qreal direction, qreal distance, bool dr
 
     m_distance = distance;
 
-    if(m_distance < MIN_TO_METERS)
+    if (m_distance < MIN_TO_METERS)
     {
         m_distanceText.setNum(10);
         m_distanceText.prepend("< ");
         m_distanceText.append(UNIT_METER);
     }
-    else if(m_distance < MAX_TO_METERS)
+    else if (m_distance < MAX_TO_METERS)
     {
         m_distanceText.setNum(m_distance, 'f', 0);
         m_distanceText.append(UNIT_METER);
     }
-    else if(m_distance < MAX_TO_KM_WITH_DESIMAL)
+    else if (m_distance < MAX_TO_KM_WITH_DESIMAL)
     {
         m_distanceText.setNum(m_distance / M_TO_KM, 'f', 1);
         m_distanceText.append(UNIT_KILOMETER);
index b46fd44..f8fc16a 100644 (file)
@@ -31,6 +31,7 @@
 #include <QtAlgorithms>
 #include <QtWebKit>
 
+///< @todo sort
 #include "facebookservice/facebookauthentication.h"
 #include "map/mapcommon.h"
 #include "map/mapview.h"
@@ -65,7 +66,7 @@ MainWindow::MainWindow(QWidget *parent)
       m_refresh(false),
       m_progressIndicatorCount(0),
       m_ownLocationCrosshair(0),
-      m_email(),
+      m_email(), ///< @todo WTF?!?!?!?
       m_password(),
       m_webView(0),
       m_fullScreenButton(0),
@@ -512,9 +513,10 @@ void MainWindow::drawFullScreenButton(const QSize &size)
 {
     qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height();
 
-    if(m_fullScreenButton)
+    if (m_fullScreenButton) {
         m_fullScreenButton->move(size.width() - m_fullScreenButton->size().width(),
                                  size.height() - m_fullScreenButton->size().height());
+    }
 }
 
 void MainWindow::drawMapScale(const QSize &size)
@@ -523,7 +525,6 @@ void MainWindow::drawMapScale(const QSize &size)
 
     const int LEFT_SCALE_MARGIN = 10;
     const int BOTTOM_SCALE_MARGIN = 2;
-//    qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height();
 
     m_mapScale->move(LEFT_SCALE_MARGIN,
                      size.height() - m_mapScale->size().height() - BOTTOM_SCALE_MARGIN);
@@ -911,6 +912,8 @@ void MainWindow::showPanels()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+///< @todo check how this is called and can this method be removed
+
     drawFullScreenButton(m_viewPortSize);
 
 //    if(m_loggedIn) {
@@ -974,6 +977,8 @@ void MainWindow::updateItemVisibility()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+///< @todo can this be removed?
+
 //    if(!m_loggedIn) {
 //        m_friendsListPanel->closePanel();
 //        m_friendsListPanel->hide();
index ee1abfa..f741216 100644 (file)
@@ -47,10 +47,10 @@ class GeoCoordinate;
 class MapScale;
 class MapScene;
 class MapView;
-class TabbedPanel;
 class SettingsDialog;
 class SceneCoordinate;
 class SituareService;
+class TabbedPanel;
 class User;
 class UserInfoPanel;
 class ZoomButtonPanel;
index b254822..32b22a4 100644 (file)
@@ -55,6 +55,7 @@ const int PANEL_MARGIN_BOTTOM = 0;                    ///< Panel inner margin (b
  *
  * @var FRIENDPANEL_FILTER_MARGIN_LEFT
  */
+///< @todo not really commom
 const int FRIENDPANEL_FILTER_MARGIN_LEFT = PANEL_MARGIN_LEFT + 4;
 
 /**
@@ -62,6 +63,7 @@ const int FRIENDPANEL_FILTER_MARGIN_LEFT = PANEL_MARGIN_LEFT + 4;
  *
  * @var FRIENDPANEL_FILTER_MARGIN_RIGHT
  */
+///< @todo not really common
 const int FRIENDPANEL_FILTER_MARGIN_RIGHT = PANEL_MARGIN_RIGHT + MAEMO5_SCROLLBAR_WIDTH + 4;
 
 const int SHOW_ALL_BUTTON_RIGHT_MARGIN = 39; ///< Show all button right margin
index 170d45b..a4b4ac0 100644 (file)
@@ -99,7 +99,7 @@ public:
      * Removes a tab and its widget from the panel at index position. The widget itself is not
      * deleted.
      *
-     * TODO: Fix tab drawing order
+     * @todo: Fix tab drawing order
      *
      * @param index Index of the tab
      */
index 70bd35f..6f48bbd 100644 (file)
@@ -307,8 +307,10 @@ void UserInfo::paintEvent(QPaintEvent *aPaintEvent)
     QPainter painter(this);
 
     QRect topRect = QRect(0, MARGIN, BACKGROUND_WIDTH, BACKGROUND_TOP_HEIGHT);
+///< @todo Overlaps with topRect?
     QRect middleRect = QRect(0, topRect.bottom(), BACKGROUND_WIDTH,
                              this->height() - BACKGROUND_TOP_HEIGHT - BACKGROUND_BOTTOM_HEIGHT);
+///< @todo Overlaps with middleRect
     QRect bottomRect = QRect(topRect.left(), middleRect.bottom(), BACKGROUND_WIDTH,
                              BACKGROUND_BOTTOM_HEIGHT);
 
index f3514c8..de62847 100644 (file)
@@ -35,8 +35,6 @@ class ImageButton;
 
 /**
  * @brief UserInfo shows user's data in expandable item.
- *
- * @class UserInfo userinfo.h "ui/userinfo.h"
  */
 class UserInfo : public QWidget
 {
@@ -48,7 +46,7 @@ public:
      *
      * @param parent Parent
      */
-    UserInfo(QWidget *parent=0);
+    UserInfo(QWidget *parent = 0);
 
     /**
      * @brief Desctructor
index 449aa0a..df38811 100644 (file)
@@ -36,8 +36,6 @@ class UserInfo;
  * @author Kaj Wallin - kaj.wallin (at) ixonos.com
  * @author Katri Kaikkonen - katri.kaikkonen (at) ixonos.com
  * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
- *
- * @class UserInfoPanel
  */
 class UserInfoPanel : public QWidget
 {
@@ -118,6 +116,5 @@ signals:
  ******************************************************************************/
 private:
     UserInfo *m_userInfo; ///< Instance of the user info view
-
 };
 #endif // USERPANEL_H
index 2a4ef94..6ff47ef 100644 (file)
@@ -264,11 +264,10 @@ void ZoomButtonPanel::screenResized(const QSize &newSize)
     else if(resizedPosition.y() > (newSize.height() - rect().height()))
         resizedPosition.ry() = newSize.height() - rect().height();
 
-
-    if((pos().y() + rect().center().y()) > (oldHeight/2))
+    if((pos().y() + rect().center().y()) > (oldHeight / 2))
         resizedPosition.ry() = newSize.height() - (oldHeight - pos().y());
 
-    if((pos().x() + rect().center().x()) > (oldWidth/2))
+    if((pos().x() + rect().center().x()) > (oldWidth / 2))
         resizedPosition.rx() = newSize.width() - (oldWidth - pos().x());
 
     move(resizedPosition);