diff options
author | portix <portix@gmx.net> | 2012-02-23 12:43:51 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-02-23 12:43:51 +0100 |
commit | 970c23e627dbbc8389cd6c376d420b41d242d785 (patch) | |
tree | d1c5ccbd8058cd378fc063f7bfe5706132ccf046 | |
parent | e33004c9a1bba53f66aa952a91be1db268d7bd1c (diff) | |
download | dwb-970c23e627dbbc8389cd6c376d420b41d242d785.zip |
Replace dwb://-uris with dwb:-uris
-rw-r--r-- | doc/dwb.1 | 32 | ||||
-rw-r--r-- | lib/info.html | 12 | ||||
-rw-r--r-- | src/commands.c | 11 | ||||
-rw-r--r-- | src/commands.h | 5 | ||||
-rw-r--r-- | src/config.h | 34 | ||||
-rw-r--r-- | src/dwb.c | 2 | ||||
-rw-r--r-- | src/html.c | 22 | ||||
-rw-r--r-- | src/view.c | 6 | ||||
-rw-r--r-- | util/keys.in | 4 |
9 files changed, 92 insertions, 36 deletions
@@ -614,11 +614,29 @@ Add a searchengine. Text fields can be focused via hints (command aliases: .BR search ). .TP -.BR Ss -Show settings (command -.BR show_settings , +.BR Sb +Show bookmarks (command +.BR show_bookmarks , aliases: -.BR ssettings ). +.BR sbookmarks ). +.TP +.BR Sq +Show quickmarks (command +.BR show_quickmarks , +aliases: +.BR squickmarks ). +.TP +.BR Sh +Show history (command +.BR show_history , +aliases: +.BR shistory ). +.TP +.BR Sd +Show download (command +.BR show_downloads , +aliases: +.BR sdownloads ). .TP .BR Sk Show keys (command @@ -626,6 +644,12 @@ Show keys (command aliases: .BR skeys ). .TP +.BR Ss +Show settings (command +.BR show_settings , +aliases: +.BR ssettings ). +.TP .BR ss Set setting (command .BR set_setting , diff --git a/lib/info.html b/lib/info.html index b03e7427..b7a6c76c 100644 --- a/lib/info.html +++ b/lib/info.html @@ -1,12 +1,12 @@ <body id="dwb_body"> <div id="dwb_main_container"> <div id="dwb_headline"> - <a href="dwb://bookmarks">Bookmarks</a> - <a href="dwb://quickmarks">Quickmarks</a> - <a href="dwb://history">History</a> - <a href="dwb://downloads">Downloads</a> - <a href="dwb://keys">Keys</a> - <a href="dwb://settings">Settings</a> + <a href="dwb:bookmarks">Bookmarks</a> + <a href="dwb:quickmarks">Quickmarks</a> + <a href="dwb:history">History</a> + <a href="dwb:downloads">Downloads</a> + <a href="dwb:keys">Keys</a> + <a href="dwb:settings">Settings</a> </div> <div id="dwb_table_container"> <table id="dwb_info_table" width="100%" border="0"> diff --git a/src/commands.c b/src/commands.c index 0467ac69..ce06e20b 100644 --- a/src/commands.c +++ b/src/commands.c @@ -188,19 +188,26 @@ commands_show_hints(KeyMap *km, Arg *arg) { return dwb_show_hints(arg); }/*}}}*/ +DwbStatus +commands_show(KeyMap *km, Arg *arg) { + html_load(dwb.state.fview, arg->p); + return STATUS_OK; +} +#if 0 /* commands_show_keys(KeyMap *km, Arg *arg){{{*/ DwbStatus commands_show_keys(KeyMap *km, Arg *arg) { - html_load(dwb.state.fview, "dwb://keys"); + html_load(dwb.state.fview, "dwb:keys"); return STATUS_OK; }/*}}}*/ /* commands_show_settings(KeyMap *km, Arg *a) {{{*/ DwbStatus commands_show_settings(KeyMap *km, Arg *arg) { - html_load(dwb.state.fview, "dwb://settings"); + html_load(dwb.state.fview, "dwb:settings"); return STATUS_OK; }/*}}}*/ +#endif /* commands_allow_cookie {{{*/ DwbStatus diff --git a/src/commands.h b/src/commands.h index 0778f5af..3d0fac95 100644 --- a/src/commands.h +++ b/src/commands.h @@ -59,8 +59,9 @@ DwbStatus commands_set_key(KeyMap *, Arg *); DwbStatus commands_set_orientation(KeyMap *, Arg *); DwbStatus commands_set_setting(KeyMap *, Arg *); DwbStatus commands_show_hints(KeyMap *, Arg *); -DwbStatus commands_show_keys(KeyMap *, Arg *); -DwbStatus commands_show_settings(KeyMap *, Arg *); +//DwbStatus commands_show_keys(KeyMap *, Arg *); +//DwbStatus commands_show_settings(KeyMap *, Arg *); +DwbStatus commands_show(KeyMap *, Arg *); DwbStatus commands_toggle_scripts(KeyMap *, Arg *a); DwbStatus commands_toggle_plugin_blocker(KeyMap *, Arg *a); DwbStatus commands_toggle_property(KeyMap *, Arg *); diff --git a/src/config.h b/src/config.h index 72617b4c..cf84d51b 100644 --- a/src/config.h +++ b/src/config.h @@ -81,6 +81,10 @@ static KeyValue KEYS[] = { { "scroll_up", { "k", 0, }, }, { "show_keys", { "Sk", 0, }, }, { "show_settings", { "Ss", 0, }, }, + { "show_bookmarks", { "Sb", 0, }, }, + { "show_history", { "Sh", 0, }, }, + { "show_downloads", { "Sd", 0, }, }, + { "show_quickmarks", { "Sq", 0, }, }, { "stop_loading", { "s", GDK_CONTROL_MASK, }, }, { "view_source", { "gf", 0, }, }, { "zoom_in", { "+", 0, }, }, @@ -428,7 +432,7 @@ static FunctionMap FMAP [] = { { { "start_page", "Open startpage", }, 1, (Func)commands_open_startpage, "No startpage set", ALWAYS_SM, - { .p = "dwb://bookmarks" }, EP_NONE, { "home", NULL }, }, + { 0 }, EP_NONE, { "home", NULL }, }, { { "quit", "Quit dwb", }, 1, (Func)commands_quit, NULL, ALWAYS_SM, @@ -510,13 +514,29 @@ static FunctionMap FMAP [] = { (Func)commands_set_key, NULL, NEVER_SM, { 0 }, EP_NONE, { "keys", NULL }, }, - { { "show_keys", "Key configuration", }, 1, - (Func)commands_show_keys, NULL, ALWAYS_SM, - { 0 }, EP_NONE, { "skeys", NULL }, }, + { { "show_bookmarks", "Show bookmarks", }, 1, + (Func)commands_show, NULL, ALWAYS_SM, + { .p = "dwb:bookmarks", .ro = true }, EP_NONE, { "sbookmarks", NULL }, }, + + { { "show_quickmarks", "Show quickmarks", }, 1, + (Func)commands_show, NULL, ALWAYS_SM, + { .p = "dwb:quickmarks", .ro = true }, EP_NONE, { "squickmarks", NULL }, }, + + { { "show_history", "Show quickmarks", }, 1, + (Func)commands_show, NULL, ALWAYS_SM, + { .p = "dwb:history", .ro = true }, EP_NONE, { "shistory", NULL }, }, + + { { "show_downloads", "Show downloads", }, 1, + (Func)commands_show, NULL, ALWAYS_SM, + { .p = "dwb:downloads", .ro = true }, EP_NONE, { "sdownloads", NULL }, }, + { { "show_keys", "Key configuration", }, 1, + (Func)commands_show, NULL, ALWAYS_SM, + { .p = "dwb:keys", .ro = true }, EP_NONE, { "skeys", NULL }, }, + { { "show_settings", "Settings configuration", }, 1, - (Func)commands_show_settings, NULL, ALWAYS_SM, - { 0 }, EP_NONE, { "ssettings", NULL }, }, + (Func)commands_show, NULL, ALWAYS_SM, + { .p = "dwb:settings", .ro = true }, EP_NONE, { "ssettings", NULL }, }, { { "view_source", "View source", }, 1, (Func)commands_view_source, NULL, ALWAYS_SM, @@ -948,7 +968,7 @@ static WebSettings DWB_SETTINGS[] = { { { "auto-completion", "Show possible shortcuts", }, SETTING_GLOBAL, BOOLEAN, { .b = false }, (S_Func)completion_set_autcompletion, }, { { "startpage", "The default homepage", }, - SETTING_GLOBAL, CHAR, { .p = "dwb://bookmarks" }, (S_Func)dwb_set_startpage, }, + SETTING_GLOBAL, CHAR, { .p = "dwb:bookmarks" }, (S_Func)dwb_set_startpage, }, { { "single-instance", "Whether to have only on instance", }, SETTING_GLOBAL, BOOLEAN, { .b = true }, NULL, }, { { "save-session", "Whether to automatically save sessions", }, @@ -1853,7 +1853,7 @@ dwb_load_uri(GList *gl, const char *arg) { } } } - else if (g_str_has_prefix(tmpuri, "dwb://")) { + else if (g_str_has_prefix(tmpuri, "dwb:")) { webkit_web_view_load_uri(web, tmpuri); goto clean; } @@ -45,13 +45,13 @@ DwbStatus html_keys(GList *, HtmlTable *); static HtmlTable table[] = { - { "dwb://bookmarks", "Bookmarks", INFO_FILE, 0, html_bookmarks, }, - { "dwb://quickmarks", "Quickmarks", INFO_FILE, 0, html_quickmarks, }, - { "dwb://history", "History", INFO_FILE, 0, html_history, }, - { "dwb://downloads", "Downloads", INFO_FILE, 0, html_downloads, }, - { "dwb://keys", "Keys", INFO_FILE, 0, html_keys }, - { "dwb://settings", "Settings", INFO_FILE, 0, html_settings }, - { "dwb://startpage", NULL, NULL, 0, html_startpage }, + { "dwb:bookmarks", "Bookmarks", INFO_FILE, 0, html_bookmarks, }, + { "dwb:quickmarks", "Quickmarks", INFO_FILE, 0, html_quickmarks, }, + { "dwb:history", "History", INFO_FILE, 0, html_history, }, + { "dwb:downloads", "Downloads", INFO_FILE, 0, html_downloads, }, + { "dwb:keys", "Keys", INFO_FILE, 0, html_keys }, + { "dwb:settings", "Settings", INFO_FILE, 0, html_settings }, + { "dwb:startpage", NULL, NULL, 0, html_startpage }, }; static char current_uri[BUFFER_LENGTH]; @@ -88,16 +88,16 @@ html_remove_item_cb(WebKitDOMElement *el, WebKitDOMEvent *ev, GList *gl) { if (webkit_dom_element_has_attribute((void*)target, "navigation")) { char *navigation = webkit_dom_element_get_attribute(WEBKIT_DOM_ELEMENT(target), "navigation"); const char *uri = webkit_web_view_get_uri(WEBVIEW(gl)); - if (!g_strcmp0(uri, "dwb://history")) { + if (!g_strcmp0(uri, "dwb:history")) { dwb_remove_history(navigation); } - else if (!g_strcmp0(uri, "dwb://bookmarks")) { + else if (!g_strcmp0(uri, "dwb:bookmarks")) { dwb_remove_bookmark(navigation); } - else if (!g_strcmp0(uri, "dwb://quickmarks")) { + else if (!g_strcmp0(uri, "dwb:quickmarks")) { dwb_remove_quickmark(navigation); } - else if (!g_strcmp0(uri, "dwb://downloads")) { + else if (!g_strcmp0(uri, "dwb:downloads")) { dwb_remove_download(navigation); } } @@ -340,7 +340,7 @@ view_navigation_policy_cb(WebKitWebView *web, WebKitWebFrame *frame, WebKitNetwo return true; } } - if (g_str_has_prefix(uri, "dwb://")) { + if (g_str_has_prefix(uri, "dwb:")) { if (!html_load(gl, uri)) { fprintf(stderr, "Error loadings %s, maybe some files are missing.\n", uri); } @@ -564,7 +564,7 @@ view_load_status_cb(WebKitWebView *web, GParamSpec *pspec, GList *gl) { && (((host = dwb_get_host(web)) && (dwb_get_allowed(dwb.files.scripts_allow, host) || dwb_get_allowed(dwb.files.scripts_allow, uri) || g_list_find_custom(dwb.fc.tmp_scripts, host, (GCompareFunc)g_strcmp0) || g_list_find_custom(dwb.fc.tmp_scripts, uri, (GCompareFunc)g_strcmp0))) - || !g_strcmp0(uri, "dwb://") || !g_strcmp0(uri, "Error"))) { + || !g_str_has_prefix(uri, "dwb:") || !g_strcmp0(uri, "Error"))) { g_object_set(webkit_web_view_get_settings(web), "enable-scripts", true, NULL); v->status->scripts |= SCRIPTS_ALLOWED_TEMPORARY; } @@ -582,7 +582,7 @@ view_load_status_cb(WebKitWebView *web, GParamSpec *pspec, GList *gl) { /* TODO sqlite */ if (!dwb.misc.private_browsing && g_strcmp0(uri, "about:blank") - && !g_str_has_prefix(uri, "dwb://") + && !g_str_has_prefix(uri, "dwb:") && (dwb_prepend_navigation(gl, &dwb.fc.history) == STATUS_OK) && dwb.misc.synctimer <= 0) { util_file_add_navigation(dwb.files.history, dwb.fc.history->data, false, dwb.misc.history_length); diff --git a/util/keys.in b/util/keys.in index 7ad16089..ac284e92 100644 --- a/util/keys.in +++ b/util/keys.in @@ -153,4 +153,8 @@ toggle_hidden_files Toggle hidden files in directory listing save_search_field Add a new searchengine reload_scripts Reload all javascript userscripts reload_userscripts Reload userscripts +show_bookmarks Show bookmarks page +show_downloads Show download page +show_history Show history page +show_quickmarks Show quickmark page |