From 1d80745dd5669bfbc105f2535a315ccddf5a45ca Mon Sep 17 00:00:00 2001 From: HyukSoon Choi Date: Thu, 4 Apr 2013 15:30:26 +0900 Subject: [PATCH] Fix set as caller image Change-Id: I936eabe5ae8c96d7fa77c3dba2d6c08b9f63d727 Signed-off-by: HyukSoon Choi --- inc/IvTypes.h | 2 +- src/IvImageViewerForm.cpp | 34 ++++++++++++++++++++++------------ src/IvTypes.cpp | 2 +- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/inc/IvTypes.h b/inc/IvTypes.h index 396a646..1ced67c 100644 --- a/inc/IvTypes.h +++ b/inc/IvTypes.h @@ -95,7 +95,7 @@ extern const wchar_t* APPCONTROL_PROVIDER_ID_CONTACTS; extern const wchar_t* APPCONTROL_PROVIDER_ID_VIDEO_PLAYER; extern const wchar_t* APPCONTROL_PROVIDER_ID_GALLERY; -extern const wchar_t* APPCONTROL_OPERATION_ID_PICK; +extern const wchar_t* APPCONTROL_OPERATION_ID_SOCIAL_PICK; extern const wchar_t* APPCONTROL_OPERATION_ID_VIEW; extern const wchar_t* APPCONTROL_OPERATION_ID_COMPOSE; extern const wchar_t* APPCONTROL_OPERATION_ID_MAIN; diff --git a/src/IvImageViewerForm.cpp b/src/IvImageViewerForm.cpp index 19d2589..8543c1a 100644 --- a/src/IvImageViewerForm.cpp +++ b/src/IvImageViewerForm.cpp @@ -809,7 +809,8 @@ ImageViewerForm::InitializeContextMenuSetAs(void) ACTION_ID_CONTEXTMENU_HOME); __pContextMenuSetAs->AddItem(ResourceManager::GetString(L"IDS_IV_HEADER_LOCK_SCREEN_WALLPAPER_ABB"), ACTION_ID_CONTEXTMENU_LOCK); - __pContextMenuSetAs->AddItem(L"Home and lock screens", ACTION_ID_CONTEXTMENU_HOME_AND_LOCK); + __pContextMenuSetAs->AddItem(ResourceManager::GetString(L"IDS_IV_POP_SET_WALLPAPER_FOR_HOME_SCREEN_AND_LOCK_SCREEN"), + ACTION_ID_CONTEXTMENU_HOME_AND_LOCK); __pContextMenuSetAs->AddItem(ResourceManager::GetString(L"IDS_IV_BODY_CALLER_IMAGE"), ACTION_ID_CONTEXTMENU_CALLER); __pContextMenuSetAs->AddActionEventListener(*this); @@ -1501,7 +1502,7 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) new (std::nothrow) String(APPCONTROL_DATA_ITEM_ID)); __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_CONTACTS, - APPCONTROL_OPERATION_ID_PICK, null, null, pDataList, this); + APPCONTROL_OPERATION_ID_SOCIAL_PICK, null, null, pDataList, this); break; } @@ -1680,23 +1681,32 @@ ImageViewerForm::OnAppControlCompleteResponseReceived(const AppId& appId, AppLogDebug("ENTER"); if (appId == APPCONTROL_PROVIDER_ID_CONTACTS - && operationId == APPCONTROL_OPERATION_ID_PICK + && operationId == APPCONTROL_OPERATION_ID_SOCIAL_PICK && appControlResult == APP_CTRL_RESULT_SUCCEEDED) { - const String* pContactId = - static_cast(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID))); - SceneManager* pSceneManager = SceneManager::GetInstance(); + const ArrayList* pResultList = + static_cast(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID))); + const String* pContactId = null; + + if (pResultList != null) + { + pContactId = static_cast(pResultList->GetAt(0)); + } + long long lresult = 0; if (pContactId != null && pContactId->GetLength() > 0) { LongLong::Parse(*pContactId, lresult); + + ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter); + pList->Add(new (std::nothrow) Integer(__pGallery->GetCurrentItemIndex())); + pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_CALLER_IMAGE)); + pList->Add(new (std::nothrow) LongLong(lresult)); + __pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex()); + + SceneManager* pSceneManager = SceneManager::GetInstance(); + pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_SETTER), pList); } - ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter); - pList->Add(new (std::nothrow) Integer(__pGallery->GetCurrentItemIndex())); - pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_CALLER_IMAGE)); - pList->Add(new (std::nothrow) LongLong(lresult)); - __pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex()); - pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_SETTER), pList); } ImageViewerApp* pImageViewerApp = static_cast(ImageViewerApp::GetInstance()); diff --git a/src/IvTypes.cpp b/src/IvTypes.cpp index d125d33..40e650d 100644 --- a/src/IvTypes.cpp +++ b/src/IvTypes.cpp @@ -44,7 +44,7 @@ const wchar_t* APPCONTROL_PROVIDER_ID_CONTACTS = L"tizen.contacts"; const wchar_t* APPCONTROL_PROVIDER_ID_VIDEO_PLAYER = L"tizen.videoplayer"; const wchar_t* APPCONTROL_PROVIDER_ID_GALLERY = L"tizen.gallery"; -const wchar_t* APPCONTROL_OPERATION_ID_PICK = L"http://tizen.org/appcontrol/operation/pick"; +const wchar_t* APPCONTROL_OPERATION_ID_SOCIAL_PICK = L"http://tizen.org/appcontrol/operation/social/pick"; const wchar_t* APPCONTROL_OPERATION_ID_VIEW = L"http://tizen.org/appcontrol/operation/view"; const wchar_t* APPCONTROL_OPERATION_ID_COMPOSE = L"http://tizen.org/appcontrol/operation/compose"; const wchar_t* APPCONTROL_OPERATION_ID_MAIN = L"http://tizen.org/appcontrol/operation/main"; -- 2.7.4