From eaa712d929127d252efd13522a6b76ea01c862a4 Mon Sep 17 00:00:00 2001 From: matgic78 Date: Sun, 22 Nov 2009 16:50:27 +0100 Subject: make clicktoflash optionnal --- src/mainwindow.cpp | 6 ++++- src/rekonq.kcfg | 4 ++-- src/settings/settings_webkit.ui | 50 +++++++++++++++++++++++++---------------- src/webpluginfactory.cpp | 4 ++++ 4 files changed, 42 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 628743ee..8b43f6ae 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -514,12 +514,16 @@ void MainWindow::updateConfiguration() 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::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()); + + if(ReKonfig::pluginsEnabled() == 2) + defaultSettings->setAttribute(QWebSettings::PluginsEnabled, false); + else + defaultSettings->setAttribute(QWebSettings::PluginsEnabled, true); // ===== HTML 5 features WebKit support ====== defaultSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, ReKonfig::offlineStorageDatabaseEnabled()); diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index cc9c4317..0875342c 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -100,8 +100,8 @@ true - - true + + 0 true diff --git a/src/settings/settings_webkit.ui b/src/settings/settings_webkit.ui index 129bcf03..c59dc9c3 100644 --- a/src/settings/settings_webkit.ui +++ b/src/settings/settings_webkit.ui @@ -6,7 +6,7 @@ 0 0 - 622 + 485 360 @@ -66,46 +66,58 @@ - - + + - Plugins + Offline storage database - - + + - Offline storage database + Offline web application cache - - + + - JavaScript can open windows + Local storage database - - + + - Offline web application cache + JavaScript can open windows - + JavaScript can access clipboard - - - - Local storage database - + + + + + Autoload plugins + + + + + Manually load plugins + + + + + Never load plugins + + diff --git a/src/webpluginfactory.cpp b/src/webpluginfactory.cpp index 1478339b..0d333748 100644 --- a/src/webpluginfactory.cpp +++ b/src/webpluginfactory.cpp @@ -29,6 +29,7 @@ #include "webpluginfactory.moc" // Local Includes +#include "rekonq.h" #include "application.h" #include "mainwindow.h" #include "previewimage.h" @@ -85,6 +86,9 @@ QObject *WebPluginFactory::create(const QString &mimeType, return new PreviewImage(url, title, number, isFavorite); } + if(ReKonfig::pluginsEnabled() == 0) + return 0; + if(mimeType == QString("application/x-shockwave-flash") && !loadClickToFlash) // the button wasn't clicked { -- cgit v1.2.1