summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index ec5094c2..4a6c50b8 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -42,7 +42,6 @@
//Ui Includes
#include "ui_settings_general.h"
#include "ui_settings_fonts.h"
-#include "ui_settings_proxy.h"
#include "ui_settings_webkit.h"
// KDE Includes
@@ -63,10 +62,11 @@ class Private
private:
Ui::general generalUi;
Ui::fonts fontsUi;
- Ui::proxy proxyUi;
Ui::webkit webkitUi;
+ KCModuleProxy *proxyModule;
KCModuleProxy *ebrowsingModule;
KCModuleProxy *cookiesModule;
+ KShortcutsEditor *shortcutsEditor;
Private(SettingsDialog *parent);
@@ -84,7 +84,7 @@ Private::Private(SettingsDialog *parent)
widget->layout()->setMargin(0);
pageItem = parent->addPage(widget , i18n("General"));
pageItem->setIcon(KIcon("rekonq"));
-
+
widget = new QWidget;
fontsUi.setupUi(widget);
widget->layout()->setMargin(0);
@@ -96,12 +96,11 @@ Private::Private(SettingsDialog *parent)
pageItem = parent->addPage(cookiesModule, i18n(cookiesInfo.moduleName().toLocal8Bit()));
pageItem->setIcon(KIcon(cookiesInfo.icon()));
- widget = new QWidget;
- proxyUi.setupUi(widget);
- widget->layout()->setMargin(0);
- pageItem = parent->addPage(widget , i18n("Proxy"));
- pageItem->setIcon(KIcon("preferences-system-network"));
-
+ KCModuleInfo proxyInfo("proxy.desktop");
+ proxyModule = new KCModuleProxy(proxyInfo,parent);
+ pageItem = parent->addPage(proxyModule, i18n(proxyInfo.moduleName().toLocal8Bit()));
+ pageItem->setIcon(KIcon(proxyInfo.icon()));
+
widget = new QWidget;
webkitUi.setupUi(widget);
widget->layout()->setMargin(0);
@@ -110,8 +109,8 @@ Private::Private(SettingsDialog *parent)
KIcon webkitIcon = KIcon(QIcon(webkitIconPath));
pageItem->setIcon(webkitIcon);
- widget = new KShortcutsEditor(Application::instance()->mainWindow()->actionCollection(),parent);
- pageItem = parent->addPage(widget , i18n("Shortcuts"));
+ shortcutsEditor = new KShortcutsEditor(Application::instance()->mainWindow()->actionCollection(),parent);
+ pageItem = parent->addPage(shortcutsEditor , i18n("Shortcuts"));
pageItem->setIcon(KIcon("configure-shortcuts"));
KCModuleInfo ebrowsingInfo("ebrowsing.desktop");
@@ -143,7 +142,9 @@ SettingsDialog::SettingsDialog(QWidget *parent)
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->shortcutsEditor, SIGNAL(keyChange()), this, SLOT(updateButtons()));
+
connect(this, SIGNAL(applyClicked()), this, SLOT(saveSettings()));
connect(this, SIGNAL(okClicked()), this, SLOT(saveSettings()));
@@ -185,11 +186,6 @@ void SettingsDialog::readConfig()
// ======= Fonts
d->fontsUi.kcfg_fixedFont->setOnlyFixed(true);
-
- // ======= Proxy
- bool proxyEnabled = ReKonfig::isProxyEnabled();
- d->proxyUi.groupBox->setEnabled(proxyEnabled);
- connect(d->proxyUi.kcfg_isProxyEnabled, SIGNAL(clicked(bool)), d->proxyUi.groupBox, SLOT(setEnabled(bool)));
}
@@ -201,6 +197,8 @@ void SettingsDialog::saveSettings()
ReKonfig::self()->writeConfig();
d->ebrowsingModule->save();
d->cookiesModule->save();
+ d->proxyModule->save();
+ d->shortcutsEditor->save();
}
@@ -209,6 +207,7 @@ bool SettingsDialog::hasChanged()
return KConfigDialog::hasChanged()
|| d->ebrowsingModule->changed()
|| d->cookiesModule->changed()
+ || d->proxyModule->changed()
;
}