Added signals
authorKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Mon, 26 Jul 2010 08:48:05 +0000 (11:48 +0300)
committerKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Mon, 26 Jul 2010 08:48:05 +0000 (11:48 +0300)
src/engine/engine.cpp
src/engine/engine.h
src/ui/indicatorbutton.cpp
src/ui/indicatorbutton.h
src/ui/mainwindow.cpp
src/ui/mainwindow.h
src/ui/panelcommon.h

index bc2c67b..5679b1a 100644 (file)
@@ -51,7 +51,7 @@ const qreal USER_MOVEMENT_MINIMUM_LATITUDE_DIFFERENCE = 0.001;///< Min value for
 const int MIN_UPDATE_INTERVAL_MSECS = 5*60*1000;
 
 SituareEngine::SituareEngine()
-    : //m_autoCenteringEnabled(false),
+    : m_autoCenteringEnabled(false),
       m_automaticUpdateFirstStart(true),
       m_automaticUpdateRequest(false),
       m_userMoved(false),
@@ -145,35 +145,35 @@ SituareEngine::~SituareEngine()
 
     QSettings settings(DIRECTORY_NAME, FILE_NAME);
     settings.setValue(SETTINGS_GPS_ENABLED, m_gps->isRunning());
-//    settings.setValue(SETTINGS_AUTO_CENTERING_ENABLED, m_autoCenteringEnabled);
+    settings.setValue(SETTINGS_AUTO_CENTERING_ENABLED, m_autoCenteringEnabled);
 }
 
-//void SituareEngine::changeAutoCenteringSetting(bool enabled)
-//{
-//    qDebug() << __PRETTY_FUNCTION__;
+void SituareEngine::changeAutoCenteringSetting(bool enabled)
+{
+    qDebug() << __PRETTY_FUNCTION__;
 
-//    m_autoCenteringEnabled = enabled;
-//    enableAutoCentering(enabled);
-//}
+    m_autoCenteringEnabled = enabled;
+    enableAutoCentering(enabled);
+}
 
-//void SituareEngine::disableAutoCentering()
-//{
-//    qDebug() << __PRETTY_FUNCTION__;
+void SituareEngine::disableAutoCentering()
+{
+    qDebug() << __PRETTY_FUNCTION__;
 
-//    changeAutoCenteringSetting(false);
-//    m_ui->buildInformationBox(tr("Auto centering disabled"));
-//}
+    changeAutoCenteringSetting(false);
+    m_ui->buildInformationBox(tr("Auto centering disabled"));
+}
 
-//void SituareEngine::enableAutoCentering(bool enabled)
-//{
-//    qDebug() << __PRETTY_FUNCTION__;
+void SituareEngine::enableAutoCentering(bool enabled)
+{
+    qDebug() << __PRETTY_FUNCTION__;
 
-//    m_ui->setAutoCenteringButtonEnabled(enabled);
-//    m_mapEngine->setAutoCentering(enabled);
+    m_ui->setIndicatorButtonEnabled(enabled);
+    m_mapEngine->setAutoCentering(enabled);
 
-//    if (enabled)
-//        m_gps->requestLastPosition();
-//}
+    if (enabled)
+        m_gps->requestLastPosition();
+}
 
 void SituareEngine::enableGPS(bool enabled)
 {
@@ -187,7 +187,7 @@ void SituareEngine::enableGPS(bool enabled)
 
         if (enabled && !m_gps->isRunning()) {
             m_gps->start();
-//            enableAutoCentering(m_autoCenteringEnabled);
+            enableAutoCentering(m_autoCenteringEnabled);
             m_gps->requestLastPosition();
 
             if(m_ui->loginState())
@@ -195,7 +195,7 @@ void SituareEngine::enableGPS(bool enabled)
         }
         else if (!enabled && m_gps->isRunning()) {
             m_gps->stop();
-//            enableAutoCentering(false);
+            enableAutoCentering(false);
             enableAutomaticLocationUpdate(false);
         }
     }
