summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--doc/dwb.14
-rw-r--r--lib/head.html47
-rw-r--r--lib/info.html1
-rw-r--r--lib/settings.html935
-rw-r--r--src/commands.c51
-rw-r--r--src/config.h3
-rw-r--r--src/dwb.c301
-rw-r--r--src/dwb.h34
-rw-r--r--src/html.c64
-rw-r--r--src/view.c70
11 files changed, 1207 insertions, 304 deletions
diff --git a/Makefile b/Makefile
index 5138d473..74525a2a 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ install-data:
install -Dm 644 $(SHAREDIR)/selection.js $(DESTDIR)$(DATADIR)/$(REAL_NAME)/scripts/selection.js
install -Dm 644 $(LIBDIR)/info.html $(DESTDIR)$(DATADIR)/$(REAL_NAME)/$(LIBDIR)/info.html
install -Dm 644 $(LIBDIR)/head.html $(DESTDIR)$(DATADIR)/$(REAL_NAME)/$(LIBDIR)/head.html
+ install -Dm 644 $(LIBDIR)/settings.html $(DESTDIR)$(DATADIR)/$(REAL_NAME)/$(LIBDIR)/settings.html
uninstall: uninstall-man uninstall-data
@echo "Removing executable from $(subst //,/,$(DESTDIR)$(BINDIR))"
diff --git a/doc/dwb.1 b/doc/dwb.1
index af3943d0..de9e248f 100644
--- a/doc/dwb.1
+++ b/doc/dwb.1
@@ -290,10 +290,6 @@ Add a searchengine. Text fields can be focused via hints (command
.BR save_search_field ).
.TP
.BR Ss
-Show settings (command
-.BR show_settings ).
-.TP
-.BR Sgs
Show global settings (command
.BR show_global_settings ).
.TP
diff --git a/lib/head.html b/lib/head.html
index e2383a3d..77ae7438 100644
--- a/lib/head.html
+++ b/lib/head.html
@@ -1,4 +1,4 @@
-<head>
+<head><!--{{{-->
<title>dwb - %s</title>
<style type="text/css">
body {
@@ -75,6 +75,8 @@
background: #efefef;
}
.dwb_attr {
+ padding-top: 5px;
+ padding-left: 10px;
float: left;
font: bold 13px helvetica;
color: #326f32;
@@ -94,6 +96,45 @@
padding-left: 20px;
padding-top: 8px;
}
-
+ #dwb_settings_panel {
+ top: 12px;
+ position: relative;
+ }
+ #setting_bar {
+ display: table;
+ color #000000;
+ position:fixed;
+ top : 44px;
+ left : 0px;
+ background: #eeeeee;
+ width: 100%;
+ z-index: 5;
+ font: bold 15px helvetica;
+ border-bottom: solid 1px #151515;
+ border-top: solid 1px #151515;
+ }
+ a.setting_button {
+ padding-left: 10px;
+ padding-right: 10px;
+ color: #999;
+ text-decoration: none;
+ width: 11%;
+ }
+ a.setting_button:hover {
+ color: #333;
+ text-decoration: none;
+ }
+ .dwb_settings_headline {
+ position: relative;
+ font: bold 13px helvetica;
+ line-height:25px;
+ background: #999;
+ color: #fff;
+ }
+ .dwb_settings_headline a {
+ color: #fff;
+ padding-left: 10px;
+ padding-top: 68;
+ }
</style>
-</head>
+</head><!--}}}-->
diff --git a/lib/info.html b/lib/info.html
index a4c57c7e..4c801e5d 100644
--- a/lib/info.html
+++ b/lib/info.html
@@ -6,6 +6,7 @@
<div class='dwb_button' ><a href="dwb://quickmarks">Quickmarks</a></div>
<div class='dwb_button' ><a href="dwb://history">History</a></div>
<div class='dwb_button' ><a href="dwb://keys">Keys</a></div>
+ <div class='dwb_button' ><a href="dwb://settings">Settings</a></div>
<!-- <div class='dwb_sbutton' ><a href="dwb://settings">Settings</a></div> -->
</div>
diff --git a/lib/settings.html b/lib/settings.html
index 1bf7718d..26279d77 100644
--- a/lib/settings.html
+++ b/lib/settings.html
@@ -1,11 +1,928 @@
-<!-- vim: set tw=0 -->
-<body>
- <div id="bar">
- <img id="dwb_icon" src=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeEAQAAADBqbpqAAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAAAEgAAABIAEbJaz4AAANUSURBVEjH7ZR7TFN3FMc/9wEFQkWpIEwWplUS39EuMINbAdHEZSmawNSQ+WiixOka3dw/Gtkjezi3ZWEmCzhRo5tETSU+olMCUZnLNGi1Yz7Gio+owyIK0sBa2/72RxmPpXcZY2HJxje5yb3nfM/3e3/nnHthCP91SFqJx2UAEXG8GGH2p/JrqyeQG3zWu186Qp3RqMVnJURtwyrndCSheO77TNIt/+ZwfDmc6QcNsHatXrl8+8Pnr3fUum9drd0UbP/sNWWKWq/1ovqVYHdMGn31kj3xuv10dUtL7Svy1wWx/WqD/n2ItloXjC0K/DD+OSHyrglRb6pxPnBGJLlcWlXK+vhme1raeSHGGYR4Ty/E3e3r0rT4arhg+0aAuB8bkScDxGZDUAZ1FuDQMpa/epgw4uTDrqcH20E+CGRrsPvVin8Q/z9jtb8F+qPQ9qViAPVNsmjyPENM8M6T5KfHiGXAjb9s3Dp75HHfuqwc9umaUSkHGFYZODT/skn5JvUPpm3i46y6yJ83n3vdHWPPKxXzAnujL0iSbuo7G6DqGPBRdyt3gpppitP7F81wL1fyABgO4gZ0lINaZNrmmPhT3mppsezCTTGAcpNilHBz8VvOJb/kWHr27YVRr+qaAsNhtRvyjQmTQBzvzXVcg7LdheeDZwvB3BX8FKJmQe4vADohkIUA7Wt6shDO0TVOITBC4ZreuXd3CeEuLVwDGKHG+Wc6IET8IyFOWIRQ8Q7uUnXPuPvODCnNxLY9cb3Q3vDYAKOa4Kmqvyuc8DKguzenec/9JBjWAsYzgKdnbF2QgPX1/tRjh20HID0AW00DOVHBF3Di1FZTSMt2APx9VrXnO46HaKuonjiuc6Z1g78CvJUDMY70QfJ33sqNHf4K6JwJojq8MaBMkSulKrOhbK/FNid7WkZPAiItiVt8n+eXLNyRvqJPjQ2UCekrXKX5JaNciVu6hReBenFaxqYUi+0Nu9kglch9DiKFtg34FpakweR2kBbAaQ8cbQyRUt6Cok8gKgfqlsC+gh6B+TGQOR18xVCuQuPsUDw3A+Z+D+yEhoRQLjgP4h9BxdLexoOE343/zX/1lVWDaSiPlUyde65MUCEzcjCNpVwiWg96pYErDWEIGvgNdLVGBQKQtg8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTEtMDItMDhUMjA6NDU6MjMrMDE6MDAWGaRfAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDExLTAyLTA4VDIwOjQ1OjIzKzAxOjAwZ0Qc4wAAAABJRU5ErkJggg== />
- <div class='dwb_button' ><a href="dwb://settings/general">General</a></div>
+<div id='setting_bar'>
+ <a class="setting_button" href="#general">General</a>
+ <a class="setting_button" href="#session">Network &amp Session</a>
+ <a class="setting_button" href="#fonts">Fonts</a>
+ <a class="setting_button" href="#colors">Colors</a>
+ <a class="setting_button" href="#lt">Layout</a>
+ <a class="setting_button" href="#hints">Hints</a>
+ <a class="setting_button" href="#plugins">Plugins &amp Scripts</a>
+ <a class="setting_button" href="#completion">Completion</a>
+ <a class="setting_button" href="#misc">Miscellaneous</a>
+</div>
+<div id='dwb_settings_panel'>
+ <div class='dwb_settings_headline'><a name='general'>General</a></div><!--{{{-->
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>auto-load-images</div>
+ <div style='float:right;'>
+ <label for='auto-load-images' class='dwb_desc'>Load images automatically</label>
+ <input id='auto-load-images' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
</div>
- <!--content goes here-->
- <div class='dwb_infopanel'>
- %s
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>auto-resize-window</div>
+ <div style='float:right;'>
+ <label for='auto-resize-window' class='dwb_desc'>Autoresize the window</label>
+ <input id='auto-resize-window' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
</div>
-</body>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>auto-shrink-images</div>
+ <div style='float:right;'>
+ <label for='auto-shrink-images' class='dwb_desc'>Automatically shrink standalone images to fit</label>
+ <input id='auto-shrink-images' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-private-browsing</div>
+ <div style='float:right;'>
+ <label for='enable-private-browsing' class='dwb_desc'>Whether to enable private browsing mode</label>
+ <input id='enable-private-browsing' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-spell-checking</div>
+ <div style='float:right;'>
+ <label for='enable-spell-checking' class='dwb_desc'>Whether to enable spell checking</label>
+ <input id='enable-spell-checking' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>resizable-text-areas</div>
+ <div style='float:right;'>
+ <label for='resizable-text-areas' class='dwb_desc'>Whether to enable private browsing mode</label>
+ <input id='resizable-text-areas' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>full-content-zoom</div>
+ <div style='float:right;'>
+ <label for='full-content-zoom' class='dwb_desc'>Whether the full content is scaled when zooming</label>
+ <input id='full-content-zoom' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>default-encoding</div>
+ <div style='float:right;'>
+ <label for='default-encoding' class='dwb_desc'>Default encoding used to display text</label>
+ <input id='default-encoding' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>history-length</div>
+ <div style='float:right;'>
+ <label for='history-length' class='dwb_desc'>Length of browsing history</label>
+ <input id='history-length' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>scroll-step</div>
+ <div style='float:right;'>
+ <label for='scroll-step' class='dwb_desc'>Scroll step</label>
+ <input id='scroll-step' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>spell-checking-languages</div>
+ <div style='float:right;'>
+ <label for='spell-checking-languages' class='dwb_desc'>Languages used for spell checking, seperated by commas</label>
+ <input id='spell-checking-languages' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>startpage</div>
+ <div style='float:right;'>
+ <label for='startpage' class='dwb_desc'>The default homepage</label>
+ <input id='startpage' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>zoom-level</div>
+ <div style='float:right;'>
+ <label for='zoom-level' class='dwb_desc'>The default zoom level</label>
+ <input id='zoom-level' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>zoom-step</div>
+ <div style='float:right;'>
+ <label for='zoom-step' class='dwb_desc'>The zoom step</label>
+ <input id='zoom-step' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div><!--}}}-->
+ <div class='dwb_settings_headline'><a name='session'>Network &amp Session</a></div><!--{{{-->
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>cookies</div>
+ <div style='float:right;'>
+ <label for='cookies' class='dwb_desc'>Whether to allow all cookies</label>
+ <input id='cookies' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-dns-prefetching</div>
+ <div style='float:right;'>
+ <label for='enable-dns-prefetching' class='dwb_desc'>Whether webkit prefetches domain names</label>
+ <input id='enable-dns-prefetching' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>proxy</div>
+ <div style='float:right;'>
+ <label for='proxy' class='dwb_desc'>Whether to use a HTTP-proxy</label>
+ <input id='proxy' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>single-instance</div>
+ <div style='float:right;'>
+ <label for='single-instance' class='dwb_desc'>Whether to have only one instance</label>
+ <input id='single-instance' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>save-session</div>
+ <div style='float:right;'>
+ <label for='save-session' class='dwb_desc'>Whether to Automatically save sessions</label>
+ <input id='save-session' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>proxy-url</div>
+ <div style='float:right;'>
+ <label for='proxy-url' class='dwb_desc'>The HTTP-proxy url</label>
+ <input id='proxy-url' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>user-agent</div>
+ <div style='float:right;'>
+ <label for='user-agent' class='dwb_desc'>The user agent string</label>
+ <input id='user-agent' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div><!--}}}-->
+ <div class='dwb_settings_headline'><a name='fonts'>Fonts</a></div><!--{{{-->
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>font</div>
+ <div style='float:right;'>
+ <label for='font' class='dwb_desc'>Default font used for the ui</label>
+ <input id='font' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>font-inactive</div>
+ <div style='float:right;'>
+ <label for='font-inactive' class='dwb_desc'>Font for views without focus</label>
+ <input id='font-inactive' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>font-completion</div>
+ <div style='float:right;'>
+ <label for='font-completion' class='dwb_desc'>Font for tab-completion</label>
+ <input id='font-completion' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>font-entry</div>
+ <div style='float:right;'>
+ <label for='font-entry' class='dwb_desc'>Font for the addressbar</label>
+ <input id='font-entry' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>cursive-font-family</div>
+ <div style='float:right;'>
+ <label for='cursive-font-family' class='dwb_desc'>Cursive font family used to display text</label>
+ <input id='cursive-font-family' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>default-font-family</div>
+ <div style='float:right;'>
+ <label for='default-font-family' class='dwb_desc'>Default font family used to display text</label>
+ <input id='default-font-family' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>default-font-size</div>
+ <div style='float:right;'>
+ <label for='default-font-size' class='dwb_desc'>Default font size used to display text</label>
+ <input id='default-font-size' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>default-monospace-font-size</div>
+ <div style='float:right;'>
+ <label for='default-monospace-font-size' class='dwb_desc'>Default monospace font size used to display text</label>
+ <input id='default-monospace-font-size' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>fantasy-font-family</div>
+ <div style='float:right;'>
+ <label for='fantasy-font-family' class='dwb_desc'>Fantasy font family used to display text</label>
+ <input id='fantasy-font-family' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>minimum-font-size</div>
+ <div style='float:right;'>
+ <label for='minimum-font-size' class='dwb_desc'>Minimum font size used to display text</label>
+ <input id='minimum-font-size' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>monospace-font-family</div>
+ <div style='float:right;'>
+ <label for='monospace-font-family' class='dwb_desc'>Monospace font family used to display text</label>
+ <input id='monospace-font-family' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>minimum-logical-font-size</div>
+ <div style='float:right;'>
+ <label for='minimum-logical-font-size' class='dwb_desc'>Minimum logical font size used to display text</label>
+ <input id='minimum-logical-font-size' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>sans-serif-font-family</div>
+ <div style='float:right;'>
+ <label for='sans-serif-font-family' class='dwb_desc'>Sans serif font family used to display text</label>
+ <input id='sans-serif-font-family' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>serif-font-family</div>
+ <div style='float:right;'>
+ <label for='serif-font-family' class='dwb_desc'>Serif font family used to display text</label>
+ <input id='serif-font-family' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div><!--}}}-->
+ <div class='dwb_settings_headline'><a name='colors'>Colors</a></div><!--{{{-->
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>active-fg-color</div>
+ <div style='float:right;'>
+ <label for='active-fg-color' class='dwb_desc'>Foreground color of the active view</label>
+ <input id='active-fg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>active-bg-color</div>
+ <div style='float:right;'>
+ <label for='active-bg-color' class='dwb_desc'>Background color of the active view</label>
+ <input id='active-bg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>normal-fg-color</div>
+ <div style='float:right;'>
+ <label for='normal-fg-color' class='dwb_desc'>Foreground color of the normal view</label>
+ <input id='normal-fg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>normal-bg-color</div>
+ <div style='float:right;'>
+ <label for='normal-bg-color' class='dwb_desc'>Background color of the normal view</label>
+ <input id='normal-bg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>tab-active-fg-color</div>
+ <div style='float:right;'>
+ <label for='tab-active-fg-color' class='dwb_desc'>Foreground color of the active tab</label>
+ <input id='tab-active-fg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>tab-active-bg-color</div>
+ <div style='float:right;'>
+ <label for='tab-active-bg-color' class='dwb_desc'>Background color of the active tab</label>
+ <input id='tab-active-bg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>tab-normal-fg-color</div>
+ <div style='float:right;'>
+ <label for='tab-normal-fg-color' class='dwb_desc'>Foreground color of the normal tab</label>
+ <input id='tab-normal-fg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>tab-normal-bg-color</div>
+ <div style='float:right;'>
+ <label for='tab-normal-bg-color' class='dwb_desc'>Background color of the normal tab</label>
+ <input id='tab-normal-bg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>tab-number-color</div>
+ <div style='float:right;'>
+ <label for='tab-number-color' class='dwb_desc'>Color of the tabnumber</label>
+ <input id='tab-number-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>active-completion-fg-color</div>
+ <div style='float:right;'>
+ <label for='active-completion-fg-color' class='dwb_desc'>Foreground color of the active completion item</label>
+ <input id='active-completion-fg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>active-completion-bg-color</div>
+ <div style='float:right;'>
+ <label for='active-completion-bg-color' class='dwb_desc'>Background color of the active completion item</label>
+ <input id='active-completion-bg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>normal-completion-fg-color</div>
+ <div style='float:right;'>
+ <label for='normal-completion-fg-color' class='dwb_desc'>Foreground color of normal completion items</label>
+ <input id='normal-completion-fg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>normal-completion-bg-color</div>
+ <div style='float:right;'>
+ <label for='normal-completion-bg-color' class='dwb_desc'>Background color of normal completion items</label>
+ <input id='normal-completion-bg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>ssl-trusted-color</div>
+ <div style='float:right;'>
+ <label for='ssl-trusted-color' class='dwb_desc'>Color for encrypted sites, trusted certificate</label>
+ <input id='ssl-trusted-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>ssl-untrusted-color</div>
+ <div style='float:right;'>
+ <label for='ssl-untrusted-color' class='dwb_desc'>Color for encrypted sites, untrusted certificate</label>
+ <input id='ssl-untrusted-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>insertmode-fg-color</div>
+ <div style='float:right;'>
+ <label for='insertmode-fg-color' class='dwb_desc'>Foreground color of the statusbar in insertmode</label>
+ <input id='insertmode-fg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>insertmode-bg-color</div>
+ <div style='float:right;'>
+ <label for='insertmode-bg-color' class='dwb_desc'>Background color of the statusbar in insertmode</label>
+ <input id='insertmode-bg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>status-allowed-color</div>
+ <div style='float:right;'>
+ <label for='status-allowed-color' class='dwb_desc'>Color for script blocker, status allowed</label>
+ <input id='status-allowed-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>status-blocked-color</div>
+ <div style='float:right;'>
+ <label for='status-blocked-color' class='dwb_desc'>Color for script blocker, status blocked</label>
+ <input id='status-blocked-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>error-color</div>
+ <div style='float:right;'>
+ <label for='error-color' class='dwb_desc'>Color for error messages</label>
+ <input id='error-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div><!--}}}-->
+ <div class='dwb_settings_headline'><a name='lt'>Layout</a></div><!--{{{-->
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>background-tabs</div>
+ <div style='float:right;'>
+ <label for='background-tabs' class='dwb_desc'>Whether to open tabs in background</label>
+ <input id='background-tabs' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-frame-flattening</div>
+ <div style='float:right;'>
+ <label for='enable-frame-flattening' class='dwb_desc'>Whether to enable frame flattening</label>
+ <input id='enable-frame-flattening' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enforce-96-dpi</div>
+ <div style='float:right;'>
+ <label for='enforce-96-dpi' class='dwb_desc'>Enforce a resolution of 96 dpi</label>
+ <input id='enforce-96-dpi' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>tabbed-brosing</div>
+ <div style='float:right;'>
+ <label for='tabbed-browsing' class='dwb_desc'>Whether to enable tabbed browsing</label>
+ <input id='tabbed-browsing' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>default-width</div>
+ <div style='float:right;'>
+ <label for='default-width' class='dwb_desc'>Default width of the window</label>
+ <input id='default-width' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>default-height</div>
+ <div style='float:right;'>
+ <label for='default-height' class='dwb_desc'>Default height of the window</label>
+ <input id='default-height' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>factor</div>
+ <div style='float:right;'>
+ <label for='factor' class='dwb_desc'>Zoom factor of the tiling area</label>
+ <input id='factor' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>hide-tabbar</div>
+ <div style='float:right;'>
+ <label for='hide-tabbar' class='dwb_desc'>Whether to hide the tabbar (never, always, tiled)</label>
+ <input id='hide-tabbar' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>layout</div>
+ <div style='float:right;'>
+ <label for='layout' class='dwb_desc'>The default layout (Normal, Bottomstack, Maximized)</label>
+ <input id='layout' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>message-delay</div>
+ <div style='float:right;'>
+ <label for='message-delay' class='dwb_desc'>Time messages are shown,
+ in seconds</label>
+ <input id='message-delay' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>size</div>
+ <div style='float:right;'>
+ <label for='size' class='dwb_desc'>Tiling area size in percent</label>
+ <input id='size' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>user-stylesheet-uri</div>
+ <div style='float:right;'>
+ <label for='user-stylesheet-uri' class='dwb_desc'>The uri of a stylesheet applied to every page</label>
+ <input id='user-stylesheet-uri' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div><!--}}}-->
+ <div class='dwb_settings_headline'><a name='hints'>Hints</a></div><!--{{{-->
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>hint-letter-seq</div>
+ <div style='float:right;'>
+ <label for='hint-letter-seq' class='dwb_desc'>Letter sequence for letter hints</label>
+ <input id='hint-letter-seq' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>hint-style</div>
+ <div style='float:right;'>
+ <label for='hint-style' class='dwb_desc'>Whether to use 'number' or 'letter' hints</label>
+ <input id='hint-style' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>hint-font-size</div>
+ <div style='float:right;'>
+ <label for='hint-font-size' class='dwb_desc'>Font size of hints</label>
+ <input id='hint-font-size' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>hint-font-weight</div>
+ <div style='float:right;'>
+ <label for='hint-font-weight' class='dwb_desc'>Font weight of hints</label>
+ <input id='hint-font-weight' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>hint-font-family</div>
+ <div style='float:right;'>
+ <label for='hint-font-family' class='dwb_desc'>Font family of hints</label>
+ <input id='hint-font-family' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>hint-fg-color</div>
+ <div style='float:right;'>
+ <label for='hint-fg-color' class='dwb_desc'>Foreground color of hints</label>
+ <input id='hint-fg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>hint-bg-color</div>
+ <div style='float:right;'>
+ <label for='hint-bg-color' class='dwb_desc'>Background color of hints</label>
+ <input id='hint-bg-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>hint-active-color</div>
+ <div style='float:right;'>
+ <label for='hint-active-color' class='dwb_desc'>Color of active links in hintmode</label>
+ <input id='hint-active-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>hint-normal-color</div>
+ <div style='float:right;'>
+ <label for='hint-normal-color' class='dwb_desc'>Color of inactive links in hintmode</label>
+ <input id='hint-normal-color' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>hint-border</div>
+ <div style='float:right;'>
+ <label for='hint-border' class='dwb_desc'>Border used for hints</label>
+ <input id='hint-border' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>hint-opacity</div>
+ <div style='float:right;'>
+ <label for='hint-opacity' class='dwb_desc'>Opacity used for hints</label>
+ <input id='hint-opacity' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div><!--}}}-->
+ <div class='dwb_settings_headline'><a name='plugins'>Plugins &amp Scripts</a></div><!--{{{-->
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-java-applet</div>
+ <div style='float:right;'>
+ <label for='enable-java-applet' class='dwb_desc'>Whether to enable java applets</label>
+ <input id='enable-java-applet' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-plugins</div>
+ <div style='float:right;'>
+ <label for='enable-plugins' class='dwb_desc'>Whether to enable plugins</label>
+ <input id='enable-plugins' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-scripts</div>
+ <div style='float:right;'>
+ <label for='enable-scripts' class='dwb_desc'>Enable embedded scripting languages</label>
+ <input id='enable-scripts' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>javascript-can-access-clipboard</div>
+ <div style='float:right;'>
+ <label for='javascript-can-access-clipboard' class='dwb_desc'>Whether javascript can access the clipboard</label>
+ <input id='javascript-can-access-clipboard' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>javascript-can-open-windows-automatically</div>
+ <div style='float:right;'>
+ <label for='javascript-can-open-windows-automatically' class='dwb_desc'>Whether javascript can open windows</label>
+ <input id='javascript-can-open-windows-automatically' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>adblocker</div>
+ <div style='float:right;'>
+ <label for='adblocker' class='dwb_desc'>Whether to block advertisements via a filterlist</label>
+ <input id='adblocker' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div><!--}}}-->
+ <div class='dwb_settings_headline'><a name='completion'>Completion</a></div><!--{{{-->
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>auto-completion</div>
+ <div style='float:right;'>
+ <label for='auto-completion' class='dwb_desc'>Whether to show possible shortcuts</label>
+ <input id='auto-completion' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>complete-bookmarks</div>
+ <div style='float:right;'>
+ <label for='complete-bookmarks' class='dwb_desc'>Whether to enable tabcompletion for bookmarks</label>
+ <input id='complete-bookmarks' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>complete-commands</div>
+ <div style='float:right;'>
+ <label for='complete-commands' class='dwb_desc'>Whether to enable tabcompletion for command history</label>
+ <input id='complete-commands' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>complete-history</div>
+ <div style='float:right;'>
+ <label for='complete-history' class='dwb_desc'>Whether to enable tabcompletion for browsing history</label>
+ <input id='complete-history' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>complete-searchengines</div>
+ <div style='float:right;'>
+ <label for='complete-searchengines' class='dwb_desc'>Whether to enable tabcompletion for searchengines</label>
+ <input id='complete-searchengines' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>complete-userscripts</div>
+ <div style='float:right;'>
+ <label for='complete-userscripts' class='dwb_desc'>Whether to enable tabcompletion for userscripts</label>
+ <input id='complete-userscripts' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div><!--}}}-->
+ <div class='dwb_settings_headline'><a name='misc'>Miscellaneous</a></div><!--{{{-->
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>editable</div>
+ <div style='float:right;'>
+ <label for='editable' class='dwb_desc'>Whether content can be modified</label>
+ <input id='editable' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-caret-browsing</div>
+ <div style='float:right;'>
+ <label for='enable-caret-browsing' class='dwb_desc'>Whether to enable caret browsing</label>
+ <input id='enable-caret-browsing' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-default-context-menu</div>
+ <div style='float:right;'>
+ <label for='enable-default-context-menu' class='dwb_desc'>Whether to enable the right click context menu</label>
+ <input id='enable-default-context-menu' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-developer-extras</div>
+ <div style='float:right;'>
+ <label for='enable-developer-extras' class='dwb_desc'>Whether developer extensions should be enabled</label>
+ <input id='enable-developer-extras' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-dom-paste</div>
+ <div style='float:right;'>
+ <label for='enable-dom-paste' class='dwb_desc'>Whether to enable DOM paste</label>
+ <input id='enable-dom-paste' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-file-access-from-file-uris</div>
+ <div style='float:right;'>
+ <label for='enable-file-access-from-file-uris' class='dwb_desc'>Whether file access from file uris is allowed</label>
+ <input id='enable-file-access-from-file-uris' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-html5-database</div>
+ <div style='float:right;'>
+ <label for='enable-html5-database' class='dwb_desc'>Enable HTML5 client side SQL-database support</label>
+ <input id='enable-html5-database' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-html5-local-storage</div>
+ <div style='float:right;'>
+ <label for='enable-html5-local-storage' class='dwb_desc'>Enable HTML5 local storage</label>
+ <input id='enable-html5-local-storage' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-offline-web-application-cache</div>
+ <div style='float:right;'>
+ <label for='enable-offline-web-application-cache' class='dwb_desc'>Enable HTML5 offline web application cache</label>
+ <input id='enable-offline-web-application-cache' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-page-cache</div>
+ <div style='float:right;'>
+ <label for='enable-page-cache' class='dwb_desc'>Enable page cache</label>
+ <input id='enable-page-cache' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-site-specific-quirks</div>
+ <div style='float:right;'>
+ <label for='enable-site-specific-quirks' class='dwb_desc'>Enable site specific compatibility workarounds</label>
+ <input id='enable-site-specific-quirks' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-spatial-navigation</div>
+ <div style='float:right;'>
+ <label for='enable-spatial-navigation' class='dwb_desc'>Enable spatial
+ navigation</label>
+ <input id='enable-spatial-navigation' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>enable-universal-access-from-file-uris</div>
+ <div style='float:right;'>
+ <label for='enable-universal-access-from-file-uris' class='dwb_desc'>Whether to allow files loaded through file: </label>
+ <input id='enable-universal-access-from-file-uris' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>enable-xss-auditor</div>
+ <div style='float:right;'>
+ <label for='enable-xss-auditor' class='dwb_desc'>Whether to enable the xss auditor</label>
+ <input id='enable-xss-auditor' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>download-use-external-program</div>
+ <div style='float:right;'>
+ <label for='download-use-external-program' class='dwb_desc'>Whether to use an external download helper</label>
+ <input id='download-use-external-program' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>print-backgrounds</div>
+ <div style='float:right;'>
+ <label for='print-backgrounds' class='dwb_desc'>Whether background images should be printed</label>
+ <input id='print-backgrounds' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>tab-key-cycles-through-elements</div>
+ <div style='float:right;'>
+ <label for='tab-key-cycles-through-elements' class='dwb_desc'>Tab cycles through elements in insert mode</label>
+ <input id='tab-key-cycles-through-elements' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>use-fifo</div>
+ <div style='float:right;'>
+ <label for='use-fifo' class='dwb_desc'>Create a fifo for communication</label>
+ <input id='use-fifo' type='checkbox'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>custom-encoding</div>
+ <div style='float:right;'>
+ <label for='custom-encoding' class='dwb_desc'>The custom encoding of the view</label>
+ <input id='custom-encoding' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>download-external-command</div>
+ <div style='float:right;'>
+ <label for='download-external-command' class='dwb_desc'>External application used for downloads</label>
+ <input id='download-external-command' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>history-length</div>
+ <div style='float:right;'>
+ <label for='history-length' class='dwb_desc'>Length of the browsing history</label>
+ <input id='history-length' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line1'>
+ <div class='dwb_attr'>mail-client</div>
+ <div style='float:right;'>
+ <label for='mail-client' class='dwb_desc'>Application used for mailto:-urls</label>
+ <input id='mail-client' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div>
+ <div class='dwb_line0'>
+ <div class='dwb_attr'>ftp-client</div>
+ <div style='float:right;'>
+ <label for='ftp-client' class='dwb_desc'>Application used for ftp</label>
+ <input id='ftp-client' type='text'>
+ </div>
+ <div style='clear:both;'></div>
+ </div><!--}}}-->
+</div>
diff --git a/src/commands.c b/src/commands.c
index 37a44e9e..ad7b61c6 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -184,55 +184,8 @@ dwb_com_show_keys(KeyMap *km, Arg *arg) {
/* dwb_com_show_settings(KeyMap *km, Arg *a) {{{*/
gboolean
dwb_com_show_settings(KeyMap *km, Arg *arg) {
- View *v = dwb.state.fview->data;
- GString *buffer = g_string_new(NULL);
- GHashTable *t;
- const char *setting_string;
-
- dwb.state.setting_apply = arg->n;
- if ( dwb.state.setting_apply == APPLY_GLOBAL ) {
- t = dwb.settings;
- setting_string = "Global Settings";
- }
- else {
- t = v->setting;
- setting_string = "Settings";
- }
-
- GList *l = g_hash_table_get_values(t);
- l = g_list_sort(l, (GCompareFunc)dwb_util_web_settings_sort_first);
-
- g_string_append_printf(buffer, SETTINGS_VIEW, "dwb - Settings", dwb.color.settings_bg_color, dwb.color.settings_fg_color, dwb.misc.settings_border);
- g_string_append_printf(buffer, HTML_H2, setting_string, dwb.misc.profile);
-
- g_string_append(buffer, HTML_BODY_START);
- g_string_append(buffer, HTML_FORM_START);
- for (; l; l=l->next) {
- WebSettings *m = l->data;
- if (!m->global || (m->global && dwb.state.setting_apply == APPLY_GLOBAL)) {
- g_string_append(buffer, HTML_DIV_START);
- g_string_append_printf(buffer, HTML_DIV_KEYS_TEXT, m->n.first);
- if (m->type == BOOLEAN) {
- const char *value = m->arg.b ? "checked" : "";
- g_string_append_printf(buffer, HTML_DIV_SETTINGS_CHECKBOX, m->n.first, value);
- }
- else {
- char *value = dwb_util_arg_to_char(&m->arg, m->type);
- g_string_append_printf(buffer, HTML_DIV_SETTINGS_VALUE, m->n.first, value ? value : "");
- }
- g_string_append(buffer, HTML_DIV_END);
- }
- }
- g_list_free(l);
- g_string_append(buffer, HTML_FORM_END);
- g_string_append(buffer, HTML_BODY_END);
- dwb_web_view_add_history_item(dwb.state.fview);
-
- if (v->status->scripts & SCRIPTS_BLOCKED) {
- g_object_set(webkit_web_view_get_settings(CURRENT_WEBVIEW()), "enable-scripts", true, NULL);
- }
- webkit_web_view_load_string(WEBKIT_WEB_VIEW(v->web), buffer->str, "text/html", NULL, SETTINGS);
- g_string_free(buffer, true);
+ dwb.state.setting_apply = APPLY_GLOBAL;
+ dwb_html_load(CURRENT_WEBVIEW(), "dwb://settings");
return true;
}/*}}}*/
diff --git a/src/config.h b/src/config.h
index b90c5e20..384dbd7b 100644
--- a/src/config.h
+++ b/src/config.h
@@ -65,8 +65,7 @@ static KeyValue KEYS[] = {
{ "scroll_top", { "gg", 0, }, },
{ "scroll_up", { "k", 0, }, },
{ "show_keys", { "Sk", 0, }, },
- { "show_settings", { "Ss", 0, }, },
- { "show_global_settings", { "Sgs", 0, }, },
+ { "show_global_settings", { "Ss", 0, }, },
{ "toggle_bottomstack", { "tb", 0, }, },
{ "toggle_maximized", { "gm", 0, }, },
{ "view_source", { "gf", 0, }, },
diff --git a/src/dwb.c b/src/dwb.c
index b4dd7e31..6b2cb8af 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -107,9 +107,9 @@ static FunctionMap FMAP [] = {
(Func)dwb_com_resize_master, "Cannot decrease further", ALWAYS_SM, { .n = 5 } },
{ { "download_hint", "Download via hints", }, 0,
(Func)dwb_com_show_hints, NO_HINTS, NEVER_SM, { .n = OPEN_DOWNLOAD }, },
- { { "find_backward", "Find Backward ", }, 0,
+ { { "find_backward", "Find backward ", }, 0,
(Func)dwb_com_find, NO_URL, NEVER_SM, { .b = false }, },
- { { "find_forward", "Find Forward ", }, 0,
+ { { "find_forward", "Find forward ", }, 0,
(Func)dwb_com_find, NO_URL, NEVER_SM, { .b = true }, },
{ { "find_next", "Find next", }, 0,
(Func)dwb_search, "No matches", ALWAYS_SM, { .b = true }, },
@@ -141,23 +141,23 @@ static FunctionMap FMAP [] = {
(Func)dwb_com_open, NULL, NEVER_SM, { .i = HTML_STRING, .n = OPEN_NORMAL, .p = NULL } },
{ { "load_html_nv", "Load html new view", }, 1,
(Func)dwb_com_open, NULL, NEVER_SM, { .i = HTML_STRING, .n = OPEN_NEW_VIEW, .p = NULL } },
- { { "open", "Open url", }, 1,
+ { { "open", "open", }, 1,
(Func)dwb_com_open, NULL, NEVER_SM, { .n = OPEN_NORMAL, .p = NULL } },
- { { "Open", "Open url, use current url", }, 0,
+ { { "Open", "open", }, 0,
(Func)dwb_com_open, NULL, NEVER_SM, { .n = OPEN_NORMAL | SET_URL, .p = NULL } },
- { { "open_nv", "Open url in a new tab", }, 1,
+ { { "open_nv", "tabopen", }, 1,
(Func)dwb_com_open, NULL, NEVER_SM, { .n = OPEN_NEW_VIEW, .p = NULL } },
- { { "Open_nv", "Open in a new tab, use current url", }, 0,
+ { { "Open_nv", "tabopen", }, 0,
(Func)dwb_com_open, NULL, NEVER_SM, { .n = OPEN_NEW_VIEW | SET_URL, .p = NULL } },
- { { "open_nw", "Open in a new window", }, 1,
+ { { "open_nw", "winopen", }, 1,
(Func)dwb_com_open, NULL, NEVER_SM, { .n = OPEN_NEW_WINDOW, .p = NULL } },
- { { "Open_nw", "Open in a new window, use current url", }, 0,
+ { { "Open_nw", "winopen", }, 0,
(Func)dwb_com_open, NULL, NEVER_SM, { .n = OPEN_NEW_WINDOW | SET_URL, .p = NULL } },
- { { "open_quickmark", "Open a quickmark", }, 0,
+ { { "open_quickmark", "Open quickmark", }, 0,
(Func)dwb_com_quickmark, NO_URL, NEVER_SM, { .n = QUICK_MARK_OPEN, .i=OPEN_NORMAL }, },
- { { "open_quickmark_nv", "Open a quickmark in a new tab", }, 0,
+ { { "open_quickmark_nv", "Open quickmark in a new tab", }, 0,
(Func)dwb_com_quickmark, NULL, NEVER_SM, { .n = QUICK_MARK_OPEN, .i=OPEN_NEW_VIEW }, },
- { { "open_quickmark_nw", "Open a quickmark in a new window", }, 0,
+ { { "open_quickmark_nw", "Open quickmark in a new window", }, 0,
(Func)dwb_com_quickmark, NULL, NEVER_SM, { .n = QUICK_MARK_OPEN, .i=OPEN_NEW_WINDOW }, },
{ { "open_start_page", "Open startpage", }, 1,
(Func)dwb_com_open_startpage, "No startpage set", ALWAYS_SM, },
@@ -337,247 +337,241 @@ static FunctionMap FMAP [] = {
// { name, description, builtin, global, type, argument, set-function
static WebSettings DWB_SETTINGS[] = {
{ { "auto-load-images", "Load images automatically", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "auto-resize-window", "Autoresize window", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "auto-shrink-images", "Automatically shrink standalone images to fit", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "cursive-font-family", "Cursive font family used to display text", },
- true, false, CHAR, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
+ true, false, CHAR, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
{ { "default-encoding", "Default encoding used to display text", },
- true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
+ true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
{ { "default-font-family", "Default font family used to display text", },
- true, false, CHAR, { .p = "sans-serif" }, (S_Func) dwb_webkit_setting, },
+ true, false, CHAR, { .p = "sans-serif" }, (S_Func) dwb_webkit_setting, },
{ { "default-font-size", "Default font size used to display text", },
- true, false, INTEGER, { .i = 12 }, (S_Func) dwb_webkit_setting, },
+ true, false, INTEGER, { .i = 12 }, (S_Func) dwb_webkit_setting, },
{ { "default-monospace-font-size", "Default monospace font size used to display text", },
- true, false, INTEGER, { .i = 10 }, (S_Func) dwb_webkit_setting, },
+ true, false, INTEGER, { .i = 10 }, (S_Func) dwb_webkit_setting, },
{ { "enable-caret-browsing", "Whether to enable caret browsing", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "enable-default-context-menu", "Whether to enable the right click context menu", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enable-developer-extras", "Whether developer extensions should be enabled", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "enable-dns-prefetching", "Whether webkit prefetches domain names", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enable-dom-paste", "Whether to enable DOM paste", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "enable-frame-flattening", "Whether to enable Frame Flattening", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "enable-file-access-from-file-uris", "Whether file access from file uris is allowed", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enable-html5-database", "Enable HTML5 client side SQL-database support" },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enable-html5-local-storage", "Enable HTML5 local storage", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enable-java-applet", "Whether to enable java applets", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enable-offline-web-application-cache", "Enable HTML5 offline web application cache", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enable-page-cache", "Whether to enable page cache", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "enable-plugins", "Whether to enable plugins", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enable-private-browsing", "Whether to enable private browsing mode", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_set_private_browsing, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_set_private_browsing, },
{ { "enable-scripts", "Enable embedded scripting languages", },
- false, false, BOOLEAN, { .b = true }, (S_Func) dwb_set_scripts, },
+ false, false, BOOLEAN, { .b = true }, (S_Func) dwb_set_scripts, },
{ { "enable-site-specific-quirks", "Enable site-specific compatibility workarounds", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "enable-spatial-navigation", "Spatial navigation", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "enable-spell-checking", "Whether to enable spell checking", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "enable-universal-access-from-file-uris", "Whether to allow files loaded through file:", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enable-xss-auditor", "Whether to enable the XSS auditor", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "enforce-96-dpi", "Enforce a resolution of 96 dpi", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "fantasy-font-family", "Default fantasy font family used to display text", },
- true, false, CHAR, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
+ true, false, CHAR, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
{ { "javascript-can-access-clipboard", "Whether javascript can access clipboard", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "javascript-can-open-windows-automatically", "Whether javascript can open windows", },
- true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
{ { "minimum-font-size", "Minimum font size to display text", },
- true, false, INTEGER, { .i = 5 }, (S_Func) dwb_webkit_setting, },
+ true, false, INTEGER, { .i = 5 }, (S_Func) dwb_webkit_setting, },
{ { "minimum-logical-font-size", "Minimum logical font size used to display text", },
- true, false, INTEGER, { .i = 5 }, (S_Func) dwb_webkit_setting, },
+ true, false, INTEGER, { .i = 5 }, (S_Func) dwb_webkit_setting, },
{ { "monospace-font-family", "Monospace font family used to display text", },
- true, false, CHAR, { .p = "monospace" }, (S_Func) dwb_webkit_setting, },
+ true, false, CHAR, { .p = "monospace" }, (S_Func) dwb_webkit_setting, },
{ { "print-backgrounds", "Whether background images should be printed", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "resizable-text-areas", "Whether text areas are resizable", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "sans-serif-font-family", "Sans serif font family used to display text", },
- true, false, CHAR, { .p = "sans-serif" }, (S_Func) dwb_webkit_setting, },
+ true, false, CHAR, { .p = "sans-serif" }, (S_Func) dwb_webkit_setting, },
{ { "serif-font-family", "Serif font family used to display text", },
- true, false, CHAR, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
+ true, false, CHAR, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
{ { "spell-checking-languages", "Language used for spellchecking sperated by commas", },
- true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
+ true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
{ { "tab-key-cycles-through-elements", "Tab cycles through elements in insert mode", },
- true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
{ { "user-agent", "The user agent string", },
- false, false, CHAR, { .p = NULL }, (S_Func) dwb_set_user_agent, },
+ false, false, CHAR, { .p = NULL }, (S_Func) dwb_set_user_agent, },
{ { "user-stylesheet-uri", "The uri of a stylsheet applied to every page", },
- true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
+ true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
{ { "zoom-step", "The zoom step", },
- true, false, DOUBLE, { .d = 0.1 }, (S_Func) dwb_webkit_setting, },
+ true, false, DOUBLE, { .d = 0.1 }, (S_Func) dwb_webkit_setting, },
{ { "custom-encoding", "The custom encoding of the view", },
- false, false, CHAR, { .p = NULL }, (S_Func) dwb_webview_property, },
+ false, false, CHAR, { .p = NULL }, (S_Func) dwb_webview_property, },
{ { "editable", "Whether content can be modified", },
- false, false, BOOLEAN, { .b = false }, (S_Func) dwb_webview_property, },
+ false, false, BOOLEAN, { .b = false }, (S_Func) dwb_webview_property, },
{ { "full-content-zoom", "Whether the full content is scaled when zooming", },
- false, false, BOOLEAN, { .b = false }, (S_Func) dwb_webview_property, },
- { { "zoom-level", "The default zoom level", }, false, false, DOUBLE, { .d = 1.0 }, (S_Func) dwb_webview_property, },
+ false, false, BOOLEAN, { .b = false }, (S_Func) dwb_webview_property, },
+ { { "zoom-level", "The default zoom level", },
+ false, false, DOUBLE, { .d = 1.0 }, (S_Func) dwb_webview_property, },
{ { "proxy", "Whether to use a HTTP-proxy", },
- false, true, BOOLEAN, { .b = false }, (S_Func) dwb_set_proxy, },
+ false, true, BOOLEAN, { .b = false }, (S_Func) dwb_set_proxy, },
{ { "proxy-url", "The HTTP-proxy url", },
- false, true, CHAR, { .p = NULL }, (S_Func) dwb_soup_init_proxy, },
+ false, true, CHAR, { .p = NULL }, (S_Func) dwb_soup_init_proxy, },
{ { "cookies", "Whether to allow all cookies", },
- false, true, BOOLEAN, { .b = false }, (S_Func) dwb_init_vars, },
+ false, true, BOOLEAN, { .b = false }, (S_Func) dwb_init_vars, },
{ { "background-tabs", "Whether to open tabs in background", },
- false, true, BOOLEAN, { .b = false }, (S_Func) dwb_set_background_tab, },
+ false, true, BOOLEAN, { .b = false }, (S_Func) dwb_set_background_tab, },
{ { "scroll-step", "Whether to open tabs in background", },
- false, true, DOUBLE, { .d = 0 }, (S_Func) dwb_init_vars, },
+ false, true, DOUBLE, { .d = 0 }, (S_Func) dwb_init_vars, },
{ { "active-fg-color", "Foreground color of the active view", },
- false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
{ { "active-bg-color", "Background color of the active view", },
- false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_reload_layout, },
{ { "normal-fg-color", "Foreground color of inactive views", },
- false, true, COLOR_CHAR, { .p = "#cccccc" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#cccccc" }, (S_Func) dwb_reload_layout, },
{ { "normal-bg-color", "Background color of inactive views", },
- false, true, COLOR_CHAR, { .p = "#505050" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#505050" }, (S_Func) dwb_reload_layout, },
{ { "tab-active-fg-color", "Foreground color of the active tab", },
- false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
{ { "tab-active-bg-color", "Background color of the active tab", },
- false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_reload_layout, },
{ { "tab-normal-fg-color", "Foreground color of inactive tabs", },
- false, true, COLOR_CHAR, { .p = "#cccccc" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#cccccc" }, (S_Func) dwb_reload_layout, },
{ { "tab-normal-bg-color", "Background color of inactive tabs", },
- false, true, COLOR_CHAR, { .p = "#505050" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#505050" }, (S_Func) dwb_reload_layout, },
{ { "tab-number-color", "Color of the number in the tab", },
- false, true, COLOR_CHAR, { .p = "#7ac5cd" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#7ac5cd" }, (S_Func) dwb_reload_layout, },
{ { "hide-tabbar", "Whether to hide the tabbar (never, always, tiled)", },
- false, true, CHAR, { .p = "never" }, (S_Func) dwb_set_hide_tabbar, },
+ false, true, CHAR, { .p = "never" }, (S_Func) dwb_set_hide_tabbar, },
{ { "tabbed-browsing", "Whether to enable tabbed browsing", },
- false, true, BOOLEAN, { .b = true }, (S_Func) dwb_set_dummy, },
+ false, true, BOOLEAN, { .b = true }, (S_Func) dwb_set_dummy, },
{ { "active-completion-fg-color", "Foreground color of the active tabcompletion item", },
- false, true, COLOR_CHAR, { .p = "#53868b" }, (S_Func) dwb_init_style, },
+ false, true, COLOR_CHAR, { .p = "#53868b" }, (S_Func) dwb_init_style, },
{ { "active-completion-bg-color", "Background color of the active tabcompletion item", },
- false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_init_style, },
+ false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_init_style, },
{ { "normal-completion-fg-color", "Foreground color of an inactive tabcompletion item", },
- false, true, COLOR_CHAR, { .p = "#eeeeee" }, (S_Func) dwb_init_style, },
+ false, true, COLOR_CHAR, { .p = "#eeeeee" }, (S_Func) dwb_init_style, },
{ { "normal-completion-bg-color", "Background color of an inactive tabcompletion item", },
- false, true, COLOR_CHAR, { .p = "#151515" }, (S_Func) dwb_init_style, },
+ false, true, COLOR_CHAR, { .p = "#151515" }, (S_Func) dwb_init_style, },
{ { "ssl-trusted-color", "Color for ssl-encrypted sites, trusted certificate", },
- false, true, COLOR_CHAR, { .p = "#00ff00" }, (S_Func) dwb_init_style, },
+ false, true, COLOR_CHAR, { .p = "#00ff00" }, (S_Func) dwb_init_style, },
{ { "ssl-untrusted-color", "Color for ssl-encrypted sites, untrusted certificate", },
- false, true, COLOR_CHAR, { .p = "#ff0000" }, (S_Func) dwb_init_style, },
+ false, true, COLOR_CHAR, { .p = "#ff0000" }, (S_Func) dwb_init_style, },
{ { "insertmode-fg-color", "Foreground color in insertmode", },
- false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_init_style, },
+ false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_init_style, },
{ { "insertmode-bg-color", "Background color in insertmode", },
- false, true, COLOR_CHAR, { .p = "#303030" }, (S_Func) dwb_init_style, },
+ false, true, COLOR_CHAR, { .p = "#303030" }, (S_Func) dwb_init_style, },
{ { "error-color", "Color for error messages", },
- false, true, COLOR_CHAR, { .p = "#ff0000" }, (S_Func) dwb_init_style, },
+ false, true, COLOR_CHAR, { .p = "#ff0000" }, (S_Func) dwb_init_style, },
{ { "status-allowed-color", "Color of allowed elements in the statusbar", },
- false, true, COLOR_CHAR, { .p = "#00ff00" }, (S_Func) dwb_reload_layout, },
+ false, true, COLOR_CHAR, { .p = "#00ff00" }, (S_Func) dwb_reload_layout, },
{ { "status-blocked-color", "Color of blocked elements in the statusbar", },
- false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
-
- { { "settings-fg-color", "Settings view foreground color", },
- false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_init_style, },
- { { "settings-bg-color", "Settings view background color", },
- false, true, COLOR_CHAR, { .p = "#151515" }, (S_Func) dwb_init_style, },
- { { "settings-border", "Settings view border", },
- false, true, CHAR, { .p = "1px dotted black"}, (S_Func) dwb_init_style, },
-
+ false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
+
{ { "font", "Default font used for the ui", },
- false, true, CHAR, { .p = "monospace 8" }, (S_Func) dwb_reload_layout, },
+ false, true, CHAR, { .p = "monospace 8" }, (S_Func) dwb_reload_layout, },
{ { "font-inactive", "Font of views without focus", },
- false, true, CHAR, { .p = NULL }, (S_Func) dwb_reload_layout, },
+ false, true, CHAR, { .p = NULL }, (S_Func) dwb_reload_layout, },
{ { "font-entry", "Font of the addressbar", },
- false, true, CHAR, { .p = NULL }, (S_Func) dwb_reload_layout, },
+ false, true, CHAR, { .p = NULL }, (S_Func) dwb_reload_layout, },
{ { "font-completion", "Font for tab-completion", },
- false, true, CHAR, { .p = NULL }, (S_Func) dwb_reload_layout, },
+ false, true, CHAR, { .p = NULL }, (S_Func) dwb_reload_layout, },
{ { "hint-letter-seq", "Letter sequence for letter hints", },
- false, true, CHAR, { .p = "FDSARTGBVECWXQYIOPMNHZULKJ" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "FDSARTGBVECWXQYIOPMNHZULKJ" }, (S_Func) dwb_reload_scripts, },
{ { "hint-style", "Whether to use 'letter' or 'number' hints", },
- false, true, CHAR, { .p = "letter" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "letter" }, (S_Func) dwb_reload_scripts, },
{ { "hint-font-size", "Font size of hints", },
- false, true, CHAR, { .p = "12px" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "12px" }, (S_Func) dwb_reload_scripts, },
{ { "hint-font-weight", "Font weight of hints", },
- false, true, CHAR, { .p = "normal" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "normal" }, (S_Func) dwb_reload_scripts, },
{ { "hint-font-family", "Font family of hints", },
- false, true, CHAR, { .p = "monospace" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "monospace" }, (S_Func) dwb_reload_scripts, },
{ { "hint-fg-color", "Foreground color of hints", },
- false, true, CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_scripts, },
{ { "hint-bg-color", "Background color of hints", },
- false, true, CHAR, { .p = "#000088" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "#000088" }, (S_Func) dwb_reload_scripts, },
{ { "hint-active-color", "Color of the active link in hintmode", },
- false, true, CHAR, { .p = "#00ff00" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "#00ff00" }, (S_Func) dwb_reload_scripts, },
{ { "hint-normal-color", "Color of inactive links in hintmode", },
- false, true, CHAR, { .p = "#ffff99" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "#ffff99" }, (S_Func) dwb_reload_scripts, },
{ { "hint-border", "Border used for hints", },
- false, true, CHAR, { .p = "2px dashed #000000" }, (S_Func) dwb_reload_scripts, },
+ false, true, CHAR, { .p = "2px dashed #000000" }, (S_Func) dwb_reload_scripts, },
{ { "hint-opacity", "The opacity of hints", },
- false, true, DOUBLE, { .d = 0.65 }, (S_Func) dwb_reload_scripts, },
+ false, true, DOUBLE, { .d = 0.65 }, (S_Func) dwb_reload_scripts, },
{ { "auto-completion", "Show possible shortcuts", },
- false, true, BOOLEAN, { .b = true }, (S_Func)dwb_comp_set_autcompletion, },
+ false, true, BOOLEAN, { .b = true }, (S_Func)dwb_comp_set_autcompletion, },
{ { "startpage", "The default homepage", },
- false, true, CHAR, { .p = "dwb://bookmarks" }, (S_Func)dwb_set_startpage, },
+ false, true, CHAR, { .p = "dwb://bookmarks" }, (S_Func)dwb_set_startpage, },
{ { "single-instance", "Whether to have only on instance", },
- false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_single_instance, },
+ false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_single_instance, },
{ { "save-session", "Whether to automatically save sessions", },
- false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_dummy, },
+ false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_dummy, },
// downloads
{ { "download-external-command", "External program used for downloads", },
- false, true, CHAR, { .p = "xterm -e wget 'dwb_uri' -O 'dwb_output' --load-cookies 'dwb_cookies'" }, (S_Func)dwb_set_dummy, },
+ false, true, CHAR, { .p = "xterm -e wget 'dwb_uri' -O 'dwb_output' --load-cookies 'dwb_cookies'" }, (S_Func)dwb_set_dummy, },
{ { "download-use-external-program", "Whether to use an external download program", },
- false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_dummy, },
+ false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_dummy, },
{ { "complete-history", "Whether to complete browsing history with tab", },
- false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
+ false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
{ { "complete-bookmarks", "Whether to complete bookmarks with tab", },
- false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
+ false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
{ { "complete-searchengines", "Whether to complete searchengines with tab", },
- false, true, BOOLEAN, { .b = false }, (S_Func)dwb_init_vars, },
+ false, true, BOOLEAN, { .b = false }, (S_Func)dwb_init_vars, },
{ { "complete-commands", "Whether to complete the commmand history", },
- false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
+ false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
{ { "complete-userscripts", "Whether to complete userscripts", },
- false, true, BOOLEAN, { .b = false }, (S_Func)dwb_init_vars, },
+ false, true, BOOLEAN, { .b = false }, (S_Func)dwb_init_vars, },
{ { "use-fifo", "Create a fifo pipe for communication", },
- false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_dummy },
+ false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_dummy, },
{ { "default-width", "Default width of the window", },
- false, true, INTEGER, { .i = 800 }, (S_Func)dwb_set_dummy, },
+ false, true, INTEGER, { .i = 800 }, (S_Func)dwb_set_dummy, },
{ { "default-height", "Default height of the window", },
- false, true, INTEGER, { .i = 600 }, (S_Func)dwb_set_dummy, },
+ false, true, INTEGER, { .i = 600 }, (S_Func)dwb_set_dummy, },
{ { "message-delay", "Time in seconds, messages are shown", },
- false, true, INTEGER, { .i = 2 }, (S_Func) dwb_set_message_delay, },
+ false, true, INTEGER, { .i = 2 }, (S_Func) dwb_set_message_delay, },
{ { "history-length", "Length of the browsing history", },
- false, true, INTEGER, { .i = 500 }, (S_Func) dwb_set_history_length, },
+ false, true, INTEGER, { .i = 500 }, (S_Func) dwb_set_history_length, },
{ { "size", "Tiling area size in percent", },
- false, true, INTEGER, { .i = 30 }, (S_Func)dwb_set_dummy, },
+ false, true, INTEGER, { .i = 30 }, (S_Func)dwb_set_dummy, },
{ { "factor", "Zoom factor of the tiling area", },
- false, true, DOUBLE, { .d = 0.3 }, (S_Func)dwb_set_dummy, },
+ false, true, DOUBLE, { .d = 0.3 }, (S_Func)dwb_set_dummy, },
{ { "layout", "The default layout (Normal, Bottomstack, Maximized)", },
- false, true, CHAR, { .p = "Normal MAXIMIZED" }, (S_Func)dwb_set_dummy, },
+ false, true, CHAR, { .p = "Normal MAXIMIZED" }, (S_Func)dwb_set_dummy, },
{ { "mail-client", "Program used for mailto:-urls", },
- false, true, CHAR, { .p = "xterm -e mutt 'dwb_uri'" }, (S_Func)dwb_set_dummy },
+ false, true, CHAR, { .p = "xterm -e mutt 'dwb_uri'" }, (S_Func)dwb_set_dummy, },
{ { "ftp-client", "Program used for ftp", },
- false, true, CHAR, { .p = "xterm -e ncftp 'dwb_uri'" }, (S_Func)dwb_set_dummy },
+ false, true, CHAR, { .p = "xterm -e ncftp 'dwb_uri'" }, (S_Func)dwb_set_dummy, },
{ { "adblocker", "Whether to block advertisements via a filterlist", },
- false, false, BOOLEAN, { .b = false }, (S_Func)dwb_set_adblock },
+ false, false, BOOLEAN, { .b = false }, (S_Func)dwb_set_adblock, },
};/*}}}*/
/* SETTINGS_FUNCTIONS{{{*/
@@ -923,6 +917,47 @@ dwb_update_status_text(GList *gl, GtkAdjustment *a) {
/* FUNCTIONS {{{*/
+/* dwb_apply_settings(WebSettings *s) {{{*/
+static void
+dwb_apply_settings(WebSettings *s) {
+ if (dwb.state.setting_apply == APPLY_GLOBAL)
+ for (GList *l = dwb.state.views; l; l=l->next)
+ if (s->func)
+ s->func(l, s);
+ else
+ s->func(dwb.state.fview, s);
+ dwb_normal_mode(false);
+
+}/*}}}*/
+
+/* dwb_set_setting(const char *){{{*/
+void
+dwb_set_setting(const char *key, char *value) {
+ WebSettings *s;
+ Arg *a = NULL;
+
+ GHashTable *t = dwb.state.setting_apply == APPLY_GLOBAL ? dwb.settings : ((View*)dwb.state.fview->data)->setting;
+ if (key) {
+ if ( (s = g_hash_table_lookup(t, key)) ) {
+ if ( (a = dwb_util_char_to_arg(value, s->type)) || (s->type == CHAR && a->p == NULL)) {
+ s->arg = *a;
+ dwb_apply_settings(s);
+ dwb_set_normal_message(dwb.state.fview, true, "Saved setting %s: %s", s->n.first, s->type == BOOLEAN ? ( s->arg.b ? "true" : "false") : value);
+ dwb_save_settings();
+ }
+ else {
+ dwb_set_error_message(dwb.state.fview, "No valid value.");
+ }
+ }
+ else {
+ dwb_set_error_message(dwb.state.fview, "No such setting: %s", key);
+ }
+ }
+ dwb_normal_mode(false);
+
+
+}/*}}}*/
+
/* dwb_set_key(const char *prop, char *val) {{{*/
void
dwb_set_key(const char *prop, char *val) {
@@ -2612,9 +2647,6 @@ dwb_init_style() {
gdk_color_parse(GET_CHAR("error-color"), &dwb.color.error);
- dwb.color.settings_fg_color = GET_CHAR("settings-fg-color");
- dwb.color.settings_bg_color = GET_CHAR("settings-bg-color");
-
dwb.color.tab_number_color = GET_CHAR("tab-number-color");
dwb.color.allow_color = GET_CHAR("status-allowed-color");
dwb.color.block_color = GET_CHAR("status-blocked-color");
@@ -2629,7 +2661,6 @@ dwb_init_style() {
SET_FONT(dwb.font.fd_completion, "font-completion");
#undef SET_FONT
- dwb.misc.settings_border = GET_CHAR("settings-border");
} /*}}}*/
/* dwb_init_gui() {{{*/
diff --git a/src/dwb.h b/src/dwb.h
index 822d3bf0..c78cb5cc 100644
--- a/src/dwb.h
+++ b/src/dwb.h
@@ -49,10 +49,6 @@
#ifndef COPYRIGHT
#define COPYRIGHT "© 2010-2011 Stefan Bolte"
#endif
-/* SETTINGS MAKROS {{{*/
-#define KEY_SETTINGS "xwb://keys"
-#define SETTINGS "Dwb Settings"
-
#define SINGLE_INSTANCE 1
#define NEW_INSTANCE 2
@@ -60,35 +56,6 @@
#define STRING_LENGTH 1024
#define BUFFER_LENGTH 256
-// SETTTINGS_VIEW %s: bg-color %s: fg-color %s: border
-#define SETTINGS_VIEW "<head>\n<title>%s</title><style type=\"text/css\">\n \
- body { background-color: %s; color: %s; text-align:center; }\n\
- table { border-spacing:0px; }\n\
- th { border:%s; }\n \
- .line { vertical-align: middle; }\n \
- .text { float: left; font: normal 12px helvetica; }\n \
- .key { text-align: center; font-size: 12; }\n \
- .active { background-color: #660000; }\n \
- h2 { font: bold 16px verdana; font-variant: small-caps; }\n \
- .alignCenter { margin-left: 25%%; width: 50%%; }\n \
- input { font:normal 12px helvetica; }\
-</style>\n \
-<script type=\"text/javascript\">\n \
-function get_value(e) { value = e.value ? e.id + \" \" + e.value : e.id; console.log(value); e.blur(); } \
-</script>\n<noscript>Enable scripts to add settings!</noscript>\n</head>\n"
-#define HTML_H2 "<h2>%s -- Profile: %s</h2>"
-
-#define HTML_BODY_START "<body>\n"
-#define HTML_BODY_END "</body>\n"
-#define HTML_FORM_START "<form onsubmit=\"return false\">\n<table width=100%; style=\"border:thin solid black\">"
-#define HTML_FORM_END "</form>\n</table>\n</div>\n"
-#define HTML_DIV_START "<tr>\n"
-#define HTML_DIV_KEYS_TEXT "<th width=100%%><div class=\"text\">%s</div>\n</th> "
-#define HTML_DIV_KEYS_VALUE "<th><div class=\"key\">\n <input onchange=\"get_value(this)\" id=\"%s\" value=\"%s %s\"/>\n</div></th>\n"
-#define HTML_DIV_SETTINGS_VALUE "<th><div class=\"key\">\n <input onchange=\"get_value(this);\" id=\"%s\" value=\"%s\"/>\n</div>\n</th>"
-#define HTML_DIV_SETTINGS_CHECKBOX "<th><div class=\"key\">\n <input id=\"%s\" type=\"checkbox\" onchange=\"get_value(this);\" %s>\n</div>\n</th>"
-#define HTML_DIV_END "</tr>\n"
-/*}}}*/
#define INSERT "Insert Mode"
#define NO_URL "No URL in current context"
@@ -687,5 +654,6 @@ char * dwb_get_host(WebKitWebView *);
void dwb_focus_view(GList *);
void dwb_clean_key_buffer(void);
void dwb_set_key(const char *, char *);
+void dwb_set_setting(const char *, char *value);
#endif
diff --git a/src/html.c b/src/html.c
index 4f7bba6a..2db3f3d7 100644
--- a/src/html.c
+++ b/src/html.c
@@ -27,8 +27,8 @@ static HtmlTable table[] = {
{ "dwb://bookmarks", "Bookmarks", INFO_FILE, 0, dwb_html_bookmarks },
{ "dwb://quickmarks", "Quickmarks", INFO_FILE, 0, dwb_html_quickmarks },
{ "dwb://history", "History", INFO_FILE, 0, dwb_html_history },
- { "dwb://keys", "Keys", INFO_FILE, 0, dwb_html_keys },
- //{ "dwb://settings", "Settings", SETTINGS_FILE, 0, dwb_html_settings },
+ { "dwb://keys", "Keys", INFO_FILE, 0, dwb_html_keys },
+ { "dwb://settings", "Settings", INFO_FILE, 0, dwb_html_settings },
};
void
@@ -47,7 +47,7 @@ dwb_html_load_page(WebKitWebView *wv, HtmlTable *t, char *panel) {
g_file_get_contents(path, &filecontent, NULL, NULL);
if (panel)
g_string_append_printf(content, filecontent, panel);
- webkit_web_frame_load_alternate_string(webkit_web_view_get_main_frame(wv), content->str, t->uri, "about:blank");
+ webkit_web_frame_load_alternate_string(webkit_web_view_get_main_frame(wv), content->str, t->uri, t->uri);
g_string_free(content, true);
g_free(filecontent);
FREE(path);
@@ -73,13 +73,61 @@ void
dwb_html_history(WebKitWebView *wv, HtmlTable *table) {
dwb_html_navigation(wv, dwb.fc.history, table);
}
+gboolean
+dwb_html_settings_changed_cb(WebKitDOMElement *el, WebKitDOMEvent *ev, WebKitWebView *wv) {
+ char buffer[10];
+ memset(buffer, '\0', 10);
+ char *id = webkit_dom_html_element_get_id(WEBKIT_DOM_HTML_ELEMENT(el));
+ char *value = 0;
+ char *type = webkit_dom_element_get_attribute(el, "type");
+ PRINT_DEBUG("id: %s value: %s wv: %s", id, value, type);
+ if (!strcmp(type, "checkbox")) {
+ if (webkit_dom_html_input_element_get_checked(WEBKIT_DOM_HTML_INPUT_ELEMENT(el)) )
+ strcpy(buffer, "true");
+ else
+ strcpy(buffer, "false");
+ value = buffer;
+ }
+ else
+ value = webkit_dom_html_input_element_get_value(WEBKIT_DOM_HTML_INPUT_ELEMENT(el));
+ dwb.state.setting_apply = APPLY_GLOBAL;
+ dwb_set_setting(id, value);
+ return true;
+}
+void
+dwb_html_settings_fill(char *key, WebSettings *s, WebKitWebView *wv) {
+ char *value = dwb_util_arg_to_char(&s->arg, s->type);
+ WebKitDOMDocument *doc = webkit_web_view_get_dom_document(wv);
+ WebKitDOMElement *e = webkit_dom_document_get_element_by_id(doc, key);
+ PRINT_DEBUG("%s %s", key, value);
+ if (s->type == BOOLEAN)
+ webkit_dom_html_input_element_set_checked(WEBKIT_DOM_HTML_INPUT_ELEMENT(e), s->arg.b);
+ else if (value) {
+ webkit_dom_html_input_element_set_value(WEBKIT_DOM_HTML_INPUT_ELEMENT(e), value);
+ g_free(value);
+ }
+ webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(e), "change", G_CALLBACK(dwb_html_settings_changed_cb), false, wv);
+}
+void
+dwb_html_settings_load_cb(WebKitWebView *wv, GParamSpec *p, HtmlTable *table) {
+ if (webkit_web_view_get_load_status(wv) == WEBKIT_LOAD_FINISHED) {
+ g_hash_table_foreach(dwb.settings, (GHFunc)dwb_html_settings_fill, wv);
+ g_signal_handlers_disconnect_by_func(wv, dwb_html_settings_load_cb, table);
+ }
+}
void
dwb_html_settings(WebKitWebView *wv, HtmlTable *table) {
- //dwb_html_load_page(wv, table, "blub");
+ char *content;
+ g_signal_connect(wv, "notify::load-status", G_CALLBACK(dwb_html_settings_load_cb), table);
+ char *path = dwb_util_get_data_file(SETTINGS_FILE);
+ g_file_get_contents(path, &content, NULL, NULL);
+ dwb_html_load_page(wv, table, content);
+ g_free(path);
+ g_free(content);
}
-gboolean
-key_changed_cb(WebKitDOMElement *target, WebKitDOMEvent *e, gpointer data) {
+static gboolean
+dwb_html_key_changed_cb(WebKitDOMElement *target, WebKitDOMEvent *e, gpointer data) {
char *value = webkit_dom_html_input_element_get_value(WEBKIT_DOM_HTML_INPUT_ELEMENT(target));
char *id = webkit_dom_html_element_get_id(WEBKIT_DOM_HTML_ELEMENT(target));
dwb_set_key(id, value);
@@ -97,7 +145,7 @@ dwb_html_keys_load_cb(WebKitWebView *wv, GParamSpec *p, HtmlTable *table) {
km = l->data;
n = km->map->n;
input = webkit_dom_document_get_element_by_id(doc, n.first);
- webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(input), "change", G_CALLBACK(key_changed_cb), false, wv);
+ webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(input), "change", G_CALLBACK(dwb_html_key_changed_cb), false, wv);
}
g_signal_handlers_disconnect_by_func(wv, dwb_html_keys_load_cb, table);
}
@@ -116,7 +164,7 @@ dwb_html_keys(WebKitWebView *wv, HtmlTable *table) {
"<div class='dwb_line%d'>\
<div class='dwb_attr'>%s</div>\
<div style='float:right;'>\
- <label class='dwb_desc' for='%s'>%s</lable>\
+ <label class='dwb_desc' for='%s'>%s</label>\
<input id='%s' type='text' value='%s %s'>\
</div>\
<div style='clear:both;'></div>\
diff --git a/src/view.c b/src/view.c
index e14f1c9a..34dc4cc8 100644
--- a/src/view.c
+++ b/src/view.c
@@ -19,8 +19,6 @@
#include "view.h"
#include "html.h"
-static void dwb_parse_setting(const char *);
-static void dwb_apply_settings(WebSettings *);
static void dwb_view_ssl_state(GList *);
#if WEBKIT_CHECK_VERSION(1, 4, 0)
static const char *dummy_icon[] = { "1 1 1 1 ", " c black", " ", };
@@ -122,10 +120,12 @@ dwb_web_view_close_web_view_cb(WebKitWebView *web, GList *gl) {
/* dwb_web_view_console_message_cb(WebKitWebView *web, char *message, int line, char *sourceid, GList *gl) {{{*/
static gboolean
dwb_web_view_console_message_cb(WebKitWebView *web, char *message, int line, char *sourceid, GList *gl) {
+#if 0
if (!(strcmp(sourceid, SETTINGS))) {
dwb_parse_setting(message);
}
- else if (gl == dwb.state.fview && !(strcmp(message, "_dwb_input_mode_"))) {
+#endif
+ if (gl == dwb.state.fview && !(strcmp(message, "_dwb_input_mode_"))) {
dwb_insert_mode(NULL);
}
else if (gl == dwb.state.fview && !(strcmp(message, "_dwb_normal_mode_"))) {
@@ -522,12 +522,13 @@ dwb_view_entry_activate_cb(GtkEntry* entry, GList *gl) {
else if (mode == SEARCH_FIELD_MODE) {
dwb_submit_searchengine();
}
- else if (mode == SETTINGS_MODE) {
- dwb_parse_setting(GET_TEXT());
- }
- else if (mode == KEY_MODE) {
+ else if (mode == SETTINGS_MODE || mode == KEY_MODE) {
char **token = g_strsplit(GET_TEXT(), " ", 2);
- dwb_set_key(token[0], token[1]);
+ if (mode == KEY_MODE)
+ dwb_set_key(token[0], token[1]);
+ else
+ dwb_set_setting(token[0], token[1]);
+ g_strfreev(token);
}
else if (mode == COMMAND_MODE) {
dwb_parse_command_line(GET_TEXT());
@@ -994,57 +995,4 @@ dwb_add_view(Arg *arg, gboolean background) {
return ret;
} /*}}}*/
-
-/* dwb_parse_setting(const char *){{{*/
-void
-dwb_parse_setting(const char *text) {
- WebSettings *s;
- Arg *a = NULL;
- char **token = g_strsplit(text, " ", 2);
-
- GHashTable *t = dwb.state.setting_apply == APPLY_GLOBAL ? dwb.settings : ((View*)dwb.state.fview->data)->setting;
- if (token[0]) {
- if ( (s = g_hash_table_lookup(t, token[0])) ) {
- if ( (a = dwb_util_char_to_arg(token[1], s->type)) || (s->type == CHAR && a->p == NULL)) {
- s->arg = *a;
- dwb_apply_settings(s);
- dwb_set_normal_message(dwb.state.fview, true, "Saved setting %s: %s", s->n.first, s->type == BOOLEAN ? ( s->arg.b ? "true" : "false") : token[1]);
- dwb_save_settings();
- }
- else {
- dwb_set_error_message(dwb.state.fview, "No valid value.");
- }
- }
- else {
- dwb_set_error_message(dwb.state.fview, "No such setting: %s", token[0]);
- }
- }
- dwb_normal_mode(false);
-
- g_strfreev(token);
-
-}/*}}}*/
-
-/* dwb_apply_settings(WebSettings *s) {{{*/
-static void
-dwb_apply_settings(WebSettings *s) {
- WebSettings *new;
- if (dwb.state.setting_apply == APPLY_GLOBAL) {
- new = g_hash_table_lookup(dwb.settings, s->n.first);
- new->arg = s->arg;
- for (GList *l = dwb.state.views; l; l=l->next) {
- WebSettings *new = g_hash_table_lookup(VIEW(l)->setting, s->n.first);
- new->arg = s->arg;
- if (s->func) {
- s->func(l, s);
- }
- }
- }
- else {
- s->func(dwb.state.fview, s);
- }
- dwb_normal_mode(false);
-
-}/*}}}*/
-
/*}}}*/