/* To set system time takes some time. It makes some time before firing heynoti of setting_time_changed.*/
int setting_time_update_cb(void *data)
{
- /* time_t time_input = (time_t)data; */
-
+ retv_if(data == NULL, -1);
+ SettingTimeUG *ad = data;
+ /*
char time_str[SETTING_TIME_ENGINE_TIME_STR_LEN];
struct tm *ts;
struct tm ts_ret;
time_t ctime;
-
- retv_if(data == NULL, -1);
- SettingTimeUG *ad = data;
-
// get time from datefield UI
ctime = ad->changed_time;
//ctime = time(NULL);
retv_if(!ts, 1);
strftime(time_str, SETTING_TIME_ENGINE_TIME_STR_LEN, "%H:%M", &ts_ret);
SETTING_TRACE("After setting time ::: tm is_dst --> %d", ts_ret.tm_isdst);
- SETTING_TRACE("After Setting time time_str:%s", time_str);
+ SETTING_TRACE("After Setting time time_str:%s", time_str);*/
#if SUPPORT_SCREEN_PROTECTED
pm_unlock_state(LCD_NORMAL, STAY_CUR_STATE);
#endif
static char* s_result;
static int query_callback(void *NotUsed, int argc, char **argv, char **azColName);
-
+static bool setting_update_timezone(SettingTimeUG *ad);
static int setting_time_main_create(void *cb);
static int setting_time_main_destroy(void *cb);
static void setting_time_reboot_resp_cb(void *data, Evas_Object *obj,
void *event_info);
+bool __update_timezone_idler(SettingTimeUG *ad)
+{
+ setting_update_timezone(ad);
+ ad->update_timezone_idler = NULL;
+ return 0;
+}
#if TIME_CHANGED_HEYNOTY_CALLBACK
void time_changed_callback(void *data)
{
SETTING_TRACE("FAIL: setting_time_update_db(ad)\n");
}
+ SETTING_TRACE("ad->is_datefield_selected:%d", ad->is_datefield_selected)
if(EINA_TRUE == ad->is_datefield_selected) {
/* Timezone is not changed and a selected value of the datefield is already changed */
SETTING_TRACE("Datefield is selected\n");
}
tzset();
-
// vconfset to update timezone
char pTZPath[__MAX_PATH_SIZE];
ssize_t nLen = readlink(SETTING_TZONE_SYMLINK_PATH, pTZPath, sizeof(pTZPath)-1);
-
if (nLen != -1) {
pTZPath[nLen] = '\0';
} else {
SETTING_TRACE("__setting_set_city_tzone ERROR");
return;
}
-
- setting_time_main_update(data);
-
char *timezone = vconf_get_str(VCONFKEY_SETAPPL_TIMEZONE_ID);
setting_retm_if(timezone == NULL, "get vonf failed");
-
ICU_set_timezone(timezone);
FREE(timezone);
+
+ // update timezone
+ if (ad->update_timezone_idler) {
+ ecore_idler_del(ad->update_timezone_idler);
+ ad->update_timezone_idler = NULL;
+ }
+ ad->update_timezone_idler =
+ ecore_idler_add((Ecore_Task_Cb) __update_timezone_idler, ad);
+ // update time
+ if (ad->refresh_time_idler) {
+ ecore_idler_del(ad->refresh_time_idler);
+ ad->refresh_time_idler = NULL;
+ }
+ ad->refresh_time_idler = ecore_idler_add(setting_update_datefield, ad);
}
#endif
return 0;
}
-bool __update_timezone_idler(SettingTimeUG *ad)
-{
- setting_update_timezone(ad);
- ad->update_timezone_idler = NULL;
- return 0;
-}
static void setting_time_main_int_vconf_change_cb(keynode_t *key, void *data)
{
/* local time -> gmtime */
time_t the_time = mktime(&_tm); /* represent local time */
- ad->changed_time = the_time;
if ( (time(NULL)/ONE_MINUTE) == (the_time/ONE_MINUTE) )
{
Eina_Bool __refresh_date_timer(void *data)
{
- SETTING_TRACE_BEGIN;
+ //SETTING_TRACE_BEGIN;
SettingTimeUG *ad = data;
if (ad->data_time) {
time_t ctime = time(NULL);
struct tm *ts = localtime_r(&ctime, &ts_ret);
retv_if(!ts, 1);
- time_t diff = abs(ctime - ad->changed_time);
- if (diff <=1 || diff >= 60) {
- diff = 0;
- } else {
+ struct tm ui_time;
+ elm_datetime_value_get(ad->data_time->eo_check, &ui_time);
+ if ( (ctime/ONE_MINUTE) != (mktime(&ui_time)/ONE_MINUTE) )
+ {
+ SETTING_TRACE("To refresh the UI element after 1 minute passed.\t in %s", __FUNCTION__);
elm_datetime_value_set(ad->data_time->eo_check, &ts_ret);
}
}
retvm_if(cb == NULL, EINA_FALSE, "Data parameter is NULL");
SettingTimeUG *ad = (SettingTimeUG *) cb;
- __refresh_date_timer(ad);
+ //__refresh_date_timer(ad);
+ if (ad->data_time) {
+ time_t ctime = time(NULL);
+ struct tm ts_ret;
+ struct tm *ts = localtime_r(&ctime, &ts_ret);
+ if (ts) elm_datetime_value_set(ad->data_time->eo_check, &ts_ret);
+ }
ad->refresh_time_idler = NULL;
return 0;
}