camerauis/cameraxui/cxui/src/cxuiviewmanager.cpp
changeset 52 7e18d488ac5f
parent 46 c826656d6714
child 58 ddba9caa7f32
equal deleted inserted replaced
46:c826656d6714 52:7e18d488ac5f
   167     CxuiView *view = currentView();
   167     CxuiView *view = currentView();
   168     CX_DEBUG(("CxuiViewManager - current view %d", view));
   168     CX_DEBUG(("CxuiViewManager - current view %d", view));
   169 
   169 
   170     switch (newState) {
   170     switch (newState) {
   171     case CxuiApplicationState::Normal:
   171     case CxuiApplicationState::Normal:
   172         // Disable raising to foreground with capture key.
   172         // If camera is in embedded mode, we need to start
   173         disconnect(mKeyHandler, SIGNAL(captureKeyPressed()), this, SLOT(toForeground()));
   173         // listening to key events again
   174 
   174         if (CxuiServiceProvider::isCameraEmbedded()){
       
   175             mKeyHandler->startListeningKeys();
       
   176         } else {
       
   177             // If in standalone mode, we disable raising to
       
   178             // foreground with capture key.
       
   179             disconnect(mKeyHandler, SIGNAL(captureKeyPressed()),
       
   180                        this, SLOT(toForeground()));
       
   181         }
   175         connectSignals(view);
   182         connectSignals(view);
   176 
   183 
   177         CX_DEBUG(("CxuiViewManager - emitting normalStateEntered"));
   184         CX_DEBUG(("CxuiViewManager - emitting normalStateEntered"));
   178         emit normalStateEntered();
   185         emit normalStateEntered();
   179         break;
   186         break;
   191     case CxuiApplicationState::Background:
   198     case CxuiApplicationState::Background:
   192         handleExitingNormalState();
   199         handleExitingNormalState();
   193 
   200 
   194         if (newState == CxuiApplicationState::Background) {
   201         if (newState == CxuiApplicationState::Background) {
   195             // Moved to background.
   202             // Moved to background.
   196             // Bring application back to foreground by capture key press
   203             // If we're in embedded mode, we should stop listening to camera key
   197             connect(mKeyHandler, SIGNAL(captureKeyPressed()), this, SLOT(toForeground()));
   204             // events
       
   205             if (CxuiServiceProvider::isCameraEmbedded()){
       
   206                 mKeyHandler->stopListeningKeys();
       
   207             } else {
       
   208                 // If not in embedded mode, then we bring application back to
       
   209                 // foreground by capture key press
       
   210                 connect(mKeyHandler, SIGNAL(captureKeyPressed()),
       
   211                         this, SLOT(toForeground()));
       
   212             }
   198         }
   213         }
   199         break;
   214         break;
   200     }
   215     }
   201 
   216 
   202     CX_DEBUG_EXIT_FUNCTION();
   217     CX_DEBUG_EXIT_FUNCTION();