Added Apps icon to apptray-widget. 18/75818/1
authoranirudha_r.c <anirudha_r.c@samsung.com>
Tue, 21 Jun 2016 13:55:47 +0000 (19:25 +0530)
committeranirudha_r.c <anirudha_r.c@samsung.com>
Tue, 21 Jun 2016 13:55:47 +0000 (19:25 +0530)
Change-Id: Ic1c0234438c80ffc130cc038f3e3119a066e92fd

apptray-widget-app/src/app-widget-app.c
apptray-widget/src/app-widget.c

index 1ec51673d89fc6f22ead3f7519d9b335f4f4f0ce..1442fbb0b1065f64e9828ae723e65a6eacf6249c 100755 (executable)
@@ -37,7 +37,7 @@
 #include "item_info.h"
 #include "elm_layout_legacy.h"
 
-#define IDS_IDLE_BODY_APPS "apps"
+#define IDS_IDLE_BODY_APPS "Apps"
 #define EDJE_FILE "edje/add_to_shortcut.edj"
 
 #define SCHEDULE_ICON_ARABIC "res/schedule_arabic_%s.png"
@@ -47,8 +47,8 @@
 #define APP_WIDGET_PKGID "org.tizen.app-widget"
 
 
-#define DEFAULT_APP_ORDER "org.tizen.watch-setting empty empty empty"
-#define APPS_PKG "org.tizen.appptray-widget-app"
+#define DEFAULT_APP_ORDER "org.tizen.apptray-widget-app empty org.tizen.watch-setting empty"
+#define APPS_PKG "org.tizen.apptray-widget-app"
 
 #define APP_WIDGET_CONTENT_KEY "org.tizen.apptray-widget"
 
@@ -956,8 +956,8 @@ static void _create_layout(appdata_s *info){
        _D("scroller create done");
        /* get apps list */
        item_info_list = g_info->app_list;
-       //todo : check why this is required
-#if 0
+
+       //Handle AppsUI case
        item_info_s *apps_item_info = NULL;
        Evas_Object *apps_item = NULL;
        g_info->item_list = NULL;
@@ -972,7 +972,7 @@ static void _create_layout(appdata_s *info){
                apps_item = _create_item(scroller, apps_item_info);
                g_info->item_list = eina_list_append(g_info->item_list, apps_item);
        }
-#endif
+
        Eina_List *l = NULL;
        Eina_List *n = NULL;
        EINA_LIST_FOREACH_SAFE(item_info_list, l, n, item_info) {
@@ -1314,7 +1314,10 @@ item_info_s *apps_item_info_create(const char *appid)
                return NULL;
        }
 
-       goto_if(0 > pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_h), ERROR);
+       int error = pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_h);
+       _D("AppTrayError Error = %d, AppID=%s", error, appid);
+       goto_if(0 > error, ERROR);
+
 
        goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_label(appinfo_h, &name), ERROR);
        goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_icon(appinfo_h, &icon), ERROR);
@@ -1328,19 +1331,22 @@ item_info_s *apps_item_info_create(const char *appid)
                break_if(NULL == pkghandle);
        } while (0);
 
-       goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_is_nodisplay(appinfo_h, &nodisplay), ERROR);
-       if (nodisplay) goto ERROR;
+       if(appid != APPS_PKG){
+               goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_is_nodisplay(appinfo_h, &nodisplay), ERROR);
+               if (nodisplay) goto ERROR;
 
-       goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_is_enabled(appinfo_h, &enabled), ERROR);
-       if (!enabled) goto ERROR;
+               goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_is_enabled(appinfo_h, &enabled), ERROR);
+               if (!enabled) goto ERROR;
 
-       goto_if(PMINFO_R_OK != pkgmgrinfo_pkginfo_get_type(pkghandle, &type), ERROR);
+               goto_if(PMINFO_R_OK != pkgmgrinfo_pkginfo_get_type(pkghandle, &type), ERROR);
+       }
 
        if (pkgid) {
                item_info->pkgid = strdup(pkgid);
                goto_if(NULL == item_info->pkgid, ERROR);
        }
 
+
        item_info->appid = strdup(appid);
        goto_if(NULL == item_info->appid, ERROR);
 
index 24e5c7b8fa2e35ac5cadcd48e77e5ac5f6c67128..79a7954a8b66bbab34e64a8d5f5fde94f3ae88a8 100755 (executable)
 #define VCONFKEY_WMS_HOST_STATUS_VENDOR "db/wms/host_status/vendor"
 #define APP_TYPE_WGT "wgt"
 #define APP_WIDGET_CONTENT_KEY "org.tizen.apptray-widget"
+#define APP_LAUNCH_KEY "launch_apps"
+ #define WHOME_APP_CONTROL "home_op"
 
-#define DEFAULT_APP_ORDER "org.tizen.watch-setting empty empty empty"
+#define DEFAULT_APP_ORDER "org.tizen.apptray-widget-app empty org.tizen.watch-setting empty"
 
 static Eina_List *s_list;
 //int errno;
@@ -496,7 +498,6 @@ void item_badge_unregister_changed_cb(void)
 static void _slot_l_mouse_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source){
        _D("icon clicked");
        _ENTER;
-
 }
 
 static void _slot_r_mouse_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source){
@@ -512,16 +513,17 @@ static void _slot_mouse_clicked_cb(void *data, Evas_Object *o, const char *emiss
        info = data;
        if(!strcmp(info->appid, APPS_PKG)){
                app_control_h service = NULL;
-               char *type = "launch_apps";
+               char *type = APP_LAUNCH_KEY;
 
                ret_if(APP_CONTROL_ERROR_NONE != app_control_create(&service));
                ret_if(NULL == service);
 
                app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT);
-               app_control_set_app_id(service, "WHOME_PKG");
-               app_control_add_extra_data(service, "home_op", type);
+               app_control_set_app_id(service, WHOME_PKG);
+               app_control_add_extra_data(service, WHOME_APP_CONTROL, type);
 
                int ret = app_control_send_launch_request(service, NULL, NULL);
+               _D("Send Launch Request = %d", ret);
                if (APP_CONTROL_ERROR_NONE != ret) {
                        LOGE("error");
                        app_control_destroy(service);