@@ -245,8 +245,8 @@ void SituareEngine::enablePowerSave(bool enabled)
 
     m_gps->enablePowerSave(enabled);
 
-//    if(m_autoCenteringEnabled)
-//        m_mapEngine->setAutoCentering(!enabled);
+    if(m_autoCenteringEnabled)
+        m_mapEngine->setAutoCentering(!enabled);
 }
 
 void SituareEngine::error(const int context, const int error)
@@ -372,7 +372,7 @@ void SituareEngine::initializeGpsAndAutocentering()
 
     QSettings settings(DIRECTORY_NAME, FILE_NAME);
     QVariant gpsEnabled = settings.value(SETTINGS_GPS_ENABLED);
-//    QVariant autoCenteringEnabled = settings.value(SETTINGS_AUTO_CENTERING_ENABLED);
+    QVariant autoCenteringEnabled = settings.value(SETTINGS_AUTO_CENTERING_ENABLED);
 
     if (m_gps->isInitialized()) {
 
@@ -381,20 +381,20 @@ void SituareEngine::initializeGpsAndAutocentering()
             connect(m_gps, SIGNAL(position(GeoCoordinate, qreal)),
                     this, SLOT(setFirstStartZoomLevel()));
 
-//            changeAutoCenteringSetting(true);
+            changeAutoCenteringSetting(true);
             enableGPS(true);
 
             m_ui->buildInformationBox(tr("GPS enabled"));
             m_ui->buildInformationBox(tr("Auto centering enabled"));
 
         } else { // Normal start
-//            changeAutoCenteringSetting(autoCenteringEnabled.toBool());
+            changeAutoCenteringSetting(autoCenteringEnabled.toBool());
             enableGPS(gpsEnabled.toBool());
 
             if (gpsEnabled.toBool())
                 m_ui->buildInformationBox(tr("GPS enabled"));
 
-            if (gpsEnabled.toBool()) /*&& autoCenteringEnabled.toBool())*/
+            if (gpsEnabled.toBool() && autoCenteringEnabled.toBool())
                 m_ui->buildInformationBox(tr("Auto centering enabled"));
         }
     } else {
@@ -524,8 +524,8 @@ void SituareEngine::setFirstStartZoomLevel()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-//    if (m_autoCenteringEnabled) // autocentering is disabled when map is scrolled
-//        m_mapEngine->setZoomLevel(DEFAULT_ZOOM_LEVEL_WHEN_GPS_IS_AVAILABLE);
+    if (m_autoCenteringEnabled) // autocentering is disabled when map is scrolled
+        m_mapEngine->setZoomLevel(DEFAULT_ZOOM_LEVEL_WHEN_GPS_IS_AVAILABLE);
 
     disconnect(m_gps, SIGNAL(position(GeoCoordinate, qreal)),
                this, SLOT(setFirstStartZoomLevel()));
@@ -605,9 +605,6 @@ void SituareEngine::signalsFromMainWindow()
             m_mapEngine, SLOT(zoomOut()));
 
     // signals from menu buttons
-//    connect(m_ui, SIGNAL(autoCenteringTriggered(bool)),
-//            this, SLOT(changeAutoCenteringSetting(bool)));
-
     connect(m_ui, SIGNAL(gpsTriggered(bool)),
             this, SLOT(enableGPS(bool)));
 
@@ -634,6 +631,10 @@ void SituareEngine::signalsFromMainWindow()
     // signals from friend list tab
     connect(m_ui, SIGNAL(findFriend(GeoCoordinate)),
             m_mapEngine, SLOT(centerToCoordinates(GeoCoordinate)));
+
+    // signals from distence indicator button
+        connect(m_ui, SIGNAL(autoCenteringTriggered(bool)),
+                this, SLOT(changeAutoCenteringSetting(bool)));
 }
 
 void SituareEngine::signalsFromMapEngine()
