When list is used in popup, sound playing.
authorleerang song <leerang.song@samsung.com>
Mon, 20 May 2013 05:38:54 +0000 (14:38 +0900)
committerleerang song <leerang.song@samsung.com>
Thu, 23 May 2013 08:32:29 +0000 (17:32 +0900)
[Issue#] PLM(130509-5588)
[Problem] When list is used in popup, sound not playing.
[Cause] When popup is deleted in idler callback, sounds events are also getting deleted
[Solution] Add a ecore_idler_add("callback", "data") API
[SCMRequest] N/A

Change-Id: I22722321bc3076a87d3f14b7dcec16f649374d7b

src/Core/Service/CMakeLists.txt [changed mode: 0644->0755]
src/Core/Service/PeriodChanger.cpp
src/Core/Service/PeriodChanger.h

old mode 100644 (file)
new mode 100755 (executable)
index 0a4c9a4..abc3c72
@@ -26,6 +26,7 @@ PKG_CHECK_MODULES(${DEPS}
     ecore-x
     elementary
     provider
+    ecore
     REQUIRED
 )
 ADD_DEFINITIONS(${${DEPS}_CFLAGS})
index c754fb5..b58719e 100755 (executable)
@@ -21,6 +21,7 @@
 #include <string>
 #include <Evas.h>
 #include <Ecore_X.h>
+#include <Ecore.h>
 #include <Elementary.h>
 #include <livebox-service.h>
 #include <Core/Util/Log.h>
@@ -101,7 +102,6 @@ void PeriodChanger::showPeriodPopup()
 
     Evas_Object* window = createWindow();
     Evas_Object* periodList = elm_list_add(window);
-    Evas_Object* radio;
 
     if (!periodList) {
         LogD("failed to add elm_list_add");
@@ -111,12 +111,12 @@ void PeriodChanger::showPeriodPopup()
     setPopupListData();
     // TODO Language ID should be used, not static string
     for(int i = 0 ; i < sizeof(m_hour) / sizeof(PopupListData); i++) {
-        radio = elm_radio_add(periodList);
-        elm_radio_state_value_set(radio,
+        m_hour[i].radio = elm_radio_add(periodList);
+        elm_radio_state_value_set(m_hour[i].radio,
             m_currentPeriod == m_hour[i].newPeriod ? EINA_FALSE : EINA_TRUE);
         elm_list_item_append(periodList,
             m_hour[i].period,
-            radio,
+            m_hour[i].radio,
             NULL,
             selectPeriodCallback, &m_hour[i]);
     }
@@ -248,7 +248,7 @@ void PeriodChanger::selectPeriodCallback(void *data, Evas_Object *obj, void *eve
 
     LogD("Update period is set to %f", popupData->newPeriod);
     popupData->periodChanger->requestToPlatform(popupData->newPeriod);
-    popupData->periodChanger->destroyPeriodPopup(obj);
+    ecore_idler_add(popupDestroyIdlerCallback, popupData);
 }
 
 void PeriodChanger::cancelButtonCallback(void *data, Evas_Object *obj, void *event_info)
@@ -258,4 +258,11 @@ void PeriodChanger::cancelButtonCallback(void *data, Evas_Object *obj, void *eve
     This->destroyPeriodPopup(obj);
 }
 
+Eina_Bool PeriodChanger::popupDestroyIdlerCallback(void *data)
+{
+    LogD("enter");
+    PopupListData* popupData = static_cast<PopupListData*>(data);
+    popupData->periodChanger->destroyPeriodPopup(popupData->radio);
+    return ECORE_CALLBACK_CANCEL;
+}
 } // Service
index 06cfbfb..aabf1e7 100755 (executable)
@@ -50,6 +50,7 @@ class PeriodChanger {
 
         static void selectPeriodCallback(void *data, Evas_Object *obj, void *event_info);
         static void cancelButtonCallback(void *data, Evas_Object *obj, void *event_info);
+        static Eina_Bool popupDestroyIdlerCallback(void *data);
 
         PeriodChanger(
                 std::string& boxId, std::string& instanceId,
@@ -66,6 +67,7 @@ class PeriodChanger {
             PeriodChanger* periodChanger;
             float newPeriod;
             const char* period;
+            Evas_Object* radio;
         };
 
         PopupListData m_hour[5];