From 12eff9fd2c65ea6ce244c30e4903a48ce12b5d23 Mon Sep 17 00:00:00 2001 From: Ryuan Choi Date: Mon, 23 Aug 2010 23:00:53 +0900 Subject: [PATCH] [elm_webview]add notfoundpage --- src/lib/els_webview.c | 59 ++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/src/lib/els_webview.c b/src/lib/els_webview.c index ae50755..7efa5ff 100644 --- a/src/lib/els_webview.c +++ b/src/lib/els_webview.c @@ -39,28 +39,30 @@ #define MIN_ZOOM_RATIO 0.09f #define MAX_ZOOM_RATIO 4.0f -#define NOT_FOUND_PAGE " \ - Page Not Found \ - \ - \ -
\ - \ - \ - \ - \ -

Page Not Found

\ - \ -
\ - \ - \ - " +// "" +#define NOT_FOUND_PAGE_HEADER "" \ + "Page Not Found" \ + "" \ + "
" \ + "" \ + "" \ + "" \ + "" \ + "

Page Not Found

" \ + "" \ + "
" \ + "" \ + "" \ + "" #define NEED_TO_REMOVE @@ -837,6 +839,7 @@ _smart_load_error(void* data, Evas_Object* webview, void* arg) { DBG("%s is called\n", __func__); Smart_Data* sd = (Smart_Data *)data; + char szBuffer[2048]; if (!sd) return; // if error, call loadNotFoundPage @@ -844,10 +847,10 @@ _smart_load_error(void* data, Evas_Object* webview, void* arg) int errorCode = (error)? error->code: 0; if ( errorCode != 0 && errorCode != -999 ) { // 0 ok, -999 request cancelled - char szStrBuffer[1024]; - snprintf(szStrBuffer, 1024, "page not found:, [code: %d] [domain: %s] [description: %s] [failing_url: %s] \n", - error->code, error->domain, error->description, error->failing_url); - DBG(szStrBuffer); + //char szStrBuffer[1024]; + //snprintf(szStrBuffer, 1024, "page not found:, [code: %d] [domain: %s] [description: %s] [failing_url: %s] \n", + // error->code, error->domain, error->description, error->failing_url); + //DBG(szStrBuffer); //ecore_job_add(loadNotFoundPage, (void *)this); if (!sd->ewk_view_stop) @@ -859,8 +862,10 @@ _smart_load_error(void* data, Evas_Object* webview, void* arg) if (!sd->ewk_frame_contents_set) sd->ewk_frame_contents_set = (Eina_Bool (*)(Evas_Object *, const char *, size_t, const char *, const char *, const char *))dlsym(ewk_handle, "ewk_frame_contents_set"); + + snprintf(szBuffer, 2048, NOT_FOUND_PAGE_HEADER "\"?%s?%s\"" NOT_FOUND_PAGE_FOOTER, error->failing_url, error->description); //sd->ewk_frame_contents_set(sd->ewk_view_frame_main_get(webview), szStrBuffer, 0, NULL, NULL, NULL); - sd->ewk_frame_contents_set(sd->ewk_view_frame_main_get(webview), NOT_FOUND_PAGE, 0, NULL, NULL, NULL); + sd->ewk_frame_contents_set(sd->ewk_view_frame_main_get(webview), szBuffer, 0, NULL, NULL, NULL); return; } } -- 2.7.4