@@ -649,8 +650,8 @@ void SituareEngine::signalsFromMapEngine()
     connect(m_mapEngine, SIGNAL(zoomLevelChanged(int)),
             m_ui, SIGNAL(zoomLevelChanged(int)));
 
-//    connect(m_mapEngine, SIGNAL(mapScrolledManually()),
-//            this, SLOT(disableAutoCentering()));
+    connect(m_mapEngine, SIGNAL(mapScrolledManually()),
+            this, SLOT(disableAutoCentering()));
 
     connect(m_mapEngine, SIGNAL(maxZoomLevelReached()),
             m_ui, SIGNAL(maxZoomLevelReached()));
index 5fe1293..677021f 100644 (file)
@@ -187,12 +187,12 @@ private slots:
     *
     * @param enabled true if enabled, false otherwise
     */
-//    void changeAutoCenteringSetting(bool enabled);
+    void changeAutoCenteringSetting(bool enabled);
 
     /**
     * @brief Slot for disabling automatic centering when map is scrolled manually
     */
-//    void disableAutoCentering();
+    void disableAutoCentering();
 
     /**
     * @brief Slot for auto centering enabling.
@@ -201,7 +201,7 @@ private slots:
     *
     * @param enabled true if auto centering was enabled, false otherwise
     */
