camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp
changeset 55 0da2a5b56583
parent 52 7e18d488ac5f
child 58 ddba9caa7f32
equal deleted inserted replaced
52:7e18d488ac5f 55:0da2a5b56583
    70 
    70 
    71 using namespace CxUiLayout;
    71 using namespace CxUiLayout;
    72 using namespace CxUiSettings;
    72 using namespace CxUiSettings;
    73 using namespace CxUiInternal;
    73 using namespace CxUiInternal;
    74 
    74 
       
    75 const int CXUI_GEOTAGGING_BLINK_INTERVAL = 500; //milliseconds, for geotagging icon
       
    76 
    75 
    77 
    76 // ---------------------------------------------------------------------------
    78 // ---------------------------------------------------------------------------
    77 // CxuiPrecaptureView::CxuiPrecaptureView
    79 // CxuiPrecaptureView::CxuiPrecaptureView
    78 // Constructor
    80 // Constructor
    79 // ---------------------------------------------------------------------------
    81 // ---------------------------------------------------------------------------
   154     connect(&mHideControlsTimeout, SIGNAL(timeout()), this, SLOT(hideControls()));
   156     connect(&mHideControlsTimeout, SIGNAL(timeout()), this, SLOT(hideControls()));
   155 
   157 
   156     mHideControlsTimeout.setSingleShot(true);
   158     mHideControlsTimeout.setSingleShot(true);
   157     mHideControlsTimeout.setInterval(CXUI_HIDE_CONTROLS_TIMEOUT);
   159     mHideControlsTimeout.setInterval(CXUI_HIDE_CONTROLS_TIMEOUT);
   158 
   160 
       
   161     mGeoTaggingBlinkTimer = new QTimer(this);
       
   162     connect(mGeoTaggingBlinkTimer, SIGNAL(timeout()), this, SLOT(blinkGeoTaggingIcon()));
       
   163 
   159     hideControls();
   164     hideControls();
   160 
   165 
   161     if (CxuiServiceProvider::isCameraEmbedded()) {
   166     if (CxuiServiceProvider::isCameraEmbedded()) {
   162         // override exit with action that completes the request before exiting
   167         // override exit with action that completes the request before exiting
   163         HbAction* exitAction = new HbAction(Hb::QuitNaviAction, this);
   168         HbAction* exitAction = new HbAction(Hb::QuitNaviAction, this);
   886  * the UI by enabling right icon.
   891  * the UI by enabling right icon.
   887  */
   892  */
   888 void CxuiPrecaptureView::updateLocationIndicator(CxeGeoTaggingTrail::State newState, CxeError::Id error)
   893 void CxuiPrecaptureView::updateLocationIndicator(CxeGeoTaggingTrail::State newState, CxeError::Id error)
   889 {
   894 {
   890     CX_DEBUG( ("CxuiPrecaptureView::updateLocationIndicator <> error: %d ", error));
   895     CX_DEBUG( ("CxuiPrecaptureView::updateLocationIndicator <> error: %d ", error));
   891 
   896     Cxe::GeoTagging currentValue = mEngine->settings().get<Cxe::GeoTagging>(CxeSettingIds::GEOTAGGING);
   892     if (mGeoTaggingIndicatorIcon) {
   897     if(currentValue == Cxe::GeoTaggingOn && mGeoTaggingIndicatorIcon) {
   893         if (newState == CxeGeoTaggingTrail::DataAvailable && error == CxeError::None) {
   898         if (newState == CxeGeoTaggingTrail::DataAvailable && error == CxeError::None) {
   894             CX_DEBUG(("CxuiPrecaptureView::updateLocationIndicator GPS data available, showing icon"));
   899             CX_DEBUG(("CxuiPrecaptureView::updateLocationIndicator GPS data available, showing icon"));
   895             mGeoTaggingIndicatorIcon->setIcon(HbIcon("qtg_mono_geotag"));
       
   896             mGeoTaggingIndicatorIcon->show();
   900             mGeoTaggingIndicatorIcon->show();
       
   901             mGeoTaggingBlinkTimer->stop();
   897         } else {
   902         } else {
   898             CX_DEBUG(("CxuiPrecaptureView::handleIconChanged GPS data not available"));
   903             // blinking geotagging indicator while acquiring GPS data
   899             mGeoTaggingIndicatorIcon->hide();
   904             CX_DEBUG(("CxuiPrecaptureView::updateLocationIndicator waiting for GPS data, blinking icon"));
   900         }
   905             mGeoTaggingBlinkTimer->setInterval(CXUI_GEOTAGGING_BLINK_INTERVAL);
   901     }
   906             mGeoTaggingBlinkTimer->start();
   902 
   907         }
   903     CX_DEBUG_EXIT_FUNCTION();
   908     }
   904 }
   909     else {
   905 
   910         CX_DEBUG(("CxuiPrecaptureView::handleIconChanged GPS data not available"));
       
   911         mGeoTaggingBlinkTimer->stop();
       
   912     }
       
   913 
       
   914     CX_DEBUG_EXIT_FUNCTION();
       
   915 }
       
   916 
       
   917 /*!
       
   918  * Private method for blinking geotagging icon
       
   919  */
       
   920 void CxuiPrecaptureView::blinkGeoTaggingIcon()
       
   921 {
       
   922     if (mGeoTaggingIndicatorIcon) {
       
   923         if (mGeoTaggingIndicatorIcon->isVisible()) {
       
   924             mGeoTaggingIndicatorIcon->setVisible(false);
       
   925         } else {
       
   926             mGeoTaggingIndicatorIcon->setVisible(true);
       
   927         }
       
   928     }
       
   929 }
       
   930 
       
   931 void CxuiPrecaptureView::toolbarExtensionAppearEffectFinished(const HbEffect::EffectStatus &status) {
       
   932 }
   906 
   933 
   907 void CxuiPrecaptureView::toolbarExtensionDisappearEffectFinished(const HbEffect::EffectStatus &status) {
   934 void CxuiPrecaptureView::toolbarExtensionDisappearEffectFinished(const HbEffect::EffectStatus &status) {
   908     if (mSettingsGrid) {
   935     if (mSettingsGrid) {
   909         mSettingsGrid->hide();
   936         mSettingsGrid->hide();
   910     }
   937     }
   911 }
   938 }
   912 
       
   913 void CxuiPrecaptureView::toolbarExtensionAppearEffectFinished(const HbEffect::EffectStatus &status) {
       
   914 }
       
   915 
       
   916 
       
   917 
   939 
   918 /*!
   940 /*!
   919 * Lauches "Geotagging first-time use" notification to the user
   941 * Lauches "Geotagging first-time use" notification to the user
   920 */
   942 */
   921 void CxuiPrecaptureView::launchGeoTaggingDisclaimerDialog()
   943 void CxuiPrecaptureView::launchGeoTaggingDisclaimerDialog()