void appmgr_fail_popup(char *str, SettingAppMgr *ad);
void appmgr_error_app_popup(char *str, SettingAppMgr *ad);
-char *appmgr_get_defualt_icon(pkgmgrinfo_appinfo_h handle);
-
void appmgr_utils_init_apps_list(SettingAppMgr *ad);
void appmgr_utils_init_pkgs_list(SettingAppMgr *ad);
int appmgr_utils_init_apps_and_pkgs_lists(SettingAppMgr *ad);
const char *app_id, void *user_data)
{
int ret = 0;
- pkgmgrinfo_appinfo_h internal_api_handle = NULL;
SettingAppMgr *ad = user_data;
SettingAppMgr_AppInfo *app = NULL;
app_t *sibling_info = NULL;
(void)app_info_get_icon(sibling_app_info, &sibling_info->icon);
if (EINA_TRUE != ecore_file_exists(sibling_info->icon)) {
free(sibling_info->icon);
- pkgmgrinfo_appinfo_get_appinfo(app_id, &internal_api_handle);
- sibling_info->icon =
- appmgr_get_defualt_icon(internal_api_handle);
- pkgmgrinfo_appinfo_destroy_appinfo(internal_api_handle);
+ sibling_info->icon = get_application_default_icon(app_id);
}
(void)app_info_get_label(sibling_app_info, &sibling_info->label);
appmgr_popup_close, 0, FALSE, FALSE, 1, MGRAPP_STR_OK);
}
-char *appmgr_get_defualt_icon(pkgmgrinfo_appinfo_h handle)
-{
- int ret = 0;
- char *type = NULL;
- const char *icon = NULL;
-
- icon = SETTING_ICON_PATH"/mainmenu.png";
- ret = pkgmgrinfo_appinfo_get_component_type(handle, &type);
-
- if (PMINFO_R_OK == ret) {
- if (0 == safeStrCmp(type, "svcapp"))
- icon = SETTING_ICON_PATH"/default_icon_service.png";
- } else {
- SETTING_TRACE_ERROR(
- "pkgmgrinfo_appinfo_get_component_type() Fail(%s)",
- get_error_message(ret));
- }
-
- return strdup(icon);
-}
-
int get_process_ram_usage_mb(app_info_h handle)
{
pid_t pid = 0;
void appmgr_utils_update_app_node(app_node *node, app_info_h app_info)
{
- int ret = 0;
- pkgmgrinfo_appinfo_h internal_api_handle = NULL;
ret_if(!node);
(void)app_info_get_app_id(app_info, &node->appid);
(void)app_info_get_icon(app_info, &node->icon_path);
if (EINA_TRUE != ecore_file_exists(node->icon_path)) {
free(node->icon_path);
- node->icon_path = NULL;
- /*TODO: need public API: */
- pkgmgrinfo_appinfo_get_appinfo(node->appid,
- &internal_api_handle);
- if (PMINFO_R_OK == ret) {
- node->icon_path =
- appmgr_get_defualt_icon(internal_api_handle);
- pkgmgrinfo_appinfo_destroy_appinfo(internal_api_handle);
- }
+ node->icon_path = get_application_default_icon(node->appid);
}
(void)app_info_is_enabled(app_info, &node->is_enabled);
{
char *main_app_id = NULL;
pkgmgrinfo_pkginfo_h internal_api_handle = NULL;
- pkgmgrinfo_appinfo_h internal_api_handle2 = NULL;
int ret = 0;
ret_if(!node);
ret = pkgmgrinfo_pkginfo_get_mainappid(
internal_api_handle, &main_app_id);
- if (PMINFO_R_OK == ret) {
-
- ret = pkgmgrinfo_appinfo_get_appinfo(
- main_app_id,
- &internal_api_handle2);
-
- if (PMINFO_R_OK == ret) {
- node->icon_path =
- appmgr_get_defualt_icon(
- internal_api_handle2);
- pkgmgrinfo_appinfo_destroy_appinfo(
- internal_api_handle2);
- }
- }
+ if (PMINFO_R_OK == ret)
+ node->icon_path = get_application_default_icon(main_app_id);
pkgmgrinfo_pkginfo_destroy_pkginfo(internal_api_handle);
}
}
#define sncat(to, size, from) strncat(to, from, size-strlen(to)-1)
#define SAFE_STRDUP(src) (src) ? strdup(src) : NULL
+extern char *get_application_default_icon(const char *appid);
+
extern char *setting_file_basename(char *path);
/*****/
*
*/
-#include <setting-common-general-func.h>
-#include <setting-common-data-slp-setting.h>
+#include "setting-common-general-func.h"
+#include "setting-common-data-slp-setting.h"
#include <glib.h>
#include <dlfcn.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
-#include <pkgmgr-info.h>
-
#include <sys/stat.h>
#include <sys/mount.h>
/*#include <resourced.h> */
#include <limits.h>
#include <setting-cfg.h>
+#include <pkgmgr-info.h>
#include <player.h>
-
#include <bundle.h>
#include <bundle_internal.h>
#include <app_control_internal.h>
+#include <pkgmgr-info.h>
+
+EXPORT_PUBLIC
+char *get_application_default_icon(const char *appid)
+{
+ int ret = 0;
+ char *type = NULL;
+ const char *icon = NULL;
+ pkgmgrinfo_appinfo_h handle = NULL;
+
+ icon = SETTING_ICON_PATH"/mainmenu.png";
+
+ ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+ if (PMINFO_R_OK != ret) {
+ SETTING_TRACE_ERROR("pkgmgrinfo_appinfo_get_appinfo() Fail(%s)",
+ get_error_message(ret));
+ return strdup(icon);
+ }
+
+ ret = pkgmgrinfo_appinfo_get_component_type(handle, &type);
+
+ if (PMINFO_R_OK == ret) {
+ if (0 == safeStrCmp(type, "svcapp"))
+ icon = SETTING_ICON_PATH"/default_icon_service.png";
+ } else {
+ SETTING_TRACE_ERROR(
+ "pkgmgrinfo_appinfo_get_component_type() Fail(%s)",
+ get_error_message(ret));
+ }
+
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+
+ return strdup(icon);
+}
EXPORT_PUBLIC
char *setting_file_basename(char *path)
static void _get_battery_usage_time_str(char *buff, size_t buff_len,
int seconds);
static void _back_button_cb(void *data, Evas_Object *obj, void *event_info);
-static void _get_battery_percent_text(char *desc, size_t len,
- SmartMgrBattery *ad);
+static void _get_battery_percent_text(char *desc, size_t len, int pct);
static void _get_charge_status_text(char *desc, size_t len,
SmartMgrBattery *ad);
static Evas_Object *_itc_app_batt_usage_content_get(void *data,
Evas_Object *obj, const char *part);
-static void _get_battery_percent_text(char *desc, size_t len,
- SmartMgrBattery *ad)
+static void _get_battery_percent_text(char *desc, size_t len, int pct)
{
ret_if(!desc || len == 0);
- snprintf(desc, len, "%d%s", ad->current_battery_percent, "%");
+ snprintf(desc, len, "%d%s", pct, "%");
}
static void _get_charge_status_text(char *desc, size_t len,
evas_object_pass_events_set(progress, EINA_TRUE);
evas_object_propagate_events_set(progress, EINA_FALSE);
- _get_battery_percent_text(text, sizeof(text), ad);
+ _get_battery_percent_text(text, sizeof(text), ad->current_battery_percent);
elm_object_part_text_set(layout, "elm.text", text);
elm_object_part_content_set(layout, "elm.swallow.content", progress);
_get_charge_status_text(text, sizeof(text), ad);
Evas_Object *progress = NULL;
Evas_Object *icon = NULL;
app_item_t *app_info = data;
-
+ char percent_txt[16] = {'\0'};
retv_if(!data, NULL);
if (safeStrCmp(part, "elm.swallow.content"))
evas_object_propagate_events_set(progress, EINA_FALSE);
elm_object_part_text_set(layout, "elm.text", app_info->label);
+ _get_battery_percent_text(percent_txt, sizeof(percent_txt),
+ (int)app_info->percent);
+ elm_object_part_text_set(layout, "elm.text.sub", percent_txt);
elm_object_part_content_set(layout, "elm.swallow.content", progress);
icon = elm_icon_add(layout);
app_info_create(app->appid, &app_info);
if (app_info) {
app_info_get_icon(app_info, &app->icon);
+ if (EINA_TRUE != ecore_file_exists(app->icon)) {
+ free(app->icon);
+ app->icon = get_application_default_icon(app->appid);
+ }
+
app_info_get_label(app_info, &app->label);
app_info_destroy(app_info);
}