Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / konqueror / settings / kio / kcookiesmain.cpp
blob8698d98fe15a5ea24e657f1574be2b3e06f92781
1 /* kcookiesmain.cpp - Cookies configuration
3 * First version of cookies configuration:
4 * Copyright (C) Waldo Bastian <bastian@kde.org>
5 * This dialog box:
6 * Copyright (C) David Faure <faure@kde.org>
8 */
10 // Own
11 #include "kcookiesmain.h"
13 // Qt
14 #include <QtGui/QLayout>
15 #include <QtGui/QTabWidget>
16 #include <QtDBus/QtDBus>
18 // KDE
19 #include <klocale.h>
20 #include <kapplication.h>
21 #include <kmessagebox.h>
22 #include <kdebug.h>
23 #include <kgenericfactory.h>
25 // Local
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)
34 management = 0;
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() )
42 managerOK = false;
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)));
57 if( managerOK )
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::load()
71 policies->load();
72 if( management )
73 management->load();
76 void KCookiesMain::save()
78 policies->save();
79 if ( management )
80 management->save();
83 void KCookiesMain::defaults()
85 KCModule* module = static_cast<KCModule*>(tab->currentWidget());
87 if ( module == policies )
88 policies->defaults();
89 else if( management )
90 management->defaults();
93 QString KCookiesMain::quickHelp() const
95 return i18n("<p><h1>Cookies</h1> Cookies contain information that Konqueror"
96 " (or other KDE applications using the HTTP protocol) stores on your"
97 " computer, initiated by a remote Internet server. This means that"
98 " a web server can store information about you and your browsing activities"
99 " on your machine for later use. You might consider this an invasion of"
100 " privacy.</p><p> However, cookies are useful in certain situations. For example, they"
101 " are often used by Internet shops, so you can 'put things into a shopping basket'."
102 " Some sites require you have a browser that supports cookies.</p><p>"
103 " Because most people want a compromise between privacy and the benefits cookies offer,"
104 " KDE offers you the ability to customize the way it handles cookies. So you might want"
105 " to set KDE's default policy to ask you whenever a server wants to set a cookie,"
106 " allowing you to decide. For your favorite shopping web sites that you trust, you might"
107 " want to set the policy to accept, then you can access the web sites without being prompted"
108 " every time KDE receives a cookie.</p>" );
111 #include "kcookiesmain.moc"