From: Jinkun Jang Date: Fri, 15 Mar 2013 16:03:45 +0000 (+0900) Subject: merge with master X-Git-Tag: 2.1b_release~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=b4ebab4ee5a7a7f92de861829b454f276a462c93;p=apps%2Fcore%2Fpreloaded%2Fcalendar.git merge with master --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b0d111..54c2d52 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,7 @@ pkg_check_modules(pkgs REQUIRED ecore-evas notification capi-content-media-content + status ) FOREACH(flag ${pkgs_CFLAGS}) diff --git a/common/cal-svc.c b/common/cal-svc.c index 1b7ca33..5cc4cca 100755 --- a/common/cal-svc.c +++ b/common/cal-svc.c @@ -2660,3 +2660,118 @@ void _calendar_get_coordinates(calendar_record_h record, double *latitude, doubl c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_get_double() is failed(%x)", error); } } +calendar_record_h __calendar_get_extended_record(calendar_record_h record, const char *extended_key) +{ + calendar_record_h child_record = NULL; + + c_retv_if(!record, child_record); + c_retv_if(!CAL_STRLEN(extended_key), child_record); + + calendar_error_e error = CALENDAR_ERROR_NONE; + + unsigned int child_record_count = 0; + + unsigned int property_id = 0; + + if (_calendar_is_task_record(record)) + property_id = _calendar_todo.extended; + else + property_id = _calendar_event.extended; + + error = calendar_record_get_child_record_count(record, property_id, &child_record_count); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_get_child_record_count() is failed(%x)", error); + + int i = 0; + + for (i = 0; i < child_record_count; i++) { + + error = calendar_record_get_child_record_at_p(record, property_id, i, &child_record); + if (error != CALENDAR_ERROR_NONE) { + ERR("calendar_record_get_child_record_at_p(%d) is failed(%x)", error); + continue; + } + + char *key = NULL; + + error = calendar_record_get_str_p(child_record, _calendar_extended_property.key, &key); + if (error != CALENDAR_ERROR_NONE) { + ERR("calendar_record_get_str_p(%d) is failed(%x)", error); + continue; + } + + if (!CAL_STRCMP(key, extended_key)) + return child_record; + + } + + return NULL; +} + +void _calendar_set_timezone_city(calendar_record_h record, const char *city) +{ + CAL_FN_START; + + c_ret_if(!record); + c_ret_if(!CAL_STRLEN(city)); + + calendar_record_h child_record = __calendar_get_extended_record(record, CAL_EXTENDED_KEY_TIMEZONE_CITY); + + calendar_error_e error = CALENDAR_ERROR_NONE; + + unsigned int property_id = 0; + + if (_calendar_is_task_record(record)) + property_id = _calendar_todo.extended; + else + property_id = _calendar_event.extended; + + if (!child_record) { + error = calendar_record_create(_calendar_extended_property._uri, &child_record); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_create() is failed(%x)", error); + + error = calendar_record_add_child_record(record, property_id, child_record); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_add_child_record() is failed(%x)", error); + + error = calendar_record_set_str(child_record, _calendar_extended_property.key, CAL_EXTENDED_KEY_TIMEZONE_CITY); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_str() is failed(%x)", error); + } + + error = calendar_record_set_str(child_record, _calendar_extended_property.value, city); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_str() is failed(%x)", error); +} + +char * _calendar_get_timezone_city(calendar_record_h record) +{ + CAL_FN_START; + + char *timezone_city = NULL; + + c_retv_if(!record, timezone_city); + + calendar_record_h child_record = __calendar_get_extended_record(record, CAL_EXTENDED_KEY_TIMEZONE_CITY); + + if (!child_record) + return NULL; + + calendar_error_e error = CALENDAR_ERROR_NONE; + + error = calendar_record_get_str(child_record, _calendar_extended_property.value, &timezone_city); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_get_str() is failed(%x)", error); + + return timezone_city; +} +Eina_Bool _calendar_is_event_or_task(calendar_record_h record) +{ + c_retv_if(!record, EINA_FALSE); + + + char* uri = NULL; + + calendar_error_e error = calendar_record_get_uri_p(record, &uri); + c_retv_if(error != CALENDAR_ERROR_NONE, EINA_FALSE); + + if (!CAL_STRCMP(uri, _calendar_event._uri) || !CAL_STRCMP(uri, _calendar_todo._uri)) + return EINA_TRUE; + + return EINA_FALSE; +} diff --git a/data/edc/layout/inc.layouts.edc b/data/edc/layout/inc.layouts.edc index af981e5..8b627f0 100755 --- a/data/edc/layout/inc.layouts.edc +++ b/data/edc/layout/inc.layouts.edc @@ -537,6 +537,15 @@ group { name, "list/base"; visible, 1; } } + part { name, "sw_nocontents"; + type, SWALLOW; + description { + state, "default" 0.0; + rel1 { relative: 0.0 0.0; to: "base"; } + rel2.to, "base"; + visible, 1; + } + } part { name: "sel.swallow.contents"; type: SWALLOW; diff --git a/data/edc/theme2/genlist.edc b/data/edc/theme2/genlist.edc index ada6f70..99c5f2e 100755 --- a/data/edc/theme2/genlist.edc +++ b/data/edc/theme2/genlist.edc @@ -80,7 +80,7 @@ text { font: "SLP:style=Medium"; size: 64; - min: 1 1; + min: 0 1; text: "00"; text_class: "entry"; } diff --git a/data/edc/theme3/originals/genlist_macro.edc b/data/edc/theme3/originals/genlist_macro.edc index 1495ef1..7f8e081 100644 --- a/data/edc/theme3/originals/genlist_macro.edc +++ b/data/edc/theme3/originals/genlist_macro.edc @@ -1,20 +1,19 @@ /* - * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved - * - * PROPRIETARY/CONFIDENTIAL - * - * This software is the confidential and proprietary information of SAMSUNG - * ELECTRONICS ("Confidential Information"). You agree and acknowledge that this - * software is owned by Samsung and you shall not disclose such Confidential - * Information and shall use it only in accordance with the terms of the license - * agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no - * representations or warranties about the suitability of the software, either - * express or implied, including but not limited to the implied warranties of - * merchantability, fitness for a particular purpose, or non-infringement. - * SAMSUNG shall not be liable for any damages suffered by licensee arising out - * of or releated to this software. - * - */ + * + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ //****************************************************************************// // ******************************* Default size macro **********************// @@ -3057,4 +3056,4 @@ #define GENLIST_PROGRAM_PLAY_BUTTON_PRESS \ program { name: "play_button_press"; \ } -#endif \ No newline at end of file +#endif diff --git a/data/edc/theme3/originals/genlist_textblock_style.edc b/data/edc/theme3/originals/genlist_textblock_style.edc index 9aae8ca..6c5807f 100644 --- a/data/edc/theme3/originals/genlist_textblock_style.edc +++ b/data/edc/theme3/originals/genlist_textblock_style.edc @@ -1,20 +1,19 @@ /* - * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved - * - * PROPRIETARY/CONFIDENTIAL - * - * This software is the confidential and proprietary information of SAMSUNG - * ELECTRONICS ("Confidential Information"). You agree and acknowledge that this - * software is owned by Samsung and you shall not disclose such Confidential - * Information and shall use it only in accordance with the terms of the license - * agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no - * representations or warranties about the suitability of the software, either - * express or implied, including but not limited to the implied warranties of - * merchantability, fitness for a particular purpose, or non-infringement. - * SAMSUNG shall not be liable for any damages suffered by licensee arising out - * of or releated to this software. - * - */ + * + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /* * vim:ts=3 diff --git a/data/edc/theme3/originals/tizen-hd-inc.edc b/data/edc/theme3/originals/tizen-hd-inc.edc index 33aaead..bcd3311 100644 --- a/data/edc/theme3/originals/tizen-hd-inc.edc +++ b/data/edc/theme3/originals/tizen-hd-inc.edc @@ -1,20 +1,19 @@ /* - * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved - * - * PROPRIETARY/CONFIDENTIAL - * - * This software is the confidential and proprietary information of SAMSUNG - * ELECTRONICS ("Confidential Information"). You agree and acknowledge that this - * software is owned by Samsung and you shall not disclose such Confidential - * Information and shall use it only in accordance with the terms of the license - * agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no - * representations or warranties about the suitability of the software, either - * express or implied, including but not limited to the implied warranties of - * merchantability, fitness for a particular purpose, or non-infringement. - * SAMSUNG shall not be liable for any damages suffered by licensee arising out - * of or releated to this software. - * - */ + * + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #define BG_DEFAULT_COLOR_INC 248 246 239 255 #define BG_EDIT_MODE_COLOR_INC 248 246 239 255 diff --git a/include/cal-svc.h b/include/cal-svc.h index 133531d..6ec699d 100755 --- a/include/cal-svc.h +++ b/include/cal-svc.h @@ -31,6 +31,7 @@ #define CAL_GRID_ITEM_KEY_SNOTE "snote" #define CAL_GRID_ITEM_KEY_PHOTO "photo" +#define CAL_EXTENDED_KEY_TIMEZONE_CITY "city" #define _calendar_show_error(error) \ do { \ @@ -173,4 +174,7 @@ void _calendar_get_recurrence_frequency_str(int freq, char *buf, int size); void _calendar_set_coordinates(calendar_record_h record, double latitude, double longitude); void _calendar_get_coordinates(calendar_record_h record, double *latitude, double *longitude); +void _calendar_set_timezone_city(calendar_record_h record, const char *city); +char * _calendar_get_timezone_city(calendar_record_h record); +Eina_Bool _calendar_is_event_or_task(calendar_record_h record); #endif /* __CALENDAR_CAL_SVC_H__ */ diff --git a/include/cld.h b/include/cld.h index ab070a3..0e70d45 100755 --- a/include/cld.h +++ b/include/cld.h @@ -23,9 +23,9 @@ #include #include #include +#include #include "cal-svc.h" - #include "cld-log.h" #include "cld-utils.h" @@ -155,7 +155,8 @@ typedef struct appdata { Evas_Object *win; //window Evas_Coord win_w; //width of window - Evas_Coord win_h; //height of window + Evas_Coord win_h; //height of window + app_device_orientation_e orientation; // direction of device Evas_Object *conform; //conformants Evas_Object *base; //base layout Evas_Object *naviframe; //naviframe diff --git a/packaging/org.tizen.calendar.spec b/packaging/org.tizen.calendar.spec index a097736..2155906 100755 --- a/packaging/org.tizen.calendar.spec +++ b/packaging/org.tizen.calendar.spec @@ -26,6 +26,7 @@ BuildRequires: gettext-devel BuildRequires: pkgconfig(ui-gadget-1) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(capi-content-media-content) +BuildRequires: pkgconfig(status) Requires : email-service contacts-service2 Requires : ug-bluetooth-efl diff --git a/src/list-base.c b/src/list-base.c index 2885952..d23c94c 100755 --- a/src/list-base.c +++ b/src/list-base.c @@ -361,6 +361,9 @@ static void __cal_list_delete_norepeat_popup_response_event_callback(void *data, if (NULL != strstr(elm_object_text_get(button), S_("IDS_COM_BODY_DELETE"))) { _calendar_delete_record_with_index(p->ad->cid); + + int r = status_message_post(S_("IDS_COM_POP_DELETED")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); } evas_object_del(p->popup); @@ -408,6 +411,9 @@ static void __cal_list_delete_event(cal_list_base_s* p, Eina_Bool is_delete_all) _calendar_delete_recurrence_instance(p->selected_record); else _calendar_delete_record_with_index(ad->cid); + + int r = status_message_post(S_("IDS_COM_POP_DELETED")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); } static void __cal_list_delete_popup_response_event_callback(void *data, Evas_Object *obj, void *event_info) diff --git a/src/list-delete.c b/src/list-delete.c index e6ab5bb..d3bc181 100755 --- a/src/list-delete.c +++ b/src/list-delete.c @@ -2175,6 +2175,8 @@ static void __cal_list_delete_popup_response_event_callback(void *data, Evas_Obj elm_object_disabled_set(p->bt_delete, EINA_TRUE); + int r = status_message_post(S_("IDS_COM_POP_DELETED")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); } evas_object_del(p->popup); @@ -2233,6 +2235,8 @@ static void __cal_list_delete_delete_event(cal_list_delete_data* p, Eina_Bool is it = temp; } + int r = status_message_post(S_("IDS_COM_POP_DELETED")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); elm_object_disabled_set(p->bt_delete, EINA_TRUE); } diff --git a/src/main.c b/src/main.c index d03d08a..ada54b1 100755 --- a/src/main.c +++ b/src/main.c @@ -873,6 +873,11 @@ static void cal_device_orientation(app_device_orientation_e orientation, void *u break; } + if (ad->orientation == orientation) + return; + + ad->orientation = orientation; + ad->is_landscape_mode = is_landscape_mode; if (ad->is_landscape_mode) { diff --git a/src/view-main-week.c b/src/view-main-week.c index 4f2110e..9c58916 100755 --- a/src/view-main-week.c +++ b/src/view-main-week.c @@ -998,6 +998,9 @@ static void __cal_week_delete_norepeat_popup_response_event_callback(void *data, calendar_record_h record = evas_object_data_get(p->ly, "record"); _calendar_delete_record(record); + + int r = status_message_post(S_("IDS_COM_POP_DELETED")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); } evas_object_del(p->popup); diff --git a/ug/detail/detail-ug.c b/ug/detail/detail-ug.c index a96adde..016da86 100755 --- a/ug/detail/detail-ug.c +++ b/ug/detail/detail-ug.c @@ -1067,6 +1067,9 @@ static void __cal_detail_save_button_callback(void *user_data, Evas_Object *obj, error = calendar_db_insert_record(record, NULL); if (error != CALENDAR_ERROR_NONE) { ERR("calendar_db_insert_record() is failed(%x)", error); + } else { + int r = status_message_post(S_("IDS_COM_POP_SAVED")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); } } @@ -1083,6 +1086,9 @@ static void __cal_detail_delete_event(cal_detail_ug_data *data, Eina_Bool is_del else _calendar_delete_record(record); + int r = status_message_post(S_("IDS_COM_POP_DELETED")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); + ug_destroy_me(data->ug); } @@ -1444,17 +1450,37 @@ static void *__cal_detail_ug_create_callback(ui_gadget_h ug, enum ug_mode mode, error = calendar_vcalendar_parse_to_calendar(raw_data, &list); c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_vcalendar_parse_to_calendar() is failed(%x)", error); - if (list) { - calendar_record_h record = NULL; + error = calendar_list_first(list); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_first() is failed(%x)", error); + + calendar_record_h record = NULL; + + error = calendar_list_get_current_record_p(list, &record); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error); + + while (record) { + error = calendar_list_get_current_record_p(list, &record); c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error); - error = calendar_record_clone(record, &data->record); - c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_clone() is failed(%x)", error); + if (_calendar_is_event_or_task(record)) { + + error = calendar_record_clone(record, &data->record); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_clone() is failed(%x)", error); - error = calendar_list_destroy(list, true); + break; + } + + error = calendar_list_next(list); + + record = NULL; + + error = calendar_list_get_current_record_p(list, &record); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error); } + error = calendar_list_destroy(list, true); + free(raw_data); } } diff --git a/ug/edit/edit-ug.c b/ug/edit/edit-ug.c index 9f4438e..efc3f4f 100755 --- a/ug/edit/edit-ug.c +++ b/ug/edit/edit-ug.c @@ -243,23 +243,34 @@ static inline void __cal_edit_ug_set_record_note(calendar_record_h record, const c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_str() is failed(%x)", error); } -static void __cal_edit_ug_set_record_time(cal_edit_ug_data *p, calendar_record_h record) +static void __cal_edit_ug_set_timezone(calendar_record_h record, const char *timezone_path, const char *timezone_city) { - c_ret_if(!p); c_ret_if(!record); + c_ret_if(!CAL_STRLEN(timezone_path)); + c_ret_if(!CAL_STRLEN(timezone_city)); - if (!p->timezone_path) - cal_util_get_timezone(&p->timezone_path, &p->timezone_city, &p->timezone_offset); + calendar_error_e error = CALENDAR_ERROR_NONE; - c_ret_if(!p->timezone_path); + if (_calendar_is_task_record(record)) { + error = calendar_record_set_str(record, _calendar_todo.due_tzid, timezone_path); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_str() is failed(%x)", error); + } else { + error = calendar_record_set_str(record, _calendar_event.start_tzid, timezone_path); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_str() is failed(%x)", error); - calendar_error_e error = CALENDAR_ERROR_NONE; + error = calendar_record_set_str(record, _calendar_event.end_tzid, timezone_path); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_str() is failed(%x)", error); + } - error = calendar_record_set_str(record, _calendar_event.start_tzid, p->timezone_path); - c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_str() is failed(%x)", error); + _calendar_set_timezone_city(record, timezone_city); +} - error = calendar_record_set_str(record, _calendar_event.end_tzid, p->timezone_path); - c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_str() is failed(%x)", error); +static void __cal_edit_ug_set_record_time(cal_edit_ug_data *p, calendar_record_h record) +{ + c_ret_if(!p); + c_ret_if(!record); + + calendar_error_e error = CALENDAR_ERROR_NONE; calendar_time_s start_time = {0}; @@ -289,6 +300,8 @@ static void __cal_edit_ug_set_record_time(cal_edit_ug_data *p, calendar_record_h error = calendar_record_set_caltime(record, _calendar_event.end_time, end_time); c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_caltime() is failed(%x)", error); + + __cal_edit_ug_set_timezone(record, p->timezone_path, p->timezone_city); } static void __cal_edit_ug_set_rrule_wday(calendar_record_h record, enum __cal_edit_wday tm_wday) @@ -596,22 +609,6 @@ static void __cal_edit_ug_initialize_event_record(cal_edit_ug_data *p) p->etm = p->stm; cal_util_update_tm_hour(&p->etm,1); - calendar_time_s start_time = {0}; - calendar_time_s end_time = {0}; - - start_time.type = CALENDAR_TIME_UTIME; - end_time.type = CALENDAR_TIME_UTIME; - - cal_util_convert_tm_to_lli(NULL, &p->stm, &start_time.time.utime); - cal_util_convert_tm_to_lli(NULL, &p->etm, &end_time.time.utime); - - error = calendar_record_set_caltime(p->event, _calendar_event.start_time, start_time); - c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_caltime() is failed(%x)", error); - - error = calendar_record_set_caltime(p->event, _calendar_event.end_time, end_time); - c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_caltime() is failed(%x)", error); - - cal_util_get_timezone(&p->timezone_path, &p->timezone_city, &p->timezone_offset); __cal_edit_ug_set_record_time(p, p->event); struct tm repeat_until = p->stm; @@ -660,6 +657,8 @@ static void __cal_edit_ug_initialize_todo_record(cal_edit_ug_data *p) error = calendar_record_set_caltime(p->todo, _calendar_todo.due_time, end_time); c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_set_caltime() is failed(%x)", error); + __cal_edit_ug_set_timezone(p->todo, p->timezone_path, p->timezone_city); + __cal_edit_ug_set_record_save_to(p->todo, DEFAULT_TODO_CALENDAR_BOOK_ID); __cal_edit_ug_set_record_priority(p->todo, CALENDAR_TODO_PRIORITY_NORMAL); @@ -779,7 +778,7 @@ static int __cal_edit_ug_get_timezone_offset_with_standard_name(const char *stan error = calendar_query_destroy(query); c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_query_destroy() is failed(%x)", error); - return timezone_offset; + return (-1)*timezone_offset; } static void __cal_edit_ug_get_timezone_for_eas(cal_edit_ug_data *p, calendar_record_h record) @@ -821,11 +820,14 @@ static void __cal_edit_ug_get_record_time_zone(cal_edit_ug_data *p, calendar_re error = calendar_record_get_str(record, _calendar_event.start_tzid, &p->timezone_path); c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_get_str() is failed(%x)", error); - } - c_ret_if(!CAL_STRLEN(p->timezone_path)); + p->timezone_city = _calendar_get_timezone_city(record); + } cal_util_get_timezone(&p->timezone_path, &p->timezone_city, &p->timezone_offset); + + c_ret_if(!CAL_STRLEN(p->timezone_path)); + c_ret_if(!CAL_STRLEN(p->timezone_city)); } static void __cal_edit_ug_get_record_alarm(cal_edit_ug_data *p, calendar_record_h record) @@ -1477,7 +1479,13 @@ static void __cal_edit_ug_end_date_changed_callback(void *data, Evas_Object* obj p->etm = value; - __cal_edit_ug_set_record_time(p, p->event); + Eina_Bool result = __cal_edit_ug_check_date_validity(p); + if(!result) { + int r = status_message_post(C_("IDS_CLD_POP_END_TIME_SHOULD_BE_SET_AFTER_START_TIME")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); + } else + __cal_edit_ug_set_record_time(p, p->event); + } static void __cal_edit_ug_due_date_changed_callback(void *data, Evas_Object* obj, void *ei) @@ -1702,21 +1710,23 @@ static void __cal_edit_ug_worldclock_ug_result_callback(ui_gadget_h ug, service_ p->timezone_offset = NULL; } - char *tzpath = NULL; + int r = service_get_extra_data(result, "tzpath", &p->timezone_path); + c_warn_if(r != SERVICE_ERROR_NONE, "service_get_extra_data(tzpath) is failed(%x)", r); - int r = service_get_extra_data(result, "tzpath", &tzpath); - c_ret_if(r != SERVICE_ERROR_NONE); + r = service_get_extra_data(result, "city", &p->timezone_city); + c_warn_if(r != SERVICE_ERROR_NONE, "service_get_extra_data(city) is failed(%x)", r); - p->timezone_path= tzpath; + __cal_edit_ug_set_timezone(p->record, p->timezone_path, p->timezone_city); cal_util_get_timezone(&p->timezone_path, &p->timezone_city, &p->timezone_offset); p->is_selected_timezone = EINA_TRUE; - //update char* timezone_text = NULL; timezone_text = g_strdup_printf("%s, %s", S_(p->timezone_city), p->timezone_offset); + elm_object_part_text_set(p->timezone, "elm.text.1", timezone_text); + CAL_FREE(timezone_text); } @@ -2850,6 +2860,9 @@ static void __cal_edit_ug_save_button_callback(void *data, Evas_Object *obj, voi c_retm_if(record_index < 0, "cal_edit_save() is failed"); + int r = status_message_post(S_("IDS_COM_POP_SAVED")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); + __cal_edit_ug_send_result_to_detail_ug(p, record_index); ug_destroy_me(p->ug); @@ -3268,8 +3281,11 @@ static Evas_Object *__cal_edit_ug_create_layout(Evas_Object *parent, cal_edit_ug else data->event = data->record; - if(!data->is_edit_mode) - { + if (data->is_edit_mode) { + __cal_edit_ug_get_record_time_zone(data, data->record); + } else { + cal_util_get_timezone(&data->timezone_path, &data->timezone_city, &data->timezone_offset); + __cal_edit_ug_initialize_todo_record(data); __cal_edit_ug_initialize_event_record(data); } diff --git a/ug/list/ug-list.c b/ug/list/ug-list.c index 86445ee..dca4ac2 100755 --- a/ug/list/ug-list.c +++ b/ug/list/ug-list.c @@ -659,7 +659,7 @@ static void __cal_list_ug_create_no_contents(cal_list_ug_data *p) p->no_contents = cal_util_add_nocontents(p->ly, C_("IDS_CLD_BODY_NO_EVENTS")); c_ret_if(!p->no_contents); - elm_object_part_content_set(p->ly, "sw", p->no_contents); + elm_object_part_content_set(p->ly, "sw_nocontents", p->no_contents); evas_object_show(p->no_contents); } diff --git a/viewer/viewer.c b/viewer/viewer.c index 54cb8b2..3f88dfc 100755 --- a/viewer/viewer.c +++ b/viewer/viewer.c @@ -1,5 +1,3 @@ - - /* * * Copyright 2012 Samsung Electronics Co., Ltd @@ -358,9 +356,6 @@ static void viewer_service(service_h service, void *data) __cal_viewer_create_view(ad, ad->naviframe, list); - error = calendar_list_destroy(list, false); - c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_destroy() is failed(%x)", error); - free(raw_data); free(val_ical); val_ical = NULL; @@ -425,6 +420,11 @@ static void __cal_viewer_save_to_calendar_button_callback(void *data, Evas_Objec it = temp; } + if (saved_item_count) { + + int r = status_message_post(S_("IDS_COM_POP_SAVED")); + c_warn_if(r != STATUS_ERROR_NONE, "status_message_post() is failed(%d)", r); + } } static void __cal_viewer_back_button_callback(void *data, Evas_Object *obj, void *ei) @@ -484,9 +484,22 @@ static void __cal_viewer_create_view(struct appdata *ad, Evas_Object *parent, ca calendar_record_h record = NULL; - for (i = 0; i < count; i++) { - error = calendar_list_get_current_record_p(list, &record); - c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error); + error = calendar_list_get_current_record_p(list, &record); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error); + + while (record) { + + if (!_calendar_is_event_or_task(record)) { + + calendar_list_next(list); + + record = NULL; + + error = calendar_list_get_current_record_p(list, &record); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error); + + continue; + } vcs_item_data *item_data = calloc(1, sizeof(vcs_item_data)); if(!item_data) @@ -497,12 +510,23 @@ static void __cal_viewer_create_view(struct appdata *ad, Evas_Object *parent, ca } item_data->checked = EINA_FALSE; - item_data->record = record; + + error = calendar_record_clone(record, &item_data->record); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_clone() is failed(%x)", error); + elm_genlist_item_append(genlist, &itc_3text_1icon_2, item_data, NULL, ELM_GENLIST_ITEM_NONE, __cal_viewer_genlist_select_callback, item_data); calendar_list_next(list); + + record = NULL; + + error = calendar_list_get_current_record_p(list, &record); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_get_current_record_p() is failed(%x)", error); } + error = calendar_list_destroy(list, true); + c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_list_destroy() is failed(%x)", error); + evas_object_data_set(genlist, "priv", p); p->genlist = genlist;