emailuis/nmailui/src/nmapplication.cpp
changeset 51 d845db10c0d4
parent 49 00c7ae862740
child 56 15bc1d5d6267
--- a/emailuis/nmailui/src/nmapplication.cpp	Fri Jul 02 15:55:16 2010 +0300
+++ b/emailuis/nmailui/src/nmapplication.cpp	Fri Jul 09 12:17:13 2010 +0300
@@ -221,6 +221,7 @@
     	NmBaseView *currentView = mViewStack->top();
         if (currentView) {
             currentView->viewReady();
+            emit applicationReady();
         }
     }
 }
@@ -320,6 +321,18 @@
 }
 
 /*!
+     Hide the application
+*/
+void NmApplication::hideApplication()
+{
+    // Hide the application
+    XQServiceUtil::toBackground(true);
+
+    // hide the sync indicator as well
+    mUiEngine->enableSyncIndicator(false);
+}
+
+/*!
     Pop view from view stack. View object is deleted.
 */
 void NmApplication::popView()
@@ -340,6 +353,13 @@
 				}
 	        }
             mBackButtonPressed = false;
+
+            // Move the application to background if closing the message list view
+            if (topViewId == NmUiViewMessageList && mViewStack->size() == 1) {
+                hideApplication();
+                return;
+            }
+
             mViewStack->pop();
             // Call custom exit function.
             view->aboutToExitView();