Fix timer problem of reset date&time
authorSunyeop Hwang <sunyeop.hwang@samsung.com>
Fri, 18 Jan 2013 05:54:03 +0000 (14:54 +0900)
committerSunyeop Hwang <sunyeop.hwang@samsung.com>
Fri, 18 Jan 2013 05:58:23 +0000 (14:58 +0900)
Change-Id: I768940c44711f7b857855b9858bb5481fe28a7b2

include/setting-debug.h
setting-time/src/setting-time-main.c

index f8b7d39..56b4556 100755 (executable)
@@ -93,7 +93,7 @@
 
 #define APPLIED_BACK_KEY_UG                    0
 
-#define APPLIED_DATATIME_FIRSTDAY_WEEK         1
+#define APPLIED_DATATIME_FIRSTDAY_WEEK         0
 #define SUPPORT_DATEFIELD_DATE_FORMAT_AUTOSET  0
 
 #define SUPPORT_FDN 0
index 06364f2..b3410e3 100755 (executable)
@@ -393,9 +393,17 @@ static void setting_time_main_datefield_change_cb(void *data, Evas_Object *obj,
 
        ad->is_datefield_selected = EINA_TRUE;
 
+       if (ad->update_timer) {
+               ecore_timer_reset(ad->update_timer);
+               ecore_timer_freeze(ad->update_timer);
+       }
+
        // If auto update is on, don't anything while the datefield has been updated (i.e., time runs)
        if (1 == setting_time_check_automatic_time_update_state()) {
                SETTING_TRACE("AUTO_TIME ON: no action");
+               if (ad->update_timer) {
+                       ecore_timer_thaw(ad->update_timer);
+               }
                SETTING_TRACE_END;
                return;
        } else {
@@ -410,6 +418,9 @@ static void setting_time_main_datefield_change_cb(void *data, Evas_Object *obj,
        if (2037 < _tm.tm_year) {
                setting_create_simple_popup(ad, ad->win_get,
                                            NULL, _(ERR_BIGGER_THAN_2037));
+               if (ad->update_timer) {
+                       ecore_timer_thaw(ad->update_timer);
+               }
                return;
        }
 #if SUPPORT_SCREEN_PROTECTED   /* if not lock the current state, after set the time, the screen will become dimmed */
@@ -423,6 +434,9 @@ static void setting_time_main_datefield_change_cb(void *data, Evas_Object *obj,
        } else {
                // error
                SETTING_TRACE_ERROR("get_timezone_isdst() failed");
+               if (ad->update_timer) {
+                       ecore_timer_thaw(ad->update_timer);
+               }
                return;
        }
 
@@ -433,6 +447,9 @@ static void setting_time_main_datefield_change_cb(void *data, Evas_Object *obj,
        {
                SETTING_TRACE("Time is not changed\n");
                //current time didn't change
+               if (ad->update_timer) {
+                       ecore_timer_thaw(ad->update_timer);
+               }
                return;
        }
 
@@ -451,6 +468,11 @@ static void setting_time_main_datefield_change_cb(void *data, Evas_Object *obj,
 
        // invoke API to change time
        int ret = sysman_set_datetime(the_time);
+
+       if (ad->update_timer) {
+               ecore_timer_thaw(ad->update_timer);
+       }
+
        setting_retm_if(ret == -1, "sysman_set_datetime call failed");
 
        SETTING_TRACE_END;