backup
authorlampehe-local <henri.lampela@ixonos.com>
Fri, 11 Jun 2010 09:45:41 +0000 (12:45 +0300)
committerlampehe-local <henri.lampela@ixonos.com>
Fri, 11 Jun 2010 09:45:41 +0000 (12:45 +0300)
src/engine/engine.cpp
src/ui/mainwindow.cpp
src/ui/mainwindow.h

index 83207de..ac8989b 100644 (file)
@@ -155,6 +155,8 @@ void SituareEngine::enableGPS(bool enabled)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    m_ui->setOwnLocationCrosshairVisibility(!enabled);
+
     if (m_gps->isInitialized()) {
         m_ui->setGPSButtonEnabled(enabled);
         m_mapEngine->setGPSEnabled(enabled);
index 8a4f9c4..309b0c2 100644 (file)
@@ -782,7 +782,7 @@ void MainWindow::setOwnLocationCrosshairVisibility(bool visibility)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if (visibility) {
+    if (visibility && m_loggedIn) {
         m_ownLocationCrosshair->show();
         m_drawOwnLocationCrosshair = true;
         drawOwnLocationCrosshair(QSize(m_viewPortWidth, m_viewPortHeight));
@@ -880,6 +880,8 @@ void MainWindow::toggleProgressIndicator(bool value)
 void MainWindow::updateItemVisibility(bool show)
 {
     qDebug() << __PRETTY_FUNCTION__;
+
+    setOwnLocationCrosshairVisibility(show);
     
     if(show) {
         m_friendsListPanel->show();
@@ -887,11 +889,6 @@ void MainWindow::updateItemVisibility(bool show)
         m_userPanel->show();
         m_userPanelSidebar->show();
 
-        if(m_drawOwnLocationCrosshair) {
-            m_ownLocationCrosshair->show();
-            setGPSButtonEnabled(false);
-            emit gpsTriggered(false);
-        }
     } else {
         m_friendsListPanel->closePanel();
         m_friendsListPanel->hide();
@@ -899,7 +896,6 @@ void MainWindow::updateItemVisibility(bool show)
         m_userPanel->closePanel();
         m_userPanel->hide();
         m_userPanelSidebar->hide();
-        m_ownLocationCrosshair->hide();       
     }
 }
 
index 714240b..162870b 100644 (file)
@@ -165,6 +165,13 @@ public slots:
     void openSettingsDialog();
 
     /**
+      * @brief Set own location crosshair visibility
+      *
+      * @param visible
+      */
+    void setOwnLocationCrosshairVisibility(bool visible);
+
+    /**
     * @brief Sets username to member variable for login dialog
     *
     * @param username Username to be set
@@ -258,12 +265,12 @@ private:
     */
     void queueDialog(QDialog *dialog);
 
-    /**
-      * @brief Set own location crosshair visibility
-      *
-      * @param visible
-      */
-    void setOwnLocationCrosshairVisibility(bool visible);
+//    /**
+//      * @brief Set own location crosshair visibility
+//      *
+//      * @param visible
+//      */
+//    void setOwnLocationCrosshairVisibility(bool visible);
 
     /**
     * @brief Shows queued error information box