logsui/logsapp/src/logsviewmanager.cpp
changeset 14 f27aebe284bb
parent 11 64a47b97e1e1
child 16 c5af8598d22c
--- a/logsui/logsapp/src/logsviewmanager.cpp	Tue Jul 06 14:16:36 2010 +0300
+++ b/logsui/logsapp/src/logsviewmanager.cpp	Wed Aug 18 09:49:12 2010 +0300
@@ -97,6 +97,8 @@
 void LogsViewManager::changeRecentViewViaService(
     LogsServices::LogsView view, bool showDialpad, QString dialpadText)
 {
+    closeEmbeddedApplication();
+    mMainWindow.bringAppToForeground();
     mComponentsRepository->dialpad()->editor().setText(dialpadText);
     changeRecentView(view, showDialpad);
 }
@@ -108,6 +110,8 @@
 void LogsViewManager::changeMatchesViewViaService(QString dialpadText)
 {
     LOGS_QDEBUG( "logs [UI] -> LogsViewManager::changeMatchesView()" );
+    closeEmbeddedApplication();
+    mMainWindow.bringAppToForeground();
     mComponentsRepository->dialpad()->editor().setText(dialpadText);
     doActivateView(LogsMatchesViewId, true, QVariant());
     LOGS_QDEBUG( "logs [UI] <- LogsViewManager::changeMatchesView()" );
@@ -311,7 +315,6 @@
     }
     
     QVariantHash metaData;
-    
     LOGS_QDEBUG( "logs [UI] Start taking screenshot" );
     QImage* img = new QImage(mMainWindow.rect().size(), QImage::Format_ARGB32_Premultiplied);
     QPainter p( img );
@@ -460,3 +463,16 @@
     }
     return newView;
 }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsViewManager::closeEmbeddedApplication()
+{
+    LOGS_QDEBUG( "logs [UI] -> LogsViewManager::closeEmbeddedApplication()" );
+    if (mViewStack.count()) {
+        mViewStack.at(0)->cancelServiceRequest();
+    }
+    LOGS_QDEBUG( "logs [UI] <- LogsViewManager::closeEmbeddedApplication()" );
+}