From f61c48d0e6058ebec3ff1d60ba800192d8bc1a4d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 23 Oct 2011 16:11:52 +0200 Subject: Improve rekonq WebKit settings This patch changes WebKit Settings window removing the "unuseful" stuffs and adding some news like WebGL or Frame Flattening (probably useful also on netbook). It also redesign/clean up the settings widget Let us require QtWebKit 2.2.x, hence Qt 4.8.0 at least until someone will explain me how I can check QtWebKit version number with cmake... REVIEW:102920 --- src/settings/settings_webkit.ui | 185 +++++++++++++++++++++------------------- src/settings/webkitwidget.cpp | 27 ++++-- src/settings/webkitwidget.h | 3 +- 3 files changed, 118 insertions(+), 97 deletions(-) (limited to 'src/settings') diff --git a/src/settings/settings_webkit.ui b/src/settings/settings_webkit.ui index 58fbe459..46913f63 100644 --- a/src/settings/settings_webkit.ui +++ b/src/settings/settings_webkit.ui @@ -6,59 +6,18 @@ 0 0 - 480 - 377 + 503 + 514 - + - + - WebKit Settings + Javascript - - - - - Autoload images - - - - - - - - 0 - 0 - - - - Qt::Vertical - - - - - - - Links included in focus chain - - - - - - - Prefetch DNS entries - - - - - - - Zoom text only - - - - + + @@ -67,56 +26,21 @@ - JavaScript support + Enable JavaScript - - - - Print element backgrounds - - - - - - - Offline storage database - - - - - - - Java support - - - - + - JavaScript can open windows + Let Javascipt open new windows - - - - Offline web application cache - - - - + - JavaScript can access clipboard - - - - - - - Local Storage + Let Javascript access clipboard @@ -135,7 +59,7 @@ - Plugin Settings + Plugins @@ -192,7 +116,88 @@ - + + + HTML 5 + + + + + + Offline storage database + + + + + + + Offline web application cache + + + + + + + Local Storage + + + + + + + + + + Misc + + + + + + load java applets + + + + + + + WebGL + + + + + + + Spatial Navigation + + + + + + + Frame Flattening + + + + + + + Prefetch DNS entries + + + + + + + Print element backgrounds + + + + + + + + Qt::Vertical diff --git a/src/settings/webkitwidget.cpp b/src/settings/webkitwidget.cpp index 04242af1..0f7a4b3d 100644 --- a/src/settings/webkitwidget.cpp +++ b/src/settings/webkitwidget.cpp @@ -28,12 +28,19 @@ #include "webkitwidget.h" #include "webkitwidget.moc" +// Auto Includes +#include "rekonq.h" + WebKitWidget::WebKitWidget(QWidget *parent) : QWidget(parent) , _changed(false) { setupUi(this); + setWebSettingsToolTips(); + + updateJavascriptSettings(ReKonfig::javascriptEnabled()); + connect(kcfg_javascriptEnabled, SIGNAL(clicked(bool)), this, SLOT(updateJavascriptSettings(bool))); } @@ -50,22 +57,30 @@ bool WebKitWidget::changed() void WebKitWidget::hasChanged() { + _changed = true; + emit changed(true); } void WebKitWidget::setWebSettingsToolTips() { - kcfg_autoLoadImages->setToolTip(i18n("Specifies whether images are automatically loaded in web pages.")); + kcfg_webGL->setToolTip(i18n("Enables WebGL technology")); + kcfg_spatialNavigation->setToolTip(i18n("Lets you navigating between focusable elements using arrow keys.")); + kcfg_frameFlattening->setToolTip(i18n("Flatten all the frames to become one scrollable page.")); kcfg_dnsPrefetch->setToolTip(i18n("Specifies whether WebKit will try to prefetch DNS entries to speed up browsing.")); + kcfg_printElementBackgrounds->setToolTip(i18n("If enabled, background colors and images are also drawn when the page is printed.")); kcfg_javascriptEnabled->setToolTip(i18n("Enables the execution of JavaScript programs.")); - kcfg_javaEnabled->setToolTip(i18n("Enables support for Java applets.")); - kcfg_pluginsEnabled->setToolTip(i18n("Enables support for plugins in web pages.")); kcfg_javascriptCanOpenWindows->setToolTip(i18n("If enabled, JavaScript programs are allowed to open new windows.")); kcfg_javascriptCanAccessClipboard->setToolTip(i18n("If enabled, JavaScript programs are allowed to read from and to write to the clipboard.")); - kcfg_linksIncludedInFocusChain->setToolTip(i18n("If enabled, hyperlinks are included in the keyboard focus chain.")); - kcfg_zoomTextOnly->setToolTip(i18n("If enabled, the zoom factor on a frame is only applied to the text.")); - kcfg_printElementBackgrounds->setToolTip(i18n("If enabled, background colors and images are also drawn when the page is printed.")); + kcfg_javaEnabled->setToolTip(i18n("Enables support for Java applets.")); kcfg_offlineStorageDatabaseEnabled->setToolTip(i18n("Enables support for the HTML 5 offline storage feature.")); kcfg_offlineWebApplicationCacheEnabled->setToolTip(i18n("Enables support for the HTML 5 web application cache feature.")); kcfg_localStorageEnabled->setToolTip(i18n("Enables support for the HTML 5 local storage feature.")); } + + +void WebKitWidget::updateJavascriptSettings(bool b) +{ + kcfg_javascriptCanAccessClipboard->setEnabled(b); + kcfg_javascriptCanOpenWindows->setEnabled(b); +} diff --git a/src/settings/webkitwidget.h b/src/settings/webkitwidget.h index d1435107..0046839a 100644 --- a/src/settings/webkitwidget.h +++ b/src/settings/webkitwidget.h @@ -50,7 +50,8 @@ signals: private slots: void hasChanged(); - + void updateJavascriptSettings(bool); + private: void setWebSettingsToolTips(); -- cgit v1.2.1