summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoohye Shin <soohye.shin@samsung.com>2015-12-09 14:33:50 +0900
committerSoohye Shin <soohye.shin@samsung.com>2015-12-09 14:38:46 +0900
commit990b41bac86ec1e4da4f6db935954915be460d89 (patch)
treed17d6480e832c6ec02fbce5176af7836bf7b0a7c
parent53966442a498cb5df293d1063f80d1e04681e780 (diff)
downloadair_home-990b41bac86ec1e4da4f6db935954915be460d89.tar.gz
air_home-990b41bac86ec1e4da4f6db935954915be460d89.tar.bz2
air_home-990b41bac86ec1e4da4f6db935954915be460d89.zip
Change-Id: Ie67c26cf5b4219fe1675bf0297d141ff6f137c10 Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
-rw-r--r--CMakeLists.txt1
-rw-r--r--config/home.json.in15
-rw-r--r--edje/view/home.edc49
-rw-r--r--images/badge_bg.pngbin3232 -> 0 bytes
-rw-r--r--include/datamgr.h1
-rw-r--r--include/defs.h3
-rw-r--r--include/utils.h1
-rw-r--r--include/view.h1
-rw-r--r--packaging/org.tizen.home.spec1
-rw-r--r--src/data/data_home.c49
-rw-r--r--src/data/data_recent.c38
-rw-r--r--src/utils.c57
-rw-r--r--src/view/view_home.c63
13 files changed, 8 insertions, 271 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 030e495..2af86d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,7 +71,6 @@ pkg_check_modules(PKGS REQUIRED
libgum
app-utils
pkgmgr-info
- notification
tv-service
ecore-wayland
ui-gadget-1
diff --git a/config/home.json.in b/config/home.json.in
index f81474e..e17dcab 100644
--- a/config/home.json.in
+++ b/config/home.json.in
@@ -5,40 +5,35 @@
"icon": "@IMAGEDIR@/ic_user_08_nor.png",
"focus_icon": "@IMAGEDIR@/ic_user_08_foc.png",
"select_action": "push",
- "parameter": "VIEW_USER",
- "notification": false
+ "parameter": "VIEW_USER"
},
{
"name": "Media Hub",
"icon": "@IMAGEDIR@/btn_menu_media_nor.png",
"focus_icon": "@IMAGEDIR@/btn_menu_media_foc.png",
"select_action": "launch",
- "parameter": "org.tizen.mediahub",
- "notification": false
+ "parameter": "org.tizen.mediahub"
},
{
"name": "APP",
"icon": "@IMAGEDIR@/btn_menu_app_nor.png",
"focus_icon": "@IMAGEDIR@/btn_menu_app_foc.png",
"select_action": "launch",
- "parameter": "org.tizen.apps",
- "notification": false
+ "parameter": "org.tizen.apps"
},
{
"name": "Notification",
"icon": "@IMAGEDIR@/btn_menu_notification_nor.png",
"focus_icon": "@IMAGEDIR@/btn_menu_notification_foc.png",
"select_action": "launch",
- "parameter": "org.tizen.infosquare",
- "notification": true
+ "parameter": "org.tizen.infosquare"
},
{
"name": "Settings",
"icon": "@IMAGEDIR@/btn_menu_setting_nor.png",
"focus_icon": "@IMAGEDIR@/btn_menu_setting_foc.png",
"select_action": "launch",
- "parameter": "org.tizen.settings",
- "notification": false
+ "parameter": "org.tizen.settings"
}
]
}
diff --git a/edje/view/home.edc b/edje/view/home.edc
index eee0502..7a00999 100644
--- a/edje/view/home.edc
+++ b/edje/view/home.edc
@@ -508,54 +508,5 @@ group {
rel2.to, PART_BAR_ITEM_TITLE;
}
}
- part {
- name, "pad.badge";
- type, RECT;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 40 14;
- rel1.relative, 1.0 0.0;
- rel2.relative, 1.0 0.0;
- align, 1.0 0.0;
- fixed, 1 1;
- visible, 0;
- }
- }
- part {
- name, PART_BAR_ITEM_BADGE;
- type, SWALLOW;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 36 36;
- rel1 {
- to, "pad.badge";
- relative, 0.0 1.0;
- }
- rel2 {
- to, "pad.badge";
- relative, 0.0 1.0;
- }
- align, 1.0 0.0;
- fixed, 1 1;
- }
- }
- part {
- name, PART_BAR_ITEM_BADGE_COUNT;
- type, TEXT;
- scale, 1;
- description {
- state, "default" 0.0;
- rel1.to, PART_BAR_ITEM_BADGE;
- rel2.to, PART_BAR_ITEM_BADGE;
- fixed, 1 1;
- text {
- size, 24;
- font, FONT_LIGHT;
- }
- color, 255 255 255 255;
- }
- }
}
}
diff --git a/images/badge_bg.png b/images/badge_bg.png
deleted file mode 100644
index fb93b9b..0000000
--- a/images/badge_bg.png
+++ /dev/null
Binary files differ
diff --git a/include/datamgr.h b/include/datamgr.h
index 2cfde9a..5c795a3 100644
--- a/include/datamgr.h
+++ b/include/datamgr.h
@@ -63,7 +63,6 @@ struct datamgr_item {
char *icon;
char *focus_icon;
char *parameter;
- bool noti;
enum datamgr_item_select_action action;
int type;
time_t time;
diff --git a/include/defs.h b/include/defs.h
index 854ab26..fec2eed 100644
--- a/include/defs.h
+++ b/include/defs.h
@@ -89,8 +89,6 @@
#define PART_BAR_ITEM_ICON_FOCUS "part.bar.item.icon.focus"
#define PART_BAR_ITEM_TITLE "part.bar.item.title"
#define PART_BAR_ITEM_TITLE_FOCUS "part.bar.item.title.focus"
-#define PART_BAR_ITEM_BADGE "part.bar.item.badge"
-#define PART_BAR_ITEM_BADGE_COUNT "part.bar.item.badge.count"
#define PART_BAR_ITEM_LOCK "part.bar.item.lock"
#define PART_BAR_ITEM_LOCK_FOCUS "part.bar.item.lock.focus"
#define PART_BAR_ITEM_MASK "part.bar.item.mask"
@@ -160,7 +158,6 @@
#define IMAGE_SWITCH_ON IMAGEDIR"/btn_switch_on_nor.png"
#define IMAGE_SWITCH_OFF IMAGEDIR"/btn_switch_off_nor.png"
#define IMAGE_MASK IMAGEDIR"/mask_user_nor.png"
-#define IMAGE_BADGE IMAGEDIR"/badge_bg.png"
#define IMAGE_USER_ADD IMAGEDIR"/btn_user_add_nor.png"
#define IMAGE_USER_ADD_FOCUS IMAGEDIR"/btn_user_add_foc.png"
#define IMAGE_USER_DEFAULT IMAGEDIR"/ic_user_01_nor.png"
diff --git a/include/utils.h b/include/utils.h
index ce8db57..deb43a8 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -53,6 +53,5 @@ Evas_Object *utils_add_rectangle(Evas_Object *base, int r, int g, int b, int a);
Evas_Object *utils_add_toast(Evas_Object *base, char *message);
bundle *utils_add_bundle(char *key, char *value, char *uri);
bool utils_launch_app(const char *pkg, bundle *b);
-int utils_get_notification_count(void);
#endif /* __AIR_HOME_UTILS_H__ */
diff --git a/include/view.h b/include/view.h
index 6cdb075..37fcae6 100644
--- a/include/view.h
+++ b/include/view.h
@@ -22,7 +22,6 @@
enum update_type {
UPDATE_TYPE_EDIT,
UPDATE_TYPE_PHOTO,
- UPDATE_TYPE_NOTI,
UPDATE_TYPE_USER,
UPDATE_TYPE_RESET,
UPDATE_TYPE_MENU,
diff --git a/packaging/org.tizen.home.spec b/packaging/org.tizen.home.spec
index ed39194..61ee6bb 100644
--- a/packaging/org.tizen.home.spec
+++ b/packaging/org.tizen.home.spec
@@ -18,7 +18,6 @@ BuildRequires: pkgconfig(libgum)
BuildRequires: pkgconfig(app-utils)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(tv-service)
-BuildRequires: pkgconfig(notification)
BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: pkgconfig(ui-gadget-1)
BuildRequires: pkgconfig(capi-web-history)
diff --git a/src/data/data_home.c b/src/data/data_home.c
index 54c926f..8a81a25 100644
--- a/src/data/data_home.c
+++ b/src/data/data_home.c
@@ -20,8 +20,6 @@
#include <stdbool.h>
#include <Evas.h>
#include <viewmgr.h>
-#include <notification.h>
-#include <notification_internal.h>
#include <gum/gum-user.h>
#include "data_home.h"
@@ -39,7 +37,6 @@
#define MEMBER_STR_FOCUS_ICON "focus_icon"
#define MEMBER_STR_SELECT_ACTION "select_action"
#define MEMBER_STR_PARAMETER "parameter"
-#define MEMBER_INT_NOTIFICATION "notification"
#define MAX_BUF 64
@@ -113,10 +110,9 @@ static bool _get_login_user(struct datamgr_item *di)
}
static struct datamgr_item *_new_datamgr_item(char *name, char *icon,
- char *focus_icon, char *parameter, char *action, bool noti)
+ char *focus_icon, char *parameter, char *action)
{
struct datamgr_item *di;
- char buf[MAX_BUF];
di = calloc(1, sizeof(*di));
if (!di) {
@@ -125,12 +121,6 @@ static struct datamgr_item *_new_datamgr_item(char *name, char *icon,
}
di->parameter = strdup(parameter);
- di->noti = noti;
- if (noti) {
- snprintf(buf, sizeof(buf), "%d",
- utils_get_notification_count());
- di->subtitle = strdup(buf);
- }
if (!strcmp(action, STR_SELECT_ACTION_PUSH) && _get_login_user(di)) {
di->action = ITEM_SELECT_ACTION_PUSH;
@@ -139,7 +129,6 @@ static struct datamgr_item *_new_datamgr_item(char *name, char *icon,
di->action = ITEM_SELECT_ACTION_LAUNCH;
} else {
free(di->parameter);
- free(di->subtitle);
free(di);
return NULL;
}
@@ -154,7 +143,6 @@ static struct datamgr_item *_new_datamgr_item(char *name, char *icon,
static struct datamgr_item *_pack_home_item(JsonReader *reader, int i)
{
char *name, *icon, *parameter, *focus_icon, *action;
- gboolean noti;
if (!reader) {
_ERR("Invalid argument");
@@ -180,12 +168,10 @@ static struct datamgr_item *_pack_home_item(JsonReader *reader, int i)
action = _read_string(reader, MEMBER_STR_SELECT_ACTION);
parameter = _read_string(reader, MEMBER_STR_PARAMETER);
- noti = _read_boolean(reader, MEMBER_INT_NOTIFICATION);
json_reader_end_element(reader);
- return _new_datamgr_item(name, icon, focus_icon, parameter, action,
- noti);
+ return _new_datamgr_item(name, icon, focus_icon, parameter, action);
err:
json_reader_end_element(reader);
return NULL;
@@ -271,7 +257,6 @@ static void _unload_home(struct datamgr *dm)
free(di->icon);
free(di->focus_icon);
free(di->parameter);
- free(di->subtitle);
free(di);
}
@@ -292,32 +277,6 @@ static Eina_List *_get_items(struct datamgr *dm)
return dm->list;
}
-static void _notification_cb(void *data, notification_type_e type)
-{
- Eina_List *l;
- struct datamgr *dm;
- struct datamgr_item *di;
- char buf[MAX_BUF];
-
- if (!data) {
- _ERR("Invalid argument");
- return;
- }
-
- dm = data;
-
- EINA_LIST_FOREACH(dm->list, l, di) {
- if (!di->noti)
- continue;
-
- snprintf(buf, sizeof(buf), "%d",
- utils_get_notification_count());
- viewmgr_update_view(VIEW_HOME, UPDATE_TYPE_NOTI, buf);
- free(di->subtitle);
- di->subtitle = strdup(buf);
- }
-}
-
static void _fini(struct datamgr *dm)
{
if (!dm) {
@@ -326,8 +285,6 @@ static void _fini(struct datamgr *dm)
}
_unload_home(dm);
-
- notification_unresister_changed_cb(_notification_cb);
}
static bool _init(struct datamgr *dm)
@@ -337,8 +294,6 @@ static bool _init(struct datamgr *dm)
return false;
}
- notification_resister_changed_cb(_notification_cb, dm);
-
return _load_home(dm);
}
diff --git a/src/data/data_recent.c b/src/data/data_recent.c
index 757b44f..07c7c20 100644
--- a/src/data/data_recent.c
+++ b/src/data/data_recent.c
@@ -550,41 +550,6 @@ static int _sort_list(const void *data1, const void *data2)
return -1;
}
-static bool _load_recent_notification(struct datamgr *dm)
-{
- struct datamgr_item *di;
- struct thumbnail_data *thumbnail;
- int time, count;
- char buf[MAX_BUF];
-
- count = utils_get_notification_count();
-
- if (count > 0)
- snprintf(buf, sizeof(buf), "%d Unread Noti.", count);
- else
- buf[0] = '\0';
-
- app_contents_get_basis_time(CONTENTS_NOTI, &time);
- if (time < 0) {
- _ERR("Invalid time");
- return false;
- }
-
- di = _new_datamgr_item(MESSAGE_NOTIFICATION, buf, APP_ID_INFOSQUARE,
- NULL, NULL, NULL, IMAGE_RECENT_ICON_APP, 0, time);
- if (di) {
- thumbnail = calloc(1, sizeof(*thumbnail));
- if (thumbnail) {
- thumbnail->file = strdup(IMAGE_RECENT_THUMB_NOTI);
- thumbnail->type = THUMBNAIL_FILE;
- di->thumbnail = thumbnail;
- }
- dm->list = eina_list_append(dm->list, di);
- }
-
- return true;
-}
-
static Eina_List *_get_items(struct datamgr *dm)
{
if (!dm) {
@@ -609,9 +574,6 @@ static Eina_List *_get_items(struct datamgr *dm)
if (!_load_recent(dm, CONTENTS_MUSIC, 1, _music_list_foreach))
_ERR("failed to load recent music contents");
- if (!_load_recent_notification(dm))
- _ERR("failed to load recent notification contents");
-
if (!_load_recent(dm, CONTENTS_WEB, 1, _web_list_foreach))
_ERR("failed to load recent web contents");
diff --git a/src/utils.c b/src/utils.c
index ed88fd6..90e949f 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -18,8 +18,6 @@
#include <app_debug.h>
#include <stdbool.h>
#include <app.h>
-#include <notification.h>
-#include <notification_internal.h>
#include <app_contents.h>
#include <bundle.h>
@@ -522,58 +520,3 @@ bool utils_launch_app(const char *pkg, bundle *b)
return true;
}
-
-static void _get_notification_count(notification_type_e type, int *count)
-{
- int basis_time, r;
- time_t noti_time;
- notification_list_h list = NULL;
- notification_h noti;
-
- app_contents_get_basis_time(CONTENTS_NOTI, &basis_time);
- if (basis_time < 0) {
- _ERR("failed to get basis time");
- return;
- }
-
- notification_get_list(type, -1, &list);
- if (!list)
- return;
-
- while (list) {
- noti = notification_list_get_data(list);
- if (!noti) {
- _ERR("failed to get noti data");
- list = notification_list_get_next(list);
- continue;
- }
-
- r = notification_get_insert_time(noti, &noti_time);
- if (r != NOTIFICATION_ERROR_NONE) {
- _ERR("failed to get time of notification");
- list = notification_list_get_next(list);
- continue;
- }
-
- if (noti_time < basis_time)
- break;
-
- (*count)++;
- list = notification_list_get_next(list);
- }
-
- notification_free_list(list);
-}
-
-int utils_get_notification_count(void)
-{
- int count = 0;
-
- _get_notification_count(NOTIFICATION_TYPE_ONGOING, &count);
- _get_notification_count(NOTIFICATION_TYPE_NOTI, &count);
-
- if (count > 99)
- count = 99;
-
- return count;
-}
diff --git a/src/view/view_home.c b/src/view/view_home.c
index 5b75633..f078fd5 100644
--- a/src/view/view_home.c
+++ b/src/view/view_home.c
@@ -43,7 +43,6 @@ struct _priv {
struct bar_item {
Evas_Object *eo;
- Evas_Object *badge;
struct datamgr_item *di;
struct _priv *priv;
@@ -186,23 +185,6 @@ static bool _add_navigations(struct _priv *priv, Evas_Object *base)
return true;
}
-static Evas_Object *_add_notification_badge(Evas_Object *eo, char *noti)
-{
- Evas_Object *badge;
-
- if (!strcmp(noti, "0"))
- return NULL;
-
- badge = utils_add_icon(eo, IMAGE_BADGE, PART_BAR_ITEM_BADGE);
- if (!badge) {
- _ERR("failed to add badge");
- return NULL;
- }
- elm_object_part_text_set(eo, PART_BAR_ITEM_BADGE_COUNT, noti);
-
- return badge;
-}
-
static struct bar_item *_pack_bar_item(struct _priv *priv, Evas_Object *box,
struct datamgr_item *di)
{
@@ -257,9 +239,6 @@ static struct bar_item *_pack_bar_item(struct _priv *priv, Evas_Object *box,
COLOR_DEFAULT_B, COLOR_DEFAULT_A);
}
- if (di->noti)
- bi->badge = _add_notification_badge(eo, di->subtitle);
-
inputmgr_add_callback(eo, INPUT_HANDLER_TYPE_EO, &handler, bi);
elm_box_pack_end(box, eo);
evas_object_show(eo);
@@ -459,52 +438,12 @@ static void _destroy(void *data)
free(priv);
}
-static void _update(void *view_data, int update_type, void *data)
-{
- struct _priv *priv;
- struct bar_item *bi;
- Eina_List *list;
- Evas_Object *badge;
-
- if (!view_data) {
- _ERR("Invalid argument");
- return;
- }
-
- priv = view_data;
-
- switch (update_type) {
- case UPDATE_TYPE_NOTI:
- if (!priv->list)
- return;
-
- EINA_LIST_FOREACH(priv->list, list, bi) {
- if (!bi->di->noti)
- continue;
-
- badge = _add_notification_badge(bi->eo, data);
- if (!badge && bi->badge) {
- evas_object_del(bi->badge);
- elm_object_part_text_set(bi->eo,
- PART_BAR_ITEM_BADGE_COUNT, "");
- }
- evas_object_show(bi->eo);
- bi->badge = badge;
- }
- break;
- default:
- _ERR("Invalid type");
- return;
- }
-}
-
static view_class vclass = {
.view_id = VIEW_HOME,
.create = _create,
.show = _show,
.hide = _hide,
- .destroy = _destroy,
- .update = _update
+ .destroy = _destroy
};
view_class *view_home_get_vclass(void)