From 9fff1383205279a747c09bf07af84cfa37dd3403 Mon Sep 17 00:00:00 2001
From: Andrea Diamantini <adjam7@gmail.com>
Date: Wed, 11 Nov 2009 15:32:59 +0100
Subject: cleaning home :) In Italy we say "Pulizie di Pasqua". Just some
 changes to reorganize things better

---
 src/settings/settings_fonts.ui   |  97 ++++++++++++++++
 src/settings/settings_general.ui | 244 +++++++++++++++++++++++++++++++++++++++
 src/settings/settings_tabs.ui    |  81 +++++++++++++
 src/settings/settings_webkit.ui  | 161 ++++++++++++++++++++++++++
 src/settings/settingsdialog.cpp  | 235 +++++++++++++++++++++++++++++++++++++
 src/settings/settingsdialog.h    |  62 ++++++++++
 6 files changed, 880 insertions(+)
 create mode 100644 src/settings/settings_fonts.ui
 create mode 100644 src/settings/settings_general.ui
 create mode 100644 src/settings/settings_tabs.ui
 create mode 100644 src/settings/settings_webkit.ui
 create mode 100644 src/settings/settingsdialog.cpp
 create mode 100644 src/settings/settingsdialog.h

(limited to 'src/settings')

diff --git a/src/settings/settings_fonts.ui b/src/settings/settings_fonts.ui
new file mode 100644
index 00000000..98efce16
--- /dev/null
+++ b/src/settings/settings_fonts.ui
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>fonts</class>
+ <widget class="QWidget" name="fonts">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>414</width>
+    <height>298</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Appearance</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_3">
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Fonts</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <layout class="QGridLayout" name="gridLayout">
+        <item row="0" column="0">
+         <widget class="QLabel" name="label">
+          <property name="text">
+           <string>Standard font:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0">
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>Fixed font:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1">
+         <widget class="KFontComboBox" name="kcfg_fixedFont"/>
+        </item>
+        <item row="0" column="1">
+         <widget class="KFontComboBox" name="kcfg_standardFont"/>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Dimension</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout">
+        <item>
+         <widget class="QLabel" name="label_3">
+          <property name="text">
+           <string>Font size:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="kcfg_fontSize"/>
+        </item>
+       </layout>
+      </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>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KFontComboBox</class>
+   <extends>KComboBox</extends>
+   <header>kfontcombobox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/settings/settings_general.ui b/src/settings/settings_general.ui
new file mode 100644
index 00000000..57d293e6
--- /dev/null
+++ b/src/settings/settings_general.ui
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>general</class>
+ <widget class="QWidget" name="general">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>751</width>
+    <height>523</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>General</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Startup</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
+      <item>
+       <widget class="QLabel" name="label">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>120</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="baseSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="layoutDirection">
+         <enum>Qt::LeftToRight</enum>
+        </property>
+        <property name="text">
+         <string>When starting rekonq:</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="KComboBox" name="kcfg_startupBehaviour">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <item>
+         <property name="text">
+          <string>Open the Home Page</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Open the New Tab Page</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Restore the Last Opened Tabs</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Home Page</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label_2">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>120</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="baseSize">
+         <size>
+          <width>120</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>Home page URL:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="KLineEdit" name="kcfg_homePage">
+        <property name="enabled">
+         <bool>true</bool>
+        </property>
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <item>
+         <widget class="QPushButton" name="setHomeToCurrentPageButton">
+          <property name="text">
+           <string>Set to Current Page</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_3">
+     <property name="title">
+      <string>New Tabs Behaviour</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <widget class="QLabel" name="label_4">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>120</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="baseSize">
+         <size>
+          <width>120</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>New tab opens:</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="KComboBox" name="kcfg_newTabsBehaviour">
+        <property name="enabled">
+         <bool>true</bool>
+        </property>
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <item>
+         <property name="text">
+          <string>New Tab Page</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Blank Page</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string comment="@item:inlistbox">Home Page</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Expanding</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KComboBox</class>
+   <extends>QComboBox</extends>
+   <header>kcombobox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/settings/settings_tabs.ui b/src/settings/settings_tabs.ui
new file mode 100644
index 00000000..ba903ff4
--- /dev/null
+++ b/src/settings/settings_tabs.ui
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>tabs</class>
+ <widget class="QWidget" name="tabs">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>456</width>
+    <height>329</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Tabs</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QGroupBox" name="groupBox_4">
+     <property name="title">
+      <string>Tabbed Browsing</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_4">
+      <item>
+       <widget class="QCheckBox" name="kcfg_openTabNoWindow">
+        <property name="text">
+         <string>Open links in new tab instead of in new window</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="kcfg_alwaysShowTabBar">
+        <property name="text">
+         <string>Always show tab bar</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="kcfg_openTabsBack">
+        <property name="text">
+         <string>Open new tabs in the background</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="kcfg_openTabsNearCurrent">
+        <property name="text">
+         <string>Open new tabs after currently active one</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="kcfg_alwaysShowTabPreviews">
+        <property name="text">
+         <string>Show preview when hovering tab</string>
+        </property>
+        <property name="checked">
+         <bool>false</bool>
+        </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>142</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/settings/settings_webkit.ui b/src/settings/settings_webkit.ui
new file mode 100644
index 00000000..129bcf03
--- /dev/null
+++ b/src/settings/settings_webkit.ui
@@ -0,0 +1,161 @@
+<?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>622</width>
+    <height>360</height>
+   </rect>
+  </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" colspan="2">
+       <widget class="QCheckBox" name="kcfg_autoLoadImages">
+        <property name="text">
+         <string>Autoload images</string>
+        </property>
+       </widget>
+      </item>
+      <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="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" colspan="2">
+       <widget class="QCheckBox" name="kcfg_javascriptEnabled">
+        <property name="text">
+         <string>JavaScript support</string>
+        </property>
+       </widget>
+      </item>
+      <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" colspan="2">
+       <widget class="QCheckBox" name="kcfg_javaEnabled">
+        <property name="text">
+         <string>Java support</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="3">
+       <widget class="QCheckBox" name="kcfg_printElementBackgrounds">
+        <property name="text">
+         <string>Print element backgrounds</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="3">
+       <widget class="QCheckBox" name="kcfg_offlineStorageDatabaseEnabled">
+        <property name="text">
+         <string>Offline storage database</string>
+        </property>
+       </widget>
+      </item>
+      <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="3">
+       <widget class="QCheckBox" name="kcfg_offlineWebApplicationCacheEnabled">
+        <property name="text">
+         <string>Offline web application cache</string>
+        </property>
+       </widget>
+      </item>
+      <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="3">
+       <widget class="QCheckBox" name="kcfg_localStorageDatabaseEnabled">
+        <property name="text">
+         <string>Local storage database</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>User Style Sheet</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <widget class="QLabel" name="label">
+        <property name="text">
+         <string>User CSS path:</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="KUrlRequester" name="kcfg_userCSS">
+        <property name="filter">
+         <string>*.css</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>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KUrlRequester</class>
+   <extends>QFrame</extends>
+   <header>kurlrequester.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/settings/settingsdialog.cpp b/src/settings/settingsdialog.cpp
new file mode 100644
index 00000000..1db38b96
--- /dev/null
+++ b/src/settings/settingsdialog.cpp
@@ -0,0 +1,235 @@
+/* ============================================================
+*
+* This file is a part of the rekonq project
+*
+* Copyright (C) 2007-2008 Trolltech ASA. All rights reserved
+* Copyright (C) 2008-2009 by Andrea Diamantini <adjam7 at gmail dot com>
+* Copyright (C) 2009 by Lionel Chauvin <megabigbug@yahoo.fr>
+*
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License as
+* published by the Free Software Foundation; either version 2 of
+* the License or (at your option) version 3 or any later version
+* accepted by the membership of KDE e.V. (or its successor approved
+* by the membership of KDE e.V.), which shall act as a proxy 
+* defined in Section 14 of version 3 of the license.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+* ============================================================ */
+
+
+// Self Includes
+#include "settingsdialog.h"
+#include "settingsdialog.moc"
+
+// Auto Includes
+#include "rekonq.h"
+
+// Local Includes
+#include "application.h"
+#include "mainwindow.h"
+#include "webview.h"
+
+//Ui Includes
+#include "ui_settings_general.h"
+#include "ui_settings_tabs.h"
+#include "ui_settings_fonts.h"
+#include "ui_settings_webkit.h"
+
+// KDE Includes
+#include <KConfig>
+#include <KStandardDirs>
+#include <KPageWidgetItem>
+#include <KShortcutsEditor>
+#include <KCModuleInfo>
+#include <KCModuleProxy>
+
+// Qt Includes
+#include <QtCore/QPointer>
+#include <QtGui/QWidget>
+
+
+class Private
+{
+private:
+    
+    Ui::general generalUi;
+    Ui::tabs tabsUi;
+    Ui::fonts fontsUi;
+    Ui::webkit webkitUi;
+    
+    KCModuleProxy *proxyModule;
+    KCModuleProxy *ebrowsingModule;
+    KCModuleProxy *cookiesModule;
+    KCModuleProxy *cacheModule;
+    KShortcutsEditor *shortcutsEditor;
+    
+    Private(SettingsDialog *parent);
+
+    friend class SettingsDialog;
+};
+
+
+Private::Private(SettingsDialog *parent)
+{
+    QWidget *widget;
+    KPageWidgetItem *pageItem;
+
+    widget = new QWidget;
+    generalUi.setupUi(widget);
+    widget->layout()->setMargin(0);
+    pageItem = parent->addPage(widget , i18n("General"));
+    pageItem->setIcon(KIcon("rekonq"));
+
+    widget = new QWidget;
+    tabsUi.setupUi(widget);
+    widget->layout()->setMargin(0);
+    pageItem = parent->addPage(widget , i18n("Tabs"));
+    pageItem->setIcon(KIcon("tab-duplicate"));
+
+    widget = new QWidget;
+    fontsUi.setupUi(widget);
+    widget->layout()->setMargin(0);
+    pageItem = parent->addPage(widget , i18n("Fonts"));
+    pageItem->setIcon(KIcon("preferences-desktop-font"));
+
+    KCModuleInfo cookiesInfo("cookies.desktop");
+    cookiesModule = new KCModuleProxy(cookiesInfo,parent);
+    pageItem = parent->addPage(cookiesModule, i18n(cookiesInfo.moduleName().toLocal8Bit()));
+    pageItem->setIcon(KIcon(cookiesInfo.icon()));
+
+    KCModuleInfo proxyInfo("proxy.desktop");
+    proxyModule = new KCModuleProxy(proxyInfo,parent);
+    pageItem = parent->addPage(proxyModule, i18n(proxyInfo.moduleName().toLocal8Bit()));
+    pageItem->setIcon(KIcon(proxyInfo.icon()));
+
+    KCModuleInfo cacheInfo("cache.desktop");
+    cacheModule = new KCModuleProxy(cacheInfo,parent);
+    pageItem = parent->addPage(cacheModule, i18n(cacheInfo.moduleName().toLocal8Bit()));
+    pageItem->setIcon(KIcon(cacheInfo.icon()));
+        
+    widget = new QWidget;
+    webkitUi.setupUi(widget);
+    widget->layout()->setMargin(0);
+    pageItem = parent->addPage(widget , i18n("WebKit"));
+    QString webkitIconPath = KStandardDirs::locate("appdata", "pics/webkit-icon.png");
+    KIcon webkitIcon = KIcon(QIcon(webkitIconPath));
+    pageItem->setIcon(webkitIcon);
+
+    shortcutsEditor = new KShortcutsEditor(Application::instance()->mainWindow()->actionCollection(), parent);
+    pageItem = parent->addPage(shortcutsEditor , i18n("Shortcuts"));
+    pageItem->setIcon(KIcon("configure-shortcuts"));
+
+    KCModuleInfo ebrowsingInfo("ebrowsing.desktop");
+    ebrowsingModule = new KCModuleProxy(ebrowsingInfo,parent);
+    pageItem = parent->addPage(ebrowsingModule, i18n(ebrowsingInfo.moduleName().toLocal8Bit()));
+    pageItem->setIcon(KIcon(ebrowsingInfo.icon()));
+
+    parent->setMinimumSize(700,500);
+}
+
+
+// -----------------------------------------------------------------------------------------------------
+
+
+SettingsDialog::SettingsDialog(QWidget *parent)
+        : KConfigDialog(parent, "rekonfig", ReKonfig::self())
+        , d(new Private(this))
+{
+    setFaceType(KPageDialog::Tree);
+    showButtonSeparator(true);
+
+    setWindowTitle(i18n("rekonfig..."));
+    setModal(true);
+
+    readConfig();
+
+
+    connect(d->generalUi.setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT(setHomeToCurrentPage()));
+    
+    connect(d->ebrowsingModule, SIGNAL(changed(bool)), this, SLOT(updateButtons()));
+    connect(d->cookiesModule, SIGNAL(changed(bool)), this, SLOT(updateButtons()));
+    connect(d->proxyModule, SIGNAL(changed(bool)), this, SLOT(updateButtons()));
+    connect(d->cacheModule, SIGNAL(changed(bool)), this, SLOT(updateButtons()));
+
+    connect(d->shortcutsEditor, SIGNAL(keyChange()), this, SLOT(updateButtons()));
+        
+    connect(this, SIGNAL(applyClicked()), this, SLOT(saveSettings()));
+    connect(this, SIGNAL(okClicked()), this, SLOT(saveSettings()));
+        
+    setWebSettingsToolTips();
+}
+
+
+SettingsDialog::~SettingsDialog()
+{
+    delete d;
+}
+
+
+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 execution of JavaScript programs."));
+    d->webkitUi.kcfg_javaEnabled->setToolTip(i18n("Enables support for Java applets."));
+    d->webkitUi.kcfg_pluginsEnabled->setToolTip(i18n("Enables support for plugins in web pages."));
+    d->webkitUi.kcfg_javascriptCanOpenWindows->setToolTip(i18n("If enabled, JavaScript programs are allowed to open new windows."));
+    d->webkitUi.kcfg_javascriptCanAccessClipboard->setToolTip(i18n("If enabled, JavaScript programs are allowed to read from and to write to the clipboard."));
+    d->webkitUi.kcfg_linksIncludedInFocusChain->setToolTip(i18n("If enabled, hyperlinks are included in the keyboard focus chain."));
+    d->webkitUi.kcfg_zoomTextOnly->setToolTip(i18n("If enabled, the zoom factor on a frame is only applied to the text."));
+    d->webkitUi.kcfg_printElementBackgrounds->setToolTip(i18n("If enabled, background colors and images are also drawn when the page is printed."));
+    d->webkitUi.kcfg_offlineStorageDatabaseEnabled->setToolTip(i18n("Enables support for the HTML 5 offline storage feature."));
+    d->webkitUi.kcfg_offlineWebApplicationCacheEnabled->setToolTip(i18n("Enables support for the HTML 5 web application cache feature."));
+    d->webkitUi.kcfg_localStorageDatabaseEnabled->setToolTip(i18n("Enables support for the HTML 5 local storage feature."));
+}
+
+
+// we need this function to UPDATE the config widget data..
+void SettingsDialog::readConfig()
+{
+    // ======= Fonts
+    d->fontsUi.kcfg_fixedFont->setOnlyFixed(true);
+}
+
+
+// we need this function to SAVE settings in rc file..
+void SettingsDialog::saveSettings()
+{
+    ReKonfig::self()->writeConfig();
+    d->ebrowsingModule->save();
+    d->cookiesModule->save();
+    d->proxyModule->save();
+    d->cacheModule->save();
+    d->shortcutsEditor->save();
+}
+
+
+bool SettingsDialog::hasChanged()
+{
+    return KConfigDialog::hasChanged() 
+            || d->ebrowsingModule->changed()            
+            || d->cookiesModule->changed()
+            || d->proxyModule->changed()
+            || d->cacheModule->changed()
+            || d->shortcutsEditor->isModified();
+            ;
+}
+
+
+void SettingsDialog::setHomeToCurrentPage()
+{
+    MainWindow *mw = static_cast<MainWindow*>(parent());
+    WebView *webView = mw->currentTab();
+    if (webView)
+    {
+        d->generalUi.kcfg_homePage->setText(webView->url().prettyUrl());
+    }
+}
diff --git a/src/settings/settingsdialog.h b/src/settings/settingsdialog.h
new file mode 100644
index 00000000..360fe246
--- /dev/null
+++ b/src/settings/settingsdialog.h
@@ -0,0 +1,62 @@
+/* ============================================================
+*
+* This file is a part of the rekonq project
+*
+* Copyright (C) 2007-2008 Trolltech ASA. All rights reserved
+* Copyright (C) 2008-2009 by Andrea Diamantini <adjam7 at gmail dot com>
+* Copyright (C) 2009 by Lionel Chauvin <megabigbug@yahoo.fr>
+*
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License as
+* published by the Free Software Foundation; either version 2 of
+* the License or (at your option) version 3 or any later version
+* accepted by the membership of KDE e.V. (or its successor approved
+* by the membership of KDE e.V.), which shall act as a proxy 
+* defined in Section 14 of version 3 of the license.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+* ============================================================ */
+
+
+#ifndef SETTINGS_DIALOG_H
+#define SETTINGS_DIALOG_H
+
+
+// KDE Includes
+#include <KConfigDialog>
+
+// Forward Declarations
+class QWidget;
+class Private;
+
+
+class SettingsDialog : public KConfigDialog
+{
+    Q_OBJECT
+
+public:
+    SettingsDialog(QWidget *parent = 0);
+    ~SettingsDialog();
+    
+    virtual bool hasChanged();
+
+private:
+    Private* const d;
+    void setWebSettingsToolTips();
+
+private slots:
+    void readConfig();
+    void saveSettings();
+
+    void setHomeToCurrentPage();
+};
+
+#endif // SETTINGS_DIALOG_H
-- 
cgit v1.2.1