Merge branch 'new_panels' into locationlistview
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Thu, 12 Aug 2010 05:40:00 +0000 (08:40 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Thu, 12 Aug 2010 05:40:00 +0000 (08:40 +0300)
Conflicts:
src/map/mapengine.cpp
src/src.pro
src/ui/friendlistpanel.cpp

1  2 
src/engine/engine.cpp
src/engine/engine.h
src/map/mapengine.cpp
src/map/mapengine.h
src/src.pro
src/ui/friendlistpanel.cpp
src/ui/mainwindow.cpp
src/ui/mainwindow.h

Simple merge
Simple merge
@@@ -484,17 -502,23 +509,34 @@@ void MapEngine::setTilesGridSize(const 
      m_tilesGridSize.setWidth(gridWidth);
  }
  
 +void MapEngine::showMapArea(const GeoCoordinate &swBound, const GeoCoordinate &neBound)
 +{
 +    qDebug() << __PRETTY_FUNCTION__;
 +
 +    QRect area;
 +    area.setTopRight(SceneCoordinate(neBound).toPointF().toPoint());
 +    area.setBottomLeft(SceneCoordinate(swBound).toPointF().toPoint());
 +
 +    centerAndZoomTo(area, false);
 +}
 +
+ void MapEngine::updateDirectionIndicator()
+ {
+     qDebug() << __PRETTY_FUNCTION__;
+     qreal distance = m_gpsPosition.distanceTo(m_sceneCoordinate);
+     qreal direction = m_sceneCoordinate.azimuthTo(SceneCoordinate(m_gpsPosition));
+     // direction indicator triangle should be drawn only if the gps location item is not currently
+     // visible on the view
+     bool drawDirectionIndicatorTriangle = true;
+     if (currentViewSceneRect().contains(m_gpsLocationItem->pos()))
+         drawDirectionIndicatorTriangle = false;
+     emit directionIndicatorValuesUpdate(direction, distance, drawDirectionIndicatorTriangle);
+ }
  void MapEngine::updateViewTilesSceneRect()
  {
      qDebug() << __PRETTY_FUNCTION__;
@@@ -185,11 -185,17 +185,18 @@@ private
      * as big as possible.
      *
      * @param rect Target rect
 +    * @param useMargins true if margins should be added to rect, false otherwise
      */
 -    void centerAndZoomTo(QRect rect);
 +    void centerAndZoomTo(QRect rect, bool useMargins = true);
  
      /**
+     * @brief Returns the rect of the current scene area drawn on the view
+     *
+     * @returns Rect of the current scene area drawn on the view
+     */
+     QRectF currentViewSceneRect() const;
+     /**
       * @brief Request disabling of auto centering if centered too far from the real location.
       *
       * @param coordinate scene's center coordinate
diff --cc src/src.pro
@@@ -55,11 -50,7 +55,12 @@@ SOURCES += main.cpp 
      ui/fullscreenbutton.cpp \
      ui/imagebutton.cpp \
      ui/indicatorbutton.cpp \
 +    ui/listitem.cpp \
 +    ui/listitemdelegate.cpp \
 +    ui/listview.cpp \
 +    ui/locationlistitem.cpp \
 +    ui/locationlistview.cpp \
+     ui/indicatorbuttonpanel.cpp \
      ui/logindialog.cpp \
      ui/mainwindow.cpp \
      ui/mapscale.cpp \
Simple merge
@@@ -308,8 -310,10 +312,11 @@@ void MainWindow::buildPanels(
      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_tabbedPanel->addTab(m_routingPanel, QIcon(":/res/images/routing.png"));
  
+     connect(m_tabbedPanel, SIGNAL(panelOpened()),
+             m_friendsListPanel, SLOT(clearFriendListFilter()));
      connect(m_mapView, SIGNAL(viewResized(QSize)),
              m_tabbedPanel, SLOT(resizePanel(QSize)));
  }
Simple merge