From 770f38f4aced1656fdee3c6d0dcf8ddfb9493c2b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 20 Nov 2009 14:59:55 +0100 Subject: AdBlock, first file (and first UI. Probably not last :) --- src/adblock/CMakeLists.txt | 18 +++++++ src/adblock/kcmwebkitadblock.cpp | 67 +++++++++++++++++++++++++ src/adblock/kcmwebkitadblock.h | 52 +++++++++++++++++++ src/adblock/webkitAdblock.desktop | 14 ++++++ src/adblock/webkitadblock.ui | 102 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 253 insertions(+) create mode 100644 src/adblock/CMakeLists.txt create mode 100644 src/adblock/kcmwebkitadblock.cpp create mode 100644 src/adblock/kcmwebkitadblock.h create mode 100644 src/adblock/webkitAdblock.desktop create mode 100644 src/adblock/webkitadblock.ui (limited to 'src/adblock') diff --git a/src/adblock/CMakeLists.txt b/src/adblock/CMakeLists.txt new file mode 100644 index 00000000..8777bc50 --- /dev/null +++ b/src/adblock/CMakeLists.txt @@ -0,0 +1,18 @@ + +ADD_DEFINITIONS ( ${KDE4_DEFINITIONS} ) + +SET(kcm_webkitadblock_SRCS + kcmwebkitadblock.cpp +) + +kde4_add_ui_files(kcm_webkitadblock_SRCS + webkitadblock.ui +) + +kde4_add_plugin(kcm_webkitadblock ${kcm_webkitadblock_SRCS}) + +target_link_libraries(kcm_webkitadblock ${KDE4_KDEUI_LIBS} ) + +install(TARGETS kcm_webkitadblock DESTINATION ${PLUGIN_INSTALL_DIR} ) + +install( FILES webkitAdblock.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) diff --git a/src/adblock/kcmwebkitadblock.cpp b/src/adblock/kcmwebkitadblock.cpp new file mode 100644 index 00000000..28487b74 --- /dev/null +++ b/src/adblock/kcmwebkitadblock.cpp @@ -0,0 +1,67 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2009 by Andrea Diamantini +* +* +* 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 . +* +* ============================================================ */ + + +// Self Includes +#include "kcmwebkitadblock.h" +#include "kcmwebkitadblock.moc" + +// KDE Includes +#include +#include + + +K_PLUGIN_FACTORY(RekonqPluginFactory, + registerPlugin("webkitAdblock"); + ) + +K_EXPORT_PLUGIN(RekonqPluginFactory("kcmrekonqfactory")) + + +KCMWebkitAdblock::KCMWebkitAdblock(QWidget *parent, const QVariantList &args) + : KCModule(KGlobal::mainComponent(), parent, args) +{ + setupUi(this); +} + + +KCMWebkitAdblock::~KCMWebkitAdblock() +{ +} + + +void KCMWebkitAdblock::defaults() +{ +} + + +void KCMWebkitAdblock::load() +{ +} + + +void KCMWebkitAdblock::save() +{ +} diff --git a/src/adblock/kcmwebkitadblock.h b/src/adblock/kcmwebkitadblock.h new file mode 100644 index 00000000..01f0e653 --- /dev/null +++ b/src/adblock/kcmwebkitadblock.h @@ -0,0 +1,52 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2009 by Andrea Diamantini +* +* +* 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 . +* +* ============================================================ */ + + +#ifndef KCM_WEBKIT_ADBLOCK_H +#define KCM_WEBKIT_ADBLOCK_H + + +// UI Includes +#include "ui_webkitadblock.h" + +// KDE Includes +#include + + +class KCMWebkitAdblock : public KCModule, private Ui::WebkitAdblock +{ +Q_OBJECT + +public: + KCMWebkitAdblock(QWidget *parent, const QVariantList &args); + + ~KCMWebkitAdblock(); + + void defaults(); + void load(); + void save(); +}; + +#endif diff --git a/src/adblock/webkitAdblock.desktop b/src/adblock/webkitAdblock.desktop new file mode 100644 index 00000000..22195b82 --- /dev/null +++ b/src/adblock/webkitAdblock.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Type=Service +X-KDE-ServiceTypes=KCModule + +Icon=preferences-web-browser-adblock +Exec=kcmshell4 webkitAdblock + +X-KDE-Library=kcm_webkitadblock +X-KDE-PluginKeyword=webkitAdblock +X-KDE-ParentApp=kcontrol + +Name=Webkit AdBlock Settings + +Categories=Qt;KDE;X-KDE-settings-webbrowsing; diff --git a/src/adblock/webkitadblock.ui b/src/adblock/webkitadblock.ui new file mode 100644 index 00000000..8d7ac25f --- /dev/null +++ b/src/adblock/webkitadblock.ui @@ -0,0 +1,102 @@ + + + WebkitAdblock + + + + 0 + 0 + 543 + 491 + + + + Form + + + + + + Enable adblock + + + true + + + + + + + adblock settings + + + + + + + + + <qt>Filter expression (e.g. <tt>http://www.example.com/*</tt>, <a href="filterhelp">more info</a>): + + + + + + + + + + + + Add + + + + + + + Remove + + + + + + + Search + + + + + + + Import + + + + + + + + + + + + + KListWidget + QListWidget +
klistwidget.h
+
+ + KLineEdit + QLineEdit +
klineedit.h
+
+ + KListWidgetSearchLine + KLineEdit +
klistwidgetsearchline.h
+
+
+ + +
-- cgit v1.2.1