-//    void enableAutoCentering(bool enabled);
+    void enableAutoCentering(bool enabled);
 
     /**
     * @brief Slot for gps enabling.
@@ -296,7 +296,7 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-//    bool m_autoCenteringEnabled;        ///< Auto centering flag
+    bool m_autoCenteringEnabled;        ///< Auto centering flag
     bool m_automaticUpdateFirstStart;   ///< Automatic location update first start flag
     bool m_automaticUpdateRequest;      ///< Flag for automatic update request
     bool m_userMoved;                   ///< Flag for user move
index dfe0f23..2e3a9a9 100644 (file)
@@ -32,6 +32,8 @@ const int ROUNDING_RADIUS = 9;  ///< Roundness of the rounded edge
 const qreal OPACITY = 0.13;     ///< Opacity of the background in percents
 const int BUTTON_WIDTH = 66;    ///< Button width
 const int BUTTON_HEIGHT = 66;   ///< Button height
+const int DRAGGABLE_BUTTON_WIDTH = 85;
+const int DRAGGABLE_BUTTON_HEIGHT = 85;
 
 IndicatorButton::IndicatorButton(QWidget *parent)
     : QToolButton(parent),
@@ -40,6 +42,11 @@ IndicatorButton::IndicatorButton(QWidget *parent)
     setIcon(QIcon::fromTheme(QLatin1String("general_fullsize")));
     setFixedSize(BUTTON_WIDTH, BUTTON_HEIGHT);
 
+    QSettings settings(DIRECTORY_NAME, FILE_NAME);
+    move(settings.value(DIRECTION_INDICATOR_BUTTON_POSITION,
+                        QPoint(DIRECTION_INDICATOR_POSITION_X,
+                               DIRECTION_INDICATOR_POSITION_Y)).toPoint());
+
     QPalette pal = palette();
     QColor backgroundColor = pal.color(backgroundRole());
     backgroundColor.setAlpha(floor(OPACITY * 255));
@@ -66,43 +73,10 @@ IndicatorButton::IndicatorButton(QWidget *parent)
     connect(m_forceReleaseTimer, SIGNAL(timeout()),
             this, SLOT(forceMouseRelease()));
 
-    connect(this, SIGNAL(triggered(bool)),
-        this, SIGNAL(autoCenteringTriggered(bool)));
-
-    // Create mask to round the corners of the background
-    QRegion maskbase(rect());
-
-    // left top corner
-    QRegion leftTopBase(QRect(0, 0, ROUNDING_RADIUS, ROUNDING_RADIUS));
-    QRegion leftTopRounding(QRect(0, 0, 2 * ROUNDING_RADIUS, 2 * ROUNDING_RADIUS), QRegion::Ellipse);
-    QRegion leftTopClipped = leftTopBase.subtract(leftTopRounding);
-
-    // right top corner
-    QRegion rightTopBase(QRect(rect().width() - ROUNDING_RADIUS, 0,
-                                    rect().width(), ROUNDING_RADIUS));
-    QRegion rightTopRounding(QRect(rect().width() - 2 * ROUNDING_RADIUS, 0,
-                                      2 * ROUNDING_RADIUS, 2 * ROUNDING_RADIUS), QRegion::Ellipse);
-    QRegion rightTopClipped = rightTopBase.subtract(rightTopRounding);
-
-    // left bottom corner
-    QRegion leftBottomBase(QRect(0, rect().height() - ROUNDING_RADIUS,
-                                    ROUNDING_RADIUS, rect().height()));
-    QRegion leftBottomRounding(QRect(0, rect().height() - 2 * ROUNDING_RADIUS,
-                                      2 * ROUNDING_RADIUS, 2 * ROUNDING_RADIUS), QRegion::Ellipse);
-    QRegion leftBottomClipped = leftBottomBase.subtract(leftBottomRounding);
+    connect(this, SIGNAL(clicked(bool)),
+            this, SIGNAL(autoCenteringTriggered(bool)));
 
-    // right bottom corner
-    QRegion rightBottomBase(QRect(rect().width() - ROUNDING_RADIUS, rect().height()- ROUNDING_RADIUS,
-                                    rect().height() - ROUNDING_RADIUS, rect().width()- ROUNDING_RADIUS));
-    QRegion rightBottomRounding(QRect(rect().width() - 2 * ROUNDING_RADIUS, rect().height() - 2 * ROUNDING_RADIUS,
-                                      2 * ROUNDING_RADIUS, 2 * ROUNDING_RADIUS), QRegion::Ellipse);
-    QRegion rightBottomClipped = rightBottomBase.subtract(rightBottomRounding);
-
-    QRegion cutter = leftTopClipped.unite(rightTopClipped.unite(leftBottomClipped.unite(rightBottomClipped)));
-
-    QRegion mask = maskbase.subtract(cutter);
-
-    setMask(mask);
+    setCheckable(true);
 }
 
 void IndicatorButton::mousePressEvent(QMouseEvent *event)
@@ -112,8 +86,9 @@ void IndicatorButton::mousePressEvent(QMouseEvent *event)
     if (event->button() == Qt::LeftButton) {
         m_dragPosition = event->pos();
     }
+    m_eventPosition = mapToParent(event->pos());
     m_dragStartTimer->start();
-    QWidget::mousePressEvent(event);
+//    QToolButton::mousePressEvent(event);
 }
 
 void IndicatorButton::mouseMoveEvent(QMouseEvent *event)
@@ -126,13 +101,13 @@ void IndicatorButton::mouseMoveEvent(QMouseEvent *event)
 
             if (newLocation.x() < SIDEBAR_WIDTH)
                 newLocation.rx() = SIDEBAR_WIDTH;
-            else if (newLocation.x() > m_screenSize.width() - width() - SIDEBAR_WIDTH)
-                newLocation.rx() =  m_screenSize.width() - width() - SIDEBAR_WIDTH;
+//             else if (newLocation.x() > m_screenSize.width() - width() - SIDEBAR_WIDTH)
+//                newLocation.rx() =  m_screenSize.width() - width() - SIDEBAR_WIDTH;
 
             if (newLocation.y() < 0)
                 newLocation.ry() = 0;
-            else if (newLocation.y() > m_screenSize.height() - height())
-                newLocation.ry() = m_screenSize.height() - height();
+//            else if (newLocation.y() > m_screenSize.height() - height())
+//                newLocation.ry() = m_screenSize.height() - height();
 
             move(newLocation);
         }
@@ -140,7 +115,7 @@ void IndicatorButton::mouseMoveEvent(QMouseEvent *event)
         if(!rect().contains(event->pos()))
             m_dragStartTimer->stop();
 
-    QWidget::mouseMoveEvent(event);
+    QToolButton::mouseMoveEvent(event);
 }
 
 void IndicatorButton::mouseReleaseEvent(QMouseEvent *event)
@@ -152,11 +127,21 @@ void IndicatorButton::mouseReleaseEvent(QMouseEvent *event)
     Q_UNUSED(event);
     if(m_isDraggable) {
         setDraggable(false);
-//        QSettings settings(DIRECTORY_NAME, FILE_NAME);
-//        settings.setValue(ZOOMPANEL_POSITION, pos());
+        QSettings settings(DIRECTORY_NAME, FILE_NAME);
+        settings.setValue(DIRECTION_INDICATOR_BUTTON_POSITION, pos());
         releaseMouse();
+
+    } else {
+
+        if(isChecked()) {
+            setChecked(false);
+            emit autoCenteringTriggered(false);
+        } else {
+            setChecked(true);
+            emit autoCenteringTriggered(true);
+        }
     }
-    QWidget::mouseReleaseEvent(event);
+    QToolButton::mouseReleaseEvent(event);
 }
 
 void IndicatorButton::setDraggable(bool mode, QPoint eventPosition)
@@ -166,15 +151,16 @@ void IndicatorButton::setDraggable(bool mode, QPoint eventPosition)
     m_isDraggable = mode;
 
     if(mode) {
+        setFixedSize(DRAGGABLE_BUTTON_WIDTH, DRAGGABLE_BUTTON_HEIGHT);
         setAutoFillBackground(true);
         grabMouse();
         m_forceReleaseTimer->start();
         m_dragPosition = eventPosition;
     } else {
-        setAutoFillBackground(false);
+        setFixedSize(BUTTON_WIDTH, BUTTON_HEIGHT);
+        setAutoFillBackground(true);
         releaseMouse();
         m_forceReleaseTimer->stop();
-
     }
 }
 
@@ -202,3 +188,11 @@ void IndicatorButton::timerExpired()
 
     setDraggable(true, m_dragPosition);
 }
+
+//void IndicatorButton::paintEvent(QPaintEvent *event)
+//{
+//    qDebug() << __PRETTY_FUNCTION__;
+
+//    QToolButton::paintEvent(event);
+
+//}
index c5530c6..a1a1b02 100644 (file)
@@ -53,14 +53,14 @@ public:
 protected:
 
    /**
-    * @brief Move event for the zoom button panel
+    * @brief Move event for the distance indicator button
     *
     * @param event Event
     */
    void mouseMoveEvent(QMouseEvent *event);
 
    /**
-    * @brief Press event for the zoom button panel
+    * @brief Press event for the distance indicator button
     *
     * @param event Event
     */
