SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall -O2")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+ADD_DEFINITIONS("-DPROJECT=\"${PROJECT_NAME}\"")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
#include <Elementary.h>
#include <app.h>
+#include <app_manager.h>
#include <aul.h>
#include "share_panel_internal.h"
#include "grid.h"
#include "log.h"
+#define PRIVATE_DATA_KEY_ITEM_INFO "pdkii"
+
static const char *const FILE_LAYOUT_EDJ = EDJEDIR"/layout.edj";
static void __del(void *data, Evas_Object *obj)
{
ret_if(NULL == data);
+ evas_object_data_del(obj, PRIVATE_DATA_KEY_ITEM_INFO);
}
static void __lang_changed_cb(void *data, Evas_Object *grid, void *event_info)
{
+ Elm_Object_Item *it = NULL;
+ int ret = 0;
ret_if(!grid);
- elm_gengrid_realized_items_update(grid);
+
+ it = elm_gengrid_first_item_get(grid);
+ while (it) {
+ app_info_h app_info = NULL;
+ item_s *item_info = NULL;
+ char *name = NULL;
+
+ item_info = evas_object_data_get(it, PRIVATE_DATA_KEY_ITEM_INFO);
+ goto_if(!item_info, next);
+
+ ret = app_info_create(item_info->appid, &app_info);
+ goto_if(ret != APP_MANAGER_ERROR_NONE && !app_info, next);
+
+ ret = app_info_get_label(app_info, &name);
+ if (ret == APP_MANAGER_ERROR_NONE && name) {
+ free(item_info->name);
+ item_info->name = name;
+ elm_object_item_part_text_set(it, "elm.text", item_info->name);
+ elm_gengrid_item_update(it);
+ } else {
+ _E("fail to create the app_name from app_info");
+ }
+
+ app_info_destroy(app_info);
+
+next:
+ it = elm_gengrid_item_next_get(it);
+ }
}
item = elm_gengrid_item_append(grid, grid_info.gic, item_info, __item_selected, item_info);
retv_if(!item, NULL);
+ evas_object_data_set(item, PRIVATE_DATA_KEY_ITEM_INFO, item_info);
if (item_info->name) {
_D("grid append item : %s", item_info->name);
}
item = item_info->grid_item;
ret_if(!item);
+ evas_object_data_del(item, PRIVATE_DATA_KEY_ITEM_INFO);
elm_object_item_del(item);
item_info->grid_item = NULL;
}
{
Eina_List *l;
char *data = NULL;
+ int ret = 0;
ret_if(!b);
app_info_h app_info = NULL;
app_s = (item_s *) malloc(sizeof(item_s));
- break_if(!app_s);
+ continue_if(!app_s);
app_s->appid = strdup(data);
if (!app_s->appid) {
_E("strdup error");
free(app_s);
- break;
+ continue;
}
app_s->b = b;
- app_info_create(data, &app_info);
- if (!app_info) {
+ ret = app_info_create(data, &app_info);
+ if (ret != APP_MANAGER_ERROR_NONE || !app_info) {
_E("fail to create the app_info");
free(app_s->appid);
free(app_s);
- break;
+ continue;
}
- app_info_get_label(app_info, &app_s->name);
- if (!app_s->name) {
+ ret = app_info_get_label(app_info, &app_s->name);
+ if (ret != APP_MANAGER_ERROR_NONE || !app_s->name) {
_E("fail to create the app_name from app_info");
free(app_s->appid);
free(app_s);
app_info_destroy(app_info);
- break;
+ continue;
}
_SD("icon_name : [%s]", app_s->name);
- app_info_get_icon(app_info, &app_s->icon);
- _SD("icon_path : [%s]", app_s->icon);
+ ret = app_info_get_icon(app_info, &app_s->icon);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ free(app_s->appid);
+ free(app_s->name);
+ free(app_s);
+ app_info_destroy(app_info);
+ continue;
+ }
app_info_destroy(app_info);
if (!app_s->icon) {
app_s->icon = strdup(DEFAULT_ICON);
}
+ _SD("icon_path : [%s]", app_s->icon);
*applist = eina_list_sorted_insert(*applist, __applist_compare, app_s);
}
goto_if(!__create_back_btn(ui_manager, share_panel), ERROR);
elm_object_part_text_set(ui_manager, "title", _("IDS_AM_HEADER_SHARE"));
+ elm_object_domain_translatable_part_text_set(ui_manager, "title", PROJECT, "IDS_AM_HEADER_SHARE");
share_panel->index = _index_create(ui_manager, 0);
goto_if(!share_panel->index, ERROR);