TizenRefApp-6964 Add usage of notification_system_setting_set_lock_screen_content 27/84627/1
authorDmytro Dragan <dm.dragan@samsung.com>
Fri, 19 Aug 2016 13:15:50 +0000 (16:15 +0300)
committerDmytro Dragan <dm.dragan@samsung.com>
Fri, 19 Aug 2016 13:15:50 +0000 (16:15 +0300)
Change-Id: I31a012123d3f792064f410b05273f2e1966b61f8
Signed-off-by: Dmytro Dragan <dm.dragan@samsung.com>
inc/lock_screen_content.h
inc/notification-setting-info.h
src/common-efl.c
src/lock_screen_content.c
src/notification-setting-info.c

index f253f2a5389a2c2eefe3d93c2888a607651a6523..6151ca11f9083acdf4d46dd33336206c6f488773 100644 (file)
@@ -33,4 +33,9 @@ void hide_sensitive_content_clicked();
  */
 void do_not_show_notifications_clicked();
 
+/**
+ * @brief Saves selected value to system settings
+ */
+void update_lock_screen_noti_settings();
+
 #endif /* __LOCK_SCREEN_CONTENT_H__ */
index 8f1bcb7d4af30df94318e55b3db419cb58f717cd..ebf812a21e0a8ce35c53ba50436ea0d3b63c6766 100755 (executable)
@@ -48,6 +48,9 @@ bool get_do_not_disturb();
  */
 void set_do_not_disturb(bool state);
 
+lock_screen_content_level_e get_lock_screen_content_setting();
+void set_lock_screen_content_setting(lock_screen_content_level_e value);
+
 bool get_allow_to_nofity(char *pkg_name);
 bool set_allow_to_nofity(char *pkg_name, bool state);
 bool set_excepted_apps(char *pkg_name, bool state);
index acf19e74b22d5e3fe2382998fc86f40b68c0b940..96619f4cf82cac93e93971c9d67581a7424855e1 100755 (executable)
@@ -225,17 +225,13 @@ static Evas_Object* gl_content_get_cb(void *data, Evas_Object *obj, const char *
         else if(data_list->item_style == ITEM_STYLE_RADIO)
         {
             int count = data_list->index;
-            Elm_Object_Item *it = elm_genlist_nth_item_get(obj, count);
             Evas_Object *radio = NULL;
             Evas_Object *radio_main = evas_object_data_get(obj, "radio");
             radio = elm_radio_add(obj);
             elm_radio_group_add(radio, radio_main);
-            elm_radio_state_value_set(radio, count + 1);
+            elm_radio_state_value_set(radio, count);
             evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
             evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
-            evas_object_propagate_events_set(radio, EINA_FALSE);
-            elm_atspi_accessible_relationship_append(it, ELM_ATSPI_RELATION_DESCRIBED_BY, radio);
-            elm_atspi_accessible_relationship_append(radio, ELM_ATSPI_RELATION_CONTROLLED_BY, it);
             return radio;
         }
     }
@@ -265,7 +261,7 @@ static void gl_radio_sel_cb(void *data, Evas_Object *obj, void *event_info)
 
     elm_genlist_item_selected_set(it, EINA_FALSE);
     radio = elm_object_item_part_content_get(it, "elm.swallow.end");
-    elm_radio_value_set(radio, index + 1);
+    elm_radio_value_set(radio, index);
 
     switch (index)
     {
@@ -291,8 +287,6 @@ void append_gl_radio_item_list(Evas_Object *genlist, Eina_List* list, char *styl
     int count = 0;
 
     Evas_Object *radio = elm_radio_add(genlist);
-    elm_radio_state_value_set(radio, 0);
-    elm_radio_value_set(radio, 0);
     evas_object_data_set(genlist, "radio", radio);
 
     itc->item_style = style;
@@ -316,6 +310,10 @@ void append_gl_radio_item_list(Evas_Object *genlist, Eina_List* list, char *styl
         ++count;
     }
     elm_genlist_item_class_free(itc);
+
+    int index = get_lock_screen_content_setting();
+    elm_radio_value_set(radio, index);
+    gl_radio_sel_cb((void *)index, genlist, NULL);
 }
 
 void append_gl_item_list(Evas_Object *genlist, Eina_List* list, int style, char *ugName)
@@ -543,7 +541,15 @@ void cancel_button_noti_ls_cb(void *data, Evas_Object *obj, void *event_info)
 void done_button_noti_ls_cb(void *data, Evas_Object *obj, void *event_info)
 {
     NOTISET_TRACE_BEGIN;
-    // TODO: add implementation when platform API will be available
+    update_lock_screen_noti_settings();
+    ret_if(!data);
+    ug_data *u_data = (ug_data *)data;
+    elm_naviframe_item_pop(u_data->naviframe);
+
+    EVAS_OBJECT_DELIF(u_data->done_button);
+    EVAS_OBJECT_DELIF(u_data->cancel_button);
+    EVAS_OBJECT_DELIF(u_data->list_sub);
+    EVAS_OBJECT_DELIF(u_data->list_main);
 }
 
 void back_button_cb(void *data, Evas_Object *obj, void *event_info)
index 56207381d8de5c51a6cbedbaf7ea7ef5dad4ff38..43909ec84bf85d9c67bfe2182025d83a95027ff2 100644 (file)
@@ -16,6 +16,9 @@
  */
 
 #include "common-efl.h"
+#include "notification-setting-info.h"
+
+lock_screen_content_level_e g_lock_screen_content_level = SHOW_ALL_CONTENT;
 
 void show_all_content_clicked()
 {
@@ -26,7 +29,7 @@ void show_all_content_clicked()
 
     if(genlist_item)
         elm_genlist_clear(ugd->list_sub);
-
+    g_lock_screen_content_level = SHOW_ALL_CONTENT;
     append_gl_start_option(ugd->list_sub, "type1", "show-all-content");
 
 }
@@ -40,7 +43,7 @@ void hide_sensitive_content_clicked()
 
     if(genlist_item)
         elm_genlist_clear(ugd->list_sub);
-
+    g_lock_screen_content_level = HIDE_SENSITIVE_CONTENT;
     append_gl_start_option(ugd->list_sub, "type1", "hide-sensitive-content");
 }
 
@@ -50,5 +53,12 @@ void do_not_show_notifications_clicked()
     ug_data *ugd = get_app_ui_data();
 
     elm_genlist_clear(ugd->list_sub);
+    g_lock_screen_content_level = DO_NOT_SHOW_NOTIFICATIONS;
+}
+
+void update_lock_screen_noti_settings()
+{
+    set_lock_screen_content_setting(g_lock_screen_content_level);
+    update_system_settings();
 }
 
index 9464dfefcb983344574fd6b40a88ad7f97319062..cae7e24fe8aefcd399ee8defed5bda75224ba4e3 100755 (executable)
@@ -303,6 +303,18 @@ out:
 
 }
 
+lock_screen_content_level_e get_lock_screen_content_setting()
+{
+    lock_screen_content_level_e value = SHOW_ALL_CONTENT;
+    notification_system_setting_get_lock_screen_content(get_system_setting(), &value);
+    return value;
+}
+
+void set_lock_screen_content_setting(lock_screen_content_level_e value)
+{
+    notification_system_setting_set_lock_screen_content(get_system_setting(), value);
+}
+
 bool set_allow_to_nofity(char *pkg_name, bool state)
 {
     NOTISET_TRACE_BEGIN;