@@ -73,6 +73,8 @@ protected:
     */
    void mouseReleaseEvent(QMouseEvent *event);
 
+//   void paintEvent(QPaintEvent *event);
+
 
 /*******************************************************************************
 * MEMBER FUNCTIONS AND SLOTS
@@ -86,17 +88,10 @@ public slots:
     const QPoint& eventPosition();
 
     /**
-     * @brief Toggle zoom panel draggability
+     * @brief Toggle distance indicator button draggability
      */
     void setDraggable(bool mode, QPoint eventPosition = QPoint(0,0));
 
-//    /**
-//    * @brief Slot to redraw the panel after window resize event
-//    *
-//    * @param size Size of the new screen
-//    */
-//    void screenResized(const QSize &size);
-
 private slots:
     /**
      * @brief Safeguard slot to release mouse grab if something goes horribly wrong
@@ -126,11 +121,11 @@ private:
    bool m_isDraggable;             ///< Boolean for tracking the draggability state
 
    QPoint m_dragPosition;          ///< Location from where the widget is grabbed
-   QPoint m_eventPosition;     ///< Position of mousePressEvent
+   QPoint m_eventPosition;         ///< Position of mousePressEvent
 
    QSize m_screenSize;             ///< Store for the screen size
 
-   QTimer *m_dragStartTimer;       ///< Timer to init draggability of the zoom panel
+   QTimer *m_dragStartTimer;       ///< Timer to init draggability of the distance indicator button
    QTimer *m_forceReleaseTimer;    ///< Timer to run forceMouseRelease;
 
 };
index 8050556..3d065c6 100644 (file)
@@ -98,7 +98,6 @@ MainWindow::MainWindow(QWidget *parent)
     m_mapScale->stackUnder(m_indicatorButton);
     m_mapView->stackUnder(m_mapScale);
 
-
     grabZoomKeys(true);
 
     // Set default screen size
@@ -184,9 +183,8 @@ void MainWindow::buildIndicatorButton()
 
     m_indicatorButton = new IndicatorButton(this);
 
-    connect(m_indicatorButton, SIGNAL(triggered(bool)),
+    connect(m_indicatorButton, SIGNAL(autoCenteringTriggered(bool)),
         this, SIGNAL(autoCenteringTriggered(bool)));
-
 }
 
 void MainWindow::buildInformationBox(const QString &message, bool modal)
@@ -429,18 +427,11 @@ void MainWindow::createMenus()
     connect(m_gpsToggleAct, SIGNAL(triggered(bool)),
             this, SIGNAL(gpsTriggered(bool)));
 
-    // automatic centering
-//    m_autoCenteringAct = new QAction(tr("Auto centering"), this);
-//    m_autoCenteringAct->setCheckable(true);
-//    connect(m_autoCenteringAct, SIGNAL(triggered(bool)),
-//        this, SIGNAL(autoCenteringTriggered(bool)));
-
     // build the actual menu
     m_viewMenu = menuBar()->addMenu(tr("Main"));
     m_viewMenu->addAction(m_loginAct);
     m_viewMenu->addAction(m_toSettingsAct);
     m_viewMenu->addAction(m_gpsToggleAct);
-//    m_viewMenu->addAction(m_autoCenteringAct);
     m_viewMenu->setObjectName(tr("Menu"));
 }
 
@@ -500,25 +491,6 @@ void MainWindow::drawFullScreenButton(const QSize &size)
     }
 }
 
-void MainWindow::drawIndicatorButton(const QSize &size)
-{
-    qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height();
-
-    const int LEFT_SCALE_MARGIN = 10;
-    const int BOTTOM_SCALE_MARGIN = 80;
-
-    if(m_indicatorButton) {
-        if(m_loggedIn) {
-            m_indicatorButton->move(PANEL_PEEK_AMOUNT + LEFT_SCALE_MARGIN,
-                             size.height() - m_mapScale->size().height() - BOTTOM_SCALE_MARGIN);
-
-        } else {
-            m_indicatorButton->move(PANEL_PEEK_AMOUNT + LEFT_SCALE_MARGIN,
-                             size.height() - m_mapScale->size().height() - BOTTOM_SCALE_MARGIN);
-        }
-    }
-}
-
 void MainWindow::drawMapScale(const QSize &size)
 {
     const int LEFT_SCALE_MARGIN = 10;
@@ -635,7 +607,6 @@ void MainWindow::loadCookies()
 
         m_cookieJar->setAllCookies(cookieList);
         m_webView->page()->networkAccessManager()->setCookieJar(m_cookieJar);
-
     }
 }
 
@@ -805,13 +776,6 @@ void MainWindow::saveCookies()
     settings.setValue(COOKIES, list);
 }
 
-//void MainWindow::setAutoCenteringButtonEnabled(bool enabled)
-//{
-//    qDebug() << __PRETTY_FUNCTION__;
-
-//    m_autoCenteringAct->setChecked(enabled);
-//}
-
 void MainWindow::setGPSButtonEnabled(bool enabled)
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -819,8 +783,6 @@ void MainWindow::setGPSButtonEnabled(bool enabled)
     m_gpsToggleAct->setChecked(enabled);
 
     setOwnLocationCrosshairVisibility(!enabled);
-
-//    m_autoCenteringAct->setVisible(enabled);
 }
 
 void MainWindow::setIndicatorButtonEnabled(bool enabled)
@@ -829,8 +791,6 @@ void MainWindow::setIndicatorButtonEnabled(bool enabled)
 
     m_indicatorButton->setChecked(enabled);
 
-    connect(m_autoCenteringAct, SIGNAL(triggered(bool)),
-            this, SIGNAL(autoCenteringTriggered(bool)));
 }
 
 void MainWindow::setMapViewScene(QGraphicsScene *scene)
@@ -929,7 +889,6 @@ void MainWindow::showPanels()
     qDebug() << __PRETTY_FUNCTION__;
 
     drawFullScreenButton(m_viewPortSize);
-    drawIndicatorButton(m_viewPortSize);
 
     if(m_loggedIn) {
         if(!m_friendsListPanel->isVisible()) {
@@ -945,12 +904,6 @@ void MainWindow::showPanels()
     }
 }
 
-//void MainWindow::showIndicatorButton(bool gps, bool autoCentering)
-//{
-//    qDebug() << __PRETTY_FUNCTION__;
-
-//}
-
 void MainWindow::startLoginProcess()
 {
     qDebug() << __PRETTY_FUNCTION__;
index 47aec72..eba1003 100644 (file)
@@ -112,11 +112,11 @@ public:
     */
     void readAutomaticLocationUpdateSettings();
 
