#include <string>
#include <Evas.h>
#include <Ecore_X.h>
+#include <Ecore.h>
#include <Elementary.h>
#include <livebox-service.h>
#include <Core/Util/Log.h>
Evas_Object* window = createWindow();
Evas_Object* periodList = elm_list_add(window);
- Evas_Object* radio;
if (!periodList) {
LogD("failed to add elm_list_add");
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]);
}
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)
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
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,
PeriodChanger* periodChanger;
float newPeriod;
const char* period;
+ Evas_Object* radio;
};
PopupListData m_hour[5];