* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
*
* Contact: MyoungJune Park <mj2004.park@samsung.com>
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
/* TODO once time changes, heynoti message is sent.
need to see this is proper design */
-#define TIME_CHANGED_HEYNOTY_CALLBACK 1
#define SETTING_TIME_ZONEINFO_PATH "/usr/share/zoneinfo/"
#define SETTING_TIME_SHARE_LOCAL_PATH "/usr/share/locale"
Evas_Object *controlbar,
char *label);
static int __setting_set_city_tzone(const char* pTZPath);
-
+
#endif /* __SETTING_TIME_MAIN_H__ */
#include <string.h>
#include <sqlite3.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+
#include <unicode/udat.h>
#include <unicode/ustring.h>
#include <unicode/uloc.h>
ad->update_timezone_idler = NULL;
return 0;
}
-#if TIME_CHANGED_HEYNOTY_CALLBACK
-void time_changed_callback(void *data)
-{
+
+void time_changed_callback(keynode_t *key, void *data) {
+
SETTING_TRACE_DEBUG("time and timezone have been changed: TIME_CHANGED_HEYNOTY_CALLBACK");
SettingTimeUG *ad = (SettingTimeUG *)data;
}
ad->refresh_time_idler = ecore_idler_add(setting_update_datefield, ad);
}
-#endif
void setting_time_update_time_date_format_string(SettingTimeUG *ad)
{
ad->caller = caller;
if (ad->caller) {
+ /* for setup wizard */
char *lbtn_str = (char *)g_strdup(l_btn);
bool same_flag = FALSE;
if (0 == safeStrCmp(l_btn, _("IDS_COM_BODY_BACK"))) {
}
setting_view_time_main.is_create = 1;
-
-#if TIME_CHANGED_HEYNOTY_CALLBACK
- /* ---------------------------------------------------------------- */
- /* heynoti registration */
- /* ---------------------------------------------------------------- */
- ad->noti_fd = heynoti_init();
-
- if (ad->noti_fd == -1) {
- SETTING_TRACE("heynoti_init FAIL");
- return SETTING_RETURN_FAIL;
- } else {
- SETTING_TRACE("heynoti_init OK");
- }
-
- if (-1 == heynoti_subscribe(ad->noti_fd, SETTING_TIME_CHANGED, time_changed_callback, (void *)ad)) {
- SETTING_TRACE("heynoti_subscribe FAIL");
- } else {
- SETTING_TRACE("heynoti_subscribe OK");
- }
-
- if (-1 == heynoti_attach_handler(ad->noti_fd)) {
- SETTING_TRACE("heynoti_attach_handler FAIL");
- } else {
- SETTING_TRACE("heynoti_attach_handler OK");
- }
-#endif
+ vconf_notify_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED, time_changed_callback, (void *)ad);
/* register vconf key to get event callback for converting 12/24H */
ret = vconf_notify_key_changed(VCONFKEY_REGIONFORMAT_TIME1224,
SettingTimeUG *ad = (SettingTimeUG *) cb;
-#if TIME_CHANGED_HEYNOTY_CALLBACK
- /* Closing heynoti */
- if (ad->noti_fd != -1)//first need to check the fd validation
- {
- heynoti_unsubscribe(ad->noti_fd, SETTING_TIME_CHANGED, time_changed_callback);
- //heynoti_detach_handler() will be done in heynoti_close().
- heynoti_close(ad->noti_fd);
- ad->noti_fd = -1;
- }
-#endif
if (ad->update_timer) {
ecore_timer_del(ad->update_timer);
ad->update_timer = NULL;
ecore_idler_del(ad->refresh_time_idler);
ad->refresh_time_idler = NULL;
}
+
+ vconf_ignore_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED,
+ time_changed_callback);
+
vconf_ignore_key_changed(VCONFKEY_REGIONFORMAT_TIME1224,
setting_time_main_int_vconf_change_cb);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_DATE_FORMAT_INT,
// update the display for timezone
setting_update_timezone(ad);
- heynoti_publish(SETTING_TIME_CHANGED);
+ //heynoti_publish(SETTING_TIME_CHANGED);
+ static int t_event_val = -1;
+ vconf_set_int (VCONFKEY_SYSTEM_TIME_CHANGED, t_event_val);
SETTING_TRACE_END;
}
}
// c.heynoti_publish
- heynoti_publish(SETTING_TIME_CHANGED);
+ static int t_event_val = -1;
+ vconf_set_int (VCONFKEY_SYSTEM_TIME_CHANGED, t_event_val);
}
static void
}
}
}
-
-
static void setting_time_main_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj,
void *event_info)
{
*/
static void get_gmt_offset(char *str_buf, int size)
{
- SETTING_TRACE(" before GMT processing : %s", str_buf);
// timezone string +/-<n> ex. +9, -1
time_t t = time(0); // get unix time. sec.