154 */ |
154 */ |
155 void CxuiStillPrecaptureView::reloadIndicatorWidgets() |
155 void CxuiStillPrecaptureView::reloadIndicatorWidgets() |
156 { |
156 { |
157 CX_DEBUG_ENTER_FUNCTION(); |
157 CX_DEBUG_ENTER_FUNCTION(); |
158 CX_ASSERT_ALWAYS(mDocumentLoader); |
158 CX_ASSERT_ALWAYS(mDocumentLoader); |
|
159 |
|
160 // delete old indicator container and indicators before creating new ones |
|
161 delete mIndicators; |
|
162 mIndicators = NULL; |
159 |
163 |
160 bool ok = false; |
164 bool ok = false; |
161 mDocumentLoader->load(STILL_1ST_XML, STILL_PRE_CAPTURE_INDICATORS_SECTION, &ok); |
165 mDocumentLoader->load(STILL_1ST_XML, STILL_PRE_CAPTURE_INDICATORS_SECTION, &ok); |
162 CX_ASSERT_ALWAYS(ok); |
166 CX_ASSERT_ALWAYS(ok); |
163 |
167 |
222 } |
226 } |
223 } |
227 } |
224 |
228 |
225 // create background for indicator container |
229 // create background for indicator container |
226 createWidgetBackgroundGraphic(mIndicators, TRANSPARENT_BACKGROUND_GRAPHIC); |
230 createWidgetBackgroundGraphic(mIndicators, TRANSPARENT_BACKGROUND_GRAPHIC); |
227 |
231 |
|
232 // Update the icons that are possibly changed during reloading |
|
233 updateQualityIcon(); |
|
234 updateFaceTrackingIcon(); |
|
235 updateGeotaggingIcon(); |
|
236 |
228 mIndicators->setVisible(true); |
237 mIndicators->setVisible(true); |
229 |
238 |
230 CX_DEBUG_EXIT_FUNCTION(); |
239 CX_DEBUG_EXIT_FUNCTION(); |
231 } |
240 } |
232 |
241 |
650 |
659 |
651 |
660 |
652 switch (newstate) { |
661 switch (newstate) { |
653 case CxeAutoFocusControl::Failed: |
662 case CxeAutoFocusControl::Failed: |
654 case CxeAutoFocusControl::Ready: |
663 case CxeAutoFocusControl::Ready: |
|
664 case CxeAutoFocusControl::Unknown: |
655 if (mCapturePending) { |
665 if (mCapturePending) { |
656 // focus and capture were grouped together, capture straight away |
666 // focus and capture were grouped together, capture straight away |
657 capture(); |
|
658 } |
|
659 break; |
|
660 case CxeAutoFocusControl::Unknown: |
|
661 // Capture key was pressed, focus has been cancelled, |
|
662 // continue with capturing. |
|
663 if(mCapturePending) { |
|
664 CX_DEBUG(("mCapturePending is true, starting capture now")); |
667 CX_DEBUG(("mCapturePending is true, starting capture now")); |
|
668 OstTrace0(camerax_performance, CXUISTILLPRECAPTUREVIEW_SHOT_TO_SHOT2, "msg: e_CX_SHOT_TO_SHOT 1"); |
|
669 OstTrace0(camerax_performance, CXUISTILLPRECAPTUREVIEW_SHOT_TO_SNAP2, "msg: e_CX_SHOT_TO_SNAPSHOT 1"); |
|
670 OstTrace0(camerax_performance, CXUISTILLPRECAPTUREVIEW_SHOT_TO_SAVE2, "msg: e_CX_SHOT_TO_SAVE 1"); |
665 capture(); |
671 capture(); |
666 } |
672 } |
667 break; |
673 break; |
668 default: |
674 default: |
669 break; |
675 break; |
773 CxuiPrecaptureView::showEvent(event); |
779 CxuiPrecaptureView::showEvent(event); |
774 |
780 |
775 updateImagesLeftLabel(); |
781 updateImagesLeftLabel(); |
776 updateQualityIcon(); |
782 updateQualityIcon(); |
777 updateFaceTrackingIcon(); |
783 updateFaceTrackingIcon(); |
|
784 updateGeotaggingIcon(); |
|
785 |
778 |
786 |
779 // cancel selftimer when returning to precapture |
787 // cancel selftimer when returning to precapture |
780 // since selftimer needs to be turned off after capturing an image |
788 // since selftimer needs to be turned off after capturing an image |
781 // (with selftimer postcapture is always shown) |
789 // (with selftimer postcapture is always shown) |
782 if (mSelfTimer && mSelfTimer->isEnabled()) { |
790 if (mSelfTimer && mSelfTimer->isEnabled()) { |
922 \param key CxSettingIds key defining the changed setting |
930 \param key CxSettingIds key defining the changed setting |
923 \param newValue QVariant containing the new setting value |
931 \param newValue QVariant containing the new setting value |
924 |
932 |
925 \sa CxuiStillPrecaptureView::handleSceneChanged(CxeScene &scene) |
933 \sa CxuiStillPrecaptureView::handleSceneChanged(CxeScene &scene) |
926 */ |
934 */ |
927 void CxuiStillPrecaptureView::handleSettingValueChanged(const QString& key, QVariant newValue) |
935 void CxuiStillPrecaptureView::handleSettingValueChanged(const QString &key, QVariant newValue) |
928 { |
936 { |
929 CX_DEBUG_ENTER_FUNCTION(); |
937 CX_DEBUG_ENTER_FUNCTION(); |
930 |
938 |
931 if (mEngine->mode() == Cxe::ImageMode) { |
939 if (mEngine->mode() == Cxe::ImageMode) { |
932 |
|
933 // update images left and image quality icons |
940 // update images left and image quality icons |
934 if (key == CxeSettingIds::IMAGE_QUALITY) { |
941 if (key == CxeSettingIds::IMAGE_QUALITY) { |
935 // update the quality indicator on screen |
942 reloadIndicatorWidgets(); |
936 updateQualityIcon(); |
|
937 // update images left when quality values are changed |
943 // update images left when quality values are changed |
938 updateImagesLeftLabel(); |
944 updateImagesLeftLabel(); |
939 } else if (key == CxeSettingIds::FACE_TRACKING) { |
945 } else if (key == CxeSettingIds::FACE_TRACKING || |
940 reloadIndicatorWidgets(); |
946 key == CxeSettingIds::GEOTAGGING) { |
941 updateFaceTrackingIcon(); |
|
942 } else if (key == CxeSettingIds::GEOTAGGING) { |
|
943 reloadIndicatorWidgets(); |
947 reloadIndicatorWidgets(); |
944 } |
948 } |
945 |
949 |
946 // update toolbar flash icon |
950 // update toolbar flash icon |
947 if (mFlashSetting && key == CxeSettingIds::FLASH_MODE) { |
951 if (mFlashSetting && key == CxeSettingIds::FLASH_MODE) { |
1046 } |
1050 } |
1047 |
1051 |
1048 CX_DEBUG_EXIT_FUNCTION(); |
1052 CX_DEBUG_EXIT_FUNCTION(); |
1049 } |
1053 } |
1050 |
1054 |
|
1055 /*! |
|
1056 Update the geotagging icon |
|
1057 */ |
|
1058 void CxuiStillPrecaptureView::updateGeotaggingIcon() |
|
1059 { |
|
1060 CX_DEBUG_ENTER_FUNCTION(); |
|
1061 if (mGeoTaggingIndicatorIcon && mEngine) { |
|
1062 QString key = ""; |
|
1063 QString icon = ""; |
|
1064 |
|
1065 key = CxeSettingIds::GEOTAGGING; |
|
1066 |
|
1067 int currentValue = mEngine->settings().get<int>(key, -1); |
|
1068 icon = getSettingItemIcon(key, currentValue); |
|
1069 |
|
1070 mGeoTaggingIndicatorIcon->setIcon(HbIcon(icon)); |
|
1071 mGeoTaggingIndicatorIcon->setVisible(true); |
|
1072 } |
|
1073 CX_DEBUG_EXIT_FUNCTION(); |
|
1074 } |
|
1075 |
1051 // end of file |
1076 // end of file |