From 074a549f33e199175a4c080c88ed3a9b6d91d1c0 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 7 Apr 2009 20:20:15 +0200 Subject: Added settings webkit section, with rekonq personal settings. --- src/CMakeLists.txt | 1 + src/mainwindow.cpp | 28 +++++++-- src/rekonq.kcfg | 52 +++++++++++++++-- src/settings.cpp | 29 ++++++++++ src/settings.h | 2 + src/settings_general.ui | 29 ---------- src/settings_webkit.ui | 148 ++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 248 insertions(+), 41 deletions(-) create mode 100644 src/settings_webkit.ui (limited to 'src') 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 @@ true - - true - - - true - @@ -73,4 +67,50 @@ + + + + true + + + true + + + true + + + true + + + false + + + true + + + false + + + false + + + true + + + false + + + true + + + true + + + true + + + true + + + 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 @@ -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 @@ -96,35 +96,6 @@ - - - - Web Content - - - - - - Enable Plugins - - - true - - - - - - - Enable Javascript - - - true - - - - - - 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 @@ + + + webkit + + + + 0 + 0 + 559 + 400 + + + + Form + + + + + + WebKit Settings + + + + + + Auto Load Images + + + + + + + Qt::Vertical + + + + + + + Developer Extras + + + + + + + Javascript support + + + + + + + Links included in focus chain + + + + + + + Java support + + + + + + + Zoom Text Only + + + + + + + Plugins + + + + + + + Print element Backgrounds + + + + + + + Private Browsing + + + + + + + Offline storage Database + + + + + + + Javascript can open windows + + + + + + + Offline Web Application Cache + + + + + + + Javascript can access clipboard + + + + + + + Local storage database + + + + + + + + + + Qt::Vertical + + + + 20 + 159 + + + + + + + + + -- cgit v1.2.1