static char *gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
{
- if(!strcmp(part, "elm.text"))
- {
+ if (!strcmp(part, "elm.text")) {
int index = (int)data;
return strdup(APP_STRING(items[index]));
}
Evas_Object *popup = data;
evas_object_del(popup);
- if(check_state)
- {
+ if (check_state) {
int value = 0;
notification_system_setting_get_dnd_allow_exceptions(get_system_setting(), NOTIFICATION_DND_ALLOWED_CALLS, &value);
- if(value == NOTIFICATION_DND_ALLOWED_CALLS_CONTACT)
+ if (value == NOTIFICATION_DND_ALLOWED_CALLS_CONTACT)
set_do_not_show_contact_popup_again(false);
- else if(value == NOTIFICATION_DND_ALLOWED_CALLS_FAVORITE)
+ else if (value == NOTIFICATION_DND_ALLOWED_CALLS_FAVORITE)
set_do_not_show_favorite_popup_again(false);
else
set_do_not_show_nobody_popup_again(false);
/* layout */
layout = elm_layout_add(popup);
char *res_path = app_get_resource_path();
- if(res_path)
- {
+ if (res_path) {
char edj_path[PATH_MAX] = { 0, };
snprintf(edj_path, PATH_MAX, "%s%s", res_path, "edje/reject_calls_popup.edj");
elm_layout_file_set(layout, edj_path, "popup_checkview_layout");
notification_system_setting_set_dnd_allow_exceptions(get_system_setting(), NOTIFICATION_DND_ALLOWED_CALLS, NOTIFICATION_DND_ALLOWED_CALLS_CONTACT);
update_allowed_calls_item();
- if(!is_existing_do_not_show_contact_popup_again())
+ if (!is_existing_do_not_show_contact_popup_again())
set_do_not_show_contact_popup_again(true);
- if(get_do_not_show_contact_popup_again())
+ if (get_do_not_show_contact_popup_again())
create_reject_calls_popup("IDS_ST_HEADER_REJECT_CALLS_ABB2",
"IDS_ST_BODY_INCOMING_CALLS_FROM_CONTACTS_YOU_HAVE_NOT_ALLOWED_WILL_BE_REJECTED_AUTOMATICALLY");
}
notification_system_setting_set_dnd_allow_exceptions(get_system_setting(), NOTIFICATION_DND_ALLOWED_CALLS, NOTIFICATION_DND_ALLOWED_CALLS_FAVORITE);
update_allowed_calls_item();
- if(!is_existing_do_not_show_favorite_popup_again())
+ if (!is_existing_do_not_show_favorite_popup_again())
set_do_not_show_favorite_popup_again(true);
- if(get_do_not_show_favorite_popup_again())
+ if (get_do_not_show_favorite_popup_again())
create_reject_calls_popup("IDS_ST_HEADER_REJECT_CALLS_ABB2",
"IDS_ST_BODY_INCOMING_CALLS_FROM_CONTACTS_YOU_HAVE_NOT_ALLOWED_WILL_BE_REJECTED_AUTOMATICALLY");
}
notification_system_setting_set_dnd_allow_exceptions(get_system_setting(), NOTIFICATION_DND_ALLOWED_CALLS, NOTIFICATION_DND_ALLOWED_CALLS_NOBODY);
update_allowed_calls_item();
- if(!is_existing_do_not_show_nobody_popup_again())
+ if (!is_existing_do_not_show_nobody_popup_again())
set_do_not_show_nobody_popup_again(true);
- if(get_do_not_show_nobody_popup_again())
+ if (get_do_not_show_nobody_popup_again())
create_reject_calls_popup("IDS_ST_HEADER_REJECT_ALL_CALLS_ABB", "IDS_ST_POP_ALL_INCOMING_CALLS_WILL_BE_REJECTED_AUTOMATICALLY");
}
Elm_Object_Item *item = event_info;
index = (int)elm_object_item_data_get(item);
- switch (index)
- {
+ switch (index) {
case 0:
everyone_item_clicked();
break;
#define AMOUNT_OF_CONTENT_ITEMS 3
-typedef enum
-{
+typedef enum {
APP_DETAILS_ALLOW_NOTI = 1,
APP_DETAILS_GROUP_INDEX,
APP_DETAILS_POPUP_NOTI,
notification_setting_h setting = NULL;
int err = notification_setting_get_setting_by_package_name(g_app_info->appid, &setting);
- if(err != NOTIFICATION_ERROR_NONE)
- {
+ if (err != NOTIFICATION_ERROR_NONE) {
NOTISET_ERR("notification_setting_get_setting_by_package_name [%d]\n", err);
- }
- else if(setting == NULL)
- {
+ } else if (setting == NULL) {
NOTISET_ERR("Notification setting is NULL\n");
- }
- else
- {
+ } else {
notification_setting_get_pop_up_notification(setting, &state);
NOTISET_DBG("notification_setting_get_pop_up_notification [%d]\n", state);
}
- if(setting)
+ if (setting)
notification_setting_free_notification(setting);
return state;
notification_setting_h setting = NULL;
int err = notification_setting_get_setting_by_package_name(g_app_info->appid, &setting);
- if(err != NOTIFICATION_ERROR_NONE)
- {
+ if (err != NOTIFICATION_ERROR_NONE) {
NOTISET_ERR("notification_setting_get_setting_by_package_name [%d]\n", err);
- }
- else if(setting == NULL)
- {
+ } else if (setting == NULL) {
NOTISET_ERR("Notification setting is NULL\n");
- }
- else
- {
+ } else {
notification_setting_set_pop_up_notification(setting, value);
NOTISET_DBG("notification_setting_set_pop_up_notification [%d]\n", value);
err = notification_setting_update_setting(setting);
- if(err != NOTIFICATION_ERROR_NONE)
+ if (err != NOTIFICATION_ERROR_NONE)
NOTISET_ERR("notification_setting_update_setting err[%d]\n", err);
}
- if(setting)
+ if (setting)
notification_setting_free_notification(setting);
}
notification_setting_h setting = NULL;
int err = notification_setting_get_setting_by_package_name(g_app_info->appid, &setting);
- if(err != NOTIFICATION_ERROR_NONE)
- {
+ if (err != NOTIFICATION_ERROR_NONE) {
NOTISET_ERR("notification_setting_get_setting_by_package_name [%d]\n", err);
- }
- else if(setting == NULL)
- {
+ } else if (setting == NULL) {
NOTISET_ERR("Notification setting is NULL\n");
- }
- else
- {
+ } else {
notification_setting_get_lock_screen_content(setting, &level);
NOTISET_DBG("notification_setting_get_lock_screen_content [%d]\n", level);
}
- if(setting)
+ if (setting)
notification_setting_free_notification(setting);
return level;
switch (item) {
case APP_DETAILS_ALLOW_NOTI:
- if(!strcmp(part, "elm.text"))
- {
+ if (!strcmp(part, "elm.text")) {
return strdup(APP_STRING("IDS_ST_MBODY_ALLOW_NOTIFICATIONS"));
}
break;
case APP_DETAILS_GROUP_INDEX:
- if(!strcmp(part, "elm.text"))
- {
+ if (!strcmp(part, "elm.text")) {
return strdup(APP_STRING("IDS_ST_HEADER_ADVANCED_SETTINGS_ABB2"));
}
break;
case APP_DETAILS_POPUP_NOTI:
- if(!strcmp(part, "elm.text"))
- {
+ if (!strcmp(part, "elm.text")) {
return strdup(APP_STRING("IDS_ST_MBODY_POP_UP_NOTIFICATIONS_ABB"));
- }
- else if(!strcmp(part, "elm.text.multiline"))
- {
+ } else if (!strcmp(part, "elm.text.multiline")) {
return strdup(APP_STRING("IDS_ST_SBODY_SHOW_POP_UP_NOTIFICATIONS_AT_THE_TOP_OF_THE_SCREEN"));
}
break;
case APP_DETAILS_APP_BADGE:
- if(!strcmp(part, "elm.text"))
- {
+ if (!strcmp(part, "elm.text")) {
return strdup(APP_STRING("IDS_ST_MBODY_APP_BADGES_ABB"));
- }
- else if(!strcmp(part, "elm.text.sub"))
- {
+ } else if (!strcmp(part, "elm.text.sub")) {
return strdup(APP_STRING("IDS_ST_SBODY_SHOW_BADGES_ON_THE_APP_ICON"));
}
break;
case APP_DETAILS_NOTI_ON_LOCK:
- if(!strcmp(part, "elm.text"))
- {
+ if (!strcmp(part, "elm.text")) {
return strdup(APP_STRING("IDS_QP_TMBODY_NOTIFICATIONS_ON_LOCK_SCREEN"));
- }
- else if(!strcmp(part, "elm.text.sub"))
- {
+ } else if (!strcmp(part, "elm.text.sub")) {
int level = noti_on_lock_screen_status_get();
- if(level == SHOW_ALL_CONTENT)
+ if (level == SHOW_ALL_CONTENT)
return strdup(APP_STRING("IDS_QP_OPT_SHOW_ALL_CONTENT_ABB"));
- else if(level == HIDE_SENSITIVE_CONTENT)
+ else if (level == HIDE_SENSITIVE_CONTENT)
return strdup(APP_STRING("IDS_QP_OPT_HIDE_SENSITIVE_CONTENT_ABB"));
- else if(level == DO_NOT_SHOW_NOTIFICATIONS)
+ else if (level == DO_NOT_SHOW_NOTIFICATIONS)
return strdup(APP_STRING("IDS_QP_OPT_DONT_SHOW_NOTIFICATIONS_ABB"));
}
break;
switch (item) {
case APP_DETAILS_ALLOW_NOTI:
- if(!strcmp(part, "elm.swallow.end"))
- {
+ if (!strcmp(part, "elm.swallow.end")) {
check = create_on_off_check(obj);
elm_check_state_set(check, allow_noti_status_get());
evas_object_smart_callback_add(check, "changed", allow_noti_check_changed_cb, NULL);
return check;
- }
- else if(!strcmp(part, "elm.swallow.icon"))
- {
+ } else if (!strcmp(part, "elm.swallow.icon")) {
return create_icon(obj, g_app_info->icon);
}
break;
case APP_DETAILS_POPUP_NOTI:
- if(!strcmp(part, "elm.swallow.end"))
- {
+ if (!strcmp(part, "elm.swallow.end")) {
check = create_on_off_check(obj);
elm_check_state_set(check, popup_noti_status_get());
evas_object_smart_callback_add(check, "changed", popup_noti_check_changed_cb, NULL);
}
break;
case APP_DETAILS_APP_BADGE:
- if(!strcmp(part, "elm.swallow.end"))
- {
+ if (!strcmp(part, "elm.swallow.end")) {
check = create_on_off_check(obj);
elm_check_state_set(check, app_badge_status_get());
evas_object_smart_callback_add(check, "changed", app_badge_check_changed_cb, NULL);
static char *gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
{
- if(!strcmp(part, "elm.text"))
- {
+ if (!strcmp(part, "elm.text")) {
int index = (int)data;
return strdup(APP_STRING(items[index]));
}
static Evas_Object *gl_content_get_cb(void *data, Evas_Object *obj, const char *part)
{
- if(!strcmp(part, "elm.swallow.end"))
- {
+ if (!strcmp(part, "elm.swallow.end")) {
int index = (int)data;
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, index);
- evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
+ 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);
return radio;
}
elm_radio_value_set(radio, index);
int err = notification_setting_get_setting_by_package_name(g_app_info->appid, &setting);
- if(err != NOTIFICATION_ERROR_NONE)
- {
+ if (err != NOTIFICATION_ERROR_NONE) {
NOTISET_ERR("notification_setting_get_setting_by_package_name [%d]\n", err);
- }
- else if(setting == NULL)
- {
+ } else if (setting == NULL) {
NOTISET_ERR("Notification setting is NULL\n");
- }
- else
- {
- switch (index)
- {
+ } else {
+ switch (index) {
case 0:
level = SHOW_ALL_CONTENT;
break;
NOTISET_DBG("notification_setting_set_lock_screen_content [%d]\n", level);
err = notification_setting_update_setting(setting);
- if(err != NOTIFICATION_ERROR_NONE)
+ if (err != NOTIFICATION_ERROR_NONE)
NOTISET_ERR("notification_setting_update_setting err[%d]\n", err);
}
- if(setting)
+ if (setting)
notification_setting_free_notification(setting);
elm_genlist_item_update(elm_genlist_last_item_get(get_app_ui_data()->list_sub));
itc.func.del = NULL;
int i = 0;
- for (; i < AMOUNT_OF_CONTENT_ITEMS; i++)
- {
+ for (; i < AMOUNT_OF_CONTENT_ITEMS; i++) {
elm_genlist_item_append(genlist, &itc, (void *)i, NULL, ELM_GENLIST_ITEM_NONE, gl_radio_sel_cb, popup);
}
{
App_Details_Items detail = (App_Details_Items)data;
- Elm_Object_Item *it = (Elm_Object_Item*)event_info;
+ Elm_Object_Item *it = (Elm_Object_Item *)event_info;
elm_genlist_item_selected_set(it, EINA_FALSE);
- if(detail == APP_DETAILS_NOTI_ON_LOCK)
- {
+ if (detail == APP_DETAILS_NOTI_ON_LOCK) {
show_noti_on_lock_popup();
return;
}
Evas_Object *check = elm_object_item_part_content_get(it, "elm.swallow.end");
- if(check)
- {
+ if (check) {
elm_check_state_set(check, !elm_check_state_get(check));
evas_object_smart_callback_call(check, "changed", NULL);
}
ELM_GENLIST_ITEM_NONE, /* item type */
app_details_gl_selected_cb, /* select smart callback */
(void *)item_name); /* smart callback user data */
- if(style && !strcmp(style, "group_index"))
+ if (style && !strcmp(style, "group_index"))
elm_genlist_item_select_mode_set(gen_item, ELM_OBJECT_SELECT_MODE_NONE);
elm_genlist_item_class_free(itc);
}
static ug_data *g_ug_data = NULL;
-ug_data* get_app_ui_data() {
+ug_data *get_app_ui_data()
+{
return g_ug_data;
}
-void set_app_ui_data(ug_data *data) {
+void set_app_ui_data(ug_data *data)
+{
g_ug_data = data;
}
void gl_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
{
- Elm_Object_Item *it = (Elm_Object_Item*) event_info;
+ Elm_Object_Item *it = (Elm_Object_Item *) event_info;
elm_genlist_item_selected_set(it, EINA_FALSE);
- if(data)
- {
+ if (data) {
void *item_data = elm_object_item_data_get(it);
- if(item_data && !strcmp(data, "app-notification-details"))
- {
- app_details_create_view(g_ug_data, (item_info_s*)item_data);
+ if (item_data && !strcmp(data, "app-notification-details")) {
+ app_details_create_view(g_ug_data, (item_info_s *)item_data);
return;
}
- if(!strcmp(data, "set-schedule-multiline"))
- {
+ if (!strcmp(data, "set-schedule-multiline")) {
gl_set_schedule_selected(g_ug_data);
}
- if(!strcmp(data, "allowed-calls"))
- {
+ if (!strcmp(data, "allowed-calls")) {
gl_allowed_calls_selected();
}
- if(!strcmp(data, "start-time"))
- {
+ if (!strcmp(data, "start-time")) {
create_start_time_popup();
}
- if(!strcmp(data, "end-time"))
- {
+ if (!strcmp(data, "end-time")) {
create_end_time_popup();
}
}
Evas_Object *check = elm_object_item_part_content_get(it, "elm.swallow.end");
- if (!check)
- {
+ if (!check) {
check = elm_object_item_part_content_get(it, "elm.icon.right");
}
- if (check)
- {
+ if (check) {
elm_check_state_set(check, !elm_check_state_get(check));
evas_object_smart_callback_call(check, "changed", NULL);
}
{
}
-Evas_Object* create_icon(Evas_Object *parent, char* icon)
+Evas_Object *create_icon(Evas_Object *parent, char *icon)
{
Evas_Object *img = elm_image_add(parent);
- if(access(icon, F_OK) == -1) {
- char* res_path = app_get_resource_path();
+ if (access(icon, F_OK) == -1) {
+ char *res_path = app_get_resource_path();
if (res_path) {
char buf[PATH_MAX] = {0, };
snprintf(buf, PATH_MAX, "%s%s", res_path, "images/unknown.png");
return check;
}
-Evas_Object* create_custom_layout(Evas_Object *parent, char* group_name)
+Evas_Object *create_custom_layout(Evas_Object *parent, char* group_name)
{
Evas_Object *layout = create_layout(parent);
char edj_path[PATH_MAX] = {0, };
- char* res_path = app_get_resource_path();
+ char *res_path = app_get_resource_path();
if (res_path) {
snprintf(edj_path, PATH_MAX, "%s%s", res_path, "edje/setting_notification.edj");
free(res_path);
Eina_Bool state = elm_check_state_get(obj);
set_do_not_disturb(state);
update_system_settings();
- NOTISET_DBG("do_not_disturb check value = %s", state==false ? "FALSE":"TRUE");
+ NOTISET_DBG("do_not_disturb check value = %s", state == false ? "FALSE" : "TRUE");
}
-static Evas_Object* gl_content_get_cb(void *data, Evas_Object *obj, const char *part)
+static Evas_Object *gl_content_get_cb(void *data, Evas_Object *obj, const char *part)
{
retv_if(!data, NULL);
Evas_Object *content = NULL;
item_info_s *data_list = data;
- if(!strcmp(part, "elm.swallow.icon") || !strcmp(part, "elm.icon.left"))
- {
- if(data_list->item_style != ITEM_STYLE_RADIO)
- {
+ if (!strcmp(part, "elm.swallow.icon") || !strcmp(part, "elm.icon.left")) {
+ if (data_list->item_style != ITEM_STYLE_RADIO) {
Evas_Object *icon = create_icon(obj, data_list->icon);
evas_object_show(icon);
return icon;
}
}
- if(!strcmp(part, "elm.swallow.end"))
- {
- if(data_list->item_style == ITEM_STYLE_TYPE_ONE)
- {
+ if (!strcmp(part, "elm.swallow.end")) {
+ if (data_list->item_style == ITEM_STYLE_TYPE_ONE) {
return NULL;
- }
- else if(data_list->item_style == ITEM_STYLE_DEFAULT)
- {
+ } else if (data_list->item_style == ITEM_STYLE_DEFAULT) {
content = create_on_off_check(obj);
elm_check_state_set(content, data_list->do_not_disturb_except);
evas_object_smart_callback_add(content, "changed", _excepted_check_changed_cb, data_list);
return content;
- }
- else if(data_list->item_style == ITEM_STYLE_RADIO)
- {
+ } else if (data_list->item_style == ITEM_STYLE_RADIO) {
int count = data_list->index;
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);
- evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
+ 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);
return radio;
}
return content;
}
-static char* gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
+static char *gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
{
item_info_s *data_list = data;
retv_if(data_list == NULL, NULL);
radio = elm_object_item_part_content_get(it, "elm.swallow.end");
elm_radio_value_set(radio, index);
- switch (index)
- {
+ switch (index) {
case 0:
show_all_content_clicked();
break;
itc->func.content_get = gl_content_get_cb;
itc->func.del = gl_del_cb;
- while(list)
- {
- item = (item_info_s*)eina_list_data_get(list);
+ while (list) {
+ item = (item_info_s *)eina_list_data_get(list);
item->index = count;
item->item_style = ITEM_STYLE_RADIO;
elm_genlist_item_append(genlist, /* genlist object */
gl_radio_sel_cb((void *)index, genlist, NULL);
}
-void append_gl_item_list(Evas_Object *genlist, Eina_List* list, int style, char *ugName)
+void append_gl_item_list(Evas_Object *genlist, Eina_List *list, int style, char *ugName)
{
NOTISET_TRACE_BEGIN;
item_info_s *item;
int count = 0;
- if (style == ITEM_STYLE_TYPE_ONE){
+ if (style == ITEM_STYLE_TYPE_ONE) {
itc->item_style = "type1";
- } else if(style == ITEM_STYLE_ONE_ICON){
+ } else if (style == ITEM_STYLE_ONE_ICON) {
itc->item_style = "one_icon";
} else {
itc->item_style = "default";
NOTISET_DBG("count %d", count);
while (list) {
- item = (item_info_s*)eina_list_data_get(list);
+ item = (item_info_s *)eina_list_data_get(list);
item->item_style = style;
gen_item = elm_genlist_item_append(genlist, /* genlist object */
itc, /* item class */
char buf[MAX_TEXT_SIZE] = {0,};
retv_if(!data, NULL);
- if(!strcmp(data, "do-not-disturb"))
- {
- if(!strcmp("elm.text.multiline", part))
- {
+ if (!strcmp(data, "do-not-disturb")) {
+ if (!strcmp("elm.text.multiline", part)) {
snprintf(buf, sizeof(buf), "<font_size=30>%s</font_size>", APP_STRING("IDS_ST_BODY_MUTE_ALL_ALERTS_AND_ONLY_SHOW_NOTIFICATIONS_IN_THE_NOTIFICATION_PANEL_ADD_APPS_BELOW_TO_ALLOW_EXCEPTIONS"));
return strdup(buf);
}
- if(!strcmp(part, "elm.text"))
- {
+ if (!strcmp(part, "elm.text")) {
return strdup(APP_STRING("IDS_ST_HEADER_DO_NOT_DISTURB_ABB"));
}
- }
- else if(!strcmp(data, "set-schedule-multiline"))
- {
- if(!strcmp("elm.text", part))
- {
+ } else if (!strcmp(data, "set-schedule-multiline")) {
+ if (!strcmp("elm.text", part)) {
return strdup(APP_STRING("IDS_ST_MBODY_SET_SCHEDULE_M_TIME"));
}
- if(!strcmp("elm.text.multiline", part))
- {
- if(get_schedule())
- {
+ if (!strcmp("elm.text.multiline", part)) {
+ if (get_schedule()) {
int dndSchedule = load_dnd_schedule_day();
struct tm start_time;
snprintf(buf, sizeof(buf), "<font_size=30>%s<br/>%s</font_size>",
get_day_string(dndSchedule), get_time_string(&start_time, &end_time));
- }
- else
+ } else
snprintf(buf, sizeof(buf), "<font_size=30>%s</font_size>", APP_STRING("WDS_ST_ACBUTTON_OFF_ABB2"));
return strdup(buf);
}
- }
- else if(!strcmp(data, "set-schedule"))
- {
- if(!strcmp("elm.text", part))
- {
+ } else if (!strcmp(data, "set-schedule")) {
+ if (!strcmp("elm.text", part)) {
return strdup(APP_STRING("IDS_ST_MBODY_SET_SCHEDULE_M_TIME"));
}
- }
- else if(!strcmp(data, "start-time") && !strcmp("elm.text", part))
- {
+ } else if (!strcmp(data, "start-time") && !strcmp("elm.text", part)) {
return strdup(APP_STRING("IDS_ST_BODY_START_TIME"));
- }
- else if(!strcmp(data, "end-time") && !strcmp("elm.text", part))
- {
+ } else if (!strcmp(data, "end-time") && !strcmp("elm.text", part)) {
return strdup(APP_STRING("IDS_ST_BODY_END_TIME"));
- }
- else if(!strcmp(data, "end-time") && !strcmp("elm.text.sub", part) && is_next_day())
- {
+ } else if (!strcmp(data, "end-time") && !strcmp("elm.text.sub", part) && is_next_day()) {
return strdup(APP_STRING("IDS_ST_SBODY_NEXT_DAY_M_LC_ABB"));
- }
- else if(!strcmp(data, "allowed-calls"))
- {
- if(!strcmp("elm.text.multiline", part))
- {
+ } else if (!strcmp(data, "allowed-calls")) {
+ if (!strcmp("elm.text.multiline", part)) {
snprintf(buf, sizeof(buf), "<font_size=30>%s</font_size>", APP_STRING(get_allowed_calls_string()));
return strdup(buf);
}
- if(!strcmp("elm.text", part))
- {
+ if (!strcmp("elm.text", part)) {
return strdup(APP_STRING("IDS_ST_MBODY_ALLOWED_CALLS_ABB"));
}
- }
- else if(!strcmp(data, "show-all-content"))
- {
+ } else if (!strcmp(data, "show-all-content")) {
- if(!strcmp("elm.text", part))
+ if (!strcmp("elm.text", part))
return strdup("Picture.jpg");
- else if(!strcmp("elm.text.sub", part))
+ else if (!strcmp("elm.text.sub", part))
return strdup("Download complete");
- else if(!strcmp("elm.text.sub.end", part))
+ else if (!strcmp("elm.text.sub.end", part))
return strdup(APP_STRING("IDS_ST_HEADER_TIME"));
- }
- else if(!strcmp(data, "hide-sensitive-content"))
- {
- if(!strcmp("elm.text", part))
+ } else if (!strcmp(data, "hide-sensitive-content")) {
+ if (!strcmp("elm.text", part))
return strdup("Download manager");
- else if(!strcmp("elm.text.sub", part))
+ else if (!strcmp("elm.text.sub", part))
return strdup(APP_STRING("IDS_ST_OPT_CONTENT_HIDDEN"));
- else if(!strcmp("elm.text.sub.end", part))
+ else if (!strcmp("elm.text.sub.end", part))
return strdup(APP_STRING("IDS_ST_BODY_DATE"));
- }
- else if(!strcmp(data, "blocked-noti"))
- {
- if(!strcmp("elm.text", part))
+ } else if (!strcmp(data, "blocked-noti")) {
+ if (!strcmp("elm.text", part))
return strdup(APP_STRING("IDS_ST_HEADER_BLOCKED_NOTIFICATIONS_ABB"));
}
return NULL;
}
-static Evas_Object* _gl_option_content_get_cb(void *data, Evas_Object *obj, const char *part)
+static Evas_Object *_gl_option_content_get_cb(void *data, Evas_Object *obj, const char *part)
{
retv_if(!data, NULL);
- if(!strcmp(data, "do-not-disturb") && !strcmp(part, "elm.swallow.end"))
- {
+ if (!strcmp(data, "do-not-disturb") && !strcmp(part, "elm.swallow.end")) {
Evas_Object *check = NULL;
check = create_on_off_check(obj);
elm_check_state_set(check, get_do_not_disturb());
return check;
}
- if(!strcmp(data, "set-schedule") && !strcmp("elm.swallow.end", part))
- {
+ if (!strcmp(data, "set-schedule") && !strcmp("elm.swallow.end", part)) {
Evas_Object *check = create_on_off_check(obj);
elm_check_state_set(check, get_schedule());
evas_object_smart_callback_add(check, "changed", set_schedule_check_changed_cb, NULL);
return check;
}
- if(!strcmp(data, "start-time") && !strcmp("elm.swallow.end", part))
- {
+ if (!strcmp(data, "start-time") && !strcmp("elm.swallow.end", part)) {
return start_end_time_item(obj, true);
}
- if(!strcmp(data, "end-time") && !strcmp("elm.swallow.end", part))
- {
+ if (!strcmp(data, "end-time") && !strcmp("elm.swallow.end", part)) {
return start_end_time_item(obj, false);
}
- if ((!strcmp(data, "hide-sensitive-content") || !strcmp(data, "show-all-content")) && !strcmp(part, "elm.swallow.icon"))
- {
+ if ((!strcmp(data, "hide-sensitive-content") || !strcmp(data, "show-all-content")) && !strcmp(part, "elm.swallow.icon")) {
return create_icon(obj, NULL);
}
gl_selected_cb, /* select smart callback */
ugName); /* smart callback user data */
- if(style && !strcmp(style, "group_index"))
+ if (style && !strcmp(style, "group_index"))
elm_genlist_item_select_mode_set(gen_item, ELM_OBJECT_SELECT_MODE_NONE);
elm_genlist_item_class_free(itc);
}
void cancel_button_noti_ls_cb(void *data, Evas_Object *obj, void *event_info)
{
NOTISET_TRACE_BEGIN;
- ug_data* u_data = data;
+ ug_data *u_data = data;
ret_if(!data);
elm_naviframe_item_pop(u_data->naviframe);
/**
* @brief This struct stands for helping to generate a full content-layout of item added to genlist.
*/
-typedef struct
-{
+typedef struct {
/**
* A callback raised from genlist item class'es content_get callback that should create genlist
* item's content.
* */
- Evas_Object *(*fullContentCb)(Evas_Object* parent, void *data);
+ Evas_Object *(*fullContentCb)(Evas_Object *parent, void *data);
void *cbData; /**< User-data passed to fullContentCb.*/
} full_content_data_s;
-static Evas_Object* _gl_full_content_get_cb(void *data, Evas_Object *obj, const char *part)
+static Evas_Object *_gl_full_content_get_cb(void *data, Evas_Object *obj, const char *part)
{
retv_if(!data, NULL);
full_content_data_s *content_data = (full_content_data_s *)data;
if (!strcmp(part, "elm.swallow.content")) {
- if(content_data->fullContentCb)
+ if (content_data->fullContentCb)
return content_data->fullContentCb(obj, content_data->cbData);
}
return NULL;
ret_if(!itc);
full_content_data_s *data = calloc(1, sizeof(full_content_data_s));
- if(!data)
- {
+ if (!data) {
elm_genlist_item_class_free(itc);
return;
}
#define APP_LAYOUT_HEADER ELM_SCALE_SIZE(95 + 64)
#define ITEMS_PER_ROW 5
-void do_not_disturb_append_items_in_list(Evas_Object* genlist)
+void do_not_disturb_append_items_in_list(Evas_Object *genlist)
{
append_gl_start_option(genlist, "multiline", "do-not-disturb");
append_gl_start_option(genlist, "multiline", "set-schedule-multiline");
evas_object_smart_callback_add(select_button, "clicked", exception_application_clicked_cb, ug_main);
evas_object_show(select_button);
- elm_object_part_content_set(full_layout, ALLOWED_LAYOUT_BUTTON_PART,select_button);
+ elm_object_part_content_set(full_layout, ALLOWED_LAYOUT_BUTTON_PART, select_button);
retv_if(!data, full_layout);
Eina_List *allowed_apps_list = (Eina_List *)data;
evas_object_size_hint_min_set(table, 0, height);
int row_number = 0;
- while(allowed_apps_list)
- {
+ while (allowed_apps_list) {
int items_in_row = 0;
- while(allowed_apps_list && items_in_row < ITEMS_PER_ROW)
- {
- item_info_s *item = (item_info_s*)eina_list_data_get(allowed_apps_list);
+ while (allowed_apps_list && items_in_row < ITEMS_PER_ROW) {
+ item_info_s *item = (item_info_s *)eina_list_data_get(allowed_apps_list);
Evas_Object *app_layout = create_custom_layout(table, APP_LAYOUT_NAME);
evas_object_show(app_layout);
Evas_Object *icon = create_icon(app_layout, item->icon);
evas_object_show(icon);
- elm_object_part_content_set(app_layout, APP_LAYOUT_ICON_PART,icon);
+ elm_object_part_content_set(app_layout, APP_LAYOUT_ICON_PART, icon);
elm_object_part_text_set(app_layout, APP_LAYOUT_TEXT_PART, item->name);
elm_table_pack(table, app_layout, items_in_row, row_number, 1, 1);
row_number++;
}
- elm_object_part_content_set(full_layout, ALLOWED_LAYOUT_GRID_PART,table);
+ elm_object_part_content_set(full_layout, ALLOWED_LAYOUT_GRID_PART, table);
return full_layout;
}
static bool is_list_main_need_to_be_update(item_info_s *app_data);
static void _done_button_cb(void *data, Evas_Object *obj, void *event_info);
-static Evas_Object* _create_edit_exception_apps_list(ug_data *ugd)
+static Evas_Object *_create_edit_exception_apps_list(ug_data *ugd)
{
Evas_Object *parent = ugd->naviframe;
Evas_Object *genlist;
static bool is_list_main_need_to_be_update(item_info_s *app_data)
{
- if(!state_list)
- {
+ if (!state_list) {
state_list = eina_list_append(state_list, app_data);
- }
- else
- {
- if(eina_list_data_find(state_list, app_data))
+ } else {
+ if (eina_list_data_find(state_list, app_data))
state_list = eina_list_remove(state_list, app_data);
else
state_list = eina_list_append(state_list, app_data);
static void cancel_changes()
{
NOTISET_TRACE_BEGIN;
- while(state_list)
- {
+ while (state_list) {
item_info_s *app_data = eina_list_data_get(state_list);
app_data->do_not_disturb_except = !app_data->do_not_disturb_except;
state_list = eina_list_next(state_list);
static void remove_state_list()
{
- if(state_list)
+ if (state_list)
state_list = eina_list_free(state_list);
}
EVAS_OBJECT_DELIF(u_data->cancel_button);
EVAS_OBJECT_DELIF(u_data->list_sub);
- if(u_data->list_main && is_need_to_update)
- {
+ if (u_data->list_main && is_need_to_update) {
update_do_not_disturb_application_list();
elm_genlist_clear(u_data->list_main);
do_not_disturb_append_items_in_list(u_data->list_main);
void _cancel_button_cb(void *data, Evas_Object *obj, void *event_info)
{
NOTISET_TRACE_BEGIN;
- ug_data* u_data = data;
+ ug_data *u_data = data;
ret_if(!data);
EVAS_OBJECT_DELIF(u_data->done_button);
static Eina_Bool _back_button_cb(void *data, Elm_Object_Item *it)
{
NOTISET_TRACE_BEGIN;
- if(is_need_to_update)
+ if (is_need_to_update)
cancel_changes();
return EINA_TRUE;
}
void exception_application_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
NOTISET_TRACE_BEGIN;
- ug_data* u_data = data;
+ ug_data *u_data = data;
ret_if(!u_data);
- Elm_Object_Item* navi_item = NULL;
+ Elm_Object_Item *navi_item = NULL;
Evas_Object *cancel_btn = NULL;
Evas_Object *done_btn = NULL;
Elm_Object_Item *genlist_item = elm_genlist_first_item_get(ugd->list_sub);
- if(genlist_item)
+ 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");
Elm_Object_Item *genlist_item = elm_genlist_first_item_get(ugd->list_sub);
- if(genlist_item)
+ 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");
static void update_character_orientation();
-typedef enum
-{
+typedef enum {
NOTIF_APP_TYPE,
DO_NOT_DISTURB_APP_TYPE,
NOTIFICATION_ON_LOCK_SCREEN_APP_TYPE
NOTISET_TRACE_BEGIN;
ug_data *ugd = (ug_data *) data;
retv_if(!ugd, EINA_FALSE);
- if(ugd->init_thread)
+ if (ugd->init_thread)
ecore_thread_cancel(ugd->init_thread);
ui_app_exit();
return EINA_FALSE;
}
-static Evas_Object* _create_do_not_disturb_gl(ug_data *ugd)
+static Evas_Object *_create_do_not_disturb_gl(ug_data *ugd)
{
Evas_Object *parent = ugd->naviframe;
return genlist;
}
-Evas_Object* _create_lockscreen_content(ug_data *ugd)
+Evas_Object *_create_lockscreen_content(ug_data *ugd)
{
Evas_Object *bg = create_background(ugd->naviframe);
evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
return bg;
}
-static void * _update_dnd_view(void *data)
+static void *_update_dnd_view(void *data)
{
ug_data *ugd = (ug_data *) data;
ugd->list_main = _create_do_not_disturb_gl(ugd);
static void _init_dnd_app_list(void *data, Ecore_Thread *thread)
{
create_do_not_disturb_application_list();
- //check if thread isn't pending cancellation
+ /* check if thread isn't pending cancellation */
if (!ecore_thread_check(thread))
ecore_main_loop_thread_safe_call_sync(_update_dnd_view, data);
}
NOTISET_TRACE_BEGIN;
retv_if(!ugd, NULL);
- switch(type)
- {
+ switch (type) {
case NOTIF_APP_TYPE:
_create_notif_view(ugd);
break;
app_control_get_operation(app_control, &op_str);
- if(!op_str)
- {
+ if (!op_str) {
NOTISET_DBG("app_control operation is null");
return;
}
NOTISET_DBG("%s", op_str);
app_type type = NOTIF_APP_TYPE;
- if(strcmp(DO_NOT_DISTURB_OP, op_str) == 0)
- {
+ if (strcmp(DO_NOT_DISTURB_OP, op_str) == 0) {
type = DO_NOT_DISTURB_APP_TYPE;
- }
- else if(strcmp(NOTIFICATIONS_ON_LOCK_SCREEN_OP, op_str) == 0)
- {
+ } else if (strcmp(NOTIFICATIONS_ON_LOCK_SCREEN_OP, op_str) == 0) {
type = NOTIFICATION_ON_LOCK_SCREEN_APP_TYPE;
}
{
char *lang = NULL;
system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &lang);
- if(lang)
- {
+ if (lang) {
NOTISET_DBG("Language: %s", lang);
elm_language_set(lang);
i18n_ulocale_layout_type_e layout = I18N_ULOCALE_LAYOUT_UNKNOWN;
- if(i18n_ulocale_get_character_orientation(lang, &layout) == I18N_ERROR_NONE)
- {
- if(layout == I18N_ULOCALE_LAYOUT_LTR)
+ if (i18n_ulocale_get_character_orientation(lang, &layout) == I18N_ERROR_NONE) {
+ if (layout == I18N_ULOCALE_LAYOUT_LTR)
elm_config_mirrored_set(false);
- else if(layout == I18N_ULOCALE_LAYOUT_RTL)
+ else if (layout == I18N_ULOCALE_LAYOUT_RTL)
elm_config_mirrored_set(true);
else
NOTISET_ERR("Unsupported character orientation type: %s", layout);
NOTISET_TRACE_BEGIN;
ug_data *ug_main = calloc(1, sizeof(ug_data));
- if(!ug_main)
- {
+ if (!ug_main) {
NOTISET_ERR("CALLOC ERROR");
ug_main = NULL;
assert(false);
#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
+/* 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()
if (item_info->name && strcmp(package_name, VOICE_CALL_PACKAGE)
&& strcmp(package_name, CALENDAR_PACKAGE)
- && strcmp(package_name, CLOCK_PACKAGE))
- {
- if(item_info->allow_to_notify)
+ && strcmp(package_name, CLOCK_PACKAGE)) {
+ if (item_info->allow_to_notify)
setting_info->apps_noti_allowed_list = eina_list_append(setting_info->apps_noti_allowed_list, item_info);
else
setting_info->apps_noti_blocked_list = eina_list_append(setting_info->apps_noti_blocked_list, item_info);
setting_info->apps_noti_allowed_list = eina_list_remove(setting_info->apps_noti_allowed_list, item_info);
setting_info->apps_noti_blocked_list = eina_list_remove(setting_info->apps_noti_blocked_list, item_info);
- if(get_allow_to_nofity(item_info->appid))
+ if (get_allow_to_nofity(item_info->appid))
setting_info->apps_noti_allowed_list = eina_list_sorted_insert(setting_info->apps_noti_allowed_list, apps_sort_cb, item_info);
else
setting_info->apps_noti_blocked_list = eina_list_sorted_insert(setting_info->apps_noti_blocked_list, apps_sort_cb, item_info);
NOTISET_DBG("count %d", count);
item_info_s *item_info = NULL;
- for(i = 0; i < count; i++)
- {
+ for (i = 0; i < count; i++) {
item_info = calloc(1, sizeof(item_info_s));
- if(item_info)
- {
+ if (item_info) {
temp = setting_array + i;
notification_setting_get_package_name(temp, &package_name);
item_info->icon = get_app_icon(package_name);
- if(!strcmp(package_name, CALENDAR_PACKAGE))
+ if (!strcmp(package_name, CALENDAR_PACKAGE))
item_info->name = strdup(APP_STRING("IDS_COM_BODY_CALENDAR_EVENTS"));
- else if(!strcmp(package_name, CLOCK_PACKAGE))
+ 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 && !strcmp(package_name, MESSAGES_PACKAGE)) || !strcmp(package_name, CLOCK_PACKAGE)
- || !strcmp(package_name, CALENDAR_PACKAGE) )
- {
+ if (item_info->name) {
+ 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)
- {
+ 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)
+ if (allow_to_notify && strcmp(package_name, MESSAGES_PACKAGE)
&& strcmp(package_name, CALENDAR_PACKAGE)
- && strcmp(package_name, CLOCK_PACKAGE))
- {
- if(do_not_disturb_except)
- {
+ && strcmp(package_name, CLOCK_PACKAGE)) {
+ if (do_not_disturb_except) {
setting_info->excepted_list = eina_list_append(setting_info->excepted_list, item_info);
- }
- else
- {
+ } else {
setting_info->not_excepted_list = eina_list_append(setting_info->not_excepted_list, item_info);
}
}
- }
- else
- {
+ } else {
FREEIF(package_name);
FREEIF(item_info->name);
FREEIF(item_info->icon);
Eina_List *sub_list = NULL;
Eina_List *list = get_first_allowed_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)
setting_info->first_excepted_list = eina_list_append(setting_info->first_excepted_list, item);
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)
+ while (list) {
+ item_info_s *item = (item_info_s *) eina_list_data_get(list);
+ if (item->do_not_disturb_except)
sub_list = eina_list_append(sub_list, item);
else
setting_info->not_excepted_list = eina_list_sorted_insert(setting_info->not_excepted_list, apps_sort_cb, item);
list = get_not_excepted_apps_list();
sub_list = NULL;
- 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)
setting_info->excepted_list = eina_list_sorted_insert(setting_info->excepted_list, apps_sort_cb, item);
else
sub_list = eina_list_append(sub_list, item);
}
-static void _remove_apps_list(Eina_List* input_list)
+static void _remove_apps_list(Eina_List *input_list)
{
NOTISET_TRACE_BEGIN;
item_info_s *item_info = NULL;
- if(input_list)
- {
+ if (input_list) {
EINA_LIST_FREE(input_list, item_info)
{
-// NOTISET_DBG("remove %s", item_info->name);
FREEIF(item_info->appid);
FREEIF(item_info->name);
FREEIF(item_info->icon);
void remove_lower_noti_list()
{
NOTISET_TRACE_BEGIN;
- if(setting_info)
+ if (setting_info)
_remove_apps_list(setting_info->lower_noti_list);
}
-void remove_apps_noti_allowed_list() {
+void remove_apps_noti_allowed_list()
+{
NOTISET_TRACE_BEGIN;
- if(setting_info) {
+ if (setting_info) {
_remove_apps_list(setting_info->apps_noti_allowed_list);
}
}
-void remove_apps_noti_blocked_list() {
+void remove_apps_noti_blocked_list()
+{
NOTISET_TRACE_BEGIN;
- if(setting_info)
- {
+ if (setting_info) {
_remove_apps_list(setting_info->apps_noti_blocked_list);
}
}
void remove_excepted_apps_list()
{
NOTISET_TRACE_BEGIN;
- if(setting_info)
- {
+ if (setting_info) {
_remove_apps_list(setting_info->first_excepted_list);
_remove_apps_list(setting_info->excepted_list);
_remove_apps_list(setting_info->first_allowed_list);
void update_apps_settings_info()
{
NOTISET_TRACE_BEGIN;
- if(setting_info)
- {
+ if (setting_info) {
Eina_List *first_list = eina_list_merge(setting_info->first_allowed_list, setting_info->excepted_list);
setting_info->first_allowed_list = NULL;
setting_info->excepted_list = NULL;
first_list = NULL;
setting_info->not_excepted_list = NULL;
- while(list)
- {
- item_info_s *item = (item_info_s*)eina_list_data_get(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);
}
#include <utils_i18n_udate.h>
#include <utils_i18n_ucalendar.h>
-enum TimeFormat
- {
- time_format_unknown,
- time_format_24H,
- time_format_12H
- };
+enum TimeFormat {
+ time_format_unknown,
+ time_format_24H,
+ time_format_12H
+};
#define POPUP_TIME_12_FORMAT "%d/%b/%Y %I:%M %p"
#define TIME_12_FORMAT "%I:%M %p"
#define GREEN_TEXT_MAIN "<color=#b3b3b3>%s</color>"
#define GREY_TEXT_MAIN "<color=#97e57b>%s</color>"
-typedef struct changecolor
-{
+typedef struct changecolor {
dnd_schedule_week_flag_e week;
const char *text;
bool change_color;
Evas_Object *label;
} changecolor_s;
-typedef struct datetime
-{
+typedef struct datetime {
Evas_Object *button;
Evas_Object *datetime;
Evas_Object *popup;
static void close_set_schedule_cb(void *data, Evas_Object *obj, void *event_info);
static void make_color_text(int dayCode, dnd_schedule_week_flag_e week_day, const char *text, char* outBuf);
static void save_dnd_weekday(int dayCode);
-static bool same_time(struct tm* timeA, struct tm* timeB);
+static bool same_time(struct tm *timeA, struct tm *timeB);
static void create_popup(datetime_s *dt);
static bool is_empty_str(const char *str);
static int safe_str_len(const char *str);
char buf[DEF_BUF_LEN] = {0,};
ssize_t len = readlink("/opt/etc/localtime", buf, sizeof(buf) - 1);
- if (len != -1)
- {
+ if (len != -1) {
buf[len] = '\0';
- }
- else
- {
+ } else {
NOTISET_ERR("Getting default timezone failed, use system settings value");
char res[MAX_CHAR_LEN] = {0,};
char *time_zone = NULL;
system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &time_zone);
- if(time_zone)
- {
+ if (time_zone) {
strncpy(res, time_zone, safe_str_len(time_zone));
free(time_zone);
}
NOTISET_ERR("default timezone set error");
/* convert time_t to UDate, if it is */
- if(time)
+ if (time)
date = (i18n_udate)time * 1000;
else
i18n_ucalendar_get_now(&date);
status = get_date_format(locale, u_best_pattern, &date_format);
- if(status == I18N_ERROR_NONE)
- {
+ if (status == I18N_ERROR_NONE) {
/* get formatted string */
i18n_udate_format_date(date_format, date, formatted, formatted_capacity, NULL, &formatted_length);
/* convert uchar to char */
NOTISET_TRACE_BEGIN;
char *lang = NULL;
system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &lang);
- if(lang)
- {
+ if (lang) {
struct tm msgTimeTm;
localtime_r(&curr_time, &msgTimeTm);
const char *time_format = get_time_format() == time_format_12H ? TIME_12H : TIME_24H;
end_time_p.saved_time.tm_sec = 0;
notification_system_setting_dnd_schedule_get_start_time(get_system_setting(), &start_time_p.saved_time.tm_hour, &start_time_p.saved_time.tm_min);
- if(start_time_p.saved_time.tm_hour == 0 && start_time_p.saved_time.tm_min == 0)
- {
+ if (start_time_p.saved_time.tm_hour == 0 && start_time_p.saved_time.tm_min == 0) {
start_time_p.saved_time.tm_hour = 22;
notification_system_setting_dnd_schedule_set_start_time(get_system_setting(), start_time_p.saved_time.tm_hour, start_time_p.saved_time.tm_min);
}
notification_system_setting_dnd_schedule_get_end_time(get_system_setting(), &end_time_p.saved_time.tm_hour, &end_time_p.saved_time.tm_min);
- if(end_time_p.saved_time.tm_hour == 0 && end_time_p.saved_time.tm_min == 0)
- {
+ if (end_time_p.saved_time.tm_hour == 0 && end_time_p.saved_time.tm_min == 0) {
end_time_p.saved_time.tm_hour = 8;
notification_system_setting_dnd_schedule_set_start_time(get_system_setting(), end_time_p.saved_time.tm_hour, end_time_p.saved_time.tm_min);
}
buff_start = make_time_string(mktime(start_time));
buff_end = make_time_string(mktime(end_time));
- if(buff_start && buff_end)
- {
+ if (buff_start && buff_end) {
snprintf(buff, TIME_STRING_SIZE, "%s ~ %s %s", buff_start, buff_end, is_next_day() ? APP_STRING("IDS_ST_SBODY_NEXT_DAY_M_LC_ABB") : "");
}
- if(buff_start)
- {
+ if (buff_start) {
free(buff_start);
buff_start = NULL;
}
- if(buff_end)
- {
+ if (buff_end) {
free(buff_end);
buff_end = NULL;
}
static void make_color_text(int dayCode, dnd_schedule_week_flag_e week_day, const char *text, char* outBuf)
{
char formattedDay[DAY_MAX_LENGTH] = { 0 };
- if((dayCode & week_day) == 0)
+ if ((dayCode & week_day) == 0)
snprintf(formattedDay, DAY_MAX_LENGTH, GREEN_TEXT_MAIN, text);
else
snprintf(formattedDay, DAY_MAX_LENGTH, GREY_TEXT_MAIN, text);
unsigned int i = 1;
unsigned int size = elm_genlist_items_count(ug_main->list_sub);
Elm_Object_Item *item = elm_genlist_first_item_get(ug_main->list_sub);
- for(; i < size; ++i)
- {
+ for (; i < size; ++i) {
Elm_Object_Item *next = elm_genlist_item_next_get(item);
elm_object_item_disabled_set(next, !enable);
item = next;
{
NOTISET_TRACE_BEGIN;
bool timeFormat = false;
- if(system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &timeFormat) < 0)
+ if (system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &timeFormat) < 0)
return time_format_unknown;
return timeFormat ? time_format_24H : time_format_12H;
}
Evas_Object *layout = elm_layout_add(parent);
char *res_path = app_get_resource_path();
- if(res_path)
- {
+ if (res_path) {
char edj_path[PATH_MAX] = { 0, };
snprintf(edj_path, PATH_MAX, "%s%s", res_path, "edje/repeat_weekly_item.edj");
elm_layout_file_set(layout, edj_path, "weekly_item");
notification_system_setting_dnd_schedule_set_day(get_system_setting(), dayCode);
}
-static bool same_time(struct tm* timeA, struct tm* timeB)
+static bool same_time(struct tm *timeA, struct tm *timeB)
{
time_t t1 = mktime(timeA);
time_t t2 = mktime(timeB);
static void save_date_time(datetime_s *dt)
{
- if(dt->saved_time.tm_hour == start_time_p.saved_time.tm_hour && dt->saved_time.tm_min == start_time_p.saved_time.tm_min)
+ if (dt->saved_time.tm_hour == start_time_p.saved_time.tm_hour && dt->saved_time.tm_min == start_time_p.saved_time.tm_min)
notification_system_setting_dnd_schedule_set_start_time(get_system_setting(), dt->saved_time.tm_hour, dt->saved_time.tm_min);
else
notification_system_setting_dnd_schedule_set_end_time(get_system_setting(), dt->saved_time.tm_hour, dt->saved_time.tm_min);
changecolor_s *cc = data;
char buf[BUTTON_TEXT_SIZE] = {0, };
- if(cc->change_color)
- {
+ if (cc->change_color) {
new_dnd_schedule_weekday ^= cc->week;
snprintf(buf, sizeof(buf), GREEN_TEXT_COLOR, cc->text);
elm_object_text_set(cc->label, buf);
- }
- else
- {
+ } else {
new_dnd_schedule_weekday |= cc->week;
snprintf(buf, sizeof(buf), GREY_TEXT_COLOR, cc->text);
elm_object_text_set(cc->label, buf);
static Evas_Object *create_week_button(Evas_Object *parent, const char *text, dnd_schedule_week_flag_e week)
{
- //add buttons
+ /*add buttons*/
char buf[BUTTON_TEXT_SIZE] = {0, };
Evas_Object *button = elm_button_add(parent);
evas_object_size_hint_max_set(button, WEEK_BUTTON_SIZE, WEEK_BUTTON_SIZE);
evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
changecolor_s *cc = calloc(1, sizeof(changecolor_s));
- if(!cc)
+ if (!cc)
return NULL;
cc->week = week;
cc->label = label;
cc->text = text;
- if((default_dnd_schedule_weekday & week) == 0)
- {
+ if ((default_dnd_schedule_weekday & week) == 0) {
snprintf(buf, sizeof(buf), GREEN_TEXT_COLOR, text);
cc->change_color = false;
- }
- else
- {
+ } else {
snprintf(buf, sizeof(buf), GREY_TEXT_COLOR, text);
cc->change_color = true;
}
{
Evas_Object *layout = create_week_repeat_layout(parent);
char buf[MAX_TEXT_SIZE] = {0, };
- // Set text into layout
+ /* Set text into layout */
Evas_Object *text = elm_label_add(layout);
elm_label_ellipsis_set(text, EINA_TRUE);
evas_object_size_hint_weight_set(text, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_datetime_value_get(dt->datetime, &dt->saved_time);
- if(dt->is_start_time)
+ if (dt->is_start_time)
notification_system_setting_dnd_schedule_set_start_time(get_system_setting(), dt->saved_time.tm_hour, dt->saved_time.tm_min);
else
notification_system_setting_dnd_schedule_set_end_time(get_system_setting(), dt->saved_time.tm_hour, dt->saved_time.tm_min);
buff = make_time_string(mktime(&dt->saved_time));
- if(buff)
- {
+ if (buff) {
elm_object_text_set(dt->button, buff);
free(buff);
buff = NULL;
char *format = get_time_format() == time_format_12H ? TIME_12_FORMAT : TIME_24_FORMAT;
bool fmt12hours = !strcmp(format, TIME_12_FORMAT);
const char *fmt = fmt12hours ? TIME_12_LAYOUT : TIME_24_LAYOUT;
- const char* timeMask = fmt12hours ? POPUP_TIME_12_FORMAT : POPUP_TIME_24_FORMAT;
+ const char *timeMask = fmt12hours ? POPUP_TIME_12_FORMAT : POPUP_TIME_24_FORMAT;
elm_object_style_set(dt->datetime, fmt);
elm_datetime_format_set(dt->datetime, timeMask);
Evas_Object *layout = elm_layout_add(parent);
char *res_path = app_get_resource_path();
- if(res_path)
- {
+ if (res_path) {
char edj_path[PATH_MAX] = { 0, };
snprintf(edj_path, PATH_MAX, "%s%s", res_path, "edje/time_button_layout.edj");
elm_layout_file_set(layout, edj_path, "button_layout");
return layout;
}
-Evas_Object* start_end_time_item(Evas_Object* parent, bool is_start_time_item)
+Evas_Object *start_end_time_item(Evas_Object *parent, bool is_start_time_item)
{
- Evas_Object* layout = create_start_end_time_layout(parent);
+ Evas_Object *layout = create_start_end_time_layout(parent);
char *buff = NULL;
datetime_s dt;
time_t local_time = time(0);
dt.saved_time = *time_info;
dt.saved_time.tm_sec = 0;
- if(is_start_time_item)
- {
+ if (is_start_time_item) {
notification_system_setting_dnd_schedule_get_start_time(get_system_setting(), &dt.saved_time.tm_hour, &dt.saved_time.tm_min);
start_time_p = dt;
- }
- else
- {
+ } else {
notification_system_setting_dnd_schedule_get_end_time(get_system_setting(), &dt.saved_time.tm_hour, &dt.saved_time.tm_min);
end_time_p = dt;
}
char *timeFormat = get_time_format() == time_format_12H ? TIME_12_FORMAT : TIME_24_FORMAT;
- if(is_start_time_item)
- {
+ if (is_start_time_item) {
buff = make_time_string(mktime(&start_time_p.saved_time));
NOTISET_DBG("start_time_p = %s", buff);
start_time_p.button = create_time_button(layout, buff, timeFormat, &start_time_p);
- }
- else
- {
+ } else {
buff = make_time_string(mktime(&end_time_p.saved_time));
NOTISET_DBG("ent_time_p = %s", buff);
end_time_p.button = create_time_button(layout, buff, timeFormat, &end_time_p);
}
- if(buff)
- {
+ if (buff) {
free(buff);
buff = NULL;
}
{
NOTISET_TRACE_BEGIN;
ret_if(!data);
- ug_data *ugd = (ug_data*)data;
+ ug_data *ugd = (ug_data *)data;
bool update_ui = false;
- if(new_dnd_schedule_weekday != default_dnd_schedule_weekday)
- {
+ if (new_dnd_schedule_weekday != default_dnd_schedule_weekday) {
save_dnd_weekday(new_dnd_schedule_weekday);
update_ui = true;
}
- if(!same_time(&start_time_p.saved_time, &start_time_p.default_time))
- {
+ if (!same_time(&start_time_p.saved_time, &start_time_p.default_time)) {
save_date_time(&start_time_p);
update_ui = true;
}
- if(!same_time(&end_time_p.saved_time, &end_time_p.default_time))
- {
+ if (!same_time(&end_time_p.saved_time, &end_time_p.default_time)) {
save_date_time(&end_time_p);
update_ui = true;
}
- if(update_ui)
+ if (update_ui)
elm_genlist_item_update(elm_genlist_item_next_get(elm_genlist_first_item_get(ugd->list_main)));
elm_naviframe_item_pop(ugd->naviframe);
notification_system_setting_h get_system_setting()
{
NOTISET_TRACE_BEGIN;
- if(!system_setting)
+ if (!system_setting)
load_system_setting();
return system_setting;
{
NOTISET_TRACE_BEGIN;
int err = NOTIFICATION_ERROR_NONE;
- if(system_setting)
- {
+ if (system_setting) {
err = notification_system_setting_update_system_setting(system_setting);
if (err != NOTIFICATION_ERROR_NONE)
NOTISET_ERR("notification_setting_update_setting [%d]\n", err);
- if(system_setting)
+ if (system_setting)
notification_system_setting_free_system_setting(system_setting);
system_setting = NULL;
static void load_system_setting()
{
- if(!system_setting)
- {
+ if (!system_setting) {
int err = notification_system_setting_load_system_setting(&system_setting);
- if(err != NOTIFICATION_ERROR_NONE|| system_setting == NULL)
- {
+ if (err != NOTIFICATION_ERROR_NONE || system_setting == NULL) {
NOTISET_ERR("notification_system_setting_load_system_setting failed [%d]\n", err);
- if(system_setting)
+ if (system_setting)
notification_system_setting_free_system_setting(system_setting);
system_setting = NULL;