-    /**
-    * @brief Enable / disable auto centering button.
-    *
-    * @param enabled true if shoud be enabled, false otherwise
-    */
+//    /**
+//    * @brief Enable / disable auto centering button.
+//    *
+//    * @param enabled true if shoud be enabled, false otherwise
+//    */
 //    void setAutoCenteringButtonEnabled(bool enabled);
 
     /**
@@ -330,14 +330,6 @@ private slots:
     void drawFullScreenButton(const QSize &size);
 
     /**
-    * @brief Slot for drawing the direction indicator button
-    *
-    * @param size Size of the screen
-    */
-    void drawIndicatorButton(const QSize &size);
-
-
-    /**
     * @brief Slot for drawing the map distance scale
     *
     * @param size Size of the screen
@@ -424,7 +416,7 @@ signals:
     *
     * @param enabled True if automatic centering is enabled, otherwise false
     */
-//    void autoCenteringTriggered(bool enabled);
+    void autoCenteringTriggered(bool enabled);
 
     /**
     * @brief Signal that indicates when user has cancelled login process
index a57f06d..7011f40 100644 (file)
@@ -93,9 +93,9 @@ const int ZOOM_BUTTON_PANEL_BUTTON_SPACING = 4; ///< Size of a zoom button spaci
 const QString ZOOMPANEL_POSITION = "Zoom_Panel_Position";
 
 // Direction indicator button settings
-//const int DIRECTION_INDICATOR_POSITION_X = 30 + PANEL_PEEK_AMOUNT; ///< Horizontal position of zoom panel
-//const int DIRECTION_INDICATOR_POSITION_Y = 30; ///< Vertical position of zoom panel
+const int DIRECTION_INDICATOR_POSITION_X = 10 + PANEL_PEEK_AMOUNT; ///< Horizontal position of direction indicator button
+const int DIRECTION_INDICATOR_POSITION_Y = 342; ///< Vertical position of direction indicator button
 
-//const QString DIRECTION_INDICATOR_BUTTON_POSITION = "Direction_indicator_Position";
+const QString DIRECTION_INDICATOR_BUTTON_POSITION = "Direction_Indicator_Position";
 
 #endif // PANELCOMMON_H