From 87a4fa4929a602e064d602f99773777fd47063b9 Mon Sep 17 00:00:00 2001 From: "junkyu.han" Date: Thu, 28 May 2015 21:12:22 +0900 Subject: [PATCH] change ail to pkgmgr Change-Id: Ic6cc47a4a652807609e9afe318a2864407b1e20f --- packaging/org.tizen.menu-screen.spec | 2 +- src/list.c | 2 ++ src/menu_screen.c | 31 +++++++++++++++++-------------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/packaging/org.tizen.menu-screen.spec b/packaging/org.tizen.menu-screen.spec index 1c6d01f..d5289ad 100644 --- a/packaging/org.tizen.menu-screen.spec +++ b/packaging/org.tizen.menu-screen.spec @@ -50,7 +50,7 @@ BuildRequires: pkgconfig(pkgmgr-info) BuildRequires: pkgconfig(shortcut) BuildRequires: pkgconfig(syspopup-caller) #BuildRequires: pkgconfig(utilX) -#BuildRequires: pkgconfig(capi-appfw-preference) +BuildRequires: pkgconfig(capi-appfw-preference) BuildRequires: pkgconfig(capi-system-info) BuildRequires: pkgconfig(capi-system-system-settings) BuildRequires: cmake diff --git a/src/list.c b/src/list.c index 371c937..c0f41df 100644 --- a/src/list.c +++ b/src/list.c @@ -129,7 +129,9 @@ HAPI menu_screen_error_e list_get_values(const char *package, app_info_t *ai) } while (0); goto_if(PMINFO_R_OK != pkgmgrinfo_pkginfo_is_removable(pkghandle, &ai->removable), ERROR); + _D("This package is removable: %d", ai->removable); goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_is_nodisplay(appinfo_h, &ai->nodisplay), ERROR); + _D("This package is nodisplay: %d", ai->removable); if (ai->nodisplay) goto ERROR; pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h); diff --git a/src/menu_screen.c b/src/menu_screen.c index 33c9fc4..bc3a0f4 100755 --- a/src/menu_screen.c +++ b/src/menu_screen.c @@ -32,6 +32,7 @@ #include //#include #include +#include #include "conf.h" #include "item.h" @@ -231,7 +232,6 @@ static menu_screen_error_e _create_canvas(char *name, char *title) } } - menu_screen_info.win = elm_win_add(NULL, name, ELM_WIN_BASIC); retv_if(NULL == menu_screen_info.win, MENU_SCREEN_ERROR_FAIL); @@ -288,6 +288,7 @@ static int _dead_cb(int pid, void *data) static void _create_bg(void) { + _D("Create BG"); char *buf; Evas_Coord w; Evas_Coord h; @@ -297,8 +298,10 @@ static void _create_bg(void) const char *key; int width; int height; + int ret = SYSTEM_SETTINGS_ERROR_NONE; - system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &buf); + ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &buf); + _D("result: %d, value: %s", ret, buf); ret_if(NULL == buf); width = menu_screen_get_root_width(); @@ -371,7 +374,7 @@ static void _destroy_bg() -static void _change_bg_cb(keynode_t *node, void *data) +static void _change_bg_cb(system_settings_key_e key, void *data) { _D("Background image is changed."); _create_bg(); @@ -405,9 +408,9 @@ static Evas_Object *_create_conformant(Evas_Object *win) conformant = elm_conformant_add(win); retv_if(NULL == conformant, NULL); - elm_win_indicator_opacity_set(win, ELM_WIN_INDICATOR_TRANSLUCENT); evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_indicator_mode_set(menu_screen_info.win, ELM_WIN_INDICATOR_SHOW); + elm_object_signal_emit(conformant, "elm,state,indicator,overlap", "elm"); evas_object_data_set(conformant, "win", win); evas_object_show(conformant); @@ -479,9 +482,9 @@ static bool _create_cb(void *data) _init_theme(); retv_if(MENU_SCREEN_ERROR_FAIL == _create_canvas(PACKAGE, PACKAGE), false); - //if (system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, _change_bg_cb, NULL) < 0) { - // _E("Failed to register a settings change cb for %s\n", SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN); - //} + if (system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, _change_bg_cb, NULL) < 0) { + _E("Failed to register a settings change cb for %s\n", SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN); + } _create_bg(); conformant = _create_conformant(menu_screen_info.win); @@ -629,29 +632,29 @@ static void _language_changed_cb(app_event_info_h event_info, void *data) } for (j = 0; j < page_max_app; j ++) { - ail_appinfo_h ai; + pkgmgrinfo_appinfo_h appinfo_h = NULL; char *name; item = page_get_item_at(page, j); if (!item) continue; - if (ail_get_appinfo(item_get_package(item), &ai) < 0) { - ail_destroy_appinfo(ai); + if (pkgmgrinfo_appinfo_get_appinfo(item_get_package(item), &appinfo_h) < 0) { + pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h); continue; } - if (ail_appinfo_get_str(ai, AIL_PROP_NAME_STR, &name) < 0) { - ail_destroy_appinfo(ai); + if (pkgmgrinfo_appinfo_get_label(appinfo_h, &name) < 0) { + pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h); continue; } if (!name) { _D("Failed to get name for %s", item_get_package(item)); - ail_destroy_appinfo(ai); + pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h); continue; } item_set_name(item, name, 0); - ail_destroy_appinfo(ai); + pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h); } mapbuf_enable(page, 1); -- 2.7.4