summaryrefslogtreecommitdiff
path: root/src/settings
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-10-23 16:11:52 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-10-26 00:16:24 +0200
commitf61c48d0e6058ebec3ff1d60ba800192d8bc1a4d (patch)
treede7050c0becf1a50120734570b1718900c37fcdf /src/settings
parentClean up UrlBar code (diff)
downloadrekonq-f61c48d0e6058ebec3ff1d60ba800192d8bc1a4d.tar.xz
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
Diffstat (limited to 'src/settings')
-rw-r--r--src/settings/settings_webkit.ui185
-rw-r--r--src/settings/webkitwidget.cpp27
-rw-r--r--src/settings/webkitwidget.h3
3 files changed, 118 insertions, 97 deletions
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();