diff options
author | portix <portix@gmx.net> | 2011-09-12 14:08:56 +0200 |
---|---|---|
committer | portix <portix@gmx.net> | 2011-09-12 14:08:56 +0200 |
commit | 7cb4034edcdef390cc39135e4b530c8212f8afa2 (patch) | |
tree | c17d41f21c609f8a80f4f476fd8b0dd370abf012 | |
parent | 1d45401e452291aaadfb99e189527633db590dd2 (diff) | |
download | dwb-7cb4034edcdef390cc39135e4b530c8212f8afa2.zip |
Hide error button without searchengine
-rw-r--r-- | lib/error.html | 2 | ||||
-rw-r--r-- | src/view.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/error.html b/lib/error.html index 4fab8ec0..88788849 100644 --- a/lib/error.html +++ b/lib/error.html @@ -56,7 +56,7 @@ function searchFor(uri) { <form name="bl"> <input type="button" value="Try again" onclick="javascript:tryagain()" /> -<input type="button" value="Search" %s onclick="javascript:searchFor('%s')" /> +<input type="button" value="Search" style="visibility:%s" onclick="javascript:searchFor('%s')" /> </form> </div> @@ -504,8 +504,7 @@ dwb_web_view_load_error_cb(WebKitWebView *web, WebKitWebFrame *frame, char *uri, char *content = dwb_util_get_file_content(errorfile); char *tmp = g_strdup(uri); char *res = tmp; - tmp = strstr(tmp, "://"); - if (tmp != NULL) + if ( (tmp = strstr(tmp, "://")) != NULL) tmp += 3; else tmp = res; @@ -515,11 +514,10 @@ dwb_web_view_load_error_cb(WebKitWebView *web, WebKitWebFrame *frame, char *uri, char *icon = dwb_get_stock_item_base64_encoded(GTK_STOCK_DIALOG_ERROR); if ((search = dwb_get_search_engine(tmp, true)) != NULL) - site = g_strdup_printf(content, icon != NULL ? icon : "", uri, weberror->message, "", search); + site = g_strdup_printf(content, icon != NULL ? icon : "", uri, weberror->message, "visible", search); else - site = g_strdup_printf(content, icon != NULL ? icon : "", uri, weberror->message, "disabled", ""); + site = g_strdup_printf(content, icon != NULL ? icon : "", uri, weberror->message, "hidden", ""); - printf("%d", weberror->code); webkit_web_frame_load_alternate_string(webkit_web_view_get_main_frame(web), site, "Error", uri); g_free(site); |