diff options
author | Minkyu Kang <mk7.kang@samsung.com> | 2015-12-29 20:17:01 +0900 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2015-12-29 20:17:01 +0900 |
commit | 99cbb990930fb84358cb9a4d1d8f41f1c8be76e8 (patch) | |
tree | 67a294a8e25d195f7bbd533bd3cc8d936575c631 | |
parent | 1d7f43616a6b7f16a6b6d71b97ec401aad435391 (diff) | |
download | air_mediahub-99cbb990930fb84358cb9a4d1d8f41f1c8be76e8.tar.gz air_mediahub-99cbb990930fb84358cb9a4d1d8f41f1c8be76e8.tar.bz2 air_mediahub-99cbb990930fb84358cb9a4d1d8f41f1c8be76e8.zip |
viewer: show error message when failed to load the image
Change-Id: I368b8c30eb5a3a8b17890e4ef69014d89aef8da5
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
-rw-r--r-- | include/define.h | 1 | ||||
-rw-r--r-- | include/view/viewer.h | 1 | ||||
-rw-r--r-- | res/edc/view/viewer.edc | 18 | ||||
-rw-r--r-- | src/view/viewer.c | 17 |
4 files changed, 36 insertions, 1 deletions
diff --git a/include/define.h b/include/define.h index f55eaec..a5c6890 100644 --- a/include/define.h +++ b/include/define.h @@ -49,6 +49,7 @@ #define COLOR_TEXT_SELECTED 64 136 211 255 #define COLOR_TEXT_DISABLED 87 87 87 128 #define COLOR_TEXT_BG 113 128 147 255 +#define COLOR_TEXT_ERR 218 51 51 255 #define COLOR_ITEM_BG 255 255 255 255 #define COLOR_ITEM_DEFAULT 119 169 202 255 #define COLOR_ITEM_FOCUS 0 119 246 255 diff --git a/include/view/viewer.h b/include/view/viewer.h index beb81a8..3c590fa 100644 --- a/include/view/viewer.h +++ b/include/view/viewer.h @@ -29,6 +29,7 @@ /* part */ #define PART_VIEWER_BG "part.viewer_bg" #define PART_VIEWER_CONTENT "part.viewer_content" +#define PART_VIEWER_CONTENT_ERR "part.viewer_content_err" #define PART_VIEWER_TITLE "part.viewer_title" #define PART_VIEWER_DATE "part.viewer_date" #define PART_VIEWER_PAGE "part.viewer_page" diff --git a/res/edc/view/viewer.edc b/res/edc/view/viewer.edc index 0810c18..4792b91 100644 --- a/res/edc/view/viewer.edc +++ b/res/edc/view/viewer.edc @@ -671,6 +671,24 @@ group { visible: 0; } } + + /* ERR */ + part { + name: PART_VIEWER_CONTENT_ERR; + type: TEXT; + scale: 1; + description { + state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + text { + font: FONT_LIGHT; + size: 36; + align: 0.5 0.5; + } + color: COLOR_TEXT_ERR; + } + } } programs { diff --git a/src/view/viewer.c b/src/view/viewer.c index ec5cab7..428291f 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -293,6 +293,9 @@ static void _image_loaded_detail(void *data, Evas_Object *obj, void *ev) static void _draw_contents(struct _priv *priv, int id, app_media_info *mi) { Evas_Object *obj; + Evas_Load_Error err; + + elm_object_part_text_set(priv->base, PART_VIEWER_CONTENT_ERR, ""); if (id == VIEWER_MOVIE) { _image_unload(priv); @@ -343,7 +346,19 @@ static void _draw_contents(struct _priv *priv, int id, app_media_info *mi) _set_bg_color(priv, 0, 0, 0, 255); - elm_photocam_file_set(obj, mi->file_path); + err = elm_photocam_file_set(obj, mi->file_path); + if (err != EVAS_LOAD_ERROR_NONE) { + _ERR("photocam file load failed (%d): %s", err, mi->file_path); + + _image_unload(priv); + + _set_bg_color(priv, 244, 244, 244, 255); + elm_object_part_text_set(priv->base, PART_VIEWER_CONTENT_ERR, + "Failed to load the image."); + + return; + } + elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT); elm_photocam_image_orient_set(obj, util_get_orient(mi->image->orientation)); |