From 539358e74c2edd7b9e97883b9dee1adb56b0b36d Mon Sep 17 00:00:00 2001 From: Himanshu Date: Tue, 13 Aug 2013 12:07:33 +0530 Subject: [PATCH] Fixed issue 48595 Change-Id: I3218b3ba077f55bcac7b8c6cac259f5fb4a7b672 Signed-off-by: Himanshu --- inc/IntInternetApp.h | 3 +++ src/IntInternetApp.cpp | 47 +++++++++++++++++++++++++++++++++++++---------- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/inc/IntInternetApp.h b/inc/IntInternetApp.h index 440082d..12cd572 100644 --- a/inc/IntInternetApp.h +++ b/inc/IntInternetApp.h @@ -82,12 +82,15 @@ public: void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String &operationId, const Tizen::Base::String *pDataType, const Tizen::Base::String *pUriScheme, const Tizen::Base::Collection::IMap *pArgs); long long GetAvailableMemory(void); + + virtual void OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs); private: MultipleWindowPresentationModel* __pMultiWindowManager; WindowInfo* __pNewWindowInfo;//the new window object to be created either by the normal launch of application or as an appcontrol launch MainFrame* pSceneManagementFrame; Tizen::Base::String __operationId; const Tizen::Base::String* __value; + bool __isShowMsg; }; #endif // _INT_INTERNET_APP_H_ diff --git a/src/IntInternetApp.cpp b/src/IntInternetApp.cpp index 4121f6d..43929d5 100644 --- a/src/IntInternetApp.cpp +++ b/src/IntInternetApp.cpp @@ -47,7 +47,7 @@ static const wchar_t* APPCONTROL_OPERATION_ID_IMAGE_VIEWER = L"http://tizen.org/ const int MIN_MEMORY_NEEDED = 1048576; InternetApp::InternetApp(void) -: __pMultiWindowManager(NULL),__pNewWindowInfo(null),pSceneManagementFrame(null),__value(null) +: __pMultiWindowManager(NULL),__pNewWindowInfo(null),pSceneManagementFrame(null),__value(null),__isShowMsg(false) { } @@ -264,7 +264,11 @@ InternetApp::OnForeground(void) pCurrentForm->SendUserEvent(FORE_GROUND_APP_EVENT, NULL); } - + if ( __isShowMsg == true ) + { + __isShowMsg = false; + SendUserEvent(FORE_GROUND_APP_EVENT, NULL); + } } void @@ -329,6 +333,8 @@ InternetApp::OnAppControlRequestReceived(RequestId reqId, const String &operatio } + __isShowMsg = false; + AppLogDebug("ABC::Internet::OnAppControlRequestReceivedN entered %ls",operationId.GetPointer()); __operationId.Clear(); __operationId.Append(operationId); @@ -365,20 +371,21 @@ InternetApp::OnAppControlRequestReceived(RequestId reqId, const String &operatio if(pSceneManagementFrame) pSceneManagementFrame->Show(); - if (__pNewWindowInfo == null) - { - __pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(urlData, true); - } + if (__pNewWindowInfo == null) { if (MultipleWindowPresentationModel::GetInstance()->GetAllWindowArrayList()->GetCount() >= 9) { - String strTitle = L"";//CommonUtil::GetString(L"IDS_COM_SK_MAX_LIMIT_REACHED"); - String strText = CommonUtil::GetString(L"IDS_BR_BODY_COULD_NOT_OPEN_NEW_WINDOW_BECAUSE_YOU_HAVE_ALREADY_OPENED_MAXIMUM_NUMBER"); - ShowPopup(strTitle, strText); + __isShowMsg = true; + return; } - return; } + + if (__pNewWindowInfo == null) + { + __pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(urlData, true); + } + if (__pMultiWindowManager != null && __pMultiWindowManager->GetAllWindowArrayList()->GetCount() != 0) { //if the application is running in background and it receives an appcontrol request it will launch a new(std::nothrow) window here, @@ -466,3 +473,23 @@ InternetApp::GetAvailableMemory(void) return 0; } + +void +InternetApp::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs) +{ + + if(requestId == FORE_GROUND_APP_EVENT) + { + if( MultipleWindowPresentationModel::GetInstance()->GetAllWindowArrayList()->GetCount() >= 9) + { + String strText = CommonUtil::GetString(L"IDS_BR_BODY_COULD_NOT_OPEN_NEW_WINDOW_BECAUSE_YOU_HAVE_ALREADY_OPENED_MAXIMUM_NUMBER"); + MessageBox messageBox; + messageBox.Construct(L"", strText, MSGBOX_STYLE_OK, 3000); + int modalResult = 0; + + messageBox.ShowAndWait(modalResult); + } + } +} + + -- 2.7.4