camerauis/cameraxui/cxui/src/cxuiviewmanager.cpp
changeset 56 01e205c615b9
parent 48 42ba2d16bf40
child 63 415ff50d2eca
--- a/camerauis/cameraxui/cxui/src/cxuiviewmanager.cpp	Wed Aug 18 09:37:18 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiviewmanager.cpp	Thu Sep 02 20:14:28 2010 +0300
@@ -169,9 +169,16 @@
 
     switch (newState) {
     case CxuiApplicationState::Normal:
-        // Disable raising to foreground with capture key.
-        disconnect(mKeyHandler, SIGNAL(captureKeyPressed()), this, SLOT(toForeground()));
-
+        // If camera is in embedded mode, we need to start
+        // listening to key events again
+        if (CxuiServiceProvider::isCameraEmbedded()){
+            mKeyHandler->startListeningKeys();
+        } else {
+            // If in standalone mode, we disable raising to
+            // foreground with capture key.
+            disconnect(mKeyHandler, SIGNAL(captureKeyPressed()),
+                       this, SLOT(toForeground()));
+        }
         connectSignals(view);
 
         CX_DEBUG(("CxuiViewManager - emitting normalStateEntered"));
@@ -193,8 +200,16 @@
 
         if (newState == CxuiApplicationState::Background) {
             // Moved to background.
-            // Bring application back to foreground by capture key press
-            connect(mKeyHandler, SIGNAL(captureKeyPressed()), this, SLOT(toForeground()));
+            // If we're in embedded mode, we should stop listening to camera key
+            // events
+            if (CxuiServiceProvider::isCameraEmbedded()){
+                mKeyHandler->stopListeningKeys();
+            } else {
+                // If not in embedded mode, then we bring application back to
+                // foreground by capture key press
+                connect(mKeyHandler, SIGNAL(captureKeyPressed()),
+                        this, SLOT(toForeground()));
+            }
         }
         break;
     }