Apply feature of setting time(only year) 83/56883/1 accepted/tizen/tv/20160114.012608 submit/tizen/20160113.110321
authorHyunjee Kim <hj0426.kim@samsung.com>
Wed, 13 Jan 2016 09:29:04 +0000 (18:29 +0900)
committerHyunjee Kim <hj0426.kim@samsung.com>
Wed, 13 Jan 2016 09:44:19 +0000 (18:44 +0900)
Change-Id: Id473d056f6ce6762c4f1cf197c2ccfcb791085a5
Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
CMakeLists.txt
packaging/org.tizen.settings.spec
src/view/view_clock.c

index 0223607..b1db613 100644 (file)
@@ -28,6 +28,7 @@ pkg_check_modules(PKGS REQUIRED
                capi-network-wifi
                tv-service
                dlog
+               alarm-service
                )
 
 IF(NOT DEFINED PACKAGE_NAME)
index 4312c25..494c18c 100644 (file)
@@ -19,6 +19,7 @@ BuildRequires: pkgconfig(capi-network-wifi)
 BuildRequires: pkgconfig(tv-service)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(alarm-service)
 Requires(post): /usr/bin/vconftool
 
 %define _appdir /usr/apps/%{name}
index 90a4bc7..3394bec 100644 (file)
@@ -16,6 +16,8 @@
 
 #include <app.h>
 #include <Elementary.h>
+#include <time.h>
+#include <alarm.h>
 
 #include "viewmgr.h"
 #include "inputmgr.h"
@@ -49,6 +51,7 @@ struct _priv {
        int *setup_type;
        Evas_Object *setup_type_popup;
        enum setup_type cur_type;
+       Evas_Object *year;
 };
 
 enum input_handler_type {
@@ -186,11 +189,18 @@ static void _setup_type_key_down_cb(int id, void *data, Evas *e, Evas_Object *ob
 static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
                Evas_Event_Key_Down *ev)
 {
+       struct _priv *priv;
+       priv = data;
+
        if (!obj || !ev) {
                _ERR("Invalid argument.");
                return;
        }
 
+       struct tm _tm_year;
+       elm_datetime_value_get(priv->year, &_tm_year);
+       time_t the_time = mktime(&_tm_year);
+
        if (!strcmp(ev->keyname, KEY_ENTER)) {
                switch (id) {
                        case INPUT_HANDLER_TYPE_BTN_CANCEL:
@@ -198,7 +208,7 @@ static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
                                break;
 
                        case INPUT_HANDLER_TYPE_BTN_DONE:
-                               elm_object_signal_emit(data, "picker,action,value,set", "");
+                               alarmmgr_set_systime(the_time);
                                viewmgr_pop_view();
                                break;
 
@@ -281,7 +291,7 @@ static bool _add_clock_setting(struct _priv *priv)
        priv->clock_setup_btn = setup_btn;
 
        // item - year
-       Evas_Object *year;
+       Evas_Object *year = priv->year;
        year = elm_datetime_add(priv->base);
        elm_datetime_field_visible_set(year, ELM_DATETIME_HOUR, EINA_FALSE);
        elm_datetime_field_visible_set(year, ELM_DATETIME_MINUTE, EINA_FALSE);
@@ -289,6 +299,7 @@ static bool _add_clock_setting(struct _priv *priv)
        elm_datetime_field_visible_set(year, ELM_DATETIME_MONTH, EINA_FALSE);
        elm_datetime_field_visible_set(year, ELM_DATETIME_DATE, EINA_FALSE);
        elm_object_part_content_set(priv->base, PART_MAIN_ITEM_DATE_YEAR, year);
+       priv->year = year;
 
        // item - month
        Evas_Object *month;