1 /* kcookiesmain.cpp - Cookies configuration
3 * First version of cookies configuration:
4 * Copyright (C) Waldo Bastian <bastian@kde.org>
6 * Copyright (C) David Faure <faure@kde.org>
11 #include "kcookiesmain.h"
14 #include <QtGui/QLayout>
15 #include <QtGui/QTabWidget>
16 #include <QtDBus/QtDBus>
20 #include <kapplication.h>
21 #include <kmessagebox.h>
23 #include <kgenericfactory.h>
26 #include "kcookiespolicies.h"
27 #include "kcookiesmanagement.h"
29 K_PLUGIN_FACTORY_DECLARATION(KioConfigFactory
)
31 KCookiesMain::KCookiesMain(QWidget
*parent
, const QVariantList
&)
32 : KCModule(KioConfigFactory::componentData(), parent
)
35 bool managerOK
= true;
37 QDBusInterface
kded("org.kde.kded", "/kded", "org.kde.kded");
38 QDBusReply
<bool> reply
= kded
.call("loadModule",QString( "kcookiejar" ) );
40 if( !reply
.isValid() )
43 kDebug(7103) << "kcm_kio: KDED could not load KCookiejar!";
44 KMessageBox::sorry(0, i18n("Unable to start the cookie handler service.\n"
45 "You will not be able to manage the cookies that "
46 "are stored on your computer."));
49 QVBoxLayout
*layout
= new QVBoxLayout(this);
50 tab
= new QTabWidget(this);
51 layout
->addWidget(tab
);
53 policies
= new KCookiesPolicies(componentData(), this);
54 tab
->addTab(policies
, i18n("&Policy"));
55 connect(policies
, SIGNAL(changed(bool)), SIGNAL(changed(bool)));
59 management
= new KCookiesManagement(componentData(), this);
60 tab
->addTab(management
, i18n("&Management"));
61 connect(management
, SIGNAL(changed(bool)), SIGNAL(changed(bool)));
65 KCookiesMain::~KCookiesMain()
69 void KCookiesMain::save()
76 void KCookiesMain::defaults()
78 KCModule
* module
= static_cast<KCModule
*>(tab
->currentWidget());
80 if ( module
== policies
)
83 management
->defaults();
86 QString
KCookiesMain::quickHelp() const
88 return i18n("<p><h1>Cookies</h1> Cookies contain information that Konqueror"
89 " (or other KDE applications using the HTTP protocol) stores on your"
90 " computer, initiated by a remote Internet server. This means that"
91 " a web server can store information about you and your browsing activities"
92 " on your machine for later use. You might consider this an invasion of"
93 " privacy.</p><p> However, cookies are useful in certain situations. For example, they"
94 " are often used by Internet shops, so you can 'put things into a shopping basket'."
95 " Some sites require you have a browser that supports cookies.</p><p>"
96 " Because most people want a compromise between privacy and the benefits cookies offer,"
97 " KDE offers you the ability to customize the way it handles cookies. So you might want"
98 " to set KDE's default policy to ask you whenever a server wants to set a cookie,"
99 " allowing you to decide. For your favorite shopping web sites that you trust, you might"
100 " want to set the policy to accept, then you can access the web sites without being prompted"
101 " every time KDE receives a cookie.</p>" );
104 #include "kcookiesmain.moc"