camerauis/cameraxui/cxui/src/cxuiscenemodeview.cpp
changeset 48 42ba2d16bf40
parent 37 64817133cd1d
child 56 01e205c615b9
equal deleted inserted replaced
37:64817133cd1d 48:42ba2d16bf40
   103     CX_DEBUG_ENTER_FUNCTION();
   103     CX_DEBUG_ENTER_FUNCTION();
   104     CX_DEBUG_ASSERT(mDocumentLoader);
   104     CX_DEBUG_ASSERT(mDocumentLoader);
   105 
   105 
   106     QGraphicsWidget *widget = NULL;
   106     QGraphicsWidget *widget = NULL;
   107 
   107 
   108     widget = mDocumentLoader->findWidget(SCENE_VIEW_CONTAINER);
   108     widget = mDocumentLoader->findWidget(SCENE_MODE_VIEW_CONTAINER);
   109     mScenesContainer = qobject_cast<HbWidget *> (widget);
   109     mScenesContainer = qobject_cast<HbWidget *> (widget);
   110 
   110 
   111     mScenesHeading = qobject_cast<HbLabel *>(
   111     mScenesHeading = qobject_cast<HbLabel *>(
   112         mDocumentLoader->findWidget(SCENE_VIEW_HEADING_WIDGET));
   112         mDocumentLoader->findWidget(SCENE_MODE_VIEW_HEADING_WIDGET));
   113     CX_ASSERT_ALWAYS(mScenesHeading);
   113     CX_ASSERT_ALWAYS(mScenesHeading);
   114 
   114 
   115     //Now let's retreive the pointer to icon widget
   115     //Now let's retreive the pointer to icon widget
   116     widget = mDocumentLoader->findWidget(SCENE_VIEW_BG_IMAGE);
   116     widget = mDocumentLoader->findWidget(SCENE_MODE_VIEW_BG_IMAGE);
   117     mScenesBackground = qobject_cast<HbLabel *> (widget);
   117     mScenesBackground = qobject_cast<HbLabel *> (widget);
   118 
   118 
   119     widget = mDocumentLoader->findWidget(SCENE_VIEW_BG_IMAGE2);
   119     widget = mDocumentLoader->findWidget(SCENE_MODE_VIEW_BG_IMAGE2);
   120     mScenesBackground2 = qobject_cast<HbLabel *> (widget);
   120     mScenesBackground2 = qobject_cast<HbLabel *> (widget);
   121 
   121 
   122     //Assuming that the automatic scene mode is always the default one
   122     //Assuming that the automatic scene mode is always the default one
   123     CX_DEBUG(("CxuiSceneModeView::loadDefaultWidgets -> Now setting default image"));
   123     CX_DEBUG(("CxuiSceneModeView::loadDefaultWidgets -> Now setting default image"));
   124     HbIcon background(CXUI_SCENES_AUTOMATIC_IMAGE);
   124     HbIcon background(CXUI_SCENES_AUTOMATIC_IMAGE);
   125     background.setMirroringMode(HbIcon::LayoutDirection);
   125     background.setMirroringMode(HbIcon::LayoutDirection);
   126     mScenesBackground->setIcon(background);
   126     mScenesBackground->setIcon(background);
   127 
   127 
   128     widget = mDocumentLoader->findWidget(SCENE_VIEW_RADIOBUTTONS);
   128     widget = mDocumentLoader->findWidget(SCENE_MODE_VIEW_RADIOBUTTONS);
   129     mScenesList = qobject_cast<CxuiSettingRadioButtonList *> (widget);
   129     mScenesList = qobject_cast<CxuiSettingRadioButtonList *> (widget);
   130 
   130 
   131     mTransitionAnimation = new QPropertyAnimation(mScenesBackground2, "opacity");
   131     mTransitionAnimation = new QPropertyAnimation(mScenesBackground2, "opacity");
   132     mTransitionAnimation->setDuration(CXUI_SCENES_TRANSITION_TIME);
   132     mTransitionAnimation->setDuration(CXUI_SCENES_TRANSITION_TIME);
   133 
   133 
   169     if (mScenesHeading) {
   169     if (mScenesHeading) {
   170         mScenesHeading->setPlainText(data.mHeading);
   170         mScenesHeading->setPlainText(data.mHeading);
   171     }
   171     }
   172 
   172 
   173     if (mScenesBackground) {
   173     if (mScenesBackground) {
   174         QString sceneId;
   174         QString sceneId = mEngine->settings().get<QString>(data.mSettingId);
   175         mEngine->settings().get(data.mSettingId, sceneId);
       
   176         HbIcon background(backgroundForScene(sceneId));
   175         HbIcon background(backgroundForScene(sceneId));
   177         background.setMirroringMode(HbIcon::LayoutDirection);
   176         background.setMirroringMode(HbIcon::LayoutDirection);
   178         mScenesBackground->setIcon(background);
   177         mScenesBackground->setIcon(background);
   179     } else {
   178     } else {
   180         //First time displaying a list
   179         //First time displaying a list