#define ELM_TEXT_1 "elm.text.1"
#define ELM_TEXT_2 "elm.text.2"
#define ELM_TEXT "elm.text"
-#define ELM_ICON_1 "elm.icon.1"
-#define ELM_ICON_2 "elm.icon.2"
+#define ELM_ICON "elm.icon"
#define ELM_BUTTON_STYLE "popup_button/default"
#define ITC_ITEM_STYLE "dialogue/2text.1icon.2"
-#define ITC_LIFE_ITEM_STYLE "dialogue/bg/2icon"
+//#define ITC_LIFE_ITEM_STYLE "dialogue/bg/2icon"
+#define ITC_LIFE_ITEM_STYLE "1icon/with_no_line"
#define ITC_STO_TITLE_ITEM_STYLE "dialogue/title"
#define ITC_STO_TOTAL_ITEM_STYLE "dialogue/2text.2"
#define ITC_STO_APP_ITEM_STYLE "dialogue/2text.2"
mgr_app_app_info_t *app_info;
};
+enum {
+ ELM_STATE_TOP = 0,
+ ELM_STATE_BOTTOM,
+ ELM_STATE_CENTER,
+ ELM_STATE_DEFAULT,
+};
+
static Evas_Object *mgr_app_view_app_info_create(void *data);
static Evas_Object *mgr_app_view_app_info_set_cbar(void *data);
static mgr_app_result_e mgr_app_view_app_info_set_navibar(void *data);
};
static Elm_Genlist_Item_Class *itc = NULL;
-static Elm_Genlist_Item_Class *itc_life = NULL;
+static Elm_Genlist_Item_Class *itc_forcestop= NULL;
+static Elm_Genlist_Item_Class *itc_uninstall= NULL;
static Elm_Genlist_Item_Class *itc_sto_title= NULL;
static Elm_Genlist_Item_Class *itc_sto_total= NULL;
static Elm_Genlist_Item_Class *itc_sto_app = NULL;
static Elm_Genlist_Item_Class *itc_sep_20 = NULL;
static Elm_Genlist_Item_Class *itc_sep_21 = NULL;
+static mgr_app_app_info_t *_app_info = NULL;
static void _app_info_next_cb(void *data, Evas_Object *obj, void *event_info)
{
elm_genlist_item_class_free(itc_sep_21);
elm_genlist_item_class_free(itc);
elm_genlist_item_class_free(itc_sep_10);
- elm_genlist_item_class_free(itc_life);
+ elm_genlist_item_class_free(itc_forcestop);
+ elm_genlist_item_class_free(itc_uninstall);
elm_genlist_item_class_free(itc_sto_title);
elm_genlist_item_class_free(itc_sto_total);
elm_genlist_item_class_free(itc_sto_app);
{
MGR_APP_BEGIN();
- ret_if(data == NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ ret_if(_app_info == NULL);
+ mgr_app_app_info_t *app_info = _app_info;
ret_if(app_info->pkg_name == NULL);
bool is_running = false;
int ret = APP_MANAGER_ERROR_NONE;
MGR_APP_BEGIN();
ret_if(obj == NULL);
- ret_if(data == NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ ret_if(_app_info == NULL);
+ mgr_app_app_info_t *app_info = _app_info;
ret_if(mgr_app_view_app_info.view_common_data == NULL);
mgr_app_view_common_data_t *view_common_data = mgr_app_view_app_info.view_common_data;
ret_if(obj == NULL);
Evas_Object *btn_uninstall = obj;
- ret_if(data == NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ ret_if(_app_info == NULL);
+ mgr_app_app_info_t *app_info = _app_info;
ret_if(mgr_app_view_app_info.view_common_data == NULL);
mgr_app_view_common_data_t *view_common_data = mgr_app_view_app_info.view_common_data;
ret_if(data == NULL);
struct ug_data *ugd = (struct ug_data*)data;
- ret_if(ugd->data == NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)ugd->data;
+ ret_if(_app_info == NULL);
+ mgr_app_app_info_t *app_info = _app_info;
ret_if(app_info->pkg_name == NULL);
char *package_name = NULL;
{
MGR_APP_BEGIN();
- retv_if(data == NULL, NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ retv_if(_app_info == NULL, NULL);
+ mgr_app_app_info_t *app_info = _app_info;
char *label = NULL;
{
MGR_APP_BEGIN();
- retv_if(data == NULL, NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ retv_if(_app_info == NULL, NULL);
+ mgr_app_app_info_t *app_info = _app_info;
char *label = NULL;
{
MGR_APP_BEGIN();
- retv_if(data == NULL, NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ retv_if(_app_info == NULL, NULL);
+ mgr_app_app_info_t *app_info = _app_info;
char *label = NULL;
{
MGR_APP_BEGIN();
- retv_if(data == NULL, NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ retv_if(_app_info == NULL, NULL);
+ mgr_app_app_info_t *app_info = _app_info;
char *label = NULL;
{
MGR_APP_BEGIN();
- retv_if(data == NULL, NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ retv_if(_app_info == NULL, NULL);
+ mgr_app_app_info_t *app_info = _app_info;
Evas_Object *icon = NULL;
char *icon_path = NULL;
return icon;
}
-static Evas_Object *_gl_icon_get_life(void *data, Evas_Object *obj, const char *part)
+static Evas_Object *_gl_icon_get_forcestop(void *data, Evas_Object *obj, const char *part)
{
MGR_APP_BEGIN();
MGR_APP_DEBUG("part:%s\n", part);
- retv_if(data == NULL, NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ retv_if(_app_info == NULL, NULL);
+ mgr_app_app_info_t *app_info = _app_info;
Evas_Object *button = NULL;
- if (!strncmp(part, ELM_ICON_1, strlen(ELM_ICON_1))) {
+ if (!strncmp(part, ELM_ICON, strlen(ELM_ICON))) {
button = elm_button_add(obj);
if (button) {
elm_object_disabled_set(button, EINA_TRUE);
}
}
}
- } else if (!strncmp(part, ELM_ICON_2, strlen(ELM_ICON_2))) {
+ } else {
+ MGR_APP_DEBUG_ERR("elm icon part is wrong");
+ button = NULL;
+ }
+
+ MGR_APP_END();
+ return button;
+}
+
+static Evas_Object *_gl_icon_get_uninstall(void *data, Evas_Object *obj, const char *part)
+{
+ MGR_APP_BEGIN();
+
+ MGR_APP_DEBUG("part:%s\n", part);
+ retv_if(_app_info == NULL, NULL);
+ mgr_app_app_info_t *app_info = _app_info;
+
+ Evas_Object *button = NULL;
+ if (!strncmp(part, ELM_ICON, strlen(ELM_ICON))) {
button = elm_button_add(obj);
if (button) {
elm_object_disabled_set(button, EINA_TRUE);
MGR_APP_BEGIN();
MGR_APP_DEBUG("part:%s\n", part);
- retv_if(data == NULL, NULL);
- mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)data;
+ retv_if(_app_info == NULL, NULL);
+ mgr_app_app_info_t *app_info = _app_info;
Evas_Object *button = NULL;
- if (!strncmp(part, ELM_ICON_2, strlen(ELM_ICON_2))) {
+ if (!strncmp(part, ELM_ICON, strlen(ELM_ICON))) {
button = elm_button_add(obj);
if (button) {
elm_object_text_set(button, dgettext(PACKAGE, "IDS_ST_BUTTON_CLEAR_DATA"));
return title;
}
+static void _gl_realized(void *data, Evas_Object *obj, void *event_info)
+{
+ MGR_APP_BEGIN();\r
+
+ ret_if(event_info == NULL);
+
+ int type = (int)elm_object_item_data_get(event_info);
+
+ if (type == ELM_STATE_TOP) {
+ elm_object_item_signal_emit(event_info, "elm,state,top", "");
+ } else if (type == ELM_STATE_CENTER) {
+ elm_object_item_signal_emit(event_info, "elm,state,center", "");
+ } else if (type == ELM_STATE_BOTTOM) {
+ elm_object_item_signal_emit(event_info, "elm,state,bottom", "");
+ }
+
+ MGR_APP_END();
+}
+
static Evas_Object *__create_genlist_app_info(Evas_Object *parent, void *data)
{
MGR_APP_BEGIN();
struct ug_data *ugd = (struct ug_data*)data;
Elm_Object_Item *item_app = NULL;
- Elm_Object_Item *item_life = NULL;
+ Elm_Object_Item *item_forcestop = NULL;
+ Elm_Object_Item *item_uninstall = NULL;
Elm_Object_Item *item_sto_title = NULL;
Elm_Object_Item *item_sto_total = NULL;
Elm_Object_Item *item_sto_app = NULL;
retv_if(itc == NULL, NULL);
itc_sep_10 = elm_genlist_item_class_new();
retv_if(itc_sep_10 == NULL, NULL);
- itc_life = elm_genlist_item_class_new();
- retv_if(itc_life == NULL, NULL);
+ itc_forcestop = elm_genlist_item_class_new();
+ retv_if(itc_forcestop == NULL, NULL);
+ itc_uninstall = elm_genlist_item_class_new();
+ retv_if(itc_uninstall == NULL, NULL);
itc_sto_title = elm_genlist_item_class_new();
retv_if(itc_sto_title == NULL, NULL);
itc_sto_total = elm_genlist_item_class_new();
itc_sep_10->func.state_get = NULL;
itc_sep_10->func.del = NULL;
- itc_life->item_style = ITC_LIFE_ITEM_STYLE;
- itc_life->func.text_get = NULL;
- itc_life->func.content_get = _gl_icon_get_life;
- itc_life->func.state_get = NULL;
- itc_life->func.del = NULL;
+ itc_forcestop->item_style = ITC_LIFE_ITEM_STYLE;
+ itc_forcestop->func.text_get = NULL;
+ itc_forcestop->func.content_get = _gl_icon_get_forcestop;
+ itc_forcestop->func.state_get = NULL;
+ itc_forcestop->func.del = NULL;
+
+ itc_uninstall->item_style = ITC_LIFE_ITEM_STYLE;
+ itc_uninstall->func.text_get = NULL;
+ itc_uninstall->func.content_get = _gl_icon_get_uninstall;
+ itc_uninstall->func.state_get = NULL;
+ itc_uninstall->func.del = NULL;
itc_sto_title->item_style = ITC_STO_TITLE_ITEM_STYLE;
itc_sto_title->func.text_get = _gl_label_get_title;
itc_detail->func.state_get = NULL;
itc_detail->func.del = NULL;
-
retv_if(ugd->data == NULL, NULL);
mgr_app_app_info_t *app_info = (mgr_app_app_info_t*)ugd->data;
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
elm_genlist_scroller_policy_set(genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
evas_object_data_set(genlist, STR_UGD, (void*)ugd);
- elm_object_style_set(genlist, "dialogue");
evas_object_show(genlist);
+ evas_object_smart_callback_add(genlist, "realized", _gl_realized, NULL);
MGR_APP_MEM_STRDUP(sto_title, dgettext(PACKAGE, "IDS_ST_BODY_STORAGE"));
MGR_APP_MEM_STRDUP(launch_title, dgettext(PACKAGE, "IDS_ST_BODY_LAUNCH_BY_DEFAULT"));
/* app info */
- item_app = elm_genlist_item_append(genlist, itc, (void *)app_info, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ item_app = elm_genlist_item_append(genlist, itc, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
if (item_app)
elm_genlist_item_select_mode_set(item_app, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
/* Force stop & Uninstall */
- item_life = elm_genlist_item_append(genlist, itc_life, (void *)app_info, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel, NULL);
-
+ item_forcestop = elm_genlist_item_append(genlist, itc_forcestop, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ if (item_forcestop)
+ elm_genlist_item_select_mode_set(item_forcestop, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ item_uninstall = elm_genlist_item_append(genlist, itc_uninstall, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ if (item_uninstall)
+ elm_genlist_item_select_mode_set(item_uninstall, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
/* Storage */
item_sto_title = elm_genlist_item_append(genlist, itc_sto_title, sto_title, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
- item_sto_total = elm_genlist_item_append(genlist, itc_sto_total, (void *)app_info, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ item_sto_total = elm_genlist_item_append(genlist, itc_sto_total, ELM_STATE_TOP, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
if (item_sto_total)
elm_genlist_item_select_mode_set(item_sto_total, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- item_sto_app = elm_genlist_item_append(genlist, itc_sto_app, (void *)app_info, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ item_sto_app = elm_genlist_item_append(genlist, itc_sto_app, ELM_STATE_CENTER, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
if (item_sto_app)
elm_genlist_item_select_mode_set(item_sto_app, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- item_sto_data = elm_genlist_item_append(genlist, itc_sto_data, (void *)app_info, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ item_sto_data = elm_genlist_item_append(genlist, itc_sto_data, ELM_STATE_BOTTOM, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
if (item_sto_data)
elm_genlist_item_select_mode_set(item_sto_data, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
/* Launch */
item_launch_title = elm_genlist_item_append(genlist, itc_launch_title, launch_title, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
- item_launch = elm_genlist_item_append(genlist, itc_launch, (void *)app_info, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_launch, (void*)ugd);
+ item_launch = elm_genlist_item_append(genlist, itc_launch, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_launch, (void*)ugd);
if (item_launch && !appsvc_is_defapp(app_info->pkg_name)) {
elm_genlist_item_selected_set(item_launch, EINA_FALSE);
elm_object_item_disabled_set(item_launch, EINA_TRUE);
}
- item_launch_text = elm_genlist_item_append(genlist, itc_launch_text, (void *)app_info, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ item_launch_text = elm_genlist_item_append(genlist, itc_launch_text, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
if (item_launch_text)
elm_genlist_item_select_mode_set(item_launch_text, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
item_sep_21 = elm_genlist_item_append(genlist, itc_sep_21, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
/* More Detail */
- item_detail = elm_genlist_item_append(genlist, itc_detail, (void *)app_info, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_detail, (void*)ugd);
+ item_detail = elm_genlist_item_append(genlist, itc_detail, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_detail, (void*)ugd);
if (app_info->pkg_type) {
if (item_detail != NULL && (!strncmp(app_info->pkg_type, TPK_PREFIX, strlen(TPK_PREFIX)) || !strncmp(app_info->pkg_type, RPM_PREFIX, strlen(RPM_PREFIX)))) {
elm_genlist_item_selected_set(item_detail, EINA_FALSE);
retv_if(view_common_data->user_view_data == NULL, NULL);
app_info_view_data_t *app_info_view_data = view_common_data->user_view_data;
+ retv_if(ugd->data == NULL, NULL);
+ _app_info = app_info_view_data->app_info = (mgr_app_app_info_t*)ugd->data;
app_info_view_data->genlist = __create_genlist_app_info(view_common_data->common_navibar, (void*)ugd);
MGR_APP_END();