camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp
changeset 60 a289dde0a1d6
parent 56 01e205c615b9
child 63 415ff50d2eca
--- a/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp	Thu Sep 02 20:14:28 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp	Fri Sep 17 08:27:13 2010 +0300
@@ -72,6 +72,8 @@
 using namespace CxUiSettings;
 using namespace CxUiInternal;
 
+const int CXUI_GEOTAGGING_BLINK_INTERVAL = 500; //milliseconds, for geotagging icon
+
 
 // ---------------------------------------------------------------------------
 // CxuiPrecaptureView::CxuiPrecaptureView
@@ -156,6 +158,9 @@
     mHideControlsTimeout.setSingleShot(true);
     mHideControlsTimeout.setInterval(CXUI_HIDE_CONTROLS_TIMEOUT);
 
+    mGeoTaggingBlinkTimer = new QTimer(this);
+    connect(mGeoTaggingBlinkTimer, SIGNAL(timeout()), this, SLOT(blinkGeoTaggingIcon()));
+
     hideControls();
 
     if (CxuiServiceProvider::isCameraEmbedded()) {
@@ -888,21 +893,43 @@
 void CxuiPrecaptureView::updateLocationIndicator(CxeGeoTaggingTrail::State newState, CxeError::Id error)
 {
     CX_DEBUG( ("CxuiPrecaptureView::updateLocationIndicator <> error: %d ", error));
-
-    if (mGeoTaggingIndicatorIcon) {
+    Cxe::GeoTagging currentValue = mEngine->settings().get<Cxe::GeoTagging>(CxeSettingIds::GEOTAGGING);
+    if(currentValue == Cxe::GeoTaggingOn && mGeoTaggingIndicatorIcon) {
         if (newState == CxeGeoTaggingTrail::DataAvailable && error == CxeError::None) {
             CX_DEBUG(("CxuiPrecaptureView::updateLocationIndicator GPS data available, showing icon"));
-            mGeoTaggingIndicatorIcon->setIcon(HbIcon("qtg_mono_geotag"));
             mGeoTaggingIndicatorIcon->show();
+            mGeoTaggingBlinkTimer->stop();
         } else {
-            CX_DEBUG(("CxuiPrecaptureView::handleIconChanged GPS data not available"));
-            mGeoTaggingIndicatorIcon->hide();
+            // blinking geotagging indicator while acquiring GPS data
+            CX_DEBUG(("CxuiPrecaptureView::updateLocationIndicator waiting for GPS data, blinking icon"));
+            mGeoTaggingBlinkTimer->setInterval(CXUI_GEOTAGGING_BLINK_INTERVAL);
+            mGeoTaggingBlinkTimer->start();
         }
     }
+    else {
+        CX_DEBUG(("CxuiPrecaptureView::handleIconChanged GPS data not available"));
+        mGeoTaggingBlinkTimer->stop();
+    }
 
     CX_DEBUG_EXIT_FUNCTION();
 }
 
+/*!
+ * Private method for blinking geotagging icon
+ */
+void CxuiPrecaptureView::blinkGeoTaggingIcon()
+{
+    if (mGeoTaggingIndicatorIcon) {
+        if (mGeoTaggingIndicatorIcon->isVisible()) {
+            mGeoTaggingIndicatorIcon->setVisible(false);
+        } else {
+            mGeoTaggingIndicatorIcon->setVisible(true);
+        }
+    }
+}
+
+void CxuiPrecaptureView::toolbarExtensionAppearEffectFinished(const HbEffect::EffectStatus &status) {
+}
 
 void CxuiPrecaptureView::toolbarExtensionDisappearEffectFinished(const HbEffect::EffectStatus &status) {
     if (mSettingsGrid) {
@@ -910,11 +937,6 @@
     }
 }
 
-void CxuiPrecaptureView::toolbarExtensionAppearEffectFinished(const HbEffect::EffectStatus &status) {
-}
-
-
-
 /*!
 * Lauches "Geotagging first-time use" notification to the user
 */