diff options
author | matgic78 <matgic78@gmail.com> | 2009-11-22 16:50:27 +0100 |
---|---|---|
committer | matgic78 <matgic78@gmail.com> | 2009-11-27 16:11:58 +0100 |
commit | eaa712d929127d252efd13522a6b76ea01c862a4 (patch) | |
tree | 41d7c1adf17d07296bb9e104fe0bb14fbb8f549a | |
parent | clicktoflash : step 2 make it work when there are more than one plugin in the... (diff) | |
download | rekonq-eaa712d929127d252efd13522a6b76ea01c862a4.tar.xz |
make clicktoflash optionnal
-rw-r--r-- | src/mainwindow.cpp | 6 | ||||
-rw-r--r-- | src/rekonq.kcfg | 4 | ||||
-rw-r--r-- | src/settings/settings_webkit.ui | 50 | ||||
-rw-r--r-- | src/webpluginfactory.cpp | 4 |
4 files changed, 42 insertions, 22 deletions
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 @@ <entry name="javaEnabled" type="Bool"> <default>true</default> </entry> - <entry name="pluginsEnabled" type="Bool"> - <default>true</default> + <entry name="pluginsEnabled" type="Int"> + <default>0</default> </entry> <entry name="javascriptCanOpenWindows" type="Bool"> <default>true</default> 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 @@ <rect> <x>0</x> <y>0</y> - <width>622</width> + <width>485</width> <height>360</height> </rect> </property> @@ -66,46 +66,58 @@ </property> </widget> </item> - <item row="3" column="0"> - <widget class="QCheckBox" name="kcfg_pluginsEnabled"> + <item row="3" column="3"> + <widget class="QCheckBox" name="kcfg_offlineStorageDatabaseEnabled"> <property name="text"> - <string>Plugins</string> + <string>Offline storage database</string> </property> </widget> </item> - <item row="3" column="3"> - <widget class="QCheckBox" name="kcfg_offlineStorageDatabaseEnabled"> + <item row="4" column="3"> + <widget class="QCheckBox" name="kcfg_offlineWebApplicationCacheEnabled"> <property name="text"> - <string>Offline storage database</string> + <string>Offline web application cache</string> </property> </widget> </item> - <item row="4" column="0" colspan="2"> - <widget class="QCheckBox" name="kcfg_javascriptCanOpenWindows"> + <item row="5" column="3"> + <widget class="QCheckBox" name="kcfg_localStorageDatabaseEnabled"> <property name="text"> - <string>JavaScript can open windows</string> + <string>Local storage database</string> </property> </widget> </item> - <item row="4" column="3"> - <widget class="QCheckBox" name="kcfg_offlineWebApplicationCacheEnabled"> + <item row="3" column="0"> + <widget class="QCheckBox" name="kcfg_javascriptCanOpenWindows"> <property name="text"> - <string>Offline web application cache</string> + <string>JavaScript can open windows</string> </property> </widget> </item> - <item row="5" column="0" colspan="2"> + <item row="4" column="0"> <widget class="QCheckBox" name="kcfg_javascriptCanAccessClipboard"> <property name="text"> <string>JavaScript can access clipboard</string> </property> </widget> </item> - <item row="5" column="3"> - <widget class="QCheckBox" name="kcfg_localStorageDatabaseEnabled"> - <property name="text"> - <string>Local storage database</string> - </property> + <item row="5" column="0"> + <widget class="QComboBox" name="kcfg_pluginsEnabled"> + <item> + <property name="text"> + <string>Autoload plugins</string> + </property> + </item> + <item> + <property name="text"> + <string>Manually load plugins</string> + </property> + </item> + <item> + <property name="text"> + <string>Never load plugins</string> + </property> + </item> </widget> </item> </layout> 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 { |