From 98a9aded696a2e420c2cc2829c49ef3154ccd26a Mon Sep 17 00:00:00 2001 From: Amith Kumar Mahale Date: Wed, 24 Apr 2013 12:41:26 +0530 Subject: [PATCH] Fix forN_SE-36058 Change-Id: I52c4420cc5b23de024b95df569a5bbaaed2675a5 Signed-off-by: Amith Kumar Mahale --- inc/CallButtonsPanel.h | 6 ++++-- inc/CallEndCallForm.h | 9 ++++----- src/CallButtonsPanel.cpp | 37 ++++++++++++++++++++----------------- src/CallEndCallForm.cpp | 42 ++++++++++++++++++++++++++++-------------- 4 files changed, 56 insertions(+), 38 deletions(-) diff --git a/inc/CallButtonsPanel.h b/inc/CallButtonsPanel.h index 96ed0e5..dd5e11d 100644 --- a/inc/CallButtonsPanel.h +++ b/inc/CallButtonsPanel.h @@ -80,8 +80,10 @@ public: void EnableAddCallButton(bool enable); //Used to enable or disable "Join Call" Button void EnableJoinCallButton(bool enable); - // Used to set the contact is present or not - void SetViewContactButtonStatus(bool isContactPresent); + // Used to set the ViewContact is present or not + void ShowViewContactButton(void); + // Used to set the AddToContact is present or not + void ShowAddContactButton(void); //set the buttons in the panel as the top controls. Chk if its needed in RC2 void SetButtonPosition(void); diff --git a/inc/CallEndCallForm.h b/inc/CallEndCallForm.h index 65cbfe0..ade6b2c 100644 --- a/inc/CallEndCallForm.h +++ b/inc/CallEndCallForm.h @@ -82,10 +82,10 @@ public: * @see Tizen::App::AppControl */ virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData); - //Used to set the contact button state in the end call form - void SetContactButtonState(bool showState); - //To check if contact is present in Address bool - bool IsContactPresent(void); + //Used to set the Viewcontact button state in the end call form + void ShowViewContactButton(void); + //Used to set the Viewcontact button state in the end call form + void ShowAddContactButton(void); //Called when App comes to foreground virtual void OnForeground(void); //Called when App goes to background @@ -122,7 +122,6 @@ private: Tizen::Ui::Controls::Label* __pSmallPhotoLabel; bool __isMsgAppControlLaunched; bool __isContactAppControlLaunched; - bool __isContactPresent; }; #endif // _PHN_END_CALL_FORM_H_ diff --git a/src/CallButtonsPanel.cpp b/src/CallButtonsPanel.cpp index ac0f60d..07b2213 100644 --- a/src/CallButtonsPanel.cpp +++ b/src/CallButtonsPanel.cpp @@ -315,33 +315,31 @@ CallButtonsPanel::ConstructEndCallPanel(void) AddKeyPadActionListener(IDC_ADD_TO_CONTACT_BUTTON,IDA_ADD_TO_CONTACTS); } //set initial show state to false. Correct state set on OnSceneActivatedN - SetViewContactButtonStatus(false); + SetEndCallPanelState(false); return r; } void -CallButtonsPanel::SetViewContactButtonStatus(bool isAddToContactPresent) +CallButtonsPanel::ShowViewContactButton(void) { - //Present show View Contact else show Add to contact - if(isAddToContactPresent == false) - { - SetViewContacBitmapToButton(IDC_ADD_TO_CONTACT_BUTTON,AppUtility::GetResourceString(IDS_VIEW_CONTACT), - IDB_VIEW_CONTACT_BG_ICON,IDB_VIEW_CONTACT_ICON,BTN_NORMAL); + SetViewContacBitmapToButton(IDC_ADD_TO_CONTACT_BUTTON,AppUtility::GetResourceString(IDS_VIEW_CONTACT), + IDB_VIEW_CONTACT_BG_ICON,IDB_VIEW_CONTACT_ICON,BTN_NORMAL); - SetViewContacBitmapToButton(IDC_ADD_TO_CONTACT_BUTTON,AppUtility::GetResourceString(IDS_VIEW_CONTACT), - IDB_VIEW_CONTACT_BG_PRESS_ICON,IDB_VIEW_CONTACT_PRESS_ICON,BTN_PRESS); - } - else - { - SetViewContacBitmapToButton(IDC_ADD_TO_CONTACT_BUTTON,AppUtility::GetResourceString(IDS_ADD_TO_CONTACTS), - IDB_VIEW_CONTACT_BG_ICON,IDB_VIEW_CONTACT_ICON,BTN_NORMAL); + SetViewContacBitmapToButton(IDC_ADD_TO_CONTACT_BUTTON,AppUtility::GetResourceString(IDS_VIEW_CONTACT), + IDB_VIEW_CONTACT_BG_PRESS_ICON,IDB_VIEW_CONTACT_PRESS_ICON,BTN_PRESS); +} - SetViewContacBitmapToButton(IDC_ADD_TO_CONTACT_BUTTON,AppUtility::GetResourceString(IDS_ADD_TO_CONTACTS), - IDB_VIEW_CONTACT_BG_PRESS_ICON,IDB_VIEW_CONTACT_PRESS_ICON,BTN_PRESS); - } +void +CallButtonsPanel::ShowAddContactButton(void) +{ + //Present show View Contact else show Add to contact + SetViewContacBitmapToButton(IDC_ADD_TO_CONTACT_BUTTON, AppUtility::GetResourceString(IDS_ADD_TO_CONTACTS), + IDB_VIEW_CONTACT_BG_ICON, IDB_VIEW_CONTACT_ICON, BTN_NORMAL); + SetViewContacBitmapToButton(IDC_ADD_TO_CONTACT_BUTTON, AppUtility::GetResourceString(IDS_ADD_TO_CONTACTS), + IDB_VIEW_CONTACT_BG_PRESS_ICON, IDB_VIEW_CONTACT_PRESS_ICON, BTN_PRESS); } result @@ -637,6 +635,11 @@ CallButtonsPanel::SetEndCallPanelState(bool isEnabled) //Message pButton = static_cast(GetControl(IDC_MSG_BUTTON)); pButton->SetEnabled(isEnabled); + + //AddToContact or Viewcontact button + pButton = static_cast(GetControl(IDC_ADD_TO_CONTACT_BUTTON)); + pButton->SetShowState(isEnabled); + /*pButton->Invalidate(true);*/ } void diff --git a/src/CallEndCallForm.cpp b/src/CallEndCallForm.cpp index 9ce5742..8809220 100644 --- a/src/CallEndCallForm.cpp +++ b/src/CallEndCallForm.cpp @@ -64,7 +64,6 @@ EndCallForm::EndCallForm(void) __pSmallPhotoLabel = null; __isMsgAppControlLaunched = false; __isContactAppControlLaunched = false; - __isContactPresent = false; } EndCallForm::~EndCallForm(void) @@ -301,24 +300,26 @@ EndCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& cu ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,pEndCall); //If call is hidden means contact number is empty, //or if call is from known number(i.e present in contacts db), Then do NOT show "Add to Contact" button. - if (pEndCall->GetContactInfo() != null || pEndCall->GetContactNumber().IsEmpty() == true) + if (pEndCall->GetContactInfo() != null) { + //Check if contact is deleted in mean time. Contact* pContact = __pCallPresentor->GetContactN(pEndCall->GetContactNumber()); //before setting check if the contact is deleted if(pContact != null) { - SetContactButtonState(false); + ShowViewContactButton(); delete pContact; pContact = null; } else { - SetContactButtonState(true); + ShowAddContactButton(); } } else { - SetContactButtonState(true); + //Show AddToContact + ShowAddContactButton(); } //Check if call is Emergency call or Hidden call, @@ -381,19 +382,17 @@ EndCallForm::OnDraw(void) } void -EndCallForm::SetContactButtonState(bool showState) +EndCallForm::ShowViewContactButton(void) { - __pCallButtonsPanel->SetViewContactButtonStatus(showState); - __isContactPresent = !showState; + __pCallButtonsPanel->ShowViewContactButton(); } -bool -EndCallForm::IsContactPresent(void) +void +EndCallForm::ShowAddContactButton(void) { - return __isContactPresent; + __pCallButtonsPanel->ShowAddContactButton(); } - void EndCallForm::ShowPhoneNumber(const String& phoneNumber, const String& lblName) { @@ -545,6 +544,12 @@ EndCallForm::OnAppControlCompleteResponseReceived(const AppId& appId, const Stri __isMsgAppControlLaunched = false; __pCallPresentor->AppControlRequestCompleted(); } + if(__isContactAppControlLaunched == true) + { + //notify app control completed + __isContactAppControlLaunched = false; + __pCallPresentor->AppControlRequestCompleted(); + } //AppControl completed, goto initial scene if present //else exit. HandleLastCallCompletion(); @@ -571,18 +576,27 @@ EndCallForm::OnForeground(void) } if (__pContactNumber != null && __pContactNumber->IsEmpty() == false) { + AppCallInfo* ActiveCallInfo = new (std::nothrow) AppCallInfo(); + ActiveCallInfo->SetContactNumber(*__pContactNumber); Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber); + if (pContact != null) + { + ActiveCallInfo->SetContactInfo(*pContact); + } //before setting check if the contact is deleted if(pContact != null) { - SetContactButtonState(false); + + ShowViewContactButton(); delete pContact; pContact = null; } else { - SetContactButtonState(true); + ShowAddContactButton(); } + ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,ActiveCallInfo); + delete ActiveCallInfo; } //notify app control completed -- 2.7.4