summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-04-07 20:20:15 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-04-07 20:40:39 +0200
commit074a549f33e199175a4c080c88ed3a9b6d91d1c0 (patch)
treee718b456c858b9ce522fd38244755355d7127a6e /src
parentFixed new tab QKeySequence (diff)
downloadrekonq-074a549f33e199175a4c080c88ed3a9b6d91d1c0.tar.xz
Added settings webkit section, with rekonq personal settings.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/mainwindow.cpp28
-rw-r--r--src/rekonq.kcfg52
-rw-r--r--src/settings.cpp29
-rw-r--r--src/settings.h2
-rw-r--r--src/settings_general.ui29
-rw-r--r--src/settings_webkit.ui148
7 files changed, 248 insertions, 41 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 585702f2..9f67c749 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -30,6 +30,7 @@ KDE4_ADD_UI_FILES( rekonq_SRCS
settings_fonts.ui
settings_privacy.ui
settings_proxy.ui
+ settings_webkit.ui
)
KDE4_ADD_KCFG_FILES( rekonq_SRCS rekonq.kcfgc )
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 21ceb8ee..d58208ba 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -332,12 +332,28 @@ void MainWindow::slotUpdateConfiguration()
defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family());
defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fnSize);
- // =========== Privacy ==============
- bool arePluginsEnabled = ReKonfig::enablePlugins();
- bool isJavascriptEnabled = ReKonfig::enableJavascript();
-
- defaultSettings->setAttribute(QWebSettings::PluginsEnabled, arePluginsEnabled);
- defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, isJavascriptEnabled);
+// // =========== Privacy ==============
+// bool arePluginsEnabled = ReKonfig::enablePlugins();
+// bool isJavascriptEnabled = ReKonfig::enableJavascript();
+//
+// defaultSettings->setAttribute(QWebSettings::PluginsEnabled, arePluginsEnabled);
+// defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, isJavascriptEnabled);
+
+ // ================ WebKit ============================
+ defaultSettings->setAttribute(QWebSettings::AutoLoadImages, ReKonfig::autoLoadImages());
+ defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, ReKonfig::javascriptEnabled());
+ defaultSettings->setAttribute(QWebSettings::JavaEnabled, ReKonfig::javaEnabled());
+ defaultSettings->setAttribute(QWebSettings::PluginsEnabled, ReKonfig::pluginsEnabled());
+ defaultSettings->setAttribute(QWebSettings::PrivateBrowsingEnabled, ReKonfig::privateBrowsingEnabled());
+ defaultSettings->setAttribute(QWebSettings::JavascriptCanOpenWindows, ReKonfig::javascriptCanOpenWindows());
+ defaultSettings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, ReKonfig::javascriptCanAccessClipboard());
+ defaultSettings->setAttribute(QWebSettings::DeveloperExtrasEnabled, ReKonfig::developerExtrasEnabled());
+ defaultSettings->setAttribute(QWebSettings::LinksIncludedInFocusChain, ReKonfig::linksIncludedInFocusChain());
+ defaultSettings->setAttribute(QWebSettings::ZoomTextOnly, ReKonfig::zoomTextOnly());
+ defaultSettings->setAttribute(QWebSettings::PrintElementBackgrounds, ReKonfig::printElementBackgrounds());
+ defaultSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, ReKonfig::offlineStorageDatabaseEnabled());
+ defaultSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, ReKonfig::offlineWebApplicationCacheEnabled());
+ defaultSettings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, ReKonfig::localStorageDatabaseEnabled());
// ====== load Settings on main classes
Application::networkAccessManager()->loadSettings();
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index f2a2cedd..6b74f47e 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -20,12 +20,6 @@
<entry name="alwaysShowTabBar" type="Bool">
<default>true</default>
</entry>
- <entry name="enablePlugins" type="Bool">
- <default>true</default>
- </entry>
- <entry name="enableJavascript" type="Bool">
- <default>true</default>
- </entry>
</group>
<!-- Fonts Settings -->
@@ -73,4 +67,50 @@
</entry>
</group>
+<!-- WebKit Settings -->
+ <group name="Webkit">
+ <entry name="autoLoadImages" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="javascriptEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="javaEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="pluginsEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="privateBrowsingEnabled" type="Bool">
+ <default>false</default>
+ </entry>
+ <entry name="javascriptCanOpenWindows" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="javascriptCanAccessClipboard" type="Bool">
+ <default>false</default>
+ </entry>
+ <entry name="developerExtrasEnabled" type="Bool">
+ <default>false</default>
+ </entry>
+ <entry name="linksIncludedInFocusChain" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="zoomTextOnly" type="Bool">
+ <default>false</default>
+ </entry>
+ <entry name="printElementBackgrounds" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="offlineStorageDatabaseEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="offlineWebApplicationCacheEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="localStorageDatabaseEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ </group>
+
</kcfg>
diff --git a/src/settings.cpp b/src/settings.cpp
index 8f3d61a0..37f6503c 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -40,6 +40,7 @@
#include "ui_settings_fonts.h"
#include "ui_settings_privacy.h"
#include "ui_settings_proxy.h"
+#include "ui_settings_webkit.h"
// KDE Includes
#include <KConfig>
@@ -60,6 +61,7 @@ private:
Ui::fonts fontsUi;
Ui::privacy privacyUi;
Ui::proxy proxyUi;
+ Ui::webkit webkitUi;
Private(SettingsDialog *parent);
@@ -95,6 +97,12 @@ Private::Private(SettingsDialog *parent)
widget->layout()->setMargin(0);
pageItem = parent->addPage(widget , i18n("Proxy"));
pageItem->setIcon(KIcon("preferences-system-network"));
+
+ widget = new QWidget;
+ webkitUi.setupUi(widget);
+ widget->layout()->setMargin(0);
+ pageItem = parent->addPage(widget , i18n("Webkit"));
+ pageItem->setIcon(KIcon("applications-internet"));
}
// -----------------------------------------------------------------------------------------------------
@@ -114,6 +122,8 @@ SettingsDialog::SettingsDialog(QWidget *parent)
connect(d->generalUi.setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT(setHomeToCurrentPage()));
connect(d->privacyUi.exceptionsButton, SIGNAL(clicked()), this, SLOT(showExceptions()));
connect(d->privacyUi.cookiesButton, SIGNAL(clicked()), this, SLOT(showCookies()));
+
+ setWebSettingsToolTips();
}
@@ -124,6 +134,25 @@ SettingsDialog::~SettingsDialog()
}
+void SettingsDialog::setWebSettingsToolTips()
+{
+ d->webkitUi.kcfg_autoLoadImages->setToolTip(i18n("Specifies whether images are automatically loaded in web pages") );
+ d->webkitUi.kcfg_javascriptEnabled->setToolTip(i18n("Enables the running of JavaScript programs.") );
+ d->webkitUi.kcfg_javaEnabled->setToolTip(i18n("Enables Java applets.") );
+ d->webkitUi.kcfg_pluginsEnabled->setToolTip(i18n("Enables plugins in web pages.") );
+ d->webkitUi.kcfg_privateBrowsingEnabled->setToolTip(i18n("Prevents WebKit from recording visited pages in the history.") );
+ d->webkitUi.kcfg_javascriptCanOpenWindows->setToolTip(i18n("Allows JavaScript programs to opening new windows.") );
+ d->webkitUi.kcfg_javascriptCanAccessClipboard->setToolTip(i18n("Allows JavaScript programs to reading/writing to the clipboard.") );
+ d->webkitUi.kcfg_developerExtrasEnabled->setToolTip(i18n("Enables extra tools for Web developers") );
+ d->webkitUi.kcfg_linksIncludedInFocusChain->setToolTip(i18n("Includes hyperlinks in the keyboard focus chain.") );
+ d->webkitUi.kcfg_zoomTextOnly->setToolTip(i18n("Applies the zoom factor on a frame to only the text or all content.") );
+ d->webkitUi.kcfg_printElementBackgrounds->setToolTip(i18n("Draws also background color and images when the page is printed.") );
+ d->webkitUi.kcfg_offlineStorageDatabaseEnabled->setToolTip(i18n("Support for the HTML 5 offline storage feature.") );
+ d->webkitUi.kcfg_offlineWebApplicationCacheEnabled->setToolTip(i18n("Support for the HTML 5 web application cache feature.") );
+ d->webkitUi.kcfg_localStorageDatabaseEnabled->setToolTip(i18n("Support for the HTML 5 local storage feature.") );
+}
+
+
// we need this function to UPDATE the config widget data..
void SettingsDialog::readConfig()
{
diff --git a/src/settings.h b/src/settings.h
index 3d781c20..1232ed64 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -40,6 +40,8 @@ public:
private:
Private* const d;
+
+ void setWebSettingsToolTips();
private slots:
void readConfig();
diff --git a/src/settings_general.ui b/src/settings_general.ui
index 3f07eaa5..972e2b30 100644
--- a/src/settings_general.ui
+++ b/src/settings_general.ui
@@ -97,35 +97,6 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_2">
- <property name="title">
- <string>Web Content</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QCheckBox" name="kcfg_enablePlugins">
- <property name="text">
- <string>Enable Plugins</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="kcfg_enableJavascript">
- <property name="text">
- <string>Enable Javascript</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/src/settings_webkit.ui b/src/settings_webkit.ui
new file mode 100644
index 00000000..0452ec8a
--- /dev/null
+++ b/src/settings_webkit.ui
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>webkit</class>
+ <widget class="QWidget" name="webkit">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>559</width>
+ <height>400</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>WebKit Settings</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="kcfg_autoLoadImages">
+ <property name="text">
+ <string>Auto Load Images</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" rowspan="7">
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QCheckBox" name="kcfg_developerExtrasEnabled">
+ <property name="text">
+ <string>Developer Extras</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="kcfg_javascriptEnabled">
+ <property name="text">
+ <string>Javascript support</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QCheckBox" name="kcfg_linksIncludedInFocusChain">
+ <property name="text">
+ <string>Links included in focus chain</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="kcfg_javaEnabled">
+ <property name="text">
+ <string>Java support</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QCheckBox" name="kcfg_zoomTextOnly">
+ <property name="text">
+ <string>Zoom Text Only</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="kcfg_pluginsEnabled">
+ <property name="text">
+ <string>Plugins</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2">
+ <widget class="QCheckBox" name="kcfg_printElementBackgrounds">
+ <property name="text">
+ <string>Print element Backgrounds</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QCheckBox" name="kcfg_privateBrowsingEnabled">
+ <property name="text">
+ <string>Private Browsing</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="5" column="0">
+ <widget class="QCheckBox" name="kcfg_javascriptCanOpenWindows">
+ <property name="text">
+ <string>Javascript can open 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">
+ <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_localStorageDatabaseEnabled">
+ <property name="text">
+ <string>Local storage database</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>159</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>