NABI_SE Issue Fix: 45902 45915 and internal issue fix
[apps/osp/Contacts.git] / src / CtContactDetailsForm.cpp
index 6664b16..20427a5 100644 (file)
@@ -36,6 +36,7 @@ using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Base::Utility;
 using namespace Tizen::Graphics;
+using namespace Tizen::Io;
 using namespace Tizen::Media;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
@@ -118,6 +119,7 @@ static const int Y_POPUP_TEXT_LABEL = 12;
 static const int H_POPUP_TEXT_LABEL = 90;
 
 static const int SUB_INDEX_MASK = 0xF000;
+static const int MESSAGE_BOX_TIMEOUT_MS = 300000;
 
 static const unsigned int COLOR_TABLE_BG = Color32<248, 246, 239>::Value;
 static const unsigned int COLOR_ITEM_TITLE = Color32<128, 128, 128>::Value;
@@ -159,6 +161,7 @@ ContactDetailsForm::ContactDetailsForm(void)
 , __pTableView(null)
 , __pContextMenuCall(null)
 , __pContextMenuShare(null)
+, __pFileEventManager(null)
 , __pOptionMenu(null)
 , __pDefaultSelectorPopup(null)
 , __pInvalidFilePopup(null)
@@ -234,6 +237,7 @@ ContactDetailsForm::OnTerminating(void)
        delete __pAppControl;
        delete __pContextMenuCall;
        delete __pContextMenuShare;
+       delete __pFileEventManager;
        delete __pOptionMenu;
 
        if (__pItemList != null)
@@ -277,7 +281,7 @@ ContactDetailsForm::OnActionPerformed(const Tizen::Ui::Control& source, int acti
                {
                        int modalResult = 0;
                        MessageBox deleteMessageBox;
-                       deleteMessageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"), MSGBOX_STYLE_YESNO);
+                       deleteMessageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"), MSGBOX_STYLE_YESNO, MESSAGE_BOX_TIMEOUT_MS);
                        deleteMessageBox.ShowAndWait(modalResult);
 
                        if (modalResult == MSGBOX_RESULT_YES)
@@ -1615,6 +1619,19 @@ ContactDetailsForm::OnTouchCanceled(const Tizen::Ui::Control& source, const Tize
 }
 
 void
+ContactDetailsForm::OnFileEventOccured(const unsigned long events, const Tizen::Base::String &path, const unsigned int eventId)
+{
+       AppLogDebug("Kamesh: OnFileEventOccured");
+       AppLogDebug("Kamesh: path = %ls", path.GetPointer());
+       String ringtonePath = __pPresentationModel->GetValue(DETAIL_PROPERTY_RINGTONE);
+       AppLogDebug("Kamesh: ringtonePath = %ls", ringtonePath.GetPointer());
+       if (ringtonePath.Equals(ResourceManager::GetString(L"IDS_PB_BODY_DEFAULT"), false) == true )
+       {
+               __pTableView->RefreshItem(__pItemList->GetCount() - 1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
+       }
+}
+
+void
 ContactDetailsForm::OnScrollEndReached (Tizen::Ui::Control &source, Tizen::Ui::Controls::ScrollEndEvent type)
 {
 }
@@ -1787,6 +1804,14 @@ ContactDetailsForm::OnAppControlCompleteResponseReceived(const Tizen::App::AppId
                                __pPresentationModel->SetValue(DETAIL_PROPERTY_RINGTONE, *pResultString);
                                __pPresentationModel->UpdateContact();
                                __pTableView->RefreshItem(__pItemList->GetCount() - 1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
+
+                               if (__pFileEventManager == null)
+                               {
+                                       __pFileEventManager = new (std::nothrow) FileEventManager();
+                                       __pFileEventManager->Construct(*this);
+                               }
+                               __pFileEventManager->AddPath(*pResultString, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
+
                        }
                }
        }