diff options
author | Jonas M. Gastal <jgastal@gmail.com> | 2009-08-19 22:03:56 -0300 |
---|---|---|
committer | Jonas M. Gastal <jgastal@gmail.com> | 2009-08-19 22:03:56 -0300 |
commit | f37aadbb2de64d9a8f302cf89c004eccb9834e93 (patch) | |
tree | 86d70a66a954c6e53455ded5ad799df435dc7f80 | |
parent | Some work on WebPage class.. (diff) | |
download | rekonq-f37aadbb2de64d9a8f302cf89c004eccb9834e93.tar.xz |
Implements the ability of the user to apply a user defined CSS to all web pages.
-rw-r--r-- | src/mainwindow.cpp | 5 | ||||
-rw-r--r-- | src/rekonq.kcfg | 3 | ||||
-rw-r--r-- | src/settings_webkit.ui | 47 |
3 files changed, 42 insertions, 13 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4ed885bc..29044745 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -447,6 +447,11 @@ void MainWindow::slotUpdateConfiguration() defaultSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, ReKonfig::offlineStorageDatabaseEnabled()); defaultSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, ReKonfig::offlineWebApplicationCacheEnabled()); defaultSettings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, ReKonfig::localStorageDatabaseEnabled()); + /** + * Applies user defined CSS to all open webpages. If there no longer is a + * user defined CSS removes it from all open webpages. + */ + defaultSettings->setUserStyleSheetUrl(ReKonfig::userCSS()); // ====== load Settings on main classes Application::networkAccessManager()->loadSettings(); diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index ec2b9a3b..443c9f8d 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -111,6 +111,9 @@ <entry name="localStorageDatabaseEnabled" type="Bool"> <default>true</default> </entry> + <entry name="userCSS" type="Url"> + <default></default> + </entry> </group> </kcfg> diff --git a/src/settings_webkit.ui b/src/settings_webkit.ui index a28ce915..dbdd7a34 100644 --- a/src/settings_webkit.ui +++ b/src/settings_webkit.ui @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>564</width> + <width>622</width> <height>360</height> </rect> </property> @@ -17,49 +17,49 @@ <string>WebKit Settings</string> </property> <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> + <item row="0" column="0" colspan="2"> <widget class="QCheckBox" name="kcfg_autoLoadImages"> <property name="text"> <string>Autoload images</string> </property> </widget> </item> - <item row="0" column="1" rowspan="6"> + <item row="0" column="2" rowspan="6"> <widget class="Line" name="line"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> </widget> </item> - <item row="0" column="2"> + <item row="0" column="3"> <widget class="QCheckBox" name="kcfg_linksIncludedInFocusChain"> <property name="text"> <string>Links included in focus chain</string> </property> </widget> </item> - <item row="1" column="0"> + <item row="1" column="0" colspan="2"> <widget class="QCheckBox" name="kcfg_javascriptEnabled"> <property name="text"> <string>JavaScript support</string> </property> </widget> </item> - <item row="1" column="2"> + <item row="1" column="3"> <widget class="QCheckBox" name="kcfg_zoomTextOnly"> <property name="text"> <string>Zoom text only</string> </property> </widget> </item> - <item row="2" column="0"> + <item row="2" column="0" colspan="2"> <widget class="QCheckBox" name="kcfg_javaEnabled"> <property name="text"> <string>Java support</string> </property> </widget> </item> - <item row="2" column="2"> + <item row="2" column="3"> <widget class="QCheckBox" name="kcfg_printElementBackgrounds"> <property name="text"> <string>Print element backgrounds</string> @@ -73,41 +73,55 @@ </property> </widget> </item> - <item row="3" column="2"> + <item row="3" column="3"> <widget class="QCheckBox" name="kcfg_offlineStorageDatabaseEnabled"> <property name="text"> <string>Offline storage database</string> </property> </widget> </item> - <item row="4" column="0"> + <item row="4" column="0" colspan="2"> <widget class="QCheckBox" name="kcfg_javascriptCanOpenWindows"> <property name="text"> <string>JavaScript can open windows</string> </property> </widget> </item> - <item row="4" column="2"> + <item row="4" column="3"> <widget class="QCheckBox" name="kcfg_offlineWebApplicationCacheEnabled"> <property name="text"> <string>Offline web application cache</string> </property> </widget> </item> - <item row="5" column="0"> + <item row="5" column="0" colspan="2"> <widget class="QCheckBox" name="kcfg_javascriptCanAccessClipboard"> <property name="text"> <string>JavaScript can access clipboard</string> </property> </widget> </item> - <item row="5" column="2"> + <item row="5" column="3"> <widget class="QCheckBox" name="kcfg_localStorageDatabaseEnabled"> <property name="text"> <string>Local storage database</string> </property> </widget> </item> + <item row="6" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>User CSS:</string> + </property> + </widget> + </item> + <item row="6" column="1" colspan="3"> + <widget class="KUrlRequester" name="kcfg_userCSS"> + <property name="filter"> + <string>*.css</string> + </property> + </widget> + </item> </layout> </widget> </item> @@ -126,6 +140,13 @@ </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>KUrlRequester</class> + <extends>QFrame</extends> + <header>kurlrequester.h</header> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> |