summaryrefslogtreecommitdiff
path: root/src/settings/settingsdialog.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-03-13 23:24:45 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-03-13 23:24:45 +0100
commit6faa12680a0d7d2f13c2862628325ab65521004b (patch)
treed749f40b304feb6c1d007dcce46c9c8e9d17932d /src/settings/settingsdialog.cpp
parentUpdating forgotten files (diff)
downloadrekonq-6faa12680a0d7d2f13c2862628325ab65521004b.tar.xz
Implemented automatic adblock update.
This (squashed) commit adds this new feature in rekonq, letting people to simply "forgot" adblock and let rekonq do everything for it I added: - a new (rekonq) adblock widget - an asyncronous method to update rules from the net every TOT days - a better AdBlockManager management. What it is actually missing is the adp protocol support to add new subscriptions to adblock. This will come the next week. For now this part seems stable and needs just testing :)
Diffstat (limited to 'src/settings/settingsdialog.cpp')
-rw-r--r--src/settings/settingsdialog.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/settings/settingsdialog.cpp b/src/settings/settingsdialog.cpp
index e7a9d1e8..fa1e8891 100644
--- a/src/settings/settingsdialog.cpp
+++ b/src/settings/settingsdialog.cpp
@@ -36,12 +36,14 @@
#include "application.h"
#include "mainwindow.h"
#include "webtab.h"
+#include "adblockwidget.h"
//Ui Includes
#include "ui_settings_general.h"
#include "ui_settings_tabs.h"
#include "ui_settings_fonts.h"
#include "ui_settings_webkit.h"
+#include "ui_settings_adblock.h"
// KDE Includes
#include <KConfig>
@@ -63,12 +65,14 @@ private:
Ui::tabs tabsUi;
Ui::fonts fontsUi;
Ui::webkit webkitUi;
+
+ AdBlockWidget *adBlockWidg;
KCModuleProxy *proxyModule;
KCModuleProxy *ebrowsingModule;
KCModuleProxy *cookiesModule;
KCModuleProxy *cacheModule;
- KCModuleProxy *adblockModule;
+
KShortcutsEditor *shortcutsEditor;
Private(SettingsDialog *parent);
@@ -123,10 +127,10 @@ Private::Private(SettingsDialog *parent)
KIcon webkitIcon = KIcon(QIcon(webkitIconPath));
pageItem->setIcon(webkitIcon);
- KCModuleInfo adblockInfo("khtml_filter.desktop");
- adblockModule = new KCModuleProxy(adblockInfo,parent);
- pageItem = parent->addPage(adblockModule, i18n(adblockInfo.moduleName().toLocal8Bit()));
- pageItem->setIcon(KIcon(adblockInfo.icon()));
+ adBlockWidg = new AdBlockWidget(parent);
+ adBlockWidg->layout()->setMargin(0);
+ pageItem = parent->addPage(adBlockWidg , i18n("Ad Block"));
+ pageItem->setIcon( KIcon("preferences-web-browser-adblock") );
shortcutsEditor = new KShortcutsEditor(Application::instance()->mainWindow()->actionCollection(), parent);
pageItem = parent->addPage(shortcutsEditor , i18n("Shortcuts"));
@@ -137,7 +141,7 @@ Private::Private(SettingsDialog *parent)
pageItem = parent->addPage(ebrowsingModule, i18n(ebrowsingInfo.moduleName().toLocal8Bit()));
pageItem->setIcon(KIcon(ebrowsingInfo.icon()));
- // WARNING remember wheh changing here that the smaller netbooks
+ // WARNING remember wheh changing here that the smallest netbooks
// have a 1024x576 resolution. So DON'T bother that limits!!
parent->setMinimumSize(700,525);
}
@@ -162,8 +166,7 @@ SettingsDialog::SettingsDialog(QWidget *parent)
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->adblockModule, SIGNAL(changed(bool)), this, SLOT(updateButtons()));
-
+
connect(d->shortcutsEditor, SIGNAL(keyChange()), this, SLOT(updateButtons()));
connect(this, SIGNAL(applyClicked()), this, SLOT(saveSettings()));
@@ -213,7 +216,7 @@ void SettingsDialog::saveSettings()
d->proxyModule->save();
d->cacheModule->save();
d->shortcutsEditor->save();
- d->adblockModule->save();
+ d->adBlockWidg->save();
}
@@ -224,7 +227,6 @@ bool SettingsDialog::hasChanged()
|| d->cookiesModule->changed()
|| d->proxyModule->changed()
|| d->cacheModule->changed()
- || d->adblockModule->changed()
|| d->shortcutsEditor->isModified();
;
}