camerauis/cameraxui/cxui/src/cxuistillprecaptureview.cpp
changeset 38 0f0b4c1d7744
parent 28 3075d9b614e6
child 39 c5025ea871a1
equal deleted inserted replaced
28:3075d9b614e6 38:0f0b4c1d7744
   238             CX_DEBUG(("EMBEDDED: don't allow camera switching"));
   238             CX_DEBUG(("EMBEDDED: don't allow camera switching"));
   239         }
   239         }
   240 
   240 
   241     }
   241     }
   242 
   242 
   243     // update toolbar flash icon
   243     // Setting widgets loaded here so updating icons works.
       
   244     mWidgetsLoaded = true;
       
   245 
       
   246     // Update toolbar flash mode icon
   244     int flash;
   247     int flash;
   245     if (mEngine->settings().get(CxeSettingIds::FLASH_MODE, flash) == CxeError::None) {
   248     if (mEngine->settings().get(CxeSettingIds::FLASH_MODE, flash) == CxeError::None) {
   246         handleSettingValueChanged(CxeSettingIds::FLASH_MODE, flash);
   249         handleSettingValueChanged(CxeSettingIds::FLASH_MODE, flash);
   247     }
   250     }
   248 
   251 
   249     // update toolbar scene mode
   252     // Update toolbar scene mode icon
   250     QString scene;
   253     QString sceneId;
   251     if (mEngine->settings().get(CxeSettingIds::IMAGE_SCENE, scene) == CxeError::None) {
   254     if (mEngine->settings().get(CxeSettingIds::SCENE_ID, sceneId) == CxeError::None) {
   252         handleSettingValueChanged(CxeSettingIds::IMAGE_SCENE, scene);
   255         updateSceneIcon(sceneId);
   253     }
   256     }
   254 
   257 
   255     hideControls();
   258     hideControls();
   256 
       
   257     mWidgetsLoaded = true;
       
   258 
   259 
   259     OstTrace0( camerax_performance, DUP1_CXUISTILLPRECAPTUREVIEW_LOADWIDGETS, "msg: e_CX_STILLPRECAPTUREVIEW_LOADWIDGETS 0" );
   260     OstTrace0( camerax_performance, DUP1_CXUISTILLPRECAPTUREVIEW_LOADWIDGETS, "msg: e_CX_STILLPRECAPTUREVIEW_LOADWIDGETS 0" );
   260     CX_DEBUG_EXIT_FUNCTION();
   261     CX_DEBUG_EXIT_FUNCTION();
   261 }
   262 }
   262 
   263 
   269         HbAction* action(NULL);
   270         HbAction* action(NULL);
   270 
   271 
   271         // Initialize settings grid
   272         // Initialize settings grid
   272         mSettingsGrid = new HbToolBarExtension;
   273         mSettingsGrid = new HbToolBarExtension;
   273 
   274 
   274         action = mSettingsGrid->addAction(HbIcon("qtg_mono_exposure.svg"), hbTrId("txt_cam_button_exposure_compensation"), this, SLOT(launchSliderSetting()));
   275         action = mSettingsGrid->addAction(HbIcon("qtg_mono_exposure"), hbTrId("txt_cam_button_exposure_compensation"), this, SLOT(launchSliderSetting()));
   275         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::EV_COMPENSATION_VALUE);
   276         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::EV_COMPENSATION_VALUE);
   276         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   277         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   277 
   278 
   278         action = mSettingsGrid->addAction(HbIcon("qtg_mono_iso.svg"), hbTrId("txt_cam_button_iso"), this, SLOT(launchSetting()));
   279         action = mSettingsGrid->addAction(HbIcon("qtg_mono_iso"), hbTrId("txt_cam_button_iso"), this, SLOT(launchSetting()));
   279         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::LIGHT_SENSITIVITY);
   280         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::LIGHT_SENSITIVITY);
   280         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   281         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   281 
   282 
   282         action = mSettingsGrid->addAction(HbIcon("qtg_small_rgb.svg"), hbTrId("txt_cam_button_color_tone"), this, SLOT(launchSetting()));
   283         action = mSettingsGrid->addAction(HbIcon("qtg_small_rgb"), hbTrId("txt_cam_button_color_tone"), this, SLOT(launchSetting()));
   283         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::COLOR_TONE);
   284         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::COLOR_TONE);
   284         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   285         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   285 
   286 
   286         action = mSettingsGrid->addAction(HbIcon("qtg_mono_white_balance.svg"), hbTrId("txt_cam_button_white_balance"), this, SLOT(launchSetting()));
   287         action = mSettingsGrid->addAction(HbIcon("qtg_mono_white_balance"), hbTrId("txt_cam_button_white_balance"), this, SLOT(launchSetting()));
   287         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::WHITE_BALANCE);
   288         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::WHITE_BALANCE);
   288         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   289         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   289 
   290 
   290         action = mSettingsGrid->addAction(HbIcon("qtg_mono_sharpness.svg"), hbTrId("txt_cam_grid_sharpness"), this, SLOT(launchSliderSetting()));
   291         action = mSettingsGrid->addAction(HbIcon("qtg_mono_sharpness"), hbTrId("txt_cam_grid_sharpness"), this, SLOT(launchSliderSetting()));
   291         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::SHARPNESS);
   292         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::SHARPNESS);
   292         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   293         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   293 
   294 
   294         action = mSettingsGrid->addAction(HbIcon("qtg_mono_contrast.svg"), hbTrId("txt_cam_button_contrast"), this, SLOT(launchSliderSetting()));
   295         action = mSettingsGrid->addAction(HbIcon("qtg_mono_contrast"), hbTrId("txt_cam_button_contrast"), this, SLOT(launchSliderSetting()));
   295         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::CONTRAST);
   296         action->setProperty(PROPERTY_KEY_SETTING_ID, CxeSettingIds::CONTRAST);
   296         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   297         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   297 
   298 
   298         mSettingsGrid->addAction(HbIcon("qtg_mono_face_tracking.svg"), hbTrId("txt_cam_button_face_tracking"), this, SLOT(launchNotSupportedNotification()));
   299         mSettingsGrid->addAction(HbIcon("qtg_mono_face_tracking"), hbTrId("txt_cam_button_face_tracking"), this, SLOT(launchNotSupportedNotification()));
   299         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   300         action->setProperty(PROPERTY_KEY_SETTING_GRID, PROPERTY_KEY_TRUE);
   300 
   301 
   301         connect(mKeyHandler, SIGNAL(autofocusKeyPressed()), mSettingsGrid, SLOT(close()));
   302         connect(mKeyHandler, SIGNAL(autofocusKeyPressed()), mSettingsGrid, SLOT(close()));
   302     }
   303     }
   303 }
   304 }
   698 {
   699 {
   699     CX_DEBUG_ENTER_FUNCTION();
   700     CX_DEBUG_ENTER_FUNCTION();
   700     if (mEngine->mode() == Cxe::ImageMode) {
   701     if (mEngine->mode() == Cxe::ImageMode) {
   701 
   702 
   702         // update toolbar scene mode icon
   703         // update toolbar scene mode icon
   703         QString icon = getSettingItemIcon(CxeSettingIds::IMAGE_SCENE, scene[CxeSettingIds::SCENE_ID]);
   704         updateSceneIcon(scene[CxeSettingIds::SCENE_ID].toString());
   704         CX_DEBUG((("New scene mode icon: %s"), icon.toAscii().constData()));
       
   705         if (mDocumentLoader) {
       
   706             QObject *obj = mDocumentLoader->findObject(STILL_PRE_CAPTURE_SCENE_MODE_ACTION);
       
   707             CX_DEBUG_ASSERT(obj);
       
   708             qobject_cast<HbAction *>(obj)->setIcon(HbIcon(icon));
       
   709         }
       
   710 
   705 
   711         // for now, we are only interested in flashmode change
   706         // for now, we are only interested in flashmode change
   712         if (scene.contains(CxeSettingIds::FLASH_MODE)) {
   707         if (scene.contains(CxeSettingIds::FLASH_MODE)) {
   713             CX_DEBUG(("updating flash to: %d", scene[CxeSettingIds::FLASH_MODE].value<int>()));
   708             CX_DEBUG(("updating flash to: %d", scene[CxeSettingIds::FLASH_MODE].value<int>()));
   714             handleSettingValueChanged(CxeSettingIds::FLASH_MODE, scene[CxeSettingIds::FLASH_MODE]);
   709             handleSettingValueChanged(CxeSettingIds::FLASH_MODE, scene[CxeSettingIds::FLASH_MODE]);