diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 9 | ||||
-rw-r--r-- | src/rekonq.kcfg | 36 | ||||
-rw-r--r-- | src/settings/settings_webkit.ui | 185 | ||||
-rw-r--r-- | src/settings/webkitwidget.cpp | 27 | ||||
-rw-r--r-- | src/settings/webkitwidget.h | 3 |
5 files changed, 140 insertions, 120 deletions
diff --git a/src/application.cpp b/src/application.cpp index 39b2af60..6b74766f 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -579,15 +579,14 @@ void Application::updateConfiguration() defaultSettings->setDefaultTextEncoding(enc); // ================ WebKit ============================ - defaultSettings->setAttribute(QWebSettings::AutoLoadImages, ReKonfig::autoLoadImages()); defaultSettings->setAttribute(QWebSettings::DnsPrefetchEnabled, ReKonfig::dnsPrefetch()); + defaultSettings->setAttribute(QWebSettings::PrintElementBackgrounds, ReKonfig::printElementBackgrounds()); + defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, ReKonfig::javascriptEnabled()); - defaultSettings->setAttribute(QWebSettings::JavaEnabled, ReKonfig::javaEnabled()); defaultSettings->setAttribute(QWebSettings::JavascriptCanOpenWindows, ReKonfig::javascriptCanOpenWindows()); defaultSettings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, ReKonfig::javascriptCanAccessClipboard()); - defaultSettings->setAttribute(QWebSettings::LinksIncludedInFocusChain, ReKonfig::linksIncludedInFocusChain()); - defaultSettings->setAttribute(QWebSettings::ZoomTextOnly, ReKonfig::zoomTextOnly()); - defaultSettings->setAttribute(QWebSettings::PrintElementBackgrounds, ReKonfig::printElementBackgrounds()); + + defaultSettings->setAttribute(QWebSettings::JavaEnabled, ReKonfig::javaEnabled()); if (ReKonfig::pluginsEnabled() == 2) defaultSettings->setAttribute(QWebSettings::PluginsEnabled, false); diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index d29a5a36..f0fc3766 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -177,44 +177,44 @@ <!-- WebKit Settings --> <group name="Webkit"> - <entry name="autoLoadImages" type="Bool"> - <default>true</default> + <entry name="pluginsEnabled" type="Int"> + <default>0</default> + </entry> + <entry name="webGL" type="Bool"> + <default>false</default> + </entry> + <entry name="spatialNavigation" type="Bool"> + <default>false</default> + </entry> + <entry name="frameFlattening" type="Bool"> + <default>false</default> </entry> <entry name="dnsPrefetch" type="Bool"> <default>true</default> </entry> - <entry name="javascriptEnabled" type="Bool"> + <entry name="printElementBackgrounds" type="Bool"> <default>true</default> </entry> - <entry name="javaEnabled" type="Bool"> + <entry name="javascriptEnabled" type="Bool"> <default>true</default> </entry> - <entry name="pluginsEnabled" type="Int"> - <default>0</default> - </entry> <entry name="javascriptCanOpenWindows" type="Bool"> - <default>true</default> - </entry> - <entry name="javascriptCanAccessClipboard" type="Bool"> <default>false</default> </entry> - <entry name="linksIncludedInFocusChain" type="Bool"> - <default>true</default> - </entry> - <entry name="zoomTextOnly" type="Bool"> + <entry name="javascriptCanAccessClipboard" type="Bool"> <default>false</default> </entry> - <entry name="printElementBackgrounds" type="Bool"> + <entry name="javaEnabled" type="Bool"> <default>true</default> </entry> <entry name="offlineStorageDatabaseEnabled" type="Bool"> - <default>true</default> + <default>false</default> </entry> <entry name="offlineWebApplicationCacheEnabled" type="Bool"> - <default>true</default> + <default>false</default> </entry> <entry name="localStorageEnabled" type="Bool"> - <default>true</default> + <default>false</default> </entry> <entry name="userCSS" type="Url"> <default></default> 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 @@ <rect> <x>0</x> <y>0</y> - <width>480</width> - <height>377</height> + <width>503</width> + <height>514</height> </rect> </property> - <layout class="QVBoxLayout" name="verticalLayout"> + <layout class="QVBoxLayout" name="verticalLayout_4"> <item> - <widget class="QGroupBox" name="groupBox"> + <widget class="QGroupBox" name="groupBox_2"> <property name="title"> - <string>WebKit Settings</string> + <string>Javascript</string> </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QCheckBox" name="kcfg_autoLoadImages"> - <property name="text"> - <string>Autoload images</string> - </property> - </widget> - </item> - <item row="0" column="1" rowspan="7"> - <widget class="Line" name="line"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QCheckBox" name="kcfg_linksIncludedInFocusChain"> - <property name="text"> - <string>Links included in focus chain</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QCheckBox" name="kcfg_dnsPrefetch"> - <property name="text"> - <string>Prefetch DNS entries</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QCheckBox" name="kcfg_zoomTextOnly"> - <property name="text"> - <string>Zoom text only</string> - </property> - </widget> - </item> - <item row="2" column="0"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> <widget class="QCheckBox" name="kcfg_javascriptEnabled"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> @@ -67,56 +26,21 @@ </sizepolicy> </property> <property name="text"> - <string>JavaScript support</string> + <string>Enable JavaScript</string> </property> </widget> </item> - <item row="2" column="2"> - <widget class="QCheckBox" name="kcfg_printElementBackgrounds"> - <property name="text"> - <string>Print element backgrounds</string> - </property> - </widget> - </item> - <item row="4" column="2"> - <widget class="QCheckBox" name="kcfg_offlineStorageDatabaseEnabled"> - <property name="text"> - <string>Offline storage database</string> - </property> - </widget> - </item> - <item row="3" column="0" rowspan="2"> - <widget class="QCheckBox" name="kcfg_javaEnabled"> - <property name="text"> - <string>Java support</string> - </property> - </widget> - </item> - <item row="5" column="0"> + <item> <widget class="QCheckBox" name="kcfg_javascriptCanOpenWindows"> <property name="text"> - <string>JavaScript can open windows</string> + <string>Let Javascipt open new windows</string> </property> </widget> </item> - <item row="5" column="2"> - <widget class="QCheckBox" name="kcfg_offlineWebApplicationCacheEnabled"> - <property name="text"> - <string>Offline web application cache</string> - </property> - </widget> - </item> - <item row="6" column="0"> + <item> <widget class="QCheckBox" name="kcfg_javascriptCanAccessClipboard"> <property name="text"> - <string>JavaScript can access clipboard</string> - </property> - </widget> - </item> - <item row="6" column="2"> - <widget class="QCheckBox" name="kcfg_localStorageEnabled"> - <property name="text"> - <string>Local Storage</string> + <string>Let Javascript access clipboard</string> </property> </widget> </item> @@ -135,7 +59,7 @@ </sizepolicy> </property> <property name="title"> - <string>Plugin Settings</string> + <string>Plugins</string> </property> <layout class="QFormLayout" name="formLayout"> <item row="0" column="0"> @@ -192,7 +116,88 @@ </widget> </item> <item> - <spacer name="verticalSpacer"> + <widget class="QGroupBox" name="groupBox_4"> + <property name="title"> + <string>HTML 5</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QCheckBox" name="kcfg_offlineStorageDatabaseEnabled"> + <property name="text"> + <string>Offline storage database</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_offlineWebApplicationCacheEnabled"> + <property name="text"> + <string>Offline web application cache</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_localStorageEnabled"> + <property name="text"> + <string>Local Storage</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Misc</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QCheckBox" name="kcfg_javaEnabled"> + <property name="text"> + <string>load java applets</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_webGL"> + <property name="text"> + <string>WebGL</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_spatialNavigation"> + <property name="text"> + <string>Spatial Navigation</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_frameFlattening"> + <property name="text"> + <string>Frame Flattening</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_dnsPrefetch"> + <property name="text"> + <string>Prefetch DNS entries</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_printElementBackgrounds"> + <property name="text"> + <string>Print element backgrounds</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> 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(); |