return strdup(id->label);
}
-#if 1
if (!strcmp(part, "elm.text.sub") && id->index != 0) {
-#else
- if (!strcmp(part, "elm.text.sub")) {
-#endif
+ if (id->description == NULL)
+ return NULL;
return strdup(id->description);
}
static Evas_Object* _gl_content_get_cb(void *data, Evas_Object *obj, const char *part)
{
pg_item_data_s *id = (pg_item_data_s*)data;
-#if 1
+
if (id->index == 0)
return NULL;
-#endif
+
if (!strcmp("elm.swallow.icon", part)) {
Evas_Object *icon;
icon = elm_image_add(obj);
return NULL;
}
-static bool _privacy_package_info_cb(const char *package_id, const int count, const int monitor_policy, void *user_data)
+static bool _privacy_package_info_cb(const char *package_id, const int count, time_t time, const int monitor_policy, void *user_data)
{
pg_data_s *data = (pg_data_s *)malloc(sizeof(pg_data_s));
data->pkg_id = strdup(package_id);
data->count = count;
+ data->time = time;
data->monitor_policy = monitor_policy;
pg_data_list = g_list_append(pg_data_list, data);
}
void create_privacy_guard_package_list_view(struct app_data_s* ad)
-
{
- /* Add genlist */
- Evas_Object *genlist = common_genlist_add(ad->nf);
-
- evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
- /* Set itc */
- Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
+ Evas_Object *genlist = NULL;
/* Get privacy guard data (pkg, count, policy) list by a privacy */
if (pg_data_list!= NULL) {
int res = privacy_guard_client_foreach_package_info_by_privacy_id(user_id, ad->privacy, _privacy_package_info_cb, NULL);
log_if(res != PRIV_GUARD_ERROR_SUCCESS, 1, "privacy_guard_client_foreach_package_info_by_privacy_id() is failed. [%d]", res);
- itc->item_style = "type1";
- itc->func.content_get = _gl_content_get_cb;
- itc->func.text_get = _gl_text_get_cb;
- itc->func.del = _gl_del_cb;
-
-#if 1
// no content in the genlist
if (!pg_data_list) {
-
-
- Elm_Object_Item *it = NULL;
- char temp[256] = {'\0',};
char* privacy_display = NULL;
- pg_item_data_s *item = calloc(sizeof(pg_item_data_s), 1);
- item->index = 0;
res = privilege_info_get_privacy_display(ad->privacy, &privacy_display);
log_if(res != PRVMGR_ERR_NONE, 1, "privilege_info_get_privacy_display() is failed. [%d]", res);
- snprintf(temp, sizeof(temp), "<font color=#A9A9A9FF>No app using</font><font color=#F2CB61FF> %s </font><font color=#A9A9A9FF>privacy.</font>", privacy_display);
- item->label = strdup(temp);
+ genlist = elm_layout_add(ad->nf);
+ elm_layout_theme_set(genlist, "layout", "nocontents", "default");
+ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ // TOBE /////////////////////////////////////////////////////////////////////////////////
+ //elm_object_part_text_set(genlist, "elm.text", dgettext("privacy-setting", "IDS_ST_NPBODY_NO_APPS"));
+ //char* no_app_string_format = dgettext("privacy-setting", "IDS_ST_BODY_AFTER_YOU_DOWNLOAD_APPS_THAT_USE_PS_THEY_WILL_BE_SHOWN_HERE");
+ //char no_app_string[256];
+ //snprintf(no_app_string, sizeof(no_app_string), no_app_string_format, privacy_display);
+ /////////////////////////////////////////////////////////////////////////////////////////
+
+ // temp - SHOULD BE REPLACED TO ABOVE ONE ///////////////////////////////////////////////
+ elm_object_part_text_set(genlist, "elm.text", "No apps");
+ char no_app_string[256];
+ snprintf(no_app_string, sizeof(no_app_string), "After you download apps that use %s, they will be shown here.", privacy_display);
+ /////////////////////////////////////////////////////////////////////////////////////////
+
+ elm_object_part_text_set(genlist, "elm.help.text", no_app_string);
+ elm_layout_signal_emit(genlist, "align.center", "elm");
+ } else {
+ genlist = common_genlist_add(ad->nf);
+ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
- // append to the genlist
- it = elm_genlist_item_append(genlist, itc, item, NULL, ELM_GENLIST_ITEM_NONE, _privacy_package_selected_cb, item);
- log_if(it == NULL, 1, "Error in elm_genlist_item_append");
- elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ /* Set itc */
+ Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
- } else {
-#endif
+ itc->item_style = "type1";
+ itc->func.content_get = _gl_content_get_cb;
+ itc->func.text_get = _gl_text_get_cb;
+ itc->func.del = _gl_del_cb;
Elm_Object_Item *it = NULL;
GList* l;
-#if 1
/* Append guide text to the top of genlist */
pg_item_data_s *description_item = calloc(sizeof(pg_item_data_s), 1);
description_item->index = 0;
+
char tmp[256] = {'\0',};
- snprintf(tmp, sizeof(tmp), "<wrap=word><ellipsis=-1.0><font_size=30><color=#A9A9A9FF>The recording of privacy access will be enabled for the selected apps.</color></font_size></ellipsis></wrap>");
+ snprintf(tmp, sizeof(tmp), "<wrap=word><ellipsis=-1.0><font_size=35><color=#A9A9A9FF>The selected apps will be monitored for any attempts to violate your privacy.</color></font_size></ellipsis></wrap>");
+ //snprintf(tmp, sizeof(tmp), "<wrap=word><ellipsis=-1.0><font_size=35><color=#A9A9A9FF>%s</color></font_size></ellipsis></wrap>", dgettext("privacy-setting", "IDS_ST_BODY_THE_SELECTED_APPS_WILL_BE_MONITORED_FOR_ANY_ATTEMPTS_TO_VIOLATE_YOUR_PRIVACY"));
description_item->label = strdup(tmp);
+
it = elm_genlist_item_append(genlist, itc, description_item, NULL, ELM_GENLIST_ITEM_NONE, _privacy_package_selected_cb, description_item);
elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
/* Append privacy related package as genlist item */
int i = 1;
-#else
- int i = 0;
-#endif
for (l = pg_data_list; l != NULL; l = l->next) {
pg_item_data_s *item = calloc(sizeof(pg_item_data_s), 1);
pg_data_s* data = (pg_data_s*)l->data;
char temp[256] = {'\0',};
+ char str_time[32] = {'\0',};
+ struct tm *timeinfo = NULL;
char *label = NULL;
char* icon = NULL;
pkgmgrinfo_pkginfo_h handle;
snprintf(temp, sizeof(temp), "%s", label);
item->label = strdup(temp);
- // description
- snprintf(temp, sizeof(temp), "<font color=#3DB9CCFF>%d</font> time(s)", data->count);
- //snprintf(temp, sizeof(temp), "<font color=#3DB9CCFF>%d</font> %s", data->count, dgettext("privacy-setting", "IDS_CLD_OPT_TIMES_LC"));
- item->description = strdup(temp);
+ // description - 13/08/2010 01:30 AM 21 time(s)
+ if (data->time > 0) {
+ LOGD("time : %d", data->time);
+ timeinfo = localtime(&data->time);
+ LOGD("time : %s", asctime(timeinfo));
+ strftime (str_time, 32, "%d/%m/%Y %I:%M %p", timeinfo);
+ snprintf(temp, sizeof(temp), "<font_size=27>%s <font color=#3DB9CCFF>%d</font> time(s)</font_size>", str_time, data->count);
+ //snprintf(temp, sizeof(temp), "<font_size=27>%s <font color=#3DB9CCFF>%d</font> %s</font_size>", str_time, data->count, dgettext("privacy-setting", "IDS_CLD_BODY_PD_TIMES"));
+ item->description = strdup(temp);
+ } else {
+ item->description = NULL;
+ }
// user ID
item->user_id = user_id;
it = elm_genlist_item_append(genlist, itc, item, NULL, ELM_GENLIST_ITEM_NONE, _privacy_package_selected_cb, item);
log_if(it == NULL, 1, "Error in elm_genlist_item_append");
}
-#if 1
+
+ elm_genlist_item_class_free(itc);
}
-#endif
- elm_genlist_item_class_free(itc);
evas_object_show(genlist);
/* TODO: change nf_it_title to proper DID : use dgettext() */