Eina_List *not_excepted_list;
Eina_List *excepted_list;
Eina_List *all_apps_list;
+ Eina_List *first_allowed_list;
+ Eina_List *first_excepted_list;
} setting_info_s;
bool get_do_not_disturb();
bool get_allow_all();
void set_allow_all(bool state);
Eina_List *get_all_apps_list();
+Eina_List *get_first_allowed_apps_list();
+Eina_List *get_first_excepted_apps_list();
Eina_List *get_excepted_apps_list();
Eina_List *get_not_excepted_apps_list();
void remove_all_apps_list();
void remove_excepted_apps_list();
+void remove_arranged_list();
#endif /* __NOTIFICATION_SETTING_INFO_H__ */
// TODO: append when API will be implemented, will be move to final release
// append_gl_start_option(genlist, "multiline", "set-schedule-multiline");
// append_gl_start_option(genlist, "multiline", "allowed-calls");
- append_gl_full_item(genlist, do_not_disturb_allowed_apps_cont_cb, get_excepted_apps_list());
+ Eina_List *allowed_list = eina_list_merge(get_first_excepted_apps_list(), get_excepted_apps_list());
+ append_gl_full_item(genlist, do_not_disturb_allowed_apps_cont_cb, allowed_list);
}
Evas_Object *do_not_disturb_allowed_apps_cont_cb(Evas_Object* parent, void *data)
retv_if(!data, full_layout);
Eina_List *allowed_apps_list = (Eina_List *)data;
+
Evas_Object *table = elm_table_add(full_layout);
elm_table_padding_set(table, 0, APP_LAYOUT_PAD);
int count = eina_list_count(allowed_apps_list);
evas_object_smart_callback_add(genlist, "longpressed", gl_longpressed_cb, NULL);
evas_object_smart_callback_add(genlist, "contracted", gl_contracted_cb, NULL);
+ append_gl_item_list(genlist, get_first_allowed_apps_list(), ITEM_STYLE_DEFAULT);
append_gl_item_list(genlist, get_excepted_apps_list(), ITEM_STYLE_DEFAULT);
append_gl_item_list(genlist, get_not_excepted_apps_list(), ITEM_STYLE_DEFAULT);
EVAS_OBJECT_DELIF(u_data->cancel_button);
EVAS_OBJECT_DELIF(u_data->list_sub);
- if (u_data->list_main) {
+ if(u_data->list_main)
+ {
+ list = get_first_allowed_apps_list();
+ while(list)
+ {
+ item_info_s *item = (item_info_s*) eina_list_data_get(list);
+ set_excepted_apps(item->appid, item->do_not_disturb_except);
+ list = eina_list_next(list);
+ }
+
list = get_excepted_apps_list();
- while (list) {
- item_info_s *item = (item_info_s*)eina_list_data_get(list);
- if (item->do_not_disturb_except == false) {
+ while(list)
+ {
+ item_info_s *item = (item_info_s*) eina_list_data_get(list);
+ if(item->do_not_disturb_except == false)
+ {
set_excepted_apps(item->appid, item->do_not_disturb_except);
}
list = eina_list_next(list);
}
list = get_not_excepted_apps_list();
- while (list) {
- item_info_s *item = (item_info_s*)eina_list_data_get(list);
- if (item->do_not_disturb_except) {
+ while(list)
+ {
+ item_info_s *item = (item_info_s*) eina_list_data_get(list);
+ if(item->do_not_disturb_except)
+ {
set_excepted_apps(item->appid, item->do_not_disturb_except);
}
list = eina_list_next(list);
create_do_not_disturb_application_list();
elm_genlist_clear(u_data->list_main);
do_not_disturb_append_item_in_list(u_data->list_main);
-
}
}
#include <notification.h>
#include <notification_setting.h>
#include <notification_setting_internal.h>
+#include "common-efl.h"
setting_info_s *setting_info = NULL;
#define VOICE_CALL_PACKAGE "org.tizen.call-ui"
+#define CALENDAR_PACKAGE "org.tizen.calendar"
+#define MESSAGES_PACKAGE "org.tizen.message"
+// TODO: we have no clock on device, when it will be add, we will need to change package id
+#define CLOCK_PACKAGE "org.tizen.clock"
void create_app_notification_list()
{
notification_setting_get_package_name(temp, &package_name);
item_info->appid = package_name;
+
notification_setting_get_allow_to_notify(temp, &allow_to_notify);
item_info->allow_to_notify = allow_to_notify;
item_info->index = i;
- if (item_info->name && strcmp(package_name, VOICE_CALL_PACKAGE) != 0) {
+ if (item_info->name && strcmp(package_name, VOICE_CALL_PACKAGE)
+ && strcmp(package_name, CALENDAR_PACKAGE)
+ && strcmp(package_name, CLOCK_PACKAGE))
+ {
setting_info->all_apps_list = eina_list_append(setting_info->all_apps_list, item_info);
} else {
FREEIF(package_name);
item_info->do_not_disturb_except = do_not_disturb_except;
item_info->icon = get_app_icon(package_name);
- item_info->name = get_app_name(package_name);
+
+ if(!strcmp(package_name, CALENDAR_PACKAGE))
+ item_info->name = strdup(APP_STRING("IDS_COM_BODY_CALENDAR_EVENTS"));
+ else if(!strcmp(package_name, CLOCK_PACKAGE))
+ item_info->name = strdup(APP_STRING("IDS_ST_BODY_ALARMS"));
+ else
+ item_info->name = get_app_name(package_name);
item_info->index = i;
if(item_info->name)
{
- if(allow_to_notify)
+ if((allow_to_notify && !strcmp(package_name, MESSAGES_PACKAGE)) || !strcmp(package_name, CLOCK_PACKAGE)
+ || !strcmp(package_name, CALENDAR_PACKAGE) )
+ {
+ setting_info->first_allowed_list = eina_list_append(setting_info->first_allowed_list, item_info);
+ if(do_not_disturb_except)
+ {
+ setting_info->first_excepted_list = eina_list_append(setting_info->first_excepted_list, item_info);
+ }
+ }
+
+ if(allow_to_notify && strcmp(package_name, MESSAGES_PACKAGE)
+ && strcmp(package_name, CALENDAR_PACKAGE)
+ && strcmp(package_name, CLOCK_PACKAGE))
{
if(do_not_disturb_except)
{
}
}
+ setting_info->first_excepted_list = eina_list_sort(setting_info->first_excepted_list, eina_list_count(setting_info->first_excepted_list), apps_sort_cb);
+ setting_info->first_allowed_list = eina_list_sort(setting_info->first_allowed_list, eina_list_count(setting_info->first_allowed_list), apps_sort_cb);
setting_info->excepted_list = eina_list_sort(setting_info->excepted_list, eina_list_count(setting_info->excepted_list), apps_sort_cb);
setting_info->not_excepted_list = eina_list_sort(setting_info->not_excepted_list, eina_list_count(setting_info->not_excepted_list), apps_sort_cb);
return setting_info->all_apps_list;
}
+Eina_List *get_first_allowed_apps_list()
+{
+ NOTISET_TRACE_BEGIN;
+ return setting_info->first_allowed_list;
+}
+
+Eina_List *get_first_excepted_apps_list()
+{
+ NOTISET_TRACE_BEGIN;
+ return setting_info->first_excepted_list;
+}
+
bool get_allow_all()
{
item_info_s *item = NULL;
if(input_list) {
EINA_LIST_FREE(input_list, item_info) {
- //NOTISET_DBG("remove %s", item_info->name);
+// NOTISET_DBG("remove %s", item_info->name);
FREEIF(item_info->appid);
FREEIF(item_info->name);
FREEIF(item_info->icon);
_remove_apps_list(setting_info->all_apps_list);
}
}
-void remove_excepted_apps_list(){
+void remove_excepted_apps_list()
+{
NOTISET_TRACE_BEGIN;
- if(setting_info) {
- _remove_apps_list(setting_info->excepted_list);
+ if(setting_info)
+ {
+ _remove_apps_list(setting_info->first_allowed_list);
_remove_apps_list(setting_info->not_excepted_list);
}
-
}