From c6a8f3f06bb0c6dbc9247637b8a4833e3d0e6032 Mon Sep 17 00:00:00 2001 From: Vinay Sachdeva Date: Thu, 18 Jul 2013 04:44:38 +0530 Subject: [PATCH] Fixed Nabi Issues N_SE-46667,46669,46675,46637,46632,46644,46567 Change-Id: I60d69d66fdce557f35dd6bc9978349f6710961b7 Signed-off-by: Vinay Sachdeva --- inc/IntInternetApp.h | 2 ++ res/screen-size-normal/IDL_ADDRESSBAR.xml | 4 +-- res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml | 7 ++-- src/IntInternetApp.cpp | 44 ++++++++++++++++++----- src/IntMainForm.cpp | 44 ++++++++++++++++++++--- src/IntSharePopup.cpp | 33 ++++++++++++++++- 6 files changed, 115 insertions(+), 19 deletions(-) diff --git a/inc/IntInternetApp.h b/inc/IntInternetApp.h index fba4d0e..440082d 100644 --- a/inc/IntInternetApp.h +++ b/inc/IntInternetApp.h @@ -86,6 +86,8 @@ 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; }; #endif // _INT_INTERNET_APP_H_ diff --git a/res/screen-size-normal/IDL_ADDRESSBAR.xml b/res/screen-size-normal/IDL_ADDRESSBAR.xml index c684fe9..368a48a 100644 --- a/res/screen-size-normal/IDL_ADDRESSBAR.xml +++ b/res/screen-size-normal/IDL_ADDRESSBAR.xml @@ -4,7 +4,7 @@ --> - + @@ -36,7 +36,7 @@ diff --git a/res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml b/res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml index 6c1f6ea..d8f4b59 100644 --- a/res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml +++ b/res/screen-size-normal/IDL_CONFIRMATION_POPUP.xml @@ -3,6 +3,7 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> + @@ -12,16 +13,16 @@ diff --git a/src/IntInternetApp.cpp b/src/IntInternetApp.cpp index be34a5b..f45037b 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) +: __pMultiWindowManager(NULL),__pNewWindowInfo(null),pSceneManagementFrame(null),__value(null) { } @@ -174,6 +174,22 @@ InternetApp::OnAppInitialized(void) return false; } + if (__operationId.CompareTo(L"http://tizen.org/appcontrol/operation/main") == 0) + { + AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_PROVIDER_ID_IMAGE_VIEWER, + APPCONTROL_OPERATION_ID_IMAGE_VIEWER); + if (pAc && __value && __value->GetLength() > 0) + { + AppLog("17jul __value is %S", __value->GetPointer()); + if (pAc->Start(__value, null, null, null) == E_SUCCESS) + { + delete pAc; + } + delete __value; +// return true; + } + } + ArrayList* pArgList = new(std::nothrow) ArrayList(); pArgList->Construct(); pArgList->Add(*__pNewWindowInfo); @@ -232,8 +248,9 @@ InternetApp::OnForeground(void) AppLog("Settingscreenbrightness to %d result %s",sliderValue , GetErrorMessage(r)); - - Form* pCurrentForm = (SceneManager::GetInstance()->GetCurrentScene()->GetForm()); + Form* pCurrentForm = null; + if(SceneManager::GetInstance()->GetCurrentScene() != null) + pCurrentForm = (SceneManager::GetInstance()->GetCurrentScene()->GetForm()); if (pCurrentForm) { pCurrentForm->SendUserEvent(FORE_GROUND_APP_EVENT, NULL); @@ -243,7 +260,9 @@ InternetApp::OnForeground(void) void InternetApp::OnBackground(void) { - Form* pCurrentForm = (SceneManager::GetInstance()->GetCurrentScene()->GetForm()); + Form* pCurrentForm = null; + if(SceneManager::GetInstance()->GetCurrentScene() != null) + pCurrentForm = (SceneManager::GetInstance()->GetCurrentScene()->GetForm()); if(pCurrentForm) { pCurrentForm->SendUserEvent(BACK_GROUND_APP_EVENT, NULL); @@ -293,7 +312,8 @@ void InternetApp::OnAppControlRequestReceived(RequestId reqId, const String &operationId, const String* pUriScheme, const String *pDataType, const IMap *pArgs) { AppLogDebug("ABC::Internet::OnAppControlRequestReceivedN entered %ls",operationId.GetPointer()); - + __operationId.Clear(); + __operationId.Append(operationId); if (operationId.CompareTo(L"http://tizen.org/appcontrol/operation/view") == 0) { String urlData; @@ -372,9 +392,15 @@ InternetApp::OnAppControlRequestReceived(RequestId reqId, const String &operatio { if (pArgs) { - const String* pVal = (String *) pArgs->GetValue(String(L"http://tizen.org/appcontrol/data/notification")); - if (pVal && pVal->GetLength() > 0) + //const String* pVal = (String *) pArgs->GetValue(String(L"http://tizen.org/appcontrol/data/notification")); + __value = new String(*(String *) pArgs->GetValue(String(L"http://tizen.org/appcontrol/data/notification"))); + if (__value && __value->GetLength() > 0) + { + AppLog("17jul rahul __value is %S", __value->GetPointer()); + } + if (__value && __value->GetLength() > 0 && pSceneManagementFrame != null) { + AppLog("17jul OnAppControlRequestReceived notification"); HashMap extraData; extraData.Construct(); String typeKey = APPCONTROL_SELECT_KEY_IMAGE; @@ -385,11 +411,13 @@ InternetApp::OnAppControlRequestReceived(RequestId reqId, const String &operatio APPCONTROL_OPERATION_ID_IMAGE_VIEWER); if (pAc) { - if (pAc->Start(pVal, null, null, null) == E_SUCCESS) + AppLog("17jul __value is %S", __value->GetPointer()); + if (pAc->Start(__value, null, null, null) == E_SUCCESS) { delete pAc; } } + delete __value; } } } diff --git a/src/IntMainForm.cpp b/src/IntMainForm.cpp index 47908fd..1714c95 100644 --- a/src/IntMainForm.cpp +++ b/src/IntMainForm.cpp @@ -742,6 +742,13 @@ MainForm::InitFooter(void) __pReaderBtn->SetShowState(false); // __pFooterPanel->Invalidate(true); + if(__isKeypadOpened == false) + { +// AppLog("asdasdasdasda"); + __pFooterPanel->SetShowState(true); + } + else + __pFooterPanel->SetShowState(false); AppLogDebug("MainForm::InitFooter exit"); return E_SUCCESS; } @@ -888,6 +895,11 @@ MainForm::InitSelectTextContextMenu(Point p, bool pasteOption, bool onlyPasteOpt } else { + if(GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE ) + { + AppLog("asdasdafdsfdgfd"); + p.y = p.y - 500; + } direction = CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD; } __pImageMenu = new (std::nothrow) ContextMenu(); @@ -937,8 +949,14 @@ MainForm::InitSelectTextContextMenuF(FloatPoint p, bool pasteOption, bool onlyPa } else { + if(GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE ) + { + AppLog("asdasdafdsfdgfd"); + p.y = p.y - 50; + } direction = CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD; } + __pImageMenu = new (std::nothrow) ContextMenu(); r = __pImageMenu->Construct(p, CONTEXT_MENU_STYLE_GRID, direction); TryCatch(!IsFailed(r),, "Context image menu creation failed with%s",GetErrorMessage(r)); @@ -2268,6 +2286,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) { return; } + pNewWindowInfo->isJavascriptInitiated = true; result r = E_SUCCESS; SceneManager* pSceneManager = SceneManager::GetInstance(); if (pSceneManager == NULL) @@ -2585,6 +2604,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) void MainForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source) { + AppLog("MainForm::OnFormBackRequested entered"); result r = E_FAILURE; if(__pImageMenu && __pImageMenu->GetShowState() == true) { @@ -2595,7 +2615,7 @@ MainForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source) { __pWebViewer->GoBack(); } - else if(__pWindowInfo->isJavascriptInitiated == false) + else if(__pWindowInfo && __pWindowInfo->isJavascriptInitiated == false) { UiApp* pApp = null; pApp = UiApp::GetInstance(); @@ -2700,7 +2720,7 @@ MainForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source) } else { - if (pSceneManager->GetCurrentSceneId() == pWindowInfo->sceneID && pWindowInfo->isJavascriptInitiated == true) + if (pWindowInfo && pSceneManager->GetCurrentSceneId() == pWindowInfo->sceneID && pWindowInfo->isJavascriptInitiated == true) { r = SceneRegister::DestroyAndUnRegisterScene(pWindowInfo->sceneID); if (IsFailed(r)) @@ -2749,7 +2769,8 @@ MainForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source) } else { - r = pSceneManager->GoBackward(BackwardSceneTransition(pWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE)); + if(pWindowInfo != null) + r = pSceneManager->GoBackward(BackwardSceneTransition(pWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE)); if (IsFailed(r)) { AppLogException("MainForm::OnFormBackRequested failed with %s", GetErrorMessage(r)); @@ -2761,6 +2782,7 @@ MainForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source) } } } + AppLog("MainForm::OnFormBackRequested exit"); } void @@ -2830,12 +2852,15 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, else if(__pWindowInfo->pageUrl.GetLength() > 0 && __pWindowInfo->isAppcontrolTriggered == true) { LoadUrl(__pWindowInfo->pageUrl); + __pWindowInfo->isAppcontrolTriggered = false; } else if (__pWindowInfo->isJavascriptInitiated == true) { AppLog("Called"); InitWebControl(); __pWindowInfo->pCurrentWeb = __pWebViewer; + if(__pWindowInfo->pageUrl.GetLength() > 0) + LoadUrl(__pWindowInfo->pageUrl); } } @@ -3323,7 +3348,7 @@ MainForm::OnLoadingCompleted(void) void MainForm::OnEstimatedProgress(int progress) { - AppLogDebug("MainForm::OnEstimatedProgress entered"); + AppLogDebug("MainForm::OnEstimatedProgress entered %d",progress); if (progress < DEFAULT_PROGRESS_PERCENTAGE) progress = DEFAULT_PROGRESS_PERCENTAGE; @@ -3808,6 +3833,12 @@ void MainForm::OnClipboardClosed(const Addressbar& addBar) { AppLog("XYZ::MainForm::OnClipboardClosed"); + if (__pFooterPanel && __pAddressbar->GetShowState() == false) + { + AppLog("akjshdasd 3"); + __pFooterPanel->SetShowState(true); + } + __isKeypadOpened = false; RelayoutControls(false); } @@ -3820,6 +3851,7 @@ MainForm::OnAddressBarKeypadClosed(const Addressbar& addBar, bool footerState) AppLog("akjshdasd 3"); __pFooterPanel->SetShowState(true); } + __isKeypadOpened = false; RelayoutControls(false,footerState); } @@ -3828,12 +3860,14 @@ void MainForm::OnAddressBarKeypadOpened(const Addressbar& addBar) { AppLog("XYZ::MainForm::OnAddressBarKeypadOpened"); + __isKeypadOpened = true; RelayoutControls(false); } void MainForm::OnAddressBarKeypadWillOpen(const Addressbar& addBar) { + __isKeypadOpened = true; __pFooterPanel->SetShowState(false); } @@ -4080,7 +4114,7 @@ MainForm::OnWebPageBlockSelected(Web& source, FloatPoint& startPoint, FloatPoint __currentSelectedStr = __pWebViewer->GetTextFromBlock(); AppLog("__currentSelectedStr after GetTextFromBlock %ls",__currentSelectedStr.GetPointer()); - if (((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0) /*&& __isLongPressedDone == true*/ && __currentSelectedStr.CompareTo(L"") !=0) + if (((tagName.Equals(L"INPUT",false) == 0) || tagName.Equals(L"TEXTAREA",false) == 0) /*&& __isLongPressedDone == true*/ && __currentSelectedStr.CompareTo(L"") !=0) { AppLog("MainForm::OnWebPageBlockSelected show paste option"); diff --git a/src/IntSharePopup.cpp b/src/IntSharePopup.cpp index ce40286..ce3724b 100644 --- a/src/IntSharePopup.cpp +++ b/src/IntSharePopup.cpp @@ -53,7 +53,6 @@ ShareInfo:: ShareInfo(void) ShareInfo:: ~ShareInfo(void) { - } void @@ -116,6 +115,38 @@ SharePopup::SharePopup(void) SharePopup::~SharePopup(void) { + ShareInfo* pShareInfo = null; + result r = E_FAILURE; + + if (__pShareList != null) + { + pShareInfo = dynamic_cast(__pShareList->GetAt(0)); + } + + String attachVal; + bool imageAttachment = false; + if (pShareInfo != null) + { + imageAttachment = pShareInfo->GetImageAttached(); + if (imageAttachment) + { + attachVal = pShareInfo->GetImagePath(); + AppLog("SharePopup:: imagePath is %S",attachVal.GetPointer()); + r = File::Remove(attachVal); + if(r == E_SUCCESS) + { + AppLog("removed success"); + } + else + { + AppLog("removed failure"); + } + } + if (pShareInfo != null) + { + delete pShareInfo; + } + } } -- 2.7.4