Crash fix on receiving second call , Group ringtone playing
[apps/osp/Call.git] / src / CallIncomingCallForm.cpp
index 887aeca..fa067b7 100644 (file)
@@ -218,17 +218,6 @@ IncomingCallForm::OnInitializing(void)
        }
        HideRejectPanel();
 
-       Button* pButtonRejectMessage = static_cast<Button*>(GetControl(IDC_REJECT_MESSAGE_BUTTON));
-       if (pButtonRejectMessage)
-       {
-               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
-                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, false);
-               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
-                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, true);
-               pButtonRejectMessage->SetActionId(IDA_SHOW_REJECT_CALL_MESSAGE_PANEL);
-               pButtonRejectMessage->AddActionEventListener(*this);
-       }
-
        //Get Reject list from Settings Manager
        IMapT<int,String>* pMsgMap = SettingsManager::GetInstance()->GetRejectMessageListN();
        if(pMsgMap != null)
@@ -826,7 +815,16 @@ IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId,        const SceneI
        }
        CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
        pCallApp->SetTopMostWindow(true);
-
+       Button* pButtonRejectMessage = static_cast<Button*>(GetControl(IDC_REJECT_MESSAGE_BUTTON));
+       if (pButtonRejectMessage)
+       {
+               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
+                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, false);
+               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
+                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, true);
+               pButtonRejectMessage->SetActionId(IDA_SHOW_REJECT_CALL_MESSAGE_PANEL);
+               pButtonRejectMessage->AddActionEventListener(*this);
+       }
 
 }
 
@@ -1324,12 +1322,12 @@ IncomingCallForm::OnTouchReleased(const Control& source, const Point& currentPos
                        if(__pRejectFinalVisElem == null)
                        {
                                __pRejectFinalVisElem = new (std::nothrow) VisualElement();
+                               __pRejectFinalVisElem->Construct();
+                               __pRejectFinalVisElem->SetName(IDI_REJECT_FINAL_VISUAL_ELE_NAME);
                        }
-                       __pRejectFinalVisElem->Construct();
                        __pRejectFinalVisElem->SetBounds(FloatRectangle(0, 0, W_DIAL_LABEL, H_DIAL_LABEL));
                        __pRejectFinalVisElem->SetShowState(true);
                        __pRejectFinalVisElem->SetOpacity(1.00f);
-                       __pRejectFinalVisElem->SetName(IDI_REJECT_FINAL_VISUAL_ELE_NAME);
                        if(__pRejectLabel->GetVisualElement()->GetChild(IDI_REJECT_FINAL_VISUAL_ELE_NAME,true) == null)
                        {
                                AppLogDebug("AttachChild __pRejectFinalVisElem");
@@ -1399,12 +1397,13 @@ IncomingCallForm::OnTouchReleased(const Control& source, const Point& currentPos
                        if(__pAcceptFinalVisElem == null)
                        {
                                __pAcceptFinalVisElem = new (std::nothrow) VisualElement();
+                               __pAcceptFinalVisElem->Construct();
+                               __pAcceptFinalVisElem->SetName(IDI_ACCEPT_FINAL_VISUAL_ELE_NAME);
                        }
-                       __pAcceptFinalVisElem->Construct();
                        __pAcceptFinalVisElem->SetBounds(FloatRectangle(0, 0, W_DIAL_LABEL, H_DIAL_LABEL));
-                       __pAcceptFinalVisElem->SetShowState(true);
                        __pAcceptFinalVisElem->SetOpacity(1.0f);
-                       __pAcceptFinalVisElem->SetName(IDI_ACCEPT_FINAL_VISUAL_ELE_NAME);
+
+
                        if(__pAcceptLabel->GetVisualElement()->GetChild(IDI_ACCEPT_FINAL_VISUAL_ELE_NAME,true) == null)
                        {
                                AppLogDebug("AttachChild __pAcceptFinalVisElem");